-
For example:
I've encountered it in my personal context of text processing experiments, where, in a case of non-alphabetical characters/atoms, I naively expected forms like: Like in this example:
Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
A term like Note, however, that the round brackets are only needed when an atom which is also an operator is an operand of some operator. In other situations, the round brackets are not needed like in the term |
Beta Was this translation helpful? Give feedback.
-
Interesting. SICStus & Eclipse are fine with it. SWI-Prolog accepts it but prints parens around it. ~/trealla (devel) $ rlwrap /usr/local/sicstus4.8.0/bin/sicstus EDIT: ok, I see that was covered in a comment. Ignore this. |
Beta Was this translation helpful? Give feedback.
A term like
X = ','.
is invalid syntax, because the comma is an operator. Try to enter it at the top level. An atom that is an operator cannot be the argument of another operator. Therefore the round brackets. (Of course, some Prologs are more permissive, but they often interpret invalid syntax differently).Note, however, that the round brackets are only needed when an atom which is also an operator is an operand of some operator. In other situations, the round brackets are not needed like in the term
f(*,[*,*|*],{*},*).