Documentation
¶
Index ¶
- Variables
- func IsRegistered(name string) bool
- func New(opts ...Option) (*prolog.Interpreter, error)
- func Register(i *prolog.Interpreter, name string) error
- type Option
- func WithBootstrap(ctx goctx.Context, bootstrap string) Option
- func WithFS(fs fs.FS) Option
- func WithHooks(hooks ...engine.HookFunc) Option
- func WithMaxVariables(maxVariables uint64) Option
- func WithPredicate(_ goctx.Context, predicate string) Option
- func WithPredicates(ctx goctx.Context, predicates []string) Option
- func WithUserOutputWriter(w io.Writer) Option
Constants ¶
This section is empty.
Variables ¶
var RegistryNames = func() []string { names := make([]string, 0, registry.Len()) for name := registry.Oldest(); name != nil; name = name.Next() { names = append(names, name.Key) } return names }()
RegistryNames is the list of the predicate names in the Registry.
Functions ¶
func IsRegistered ¶
IsRegistered returns true if the predicate with the given name is registered in the interpreter. Registered predicates are built-in predicates that are available in the interpreter.
Types ¶
type Option ¶
type Option func(*prolog.Interpreter) error
Option is a function that configures an Interpreter.
func WithBootstrap ¶
WithBootstrap configures the interpreter to compile the specified bootstrap script to serve as setup context. If compilation of the bootstrap script fails, the function will return an error.
func WithMaxVariables ¶
WithMaxVariables configures the interpreter to use the specified maximum number of variables.
func WithPredicate ¶
WithPredicate configures the interpreter to register the specified predicate.
The predicates names must be present in the registry, otherwise the function will return an error.
func WithPredicates ¶
WithPredicates configures the interpreter to register the specified predicates. See WithPredicate for more details.
func WithUserOutputWriter ¶
WithUserOutputWriter configures the interpreter to use the specified writer for user output.