Top 1.8% dependent packages on proxy.golang.org
Top 0.9% dependent repos on proxy.golang.org
Top 3.8% forks on proxy.golang.org
proxy.golang.org : github.com/mndrix/golog
Golog aspires to be an ISO Prolog interpreter. It currently supports a small subset of the standard. Any deviations from the standard are bugs. Typical usage looks something like this: This sample highlights a few key aspects of using Golog. To start, Golog data structures are immutable. NewMachine() creates an empty Golog machine containing just the standard library. Consult() creates another new machine with some extra code loaded. The original, empty machine is untouched. It's common to build a large Golog machine during init() and then add extra rules to it at runtime. Because Golog machines are immutable, multiple goroutines can access, run and "modify" machines in parallel. This design also opens possibilities for and-parallel and or-parallel execution. Most methods, like Consult(), can accept Prolog code in several forms. The example above shows Prolog as a string. We could have used any io.Reader instead. Error handling is one oddity. Golog methods follow Go convention by returning an error value to indicate that something went wrong. However, in many cases the caller knows that an error is highly improbable and doesn't want extra code to deal with the common case. For most methods, Golog offers one with a trailing underscore, like ByName_(), which panics on error instead of returning an error value. See also:
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/mndrix/golog
License: MIT
Latest release: about 8 years ago
First release: about 8 years ago
Namespace: github.com/mndrix
Dependent packages: 9
Dependent repositories: 43
Stars: 374 on GitHub
Forks: 40 on GitHub
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/mndrix
Last synced: 3 months ago