0
Id = 1,
Result= "1",

How do I surround the value in Id with double quotations? In the example above I have the value 1 stored in Id and I want to surround it with double quotations and store it in Result. How would I accomplish this using Prolog code?

Steven
  • 2,437
  • 5
  • 32
  • 36
  • You know that in Prolog you don't store values in variables? You "unify" the variable with an atom. That's a very different concept than storing. – Enigmativity Nov 22 '15 at 06:58
  • 1
    See http://stackoverflow.com/a/8269897/772868 about what the syntax actually means. – false Nov 22 '15 at 09:40

1 Answers1

0

You're looking for atom_string/2.

Example:

?- atom_string(1, R).
R = "1".

?- atom_string(abc, R).
R = "abc".
Steven
  • 2,437
  • 5
  • 32
  • 36