beowulf.bootstrap
TODO: write docs
APPEND
(APPEND x y)
Append the the elements of y
to the elements of x
.
All args are assumed to be beowulf.cons-cell/ConsCell
objects. See page 11 of the Lisp 1.5 Programmers Manual.
APPLY
(APPLY function args environment)
For bootstrapping, at least, a version of APPLY written in Clojure. All args are assumed to be symbols or beowulf.cons-cell/ConsCell
objects. See page 13 of the Lisp 1.5 Programmers Manual.
ASSOC
(ASSOC x a)
If a is an association list such as the one formed by PAIRLIS in the above example, then assoc will produce the first pair whose first term is x. Thus it is a table searching function.
All args are assumed to be beowulf.cons-cell/ConsCell
objects. See page 12 of the Lisp 1.5 Programmers Manual.
ATOM
(ATOM x)
It is not clear to me from the documentation whether (ATOM 7)
should return 'T
or 'F
. I’m going to assume 'T
.
ATOM?
(ATOM? x)
The convention of returning 'F
from predicates, rather than NIL
, is going to tie me in knots. This is a variant of ATOM
which returns NIL
on failure.
CAR
(CAR x)
Return the item indicated by the first pointer of a pair. NIL is treated specially: the CAR of NIL is NIL.
CDR
(CDR x)
Return the item indicated by the second pointer of a pair. NIL is treated specially: the CDR of NIL is NIL.
EQUAL
(EQUAL x y)
This is a predicate that is true if its two arguments are identical S-expressions, and false if they are different. (The elementary predicate EQ
is defined only for atomic arguments.) The definition of EQUAL
is an example of a conditional expression inside a conditional expression.
NOTE: returns F on failure, not NIL
EVAL
(EVAL expr env)
For bootstrapping, at least, a version of EVAL written in Clojure. All args are assumed to be symbols or beowulf.cons-cell/ConsCell
objects. See page 13 of the Lisp 1.5 Programmers Manual.
MEMBER
(MEMBER x y)
This predicate is true if the S-expression x
occurs among the elements of the list y
.
All args are assumed to be symbols or beowulf.cons-cell/ConsCell
objects. See page 11 of the Lisp 1.5 Programmers Manual.
oblist
The default environment; modified certainly be LABEL
(which seems to be Lisp 1.5’s EQuivalent of SETQ
), possibly by other things.
PAIRLIS
(PAIRLIS x y a)
This function gives the list of pairs of corresponding elements of the lists x
and y
, and APPENDs this to the list a
. The resultant list of pairs, which is like a table with two columns, is called an association list.
Eessentially, it builds the environment on the stack, implementing shallow binding.
All args are assumed to be beowulf.cons-cell/ConsCell
objects. See page 12 of the Lisp 1.5 Programmers Manual.
SUBLIS
(SUBLIS a y)
Here a
is assumed to be an association list of the form ((ul . vl)...(un . vn))
, where the u
s are atomic, and y
is any S-expression. What SUBLIS
does, is to treat the u
s as variables when they occur in y
, and to SUBSTitute the corresponding v
s from the pair list.
My interpretation is that this is variable binding in the stack frame.
All args are assumed to be beowulf.cons-cell/ConsCell
objects. See page 12 of the Lisp 1.5 Programmers Manual.
SUBST
(SUBST x y z)
This function gives the result of substituting the S-expression x
for all occurrences of the atomic symbol y
in the S-expression z
.
traced-eval
(traced-eval & args__2883__auto__)
Essentially, identical to EVAL except traced.
uaf
(uaf l path)
Universal access function; l
is expected to be an arbitrary list, path
a (clojure) list of the characters a
and d
. Intended to make declaring all those fiddly #'c[ad]+r'
functions a bit easier