Documentation ¶
Index ¶
- func IsList(t engine.Term, k func(*engine.Env) *engine.Promise, env *engine.Env) *engine.Promise
- type FS
- func (ff FS) Consult(files engine.Term, k func(*engine.Env) *engine.Promise, env *engine.Env) *engine.Promise
- func (ff FS) DirectoryExists(directory engine.Term, k func(*engine.Env) *engine.Promise, env *engine.Env) *engine.Promise
- func (ff FS) DirectoryFiles(directory, files engine.Term, k func(*engine.Env) *engine.Promise, ...) *engine.Promise
- func (ff FS) FileExists(file engine.Term, k func(*engine.Env) *engine.Promise, env *engine.Env) *engine.Promise
- func (ff FS) Register()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS provides native file system predicates. Non-ISO predicates are intended to maintain compatibility with Scryer Prolog's library(files). See: https://github.com/mthom/scryer-prolog/blob/master/src/lib/files.pl
func NewFS ¶
func NewFS(fsys fs.FS, i *prolog.Interpreter) FS
NewFS returns a collection of filesystem predicates tied to fsys and i.
func (FS) Consult ¶
func (ff FS) Consult(files engine.Term, k func(*engine.Env) *engine.Promise, env *engine.Env) *engine.Promise
Consult (consult/1) reads and executes the given file (if given an atom) or files (if given a list of atoms). ".pl" will be automatically appended to the file names when needed. Throws an error if files is not an atom or list of atoms.
consult(+FileOrList).
func (FS) DirectoryExists ¶ added in v0.0.4
func (ff FS) DirectoryExists(directory engine.Term, k func(*engine.Env) *engine.Promise, env *engine.Env) *engine.Promise
DirectoryExists (directory_exists/1) succeeds if a directory exists at the path given by the string directory. Throws an error if directory is not a string.
directory_exists(+Directory).
func (FS) DirectoryFiles ¶ added in v0.0.4
func (ff FS) DirectoryFiles(directory, files engine.Term, k func(*engine.Env) *engine.Promise, env *engine.Env) *engine.Promise
DirectoryFiles (directory_files/2) succeeds if files is a list of strings that contains all entries (including directories) of directory, which must be a string. This is useful for obtaining a list of files and directories. Throws an error if directory is not a string.
directory_files(+Directory, -Files).
func (FS) FileExists ¶ added in v0.0.4
func (ff FS) FileExists(file engine.Term, k func(*engine.Env) *engine.Promise, env *engine.Env) *engine.Promise
FileExists (file_exists/1) succeeds if a file exists at the path given by the string file. Throws an error if file is not a string.
file_exists(+File).
Directories ¶
Path | Synopsis |
---|---|
Package chars contains convenience functions for working with Prolog strings (list of characters).
|
Package chars contains convenience functions for working with Prolog strings (list of characters). |
Package taujson provides JSON-related Prolog predicates compatible with Tau Prolog's library(js).
|
Package taujson provides JSON-related Prolog predicates compatible with Tau Prolog's library(js). |