Difficulties with \

joel <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Hello all

How can I create atom \sin ?
I get for example

?- writef('%n%w', [92,sin]).
\sin
true.

?- with_output_to(atom(A), writef('%n%w', [92,sin])).
A = '\\sin'.

Idem :

?- A= \sin.
A = \sin.

?- A= \sin, atomic_list_concat([A, '(', 8, ')'], L).
ERROR: atomic_list_concat/2: Type error: `text' expected, found `\sin'

?- A= '\sin', atomic_list_concat([A, '(', 8, ')'], L).
A = ' in',
L = ' in(8)'.

?- A= '\\sin', atomic_list_concat([A, '(', 8, ')'], L).
A = '\\sin',
L = '\\sin(8)'.

Is it a bug ?

Thanks for any help !

Joël
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.