Hi
I do not understand why write_canonical(=/2).
leads to an error message
and why write_canonical(;/2).
displays /(;,2)
.
Could someone please enlighten me?
Hi
I do not understand why write_canonical(=/2).
leads to an error message
and why write_canonical(;/2).
displays /(;,2)
.
Could someone please enlighten me?
Enclose letter = with parens or single quotes.
The two letter symbol =/ is treated as a single atom, though
I can’t explain atom name rule well for now, though it must be explained somewhere in the manual.
?- write_canonical((=)/2).
/(=,2)
true.
?- write_canonical('='/2).
/(=,2)
true.
I don’t know where it is documented by heart. Bottom line is that there are “glueing” symbol characters (symbol meaning printing characters not being letters or digits (or _)) and “singleton” characters (most of the punctuation characters). You find the “glueing” ones using
?- char_type(C, prolog_symbol).
Note that the choice in the Unicode area is still dubious. While we want to create atoms such as >=
or =..
, most Unicode symbols are “stand alone”, so having them glueing might be a bad choice. Does anyone know how other Prolog’s handle this? AFAIK SICStus only allows for Unicode code points in quoted atoms. That is too conservative in my view as it also forces quotes if you want to use non-latin scripts for your program identifiers.
Thank you for your answer