Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 328
Joined: 14 Nov 2002 0:01

Optional parameters

Unread post by Martin Meyer »

Hello Thomas,

in below call to enum/3 the last argument for an [out] parameter cannot (unintentionally?) be skipped (in VIP 902).

Code: Select all

domains     unsigned3Enumerator = (unsigned A [out], unsigned B [out], unsigned C [out]) nondeterm.   class predicates     enum : unsigned3Enumerator. clauses     enum(1, 2, 3).     enum(4, 5, 6).   clauses     run() :-         List = [ A || enum(A, _B) ], %error c229 : Undeclared identifier 'enum/2', the identifier is known as 'enum/3'         stdIO::write(List).
Regards Martin
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Re: Optional parameters

Unread post by Thomas Linder Puls »

It is a bug, thank you for the info.

The problem is only when you declare the predicate using a predicate domain. I.e. it disappears if you change the declaration like this:

Code: Select all

class predicates     enum : (unsigned A [out], unsigned B [out], unsigned C [out]) nondeterm.
Regards Thomas Linder Puls
PDC
Post Reply