Optional parameters

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

Optional parameters

Unread post by Martin Meyer » 4 Sep 2019 0:37

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: 1158
Joined: 28 Feb 2000 0:01

Re: Optional parameters

Unread post by Thomas Linder Puls » 4 Sep 2019 9:27

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

Post Reply