Scryer-prolog: Simple quote issue

Created on 29 May 2020  路  10Comments  路  Source: mthom/scryer-prolog

This happens:

?- X = '[]', Y = [].
   X = [], Y = [].
?- X = '[]', Y = [], Y = X.
false.
?- X = "'a'".
   X = "\'a\'".
?- X = '"a"'.
   X = '\"a\"'.
?- 

Most helpful comment

Put differently, we have:

?- A = [], atom_chars(A, "[]"), A = [].
   A = [].

But a generalization fails:

?- *A = [], atom_chars(A, "[]"), A = [].
false.

All 10 comments

Related: #301 .

I was wondering if it has to do with this trait.

Duplicated, closing this.

There is one important issue that your above cases reveal, and which is nowhere else filed:

?- '[]' = [].
false.

Expected: true.

OK, reopening.

This is now filed separately, and also corrected, via #644.

But:

?- X = [], atom_chars(X, Cs), atom_chars(Y, Cs).
   X = [], Cs = "[]", Y = [].
?- X = [], atom_chars(X, Cs), atom_chars(Y, Cs), X = Y.
false.

Very nicely spotted!

Put differently, we have:

?- A = [], atom_chars(A, "[]"), A = [].
   A = [].

But a generalization fails:

?- *A = [], atom_chars(A, "[]"), A = [].
false.

The last commit solved this issue, closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

notoria picture notoria  路  4Comments

XVilka picture XVilka  路  3Comments

Qqwy picture Qqwy  路  3Comments

mkohlhaas picture mkohlhaas  路  3Comments

dcnorris picture dcnorris  路  3Comments