|Did you know ...||Search Documentation:|
|Pack onepointfour_basics -- prolog/README.md|
This directory contains several SWI-Prolog module files (ending in .pl) and their associate unit test files (ending in.plt), which contain one or more plunit modules.
The module files are relatively "small" and provide specific functionality. We avoid large modules where in-module interrelationships are hard to survey.
In this picture, the links from
checks.pl to the other modules are not shown. The orange modules are the "big collectors" of
submodules. Modules in the grey boxes (subdirectories) provide service exclusively to their repsective orange "collecting" modules.
Put the directory just above this package directory onto the list of library directories. This can be done with the following directive (or command), where you shall replace `/foo/bar` with the correct path for your machine:
space_string.pl(note that SWI-Prolog loads module files by filename not by module name, although the module name is important):
?- use_module(library('onepointfour_basics/space_string.pl')). ?- load_test_files(). ?- run_tests.
bin directory contains a shell script which runs all the test.
The name of a module is relatively arbitrary. We always use the atom
onepointfour_basis_X where X is the suffix-less name
of the file in which the module is defined.
A more powerful replacement for the venerable must_be/2.
The predicates provided by
checks.pl are used throughout other code.
An SWI-Prolog dict prettyprinter.
A "logical" mapper between atoms and SWI-Prolog strings and "list representations" of character sequences, i.e. "proper lists of char" and "proper lists of code". Provides replacement for the predicates atom_string/2, atom_codes/2, string_chars/2, string_codes/2.
Create or accept atoms or strings made only of the SPACE character (Unicode code point 0x20).
Analysis of "stringy" (atom or string) and "chary" (lists of chars or codes) terms.
Concantenate several "stringy" terms (atoms or strings) to a single "stringy" term. A front-end to the corresponding SWI-Prolog predicates.
Determine the length of a "stringy" term (atom or string).
Justify text left, right or center in a field of a given width. This is an ingredient of the dict prettyprinter.
Overwrite background text with foreground text. This is an ingredient of the dict prettyprinter.
A simple predicate fronting format/3, but able to survive a mistake in the number or type of arguments without throwing. Strongly useful in any code which may not have been given 100% coverage.
Various meta-predicate meant to make code writing and especially reading easier.
A very small set of predicates that are meant to use a dict as an options container, possibly providing defaults for missing options.