On 12/4/21 03:21, Paulo Moura wrote:
| ?- X = X+1, write(X).
X = X+1, write(X).
Segmentation fault (core dumped)


Shouldn't write/1 be protected against cyclic terms?
Note that support for cyclic terms is not a ISO Prolog standard requirement.

Quite right, this is not a standards violation. Still, gprolog already defends against cyclic terms when it outputs them:

  | ?- X=X+1.

  cannot display cyclic term for X

so presumably it could defend against them in 'write' if this was considered useful (which it would be, for my students...).

Reply via email to