Page 1 of 1

Optional parameters

Posted: 4 Sep 2019 0:37
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).

Re: Optional parameters

Posted: 4 Sep 2019 9:27
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.