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

Incomplete Reduction Error on dynamic directive.

Open dougransom opened this issue 4 months ago • 3 comments

I don't think this is correct behavior: ?- :-dynamic hello/1. error(syntax_error(incomplete_reduction),read_term/3:1). ?-

dougransom avatar Aug 28 '25 17:08 dougransom

doug@kite:~/code/scryer-prolog$ scryer-prolog -v
v0.9.4-614-gaa3d8b8f
doug@kite:~/code/scryer-prolog$ 

dougransom avatar Aug 28 '25 17:08 dougransom

dynamic is not an operator: https://github.com/mthom/scryer-prolog/issues/178#issuecomment-537597141, IMO it is expected behavior same as for:

?- a b c.
   error(syntax_error(incomplete_reduction),read_term/3:1).

hurufu avatar Aug 28 '25 19:08 hurufu

As @hurufu said, this is correct behavior. But it's not friendly behavior.

The key part of the error (incomplete_reduction) is aggressively opaque to newcomers. When such an error is unhandled, the interpreter should print a prose description what the error means, like how the Rust compiler does.

rotu avatar Sep 15 '25 19:09 rotu