drt24 / gnuprologjava

GNU Prolog for Java
8 stars 5 forks source link

If an atom does not start with an atom-start-char then it SHOULD be quoted #2

Closed thetrime closed 8 years ago

thetrime commented 8 years ago

This was swapped with a977fde6a83f0bf7484d0d53949e5fa65e223961.

I'm pretty sure that if an atom does not begin with an atom-start-char, then it /has/ to be quoted. As an example, try this: System.out.println(gnu.prolog.term.AtomTerm.get("Hello")); Surely that should print 'Hello' and not Hello. Certainly if you try and read it back, you get a VariableTerm.

drt24 commented 8 years ago

Yes that definitely looks like a bug and this looks like the correct fix.. I also note in passing that there is definitely room for optimisation in the UnicodeWriter code.