[bp-users]Dataloss with term2atom
Douglas R. Miles
dmiles@teknowledge.com
Fri, 23 Nov 2001 21:15:50 -0800
Hi,
term2atom('A'(X),Atom).
returns:
Atom = 'A(_40182090)'
It should instead return :
Atom = '\'A\'(_40182090)'
another example:
term2atom(on('BlueCone1',redBlock1),Atom).
returns:
Atom = 'on(BlueCone1,redBlock1)'
It should instead return :
Atom = 'on(\'BlueCone1\',redBlock1)'
It would be nice if one could always safely do:
term2atom(Term,Atom),parse_atom(Atom,Term,_).
and have it succeed.
also term2string/2 has the same issue:
term2string(on('BlueCone1',redBlock1),String),atom_codes(A,String).
A = on(BlueCone1,redBlock1)
String =
[111,110,40,66,108,117,101,67,111,110,101,49,44,114,101,100,66,108,111,99,10
7,49,41].
I must be missing global flag to tell it I need my atoms quoted?
Thank you.
Douglas