prolog
prolog copied to clipboard
No uninstantiation_error(Stream) in open/[3, 4]
It throws instantiation_error instead of uninstantiation_error(foo).
$ $(go env GOPATH)/bin/1pl
Top level for ichiban/prolog v1.2.1
This is for testing purposes only!
See https://github.com/ichiban/prolog for more details.
Type Ctrl-C or 'halt.' to exit.
?- open('/dev/urandom', read, S).
S = <stream>(0x14000106f00).
?- open('/dev/urandom', read, foo).
2024/10/29 11:30:41 error(instantiation_error,open/4)
if _, ok := env.Resolve(stream).(Variable); !ok {
return Error(InstantiationError(env))
}
https://github.com/ichiban/prolog/blob/main/engine/builtin.go#L1260-L1262