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

Toplevel sometimes silently ignores read-terms

Open triska opened this issue 2 years ago • 2 comments

Example:

?- write(hi). write(ho).
hi   true.

What about ho?

triska avatar Jul 03 '23 20:07 triska

In 1 Scope, Note f, the top level loop is explicitly excluded from 13211-1. Many systems do not use read/1 (actually read_term/2 for the variable names) directly, but have some heuristic built-in. Systems that would process write(ho) thereafter often have other quirks as consequences.

UWN avatar Jul 04 '23 05:07 UWN

Should maybe this give a warning or an error instead to alert the user that Scryer only executes the first term on the toplevel?

?- true. true.
Warning: multiple terms in query
   true.

% Or, alternatively
?- true. true.
   error(something,_).

bakaq avatar Dec 13 '23 19:12 bakaq