scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

'a' should be callable

Open mb64 opened this issue 3 years ago • 2 comments

Scryer Prolog assures me that 'a' and a are the same thing, but 'a'. and a. give different errors in the REPL:

$ scryer-prolog 
?- 'a' = a.
   true.
?- a.
caught: error(existence_error(procedure,a/0),a/0)
?- 'a'.
caught: error(type_error(callable,a),call/2)

I would expect them to behave identically.

mb64 avatar Nov 12 '20 02:11 mb64

Strictly speaking, the top level may do what it wants with errors since the toplevel is out of scope. However, taking the essence of your case makes it truly non-conforming:

?- catch('a',error(E,_),true).
   E = type_error(callable,a).   % unexpected

Expected: E = existence_error(procedure,a/0).

UWN avatar Nov 12 '20 18:11 UWN

This works exactly as expected now:

?- a.
caught: error(existence_error(procedure,a/0),a/0)

triska avatar Mar 06 '22 17:03 triska