Closed guregu closed 1 week ago
Noticed some oddities with strings and bagof, doesn't seem to happen with other types (that I have tried).
Example program:
foo("abc"). foo("blah").
Query:
?- bagof(X, foo(X), Xs). Xs = ["abc","blah"]. % ok, expected ?- X = "abc", bagof(X, foo(X), Xs). throw(error(type_error(compound,[a,b,c]),arg/3)). % unexpected, want Xs = ["abc"]
Another example query (this time erroring on the 2nd arg?)
?- X = "foo", bagof(X, member(X, ["foo", "bar"]), Xs). throw(error(type_error(compound,[b,a,r]),arg/3)). % unexpected
More concise issue:
?- arg(2,"foo",_74). throw(error(type_error(compound,[f,o,o]),arg/3)).
Interestingly SWI throws an error for this ^ but Scryer accepts it fine.
Thanks, looks good now!
Noticed some oddities with strings and bagof, doesn't seem to happen with other types (that I have tried).
Example program:
Query:
Another example query (this time erroring on the 2nd arg?)