diff --git a/docs/cloverage/beowulf/bootstrap.clj.html b/docs/cloverage/beowulf/bootstrap.clj.html
index 288a122..b8944e7 100644
--- a/docs/cloverage/beowulf/bootstrap.clj.html
+++ b/docs/cloverage/beowulf/bootstrap.clj.html
@@ -11,985 +11,1012 @@
002 "Lisp as defined in Chapter 1 (pages 1-14) of the
- 003 `Lisp 1.5 Programmer's Manual`; that is to say, a very simple Lisp language,"
+ 003 `Lisp 1.5 Programmer's Manual`; that is to say, a very simple Lisp language,
- 004 (:require [clojure.tools.trace :refer :all]
+ 004 which should, I believe, be sufficient in conjunction with the functions
- 005 [beowulf.cons-cell :refer [make-beowulf-list make-cons-cell NIL T F]]))
+ 005 provided by `beowulf.host`, be sufficient to bootstrap the full Lisp 1.5
+
+
+ 006 interpreter..
- 006
+ 007
- 007 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ 008 The convention is adopted that functions in this file with names in
- 008 ;;;
+ 009 ALLUPPERCASE are Lisp 1.5 functions (although written in Clojure) and that
- 009 ;;; This file is essentially Lisp as defined in Chapter 1 (pages 1-14) of the
+ 010 therefore all arguments must be numbers, symbols or `beowulf.cons_cell.ConsCell`
- 010 ;;; Lisp 1.5 Programmer's Manual; that is to say, a very simple Lisp language,
+ 011 objects."
- 011 ;;; which should, I believe, be sufficient in conjunction with the functions
+ 012 (:require [clojure.tools.trace :refer :all]
- 012 ;;; provided by `beowulf.host`, be sufficient to bootstrap the full Lisp 1.5
+ 013 [beowulf.cons-cell :refer [make-beowulf-list make-cons-cell NIL T F]]))
-
- 013 ;;; interpreter.
-
-
- 014 ;;;
+
+ 014
015 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ 016 ;;;
+
+
+ 017 ;;; This file is essentially Lisp as defined in Chapter 1 (pages 1-14) of the
+
+
+ 018 ;;; Lisp 1.5 Programmer's Manual; that is to say, a very simple Lisp language,
+
+
+ 019 ;;; which should, I believe, be sufficient in conjunction with the functions
+
+
+ 020 ;;; provided by `beowulf.host`, be sufficient to bootstrap the full Lisp 1.5
+
+
+ 021 ;;; interpreter.
+
+
+ 022 ;;;
+
+
+ 023 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
- 016
+ 024
- 017 (declare EVAL)
+ 025 (declare EVAL)
- 018
+ 026
- 019 (def oblist
+ 027 (def oblist
- 020 "The default environment; modified certainly be `LABEL` (which seems to
-
-
- 021 be Lisp 1.5's EQuivalent of `SETQ`), possibly by other things."
+ 028 "The default environment."
- 022 (atom NIL))
+ 029 (atom NIL))
- 023
+ 030
- 024 (def ^:dynamic *options*
+ 031 (def ^:dynamic *options*
- 025 "Command line options from invocation."
+ 032 "Command line options from invocation."
- 026 {})
+ 033 {})
- 027
+ 034
- 028 (defmacro NULL
+ 035 (defmacro NULL
- 029 [x]
+ 036 "Returns `T` if and only if the argument `x` is bound to `NIL`; else `F`."
+
+
+ 037 [x]
- 030 `(if (= ~x NIL) T F))
+ 038 `(if (= ~x NIL) T F))
- 031
+ 039
- 032 (defmacro ATOM
+ 040 (defmacro ATOM
- 033 "It is not clear to me from the documentation whether `(ATOM 7)` should return
+ 041 "Returns `T` if and only is the argument `x` is bound to and atom; else `F`.
- 034 `T` or `F`. I'm going to assume `T`."
+ 042 It is not clear to me from the documentation whether `(ATOM 7)` should return
- 035 [x]
+ 043 `T` or `F`. I'm going to assume `T`."
+
+
+ 044 [x]
- 036 `(if (or (symbol? ~x) (number? ~x)) T F))
+ 045 `(if (or (symbol? ~x) (number? ~x)) T F))
- 037
+ 046
- 038 (defmacro ATOM?
+ 047 (defmacro ATOM?
- 039 "The convention of returning `F` from predicates, rather than `NIL`, is going
+ 048 "The convention of returning `F` from predicates, rather than `NIL`, is going
- 040 to tie me in knots. This is a variant of `ATOM` which returns `NIL`
+ 049 to tie me in knots. This is a variant of `ATOM` which returns `NIL`
- 041 on failure."
+ 050 on failure."
- 042 [x]
+ 051 [x]
- 043 `(if (or (symbol? ~x) (number? ~x)) T NIL))
+ 052 `(if (or (symbol? ~x) (number? ~x)) T NIL))
- 044
+ 053
- 045 (defn CAR
+ 054 (defn CAR
- 046 "Return the item indicated by the first pointer of a pair. NIL is treated
+ 055 "Return the item indicated by the first pointer of a pair. NIL is treated
- 047 specially: the CAR of NIL is NIL."
+ 056 specially: the CAR of NIL is NIL."
- 048 [x]
+ 057 [x]
- 049 (cond
+ 058 (cond
- 050 (= x NIL) NIL
+ 059 (= x NIL) NIL
- 051 (instance? beowulf.cons_cell.ConsCell x) (.CAR x)
+ 060 (instance? beowulf.cons_cell.ConsCell x) (.CAR x)
- 052 :else
+ 061 :else
- 053 (throw
+ 062 (throw
- 054 (Exception.
+ 063 (Exception.
- 055 (str "Cannot take CAR of `" x "` (" (.getName (.getClass x)) ")")))))
+ 064 (str "Cannot take CAR of `" x "` (" (.getName (.getClass x)) ")")))))
- 056
+ 065
- 057 (defn CDR
+ 066 (defn CDR
- 058 "Return the item indicated by the second pointer of a pair. NIL is treated
+ 067 "Return the item indicated by the second pointer of a pair. NIL is treated
- 059 specially: the CDR of NIL is NIL."
+ 068 specially: the CDR of NIL is NIL."
- 060 [x]
+ 069 [x]
- 061 (cond
+ 070 (cond
- 062 (= x NIL) NIL
+ 071 (= x NIL) NIL
- 063 (instance? beowulf.cons_cell.ConsCell x) (.CDR x)
+ 072 (instance? beowulf.cons_cell.ConsCell x) (.CDR x)
- 064 :else
+ 073 :else
- 065 (throw
+ 074 (throw
- 066 (Exception.
+ 075 (Exception.
- 067 (str "Cannot take CDR of `" x "` (" (.getName (.getClass x)) ")")))))
+ 076 (str "Cannot take CDR of `" x "` (" (.getName (.getClass x)) ")")))))
- 068
+ 077
- 069 (defn uaf
+ 078 (defn uaf
- 070 "Universal access function; `l` is expected to be an arbitrary list, `path`
+ 079 "Universal access function; `l` is expected to be an arbitrary list, `path`
- 071 a (clojure) list of the characters `a` and `d`. Intended to make declaring
+ 080 a (clojure) list of the characters `a` and `d`. Intended to make declaring
- 072 all those fiddly `#'c[ad]+r'` functions a bit easier"
+ 081 all those fiddly `#'c[ad]+r'` functions a bit easier"
- 073 [l path]
+ 082 [l path]
- 074 (cond
+ 083 (cond
- 075 (= l NIL) NIL
+ 084 (= l NIL) NIL
- 076 (empty? path) l
+ 085 (empty? path) l
- 077 :else (case (last path)
+ 086 :else (case (last path)
- 078 \a (uaf (CAR l) (butlast path))
+ 087 \a (uaf (CAR l) (butlast path))
- 079 \d (uaf (CDR l) (butlast path)))))
+ 088 \d (uaf (CDR l) (butlast path)))))
- 080
+ 089
- 081 (defn CAAR [x] (uaf x (seq "aa")))
+ 090 (defn CAAR [x] (uaf x (seq "aa")))
- 082 (defn CADR [x] (uaf x (seq "ad")))
+ 091 (defn CADR [x] (uaf x (seq "ad")))
- 083 (defn CDDR [x] (uaf x (seq "dd")))
+ 092 (defn CDDR [x] (uaf x (seq "dd")))
- 084 (defn CDAR [x] (uaf x (seq "da")))
-
-
- 085
-
-
- 086 (defn CAAAR [x] (uaf x (seq "aaa")))
-
-
- 087 (defn CAADR [x] (uaf x (seq "aad")))
-
-
- 088 (defn CADAR [x] (uaf x (seq "ada")))
-
-
- 089 (defn CADDR [x] (uaf x (seq "add")))
-
-
- 090 (defn CDDAR [x] (uaf x (seq "dda")))
-
-
- 091 (defn CDDDR [x] (uaf x (seq "ddd")))
-
-
- 092 (defn CDAAR [x] (uaf x (seq "daa")))
-
-
- 093 (defn CDADR [x] (uaf x (seq "dad")))
+ 093 (defn CDAR [x] (uaf x (seq "da")))
094
-
- 095 (defn CAAAAR [x] (uaf x (seq "aaaa")))
+
+ 095 (defn CAAAR [x] (uaf x (seq "aaa")))
- 096 (defn CAADAR [x] (uaf x (seq "aada")))
+ 096 (defn CAADR [x] (uaf x (seq "aad")))
- 097 (defn CADAAR [x] (uaf x (seq "adaa")))
-
-
- 098 (defn CADDAR [x] (uaf x (seq "adda")))
-
-
- 099 (defn CDDAAR [x] (uaf x (seq "ddaa")))
-
-
- 100 (defn CDDDAR [x] (uaf x (seq "ddda")))
-
-
- 101 (defn CDAAAR [x] (uaf x (seq "daaa")))
-
-
- 102 (defn CDADAR [x] (uaf x (seq "dada")))
-
-
- 103 (defn CAAADR [x] (uaf x (seq "aaad")))
-
-
- 104 (defn CAADDR [x] (uaf x (seq "aadd")))
-
-
- 105 (defn CADADR [x] (uaf x (seq "adad")))
+ 097 (defn CADAR [x] (uaf x (seq "ada")))
- 106 (defn CADDDR [x] (uaf x (seq "addd")))
+ 098 (defn CADDR [x] (uaf x (seq "add")))
- 107 (defn CDDADR [x] (uaf x (seq "ddad")))
+ 099 (defn CDDAR [x] (uaf x (seq "dda")))
- 108 (defn CDDDDR [x] (uaf x (seq "dddd")))
+ 100 (defn CDDDR [x] (uaf x (seq "ddd")))
- 109 (defn CDAADR [x] (uaf x (seq "daad")))
+ 101 (defn CDAAR [x] (uaf x (seq "daa")))
- 110 (defn CDADDR [x] (uaf x (seq "dadd")))
+ 102 (defn CDADR [x] (uaf x (seq "dad")))
- 111
+ 103
+
+
+ 104 (defn CAAAAR [x] (uaf x (seq "aaaa")))
+
+
+ 105 (defn CAADAR [x] (uaf x (seq "aada")))
+
+
+ 106 (defn CADAAR [x] (uaf x (seq "adaa")))
+
+
+ 107 (defn CADDAR [x] (uaf x (seq "adda")))
+
+
+ 108 (defn CDDAAR [x] (uaf x (seq "ddaa")))
+
+
+ 109 (defn CDDDAR [x] (uaf x (seq "ddda")))
+
+
+ 110 (defn CDAAAR [x] (uaf x (seq "daaa")))
+
+
+ 111 (defn CDADAR [x] (uaf x (seq "dada")))
+
+
+ 112 (defn CAAADR [x] (uaf x (seq "aaad")))
+
+
+ 113 (defn CAADDR [x] (uaf x (seq "aadd")))
+
+
+ 114 (defn CADADR [x] (uaf x (seq "adad")))
+
+
+ 115 (defn CADDDR [x] (uaf x (seq "addd")))
+
+
+ 116 (defn CDDADR [x] (uaf x (seq "ddad")))
+
+
+ 117 (defn CDDDDR [x] (uaf x (seq "dddd")))
+
+
+ 118 (defn CDAADR [x] (uaf x (seq "daad")))
+
+
+ 119 (defn CDADDR [x] (uaf x (seq "dadd")))
+
+
+ 120
- 112 (defn EQ
+ 121 (defn EQ
- 113 ;; For some reason providing a doc string for this function breaks the
+ 122 "Returns `T` if and only if both `x` and `y` are bound to the same atom,
- 114 ;; Clojure parser!
+ 123 else `F`."
- 115 [x y]
+ 124 [x y]
- 116 (if (and (= (ATOM x) T) (= x y)) T F))
+ 125 (if (and (= (ATOM x) T) (= x y)) T F))
- 117
+ 126
- 118 (defn EQUAL
+ 127 (defn EQUAL
- 119 "This is a predicate that is true if its two arguments are identical
+ 128 "This is a predicate that is true if its two arguments are identical
- 120 S-expressions, and false if they are different. (The elementary predicate
+ 129 S-expressions, and false if they are different. (The elementary predicate
- 121 `EQ` is defined only for atomic arguments.) The definition of `EQUAL` is
+ 130 `EQ` is defined only for atomic arguments.) The definition of `EQUAL` is
- 122 an example of a conditional expression inside a conditional expression.
+ 131 an example of a conditional expression inside a conditional expression.
- 123
+ 132
- 124 NOTE: returns F on failure, not NIL"
+ 133 NOTE: returns `F` on failure, not `NIL`"
- 125 [x y]
-
-
- 126 (cond
-
-
- 127 (= (ATOM x) T) (EQ x y)
-
-
- 128 (= (EQUAL (CAR x) (CAR y)) T) (EQUAL (CDR x) (CDR y))
-
-
- 129 :else F))
-
-
- 130
-
-
- 131 (defn SUBST
-
-
- 132 "This function gives the result of substituting the S-expression `x` for
-
-
- 133 all occurrences of the atomic symbol `y` in the S-expression `z`."
-
-
- 134 [x y z]
+ 134 [x y]
135 (cond
-
- 136 (= (EQUAL y z) T) x
+
+ 136 (= (ATOM x) T) (EQ x y)
-
- 137 (= (ATOM? z) T) z ;; NIL is a symbol
-
-
- 138 :else
-
-
- 139 (make-cons-cell (SUBST x y (CAR z)) (SUBST x y (CDR z)))))
-
-
- 140
+
+ 137 (= (EQUAL (CAR x) (CAR y)) T) (EQUAL (CDR x) (CDR y))
- 141 (defn APPEND
-
-
- 142 "Append the the elements of `y` to the elements of `x`.
+ 138 :else F))
- 143
+ 139
+
+
+ 140 (defn SUBST
- 144 All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
+ 141 "This function gives the result of substituting the S-expression `x` for
- 145 See page 11 of the Lisp 1.5 Programmers Manual."
+ 142 all occurrences of the atomic symbol `y` in the S-expression `z`."
- 146 [x y]
+ 143 [x y z]
-
- 147 (cond
+
+ 144 (cond
-
- 148 (= x NIL) y
+
+ 145 (= (EQUAL y z) T) x
+
+
+ 146 (= (ATOM? z) T) z ;; NIL is a symbol
- 149 :else
+ 147 :else
-
- 150 (make-cons-cell (CAR x) (APPEND (CDR x) y))))
+
+ 148 (make-cons-cell (SUBST x y (CAR z)) (SUBST x y (CDR z)))))
- 151
+ 149
+
+
+ 150 (defn APPEND
+
+
+ 151 "Append the the elements of `y` to the elements of `x`.
152
-
- 153 (defn MEMBER
+
+ 153 All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
- 154 "This predicate is true if the S-expression `x` occurs among the elements
+ 154 See page 11 of the Lisp 1.5 Programmers Manual."
- 155 of the list `y`.
+ 155 [x y]
-
- 156
-
-
- 157 All args are assumed to be symbols or `beowulf.cons-cell/ConsCell` objects.
-
-
- 158 See page 11 of the Lisp 1.5 Programmers Manual."
-
-
- 159 [x y]
-
-
- 160 (cond
+
+ 156 (cond
- 161 (= y NIL) F ;; NOTE: returns F on falsity, not NIL
+ 157 (= x NIL) y
+
+
+ 158 :else
- 162 (= (EQUAL x (CAR y)) T) T
-
-
- 163 :else (MEMBER x (CDR y))))
+ 159 (make-cons-cell (CAR x) (APPEND (CDR x) y))))
- 164
+ 160
+
+
+ 161
- 165 (defn PAIRLIS
+ 162 (defn MEMBER
- 166 "This function gives the list of pairs of corresponding elements of the
+ 163 "This predicate is true if the S-expression `x` occurs among the elements
- 167 lists `x` and `y`, and APPENDs this to the list `a`. The resultant list
-
-
- 168 of pairs, which is like a table with two columns, is called an
-
-
- 169 association list.
+ 164 of the list `y`.
- 170
+ 165
- 171 Eessentially, it builds the environment on the stack, implementing shallow
+ 166 All args are assumed to be symbols or `beowulf.cons-cell/ConsCell` objects.
- 172 binding.
+ 167 See page 11 of the Lisp 1.5 Programmers Manual."
+
+
+ 168 [x y]
+
+
+ 169 (cond
+
+
+ 170 (= y NIL) F ;; NOTE: returns F on falsity, not NIL
+
+
+ 171 (= (EQUAL x (CAR y)) T) T
+
+
+ 172 :else (MEMBER x (CDR y))))
173
-
- 174 All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
+
+ 174 (defn PAIRLIS
- 175 See page 12 of the Lisp 1.5 Programmers Manual."
+ 175 "This function gives the list of pairs of corresponding elements of the
- 176 [x y a]
+ 176 lists `x` and `y`, and APPENDs this to the list `a`. The resultant list
+
+
+ 177 of pairs, which is like a table with two columns, is called an
+
+
+ 178 association list.
+
+
+ 179
+
+
+ 180 Eessentially, it builds the environment on the stack, implementing shallow
+
+
+ 181 binding.
+
+
+ 182
+
+
+ 183 All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
+
+
+ 184 See page 12 of the Lisp 1.5 Programmers Manual."
+
+
+ 185 [x y a]
- 177 (cond
+ 186 (cond
- 178 ;; the original tests only x; testing y as well will be a little more
+ 187 ;; the original tests only x; testing y as well will be a little more
- 179 ;; robust if `x` and `y` are not the same length.
+ 188 ;; robust if `x` and `y` are not the same length.
- 180 (or (= NIL x) (= NIL y)) a
+ 189 (or (= NIL x) (= NIL y)) a
- 181 :else (make-cons-cell
+ 190 :else (make-cons-cell
- 182 (make-cons-cell (CAR x) (CAR y))
+ 191 (make-cons-cell (CAR x) (CAR y))
- 183 (PAIRLIS (CDR x) (CDR y) a))))
+ 192 (PAIRLIS (CDR x) (CDR y) a))))
- 184
+ 193
- 185 (defn ASSOC
+ 194 (defn ASSOC
- 186 "If a is an association list such as the one formed by PAIRLIS in the above
+ 195 "If a is an association list such as the one formed by PAIRLIS in the above
- 187 example, then assoc will produce the first pair whose first term is x. Thus
+ 196 example, then assoc will produce the first pair whose first term is x. Thus
- 188 it is a table searching function.
+ 197 it is a table searching function.
- 189
+ 198
- 190 All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
+ 199 All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
- 191 See page 12 of the Lisp 1.5 Programmers Manual."
+ 200 See page 12 of the Lisp 1.5 Programmers Manual."
- 192 [x a]
+ 201 [x a]
- 193 (cond
+ 202 (cond
- 194 (= NIL a) NIL ;; this clause is not present in the original but is added for
+ 203 (= NIL a) NIL ;; this clause is not present in the original but is added for
- 195 ;; robustness.
+ 204 ;; robustness.
- 196 (= (EQUAL (CAAR a) x) T) (CAR a)
+ 205 (= (EQUAL (CAAR a) x) T) (CAR a)
- 197 :else
+ 206 :else
- 198 (ASSOC x (CDR a))))
+ 207 (ASSOC x (CDR a))))
- 199
+ 208
- 200 (defn- SUB2
+ 209 (defn- SUB2
- 201 "Internal to `SUBLIS`, q.v., which SUBSTitutes into a list from a store.
+ 210 "Internal to `SUBLIS`, q.v., which SUBSTitutes into a list from a store.
- 202 ? I think this is doing variable binding in the stack frame?"
+ 211 ? I think this is doing variable binding in the stack frame?"
- 203 [a z]
+ 212 [a z]
- 204 (cond
+ 213 (cond
- 205 (= NIL a) z
+ 214 (= NIL a) z
- 206 (= (CAAR a) z) (CDAR a) ;; TODO: this looks definitely wrong
+ 215 (= (CAAR a) z) (CDAR a) ;; TODO: this looks definitely wrong
- 207 :else
+ 216 :else
- 208 (SUB2 (CDR a) z)))
-
-
- 209
-
-
- 210 (defn SUBLIS
-
-
- 211 "Here `a` is assumed to be an association list of the form
-
-
- 212 `((ul . vl)...(un . vn))`, where the `u`s are atomic, and `y` is any
-
-
- 213 S-expression. What `SUBLIS` does, is to treat the `u`s as variables when
-
-
- 214 they occur in `y`, and to SUBSTitute the corresponding `v`s from the pair
-
-
- 215 list.
-
-
- 216
-
-
- 217 My interpretation is that this is variable binding in the stack frame.
+ 217 (SUB2 (CDR a) z)))
218
-
- 219 All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
+
+ 219 (defn SUBLIS
- 220 See page 12 of the Lisp 1.5 Programmers Manual."
+ 220 "Here `a` is assumed to be an association list of the form
- 221 [a y]
+ 221 `((ul . vl)...(un . vn))`, where the `u`s are atomic, and `y` is any
+
+
+ 222 S-expression. What `SUBLIS` does, is to treat the `u`s as variables when
+
+
+ 223 they occur in `y`, and to SUBSTitute the corresponding `v`s from the pair
+
+
+ 224 list.
+
+
+ 225
+
+
+ 226 My interpretation is that this is variable binding in the stack frame.
+
+
+ 227
+
+
+ 228 All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
+
+
+ 229 See page 12 of the Lisp 1.5 Programmers Manual."
+
+
+ 230 [a y]
- 222 (cond
+ 231 (cond
- 223 (= (ATOM? y) T) (SUB2 a y)
+ 232 (= (ATOM? y) T) (SUB2 a y)
- 224 :else
+ 233 :else
- 225 (make-cons-cell (SUBLIS a (CAR y)) (SUBLIS a (CDR y)))))
+ 234 (make-cons-cell (SUBLIS a (CAR y)) (SUBLIS a (CDR y)))))
- 226
+ 235
- 227 (defn APPLY
+ 236 (defn APPLY
- 228 "For bootstrapping, at least, a version of APPLY written in Clojure.
+ 237 "For bootstrapping, at least, a version of APPLY written in Clojure.
- 229 All args are assumed to be symbols or `beowulf.cons-cell/ConsCell` objects.
+ 238 All args are assumed to be symbols or `beowulf.cons-cell/ConsCell` objects.
- 230 See page 13 of the Lisp 1.5 Programmers Manual."
+ 239 See page 13 of the Lisp 1.5 Programmers Manual."
- 231 [function args environment]
+ 240 [function args environment]
- 232 (cond
+ 241 (cond
- 233 (=
+ 242 (=
- 234 (ATOM? function)
+ 243 (ATOM? function)
- 235 T)(cond
+ 244 T)(cond
- 236 ;; TODO: doesn't check whether `function` is bound in the environment;
+ 245 ;; TODO: doesn't check whether `function` is bound in the environment;
- 237 ;; we'll need that before we can bootstrap.
+ 246 ;; we'll need that before we can bootstrap.
- 238 (= function 'CAR) (CAAR args)
+ 247 (= function 'CAR) (CAAR args)
- 239 (= function 'CDR) (CDAR args)
+ 248 (= function 'CDR) (CDAR args)
- 240 (= function 'CONS) (make-cons-cell (CAR args) (CADR args))
+ 249 (= function 'CONS) (make-cons-cell (CAR args) (CADR args))
- 241 (= function 'ATOM) (if (ATOM? (CAR args)) T NIL)
+ 250 (= function 'ATOM) (if (ATOM? (CAR args)) T NIL)
- 242 (= function 'EQ) (if (= (CAR args) (CADR args)) T NIL)
+ 251 (= function 'EQ) (if (= (CAR args) (CADR args)) T NIL)
- 243 :else
+ 252 :else
- 244 (APPLY
+ 253 (APPLY
- 245 (EVAL function environment)
+ 254 (EVAL function environment)
- 246 args
+ 255 args
- 247 environment))
+ 256 environment))
- 248 (= (first function) 'LAMBDA) (EVAL
+ 257 (= (first function) 'LAMBDA) (EVAL
- 249 (CADDR function)
+ 258 (CADDR function)
- 250 (PAIRLIS (CADR function) args environment))
+ 259 (PAIRLIS (CADR function) args environment))
- 251 (= (first function) 'LABEL) (APPLY
+ 260 (= (first function) 'LABEL) (APPLY
- 252 (CADDR function)
+ 261 (CADDR function)
- 253 args
+ 262 args
- 254 (make-cons-cell
+ 263 (make-cons-cell
- 255 (make-cons-cell
+ 264 (make-cons-cell
- 256 (CADR function)
+ 265 (CADR function)
- 257 (CADDR function))
+ 266 (CADDR function))
- 258 environment))))
+ 267 environment))))
- 259
+ 268
- 260 (defn- EVCON
+ 269 (defn- EVCON
- 261 "Inner guts of primitive COND. All args are assumed to be
+ 270 "Inner guts of primitive COND. All args are assumed to be
- 262 `beowulf.cons-cell/ConsCell` objects.
+ 271 `beowulf.cons-cell/ConsCell` objects.
- 263 See page 13 of the Lisp 1.5 Programmers Manual."
+ 272 See page 13 of the Lisp 1.5 Programmers Manual."
- 264 [clauses env]
+ 273 [clauses env]
- 265 (if
+ 274 (if
- 266 (not= (EVAL (CAAR clauses) env) NIL)
+ 275 (not= (EVAL (CAAR clauses) env) NIL)
- 267 (EVAL (CADAR clauses) env)
+ 276 (EVAL (CADAR clauses) env)
- 268 (EVCON (CDR clauses) env)))
+ 277 (EVCON (CDR clauses) env)))
- 269
+ 278
- 270 (defn- EVLIS
+ 279 (defn- EVLIS
- 271 "Map `EVAL` across this list of `args` in the context of this
+ 280 "Map `EVAL` across this list of `args` in the context of this
- 272 `env`ironment.All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
+ 281 `env`ironment.All args are assumed to be `beowulf.cons-cell/ConsCell` objects.
- 273 See page 13 of the Lisp 1.5 Programmers Manual."
+ 282 See page 13 of the Lisp 1.5 Programmers Manual."
- 274 [args env]
+ 283 [args env]
- 275 (cond
+ 284 (cond
- 276 (= NIL args) NIL
+ 285 (= NIL args) NIL
- 277 :else
+ 286 :else
- 278 (make-cons-cell
+ 287 (make-cons-cell
- 279 (EVAL (CAR args) env)
+ 288 (EVAL (CAR args) env)
- 280 (EVLIS (CDR args) env))))
+ 289 (EVLIS (CDR args) env))))
- 281
+ 290
- 282 (deftrace traced-eval
+ 291 (deftrace traced-eval
- 283 "Essentially, identical to EVAL except traced."
+ 292 "Essentially, identical to EVAL except traced."
- 284 [expr env]
+ 293 [expr env]
- 285 (cond
+ 294 (cond
- 286 (=
+ 295 (=
- 287 (ATOM? expr) T)
+ 296 (ATOM? expr) T)
- 288 (CDR (ASSOC expr env))
+ 297 (CDR (ASSOC expr env))
- 289 (=
+ 298 (=
- 290 (ATOM? (CAR expr))
+ 299 (ATOM? (CAR expr))
- 291 T)(cond
+ 300 T)(cond
- 292 (= (CAR expr) 'QUOTE) (CADR expr)
+ 301 (= (CAR expr) 'QUOTE) (CADR expr)
- 293 (= (CAR expr) 'COND) (EVCON (CDR expr) env)
+ 302 (= (CAR expr) 'COND) (EVCON (CDR expr) env)
- 294 :else (APPLY
+ 303 :else (APPLY
- 295 (CAR expr)
+ 304 (CAR expr)
- 296 (EVLIS (CDR expr) env)
+ 305 (EVLIS (CDR expr) env)
- 297 env))
+ 306 env))
- 298 :else (APPLY
+ 307 :else (APPLY
- 299 (CAR expr)
+ 308 (CAR expr)
- 300 (EVLIS (CDR expr) env)
+ 309 (EVLIS (CDR expr) env)
- 301 env)))
+ 310 env)))
- 302
+ 311
- 303 (defn EVAL
+ 312 (defn EVAL
- 304 "For bootstrapping, at least, a version of EVAL written in Clojure.
+ 313 "For bootstrapping, at least, a version of EVAL written in Clojure.
- 305 All args are assumed to be symbols or `beowulf.cons-cell/ConsCell` objects.
+ 314 All args are assumed to be symbols or `beowulf.cons-cell/ConsCell` objects.
- 306 See page 13 of the Lisp 1.5 Programmers Manual."
+ 315 See page 13 of the Lisp 1.5 Programmers Manual."
- 307 [expr env]
+ 316 [expr env]
- 308 (cond
+ 317 (cond
- 309 (true? (:trace *options*))
+ 318 (true? (:trace *options*))
- 310 (traced-eval expr env)
+ 319 (traced-eval expr env)
- 311 (=
+ 320 (=
- 312 (ATOM? expr) T)
+ 321 (ATOM? expr) T)
- 313 (CDR (ASSOC expr env))
+ 322 (CDR (ASSOC expr env))
- 314 (=
+ 323 (=
- 315 (ATOM? (CAR expr))
+ 324 (ATOM? (CAR expr))
- 316 T)(cond
+ 325 T)(cond
- 317 (= (CAR expr) 'QUOTE) (CADR expr)
+ 326 (= (CAR expr) 'QUOTE) (CADR expr)
- 318 (= (CAR expr) 'COND) (EVCON (CDR expr) env)
+ 327 (= (CAR expr) 'COND) (EVCON (CDR expr) env)
- 319 :else (APPLY
+ 328 :else (APPLY
- 320 (CAR expr)
+ 329 (CAR expr)
- 321 (EVLIS (CDR expr) env)
+ 330 (EVLIS (CDR expr) env)
- 322 env))
+ 331 env))
- 323 :else (APPLY
+ 332 :else (APPLY
- 324 (CAR expr)
+ 333 (CAR expr)
- 325 (EVLIS (CDR expr) env)
+ 334 (EVLIS (CDR expr) env)
- 326 env)))
+ 335 env)))
- 327
+ 336
- 328
+ 337
- 329
+ 338