ichiban / prolog

The only reasonable scripting engine for Go.
MIT License
634 stars 32 forks source link

Is include/1 or ensure_loaded/1 supported? #325

Open Jean-Luc-Picard-2021 opened 3 months ago

Jean-Luc-Picard-2021 commented 3 months ago

I currently get:

$ ~/go/bin/1pl -v
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.

?- include('foo.p').
2024/08/10 21:11:48 error(existence_error(procedure,include/1),root)

?- ensure_loaded('foo.p').
2024/08/10 21:12:05 error(existence_error(procedure,ensure_loaded/1),root)

Both built-ins are defined in the ISO core standard.

How would a Prolog text have another Prolog text included or ensure_loaded?

Jean-Luc-Picard-2021 commented 3 months ago

Ok, I see it is listed here, but maybe not yet

https://github.com/ichiban/prolog/wiki

implemented, or I cannot use it on top-level?

ichiban commented 3 months ago

@Jean-Luc-Picard-2021 They're both implemented as directives. In this major version, not all the directives are backed by corresponding predicates.