Menu

#12 [dots_in_list, .. ] % causes syntax error

open
nobody
None
5
2005-06-10
2005-06-10
Anonymous
No

n Yap the following happens:

?- Z = [A, .. ] .
[ SYNTAX ERROR at line 39:
Z = [ A , ..
<==== HERE ====>
].
]

That gives no error in SWI, or in Sicstus.

Even in Yap this following are okay:
?- Z = [..] . % only dots
Z = [..] ?
yes
?- Z = [..,A]. % dots first
Z = [..,A] ?
yes
?- Z = [A,(..)]. % dots in parenthesis
Z = [A,..] ?
yes

Yap will only accept the atom (..) after the first
position in a list,
when it is enclosed in parenthesis.

earthlink.net!frayser

Discussion


Log in to post a comment.

MongoDB Logo MongoDB