Accoring to queries, string_codes/2
seems work also for the case in which the first argument is a list. Is this consistent with the help or a bug ?
string_codes(?String, ?Codes)`
Bi-directional conversion between a string
and a list of character codes. At
least one of the two arguments must be instantiated.
?- string_codes("abc", X).
X = [97, 98, 99].
?- string_codes(`abc`, X).
X = [97, 98, 99].
?- string_codes([a,b,c], R).
R = [97, 98, 99].
?- string_codes([1,2,3], R).
R = [1, 2, 3].
?- is_list(`abc`).
true.
?- string(`abc`).
false.
?- string(`abc`).
false.