Much documentation.
This commit is contained in:
parent
7a5596dc55
commit
d66b79ca3c
File diff suppressed because it is too large
Load diff
|
@ -19,374 +19,374 @@
|
|||
<span class="blank" title="0 out of 0 forms covered">
|
||||
005
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
006 (def NIL (symbol "NIL"))
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
006 (def NIL
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
007
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
007 "The canonical empty list symbol."
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
008 (def T (symbol "T")) ;; true.
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
008 (symbol "NIL"))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
009
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
010 (def F (symbol "F")) ;; false as distinct from nil
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
010 (def T
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
011 "The canonical true value."
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
012 (symbol "T")) ;; true.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
011
|
||||
013
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
014 (def F
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
015 "The canonical false value - different from `NIL`, which is not caninically
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
016 false in Lisp 1.5."
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
017 (symbol "F")) ;; false as distinct from nil
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
018
|
||||
</span><br/>
|
||||
<span class="partial" title="5 out of 8 forms covered">
|
||||
012 (deftype ConsCell [CAR CDR]
|
||||
019 (deftype ConsCell [CAR CDR]
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
013 clojure.lang.ISeq
|
||||
020 clojure.lang.ISeq
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
014 (cons [this x] (ConsCell. x this))
|
||||
021 (cons [this x] (ConsCell. x this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
015 (first [this] (.CAR this))
|
||||
022 (first [this] (.CAR this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
016 ;; next and more must return ISeq:
|
||||
023 ;; next and more must return ISeq:
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
017 ;; https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ISeq.java
|
||||
024 ;; https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ISeq.java
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
018 (more [this] (if
|
||||
025 (more [this] (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
019 (seq? (.CDR this))
|
||||
026 (seq? (.CDR this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
020 (.CDR this)
|
||||
027 (.CDR this)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
021 clojure.lang.PersistentList/EMPTY))
|
||||
028 clojure.lang.PersistentList/EMPTY))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
022 (next [this] (if
|
||||
029 (next [this] (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
023 (seq? (.CDR this))
|
||||
030 (seq? (.CDR this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
024 (.CDR this)
|
||||
031 (.CDR this)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
025 nil ;; next returns nil when empty
|
||||
032 nil ;; next returns nil when empty
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
026 ))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
027
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
028 clojure.lang.Seqable
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
029 (seq [this] this)
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
030
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
031 ;; for some reason this marker protocol is needed otherwise compiler complains
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
032 ;; that `nth not supported on ConsCell`
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
033 clojure.lang.Sequential
|
||||
033 ))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
034
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
035 clojure.lang.IPersistentCollection
|
||||
035 clojure.lang.Seqable
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
036 (count [this] (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
037 (coll? (.CDR this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
038 (inc (.count (.CDR this)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
039 1))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
040 (empty [this] false) ;; a cons cell is by definition not empty.
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
041 (equiv [this other] (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
042 (seq? other)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
043 (and
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
044 (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
045 (and
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
046 (seq? (first this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
047 (seq? (first other)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
048 (.equiv (first this) (first other))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
049 (= (first this) (first other)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
050 (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
051 (and
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
052 (seq? (rest this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
053 (seq? (rest other)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
054 (.equiv (rest this) (rest other))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
055 (= (rest this) (rest other))))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
056 false)))
|
||||
036 (seq [this] this)
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
057
|
||||
037
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
038 ;; for some reason this marker protocol is needed otherwise compiler complains
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
039 ;; that `nth not supported on ConsCell`
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
040 clojure.lang.Sequential
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
041
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
042 clojure.lang.IPersistentCollection
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
043 (count [this] (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
044 (coll? (.CDR this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
045 (inc (.count (.CDR this)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
046 1))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
047 (empty [this] false) ;; a cons cell is by definition not empty.
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
048 (equiv [this other] (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
049 (seq? other)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
050 (and
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
051 (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
052 (and
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
053 (seq? (first this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
054 (seq? (first other)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
055 (.equiv (first this) (first other))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
056 (= (first this) (first other)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
057 (if
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
058 (and
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
059 (seq? (rest this))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
060 (seq? (rest other)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
061 (.equiv (rest this) (rest other))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
062 (= (rest this) (rest other))))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
063 false)))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
064
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
058 (defn- to-string
|
||||
065 (defn- to-string
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
059 "Printing ConsCells gave me a *lot* of trouble. This is an internal function
|
||||
066 "Printing ConsCells gave me a *lot* of trouble. This is an internal function
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
060 used by the print-method override (below) in order that the standard Clojure
|
||||
067 used by the print-method override (below) in order that the standard Clojure
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
061 `print` and `str` functions will print ConsCells correctly. The argument
|
||||
068 `print` and `str` functions will print ConsCells correctly. The argument
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
062 `cell` must, obviously, be an instance of `ConsCell`."
|
||||
069 `cell` must, obviously, be an instance of `ConsCell`."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
063 [cell]
|
||||
070 [cell]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
064 (loop [c cell
|
||||
071 (loop [c cell
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
065 n 0
|
||||
072 n 0
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
066 s "("]
|
||||
073 s "("]
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
067 (if
|
||||
074 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
068 (instance? beowulf.cons_cell.ConsCell c)
|
||||
075 (instance? beowulf.cons_cell.ConsCell c)
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
069 (let [car (.CAR c)
|
||||
076 (let [car (.CAR c)
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
070 cdr (.CDR c)
|
||||
077 cdr (.CDR c)
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
071 cons? (instance? beowulf.cons_cell.ConsCell cdr)
|
||||
078 cons? (instance? beowulf.cons_cell.ConsCell cdr)
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
072 ss (str
|
||||
079 ss (str
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
073 s
|
||||
080 s
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
074 (to-string car)
|
||||
081 (to-string car)
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
075 (cond
|
||||
082 (cond
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
076 cons?
|
||||
083 cons?
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
077 " "
|
||||
084 " "
|
||||
</span><br/>
|
||||
<span class="partial" title="10 out of 11 forms covered">
|
||||
078 (or (nil? cdr) (= cdr 'NIL))
|
||||
085 (or (nil? cdr) (= cdr 'NIL))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
079 ")"
|
||||
086 ")"
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
080 :else
|
||||
087 :else
|
||||
</span><br/>
|
||||
<span class="covered" title="7 out of 7 forms covered">
|
||||
081 (str " . " (to-string cdr) ")")))]
|
||||
088 (str " . " (to-string cdr) ")")))]
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
082 (if
|
||||
089 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
083 cons?
|
||||
090 cons?
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
084 (recur cdr (inc n) ss)
|
||||
091 (recur cdr (inc n) ss)
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
085 ss))
|
||||
092 ss))
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
086 (str c))))
|
||||
093 (str c))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
087
|
||||
094
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
088 (defn pretty-print
|
||||
095 (defn pretty-print
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
089 "This isn't the world's best pretty printer but it sort of works."
|
||||
096 "This isn't the world's best pretty printer but it sort of works."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
090 ([^beowulf.cons_cell.ConsCell cell]
|
||||
097 ([^beowulf.cons_cell.ConsCell cell]
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 7 forms covered">
|
||||
091 (println (pretty-print cell 80 0)))
|
||||
098 (println (pretty-print cell 80 0)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
092 ([^beowulf.cons_cell.ConsCell cell width level]
|
||||
099 ([^beowulf.cons_cell.ConsCell cell width level]
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 3 forms covered">
|
||||
093 (loop [c cell
|
||||
100 (loop [c cell
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 3 forms covered">
|
||||
094 n (inc level)
|
||||
101 n (inc level)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
095 s "("]
|
||||
102 s "("]
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
096 (if
|
||||
103 (if
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 4 forms covered">
|
||||
097 (instance? beowulf.cons_cell.ConsCell c)
|
||||
104 (instance? beowulf.cons_cell.ConsCell c)
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 2 forms covered">
|
||||
098 (let [car (.CAR c)
|
||||
105 (let [car (.CAR c)
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
099 cdr (.CDR c)
|
||||
106 cdr (.CDR c)
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 4 forms covered">
|
||||
100 cons? (instance? beowulf.cons_cell.ConsCell cdr)
|
||||
107 cons? (instance? beowulf.cons_cell.ConsCell cdr)
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 5 forms covered">
|
||||
101 print-width (count (print-str c))
|
||||
108 print-width (count (print-str c))
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 7 forms covered">
|
||||
102 indent (apply str (repeat n " "))
|
||||
109 indent (apply str (repeat n " "))
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 2 forms covered">
|
||||
103 ss (str
|
||||
110 ss (str
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
104 s
|
||||
111 s
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 5 forms covered">
|
||||
105 (pretty-print car width n)
|
||||
112 (pretty-print car width n)
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 4 forms covered">
|
||||
106 (cond
|
||||
113 (cond
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
107 cons?
|
||||
114 cons?
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 2 forms covered">
|
||||
108 (if
|
||||
115 (if
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 9 forms covered">
|
||||
109 (< (+ (count indent) print-width) width)
|
||||
116 (< (+ (count indent) print-width) width)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
110 " "
|
||||
117 " "
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 4 forms covered">
|
||||
111 (str "\n" indent))
|
||||
118 (str "\n" indent))
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 11 forms covered">
|
||||
112 (or (nil? cdr) (= cdr 'NIL))
|
||||
119 (or (nil? cdr) (= cdr 'NIL))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
113 ")"
|
||||
120 ")"
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
114 :else
|
||||
121 :else
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 9 forms covered">
|
||||
115 (str " . " (pretty-print cdr width n) ")")))]
|
||||
122 (str " . " (pretty-print cdr width n) ")")))]
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
116 (if
|
||||
123 (if
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
117 cons?
|
||||
124 cons?
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
118 (recur cdr n ss)
|
||||
125 (recur cdr n ss)
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
119 ss))
|
||||
126 ss))
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 3 forms covered">
|
||||
120 (str c)))))
|
||||
127 (str c)))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
121
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
122
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
123
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
124 (defmethod clojure.core/print-method
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
125 ;;; I have not worked out how to document defmethod without blowing up the world.
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
126 beowulf.cons_cell.ConsCell
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
127 [this writer]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
128 (.write writer (to-string this)))
|
||||
128
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
129
|
||||
|
@ -394,62 +394,83 @@
|
|||
<span class="blank" title="0 out of 0 forms covered">
|
||||
130
|
||||
</span><br/>
|
||||
<span class="covered" title="17 out of 17 forms covered">
|
||||
131 (defmacro make-cons-cell
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
132 "Construct a new instance of cons cell with this `car` and `cdr`."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
133 [car cdr]
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
134 `(ConsCell. ~car ~cdr))
|
||||
131 (defmethod clojure.core/print-method
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
132 ;;; I have not worked out how to document defmethod without blowing up the world.
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
133 beowulf.cons_cell.ConsCell
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
134 [this writer]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
135 (.write writer (to-string this)))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
135
|
||||
136
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
137
|
||||
</span><br/>
|
||||
<span class="covered" title="17 out of 17 forms covered">
|
||||
138 (defmacro make-cons-cell
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
139 "Construct a new instance of cons cell with this `car` and `cdr`."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
140 [car cdr]
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
141 `(ConsCell. ~car ~cdr))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
142
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
136 (defn make-beowulf-list
|
||||
143 (defn make-beowulf-list
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
137 "Construct a linked list of cons cells with the same content as the
|
||||
144 "Construct a linked list of cons cells with the same content as the
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
138 sequence `x`."
|
||||
145 sequence `x`."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
139 [x]
|
||||
146 [x]
|
||||
</span><br/>
|
||||
<span class="partial" title="2 out of 3 forms covered">
|
||||
140 (cond
|
||||
147 (cond
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
141 (empty? x) NIL
|
||||
148 (empty? x) NIL
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
142 (coll? x) (ConsCell.
|
||||
149 (coll? x) (ConsCell.
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
143 (if
|
||||
150 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
144 (seq? (first x))
|
||||
151 (seq? (first x))
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
145 (make-beowulf-list (first x))
|
||||
152 (make-beowulf-list (first x))
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
146 (first x))
|
||||
153 (first x))
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
147 (make-beowulf-list (rest x)))
|
||||
154 (make-beowulf-list (rest x)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
148 :else
|
||||
155 :else
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
149 NIL))
|
||||
156 NIL))
|
||||
</span><br/>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,232 +8,241 @@
|
|||
001 (ns beowulf.core
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
002 (:require [beowulf.bootstrap :refer [EVAL oblist *options*]]
|
||||
002 "Essentially, the `-main` function and the bootstrap read-eval-print loop."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
003 [beowulf.read :refer [READ]]
|
||||
003 (:require [beowulf.bootstrap :refer [EVAL oblist *options*]]
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
004 [clojure.java.io :as io]
|
||||
004 [beowulf.read :refer [READ]]
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
005 [clojure.pprint :refer [pprint]]
|
||||
005 [clojure.java.io :as io]
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
006 [clojure.tools.cli :refer [parse-opts]]
|
||||
006 [clojure.pprint :refer [pprint]]
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
007 [environ.core :refer [env]])
|
||||
007 [clojure.tools.cli :refer [parse-opts]]
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
008 (:gen-class))
|
||||
008 [environ.core :refer [env]])
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
009 (:gen-class))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
009
|
||||
010
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
010 (def cli-options
|
||||
011 (def cli-options
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
011 [["-h" "--help"]
|
||||
012 [["-h" "--help"]
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
012 ["-p PROMPT" "--prompt PROMPT" "Set the REPL prompt to PROMPT"
|
||||
013 ["-p PROMPT" "--prompt PROMPT" "Set the REPL prompt to PROMPT"
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
013 :default "Sprecan::"]
|
||||
014 :default "Sprecan::"]
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
014 ["-r INITFILE" "--read INITFILE" "Read Lisp functions from the file INITFILE"
|
||||
015 ["-r INITFILE" "--read INITFILE" "Read Lisp functions from the file INITFILE"
|
||||
</span><br/>
|
||||
<span class="covered" title="8 out of 8 forms covered">
|
||||
015 :validate [#(and
|
||||
016 :validate [#(and
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
016 (.exists (io/file %))
|
||||
017 (.exists (io/file %))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
017 (.canRead (io/file %)))
|
||||
018 (.canRead (io/file %)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
018 "Could not find initfile"]]
|
||||
019 "Could not find initfile"]]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
019 ["-s" "--strict" "Strictly interpret the Lisp 1.5 language, without extensions."]
|
||||
020 ["-s" "--strict" "Strictly interpret the Lisp 1.5 language, without extensions."]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
020 ["-t" "--trace" "Trace Lisp evaluation."]])
|
||||
021 ["-t" "--trace" "Trace Lisp evaluation."]])
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
021
|
||||
022
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
022 (defn repl
|
||||
023 (defn repl
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
023 "Read/eval/print loop."
|
||||
024 "Read/eval/print loop."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
024 [prompt]
|
||||
025 [prompt]
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
025 (loop []
|
||||
026 (loop []
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
026 (print prompt)
|
||||
027 (print prompt)
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
027 (flush)
|
||||
028 (flush)
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
028 (try
|
||||
029 (try
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
029 (let [input (read-line)]
|
||||
030 (let [input (read-line)]
|
||||
</span><br/>
|
||||
<span class="partial" title="2 out of 3 forms covered">
|
||||
030 (cond
|
||||
031 (cond
|
||||
</span><br/>
|
||||
<span class="covered" title="11 out of 11 forms covered">
|
||||
031 (= input "quit") (throw (ex-info "\nFærwell!" {:cause :quit}))
|
||||
032 (= input "quit") (throw (ex-info "\nFærwell!" {:cause :quit}))
|
||||
</span><br/>
|
||||
<span class="covered" title="16 out of 16 forms covered">
|
||||
032 input (println (str "> " (print-str (EVAL (READ input) @oblist))))
|
||||
033 input (println (str "> " (print-str (EVAL (READ input) @oblist))))
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 2 forms covered">
|
||||
033 :else (println)))
|
||||
034 :else (println)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
034 (catch
|
||||
035 (catch
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
035 Exception
|
||||
036 Exception
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
036 e
|
||||
037 e
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
037 (let [data (ex-data e)]
|
||||
038 (let [data (ex-data e)]
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
038 (println (.getMessage e))
|
||||
039 (println (.getMessage e))
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
039 (if
|
||||
040 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
040 data
|
||||
041 data
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
041 (case (:cause data)
|
||||
042 (case (:cause data)
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 5 forms covered">
|
||||
042 :parse-failure (println (:failure data))
|
||||
043 :parse-failure (println (:failure data))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
043 :strict nil ;; the message, which has already been printed, is enough.
|
||||
044 :strict nil ;; the message, which has already been printed, is enough.
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
044 :quit (throw e)
|
||||
045 :quit (throw e)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
045 ;; default
|
||||
046 ;; default
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 3 forms covered">
|
||||
046 (pprint data))))))
|
||||
047 (pprint data))))))
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
047 (recur)))
|
||||
048 (recur)))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
048
|
||||
049
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
049 (defn -main
|
||||
050 (defn -main
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
050 [& opts]
|
||||
051 "Parse options, print the banner, read the init file if any, and enter the
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
052 read/eval/print loop."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
053 [& opts]
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
051 (let [args (parse-opts opts cli-options)]
|
||||
054 (let [args (parse-opts opts cli-options)]
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
052 (println
|
||||
055 (println
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
053 (str
|
||||
056 (str
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
054 "\nHider wilcuman. Béowulf is mín nama.\n"
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
055 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
056 (System/getProperty "beowulf.version")
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
057 (str "Síðe " (System/getProperty "beowulf.version") "\n"))
|
||||
057 "\nHider wilcuman. Béowulf is mín nama.\n"
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
058 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
059 (:help (:options args))
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
060 (:summary args))
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
061 (if (:errors args)
|
||||
</span><br/>
|
||||
<span class="covered" title="9 out of 9 forms covered">
|
||||
062 (apply str (interpose "; " (:errors args))))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
063 "\nSprecan 'quit' tó laéfan\n"))
|
||||
</span><br/>
|
||||
<span class="covered" title="12 out of 12 forms covered">
|
||||
064 (binding [*options* (:options args)]
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
065 (try
|
||||
</span><br/>
|
||||
<span class="covered" title="10 out of 10 forms covered">
|
||||
066 (repl (str (:prompt (:options args)) " "))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
067 (catch
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
068 Exception
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
069 e
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
070 (let [data (ex-data e)]
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
071 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
072 data
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
059 (System/getProperty "beowulf.version")
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
073 (case (:cause data)
|
||||
060 (str "Síðe " (System/getProperty "beowulf.version") "\n"))
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
061 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
062 (:help (:options args))
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
063 (:summary args))
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
064 (if (:errors args)
|
||||
</span><br/>
|
||||
<span class="covered" title="9 out of 9 forms covered">
|
||||
065 (apply str (interpose "; " (:errors args))))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
074 :quit nil
|
||||
066 "\nSprecan 'quit' tó laéfan\n"))
|
||||
</span><br/>
|
||||
<span class="covered" title="12 out of 12 forms covered">
|
||||
067 (binding [*options* (:options args)]
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
068 (try
|
||||
</span><br/>
|
||||
<span class="covered" title="10 out of 10 forms covered">
|
||||
069 (repl (str (:prompt (:options args)) " "))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
075 ;; default
|
||||
070 (catch
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
071 Exception
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
072 e
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
073 (let [data (ex-data e)]
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
074 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
075 data
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
076 (case (:cause data)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
077 :quit nil
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
078 ;; default
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 3 forms covered">
|
||||
076 (pprint data))
|
||||
079 (pprint data))
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 3 forms covered">
|
||||
077 (println e))))))))
|
||||
080 (println e))))))))
|
||||
</span><br/>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -5,31 +5,19 @@
|
|||
</head>
|
||||
<body>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
001 (ns beowulf.host)
|
||||
001 (ns beowulf.host
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
002 "provides Lisp 1.5 functions which can't be (or can't efficiently
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
003 be) implemented in Lisp 1.5, which therefore need to be implemented in the
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
004 host language, in this case Clojure.")
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
002
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
003 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
004 ;;;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
005 ;;; This file provides Lisp 1.5 functions which can't be (or can't efficiently
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
006 ;;; be) implemented in Lisp 1.5, which therefore need to be implemented in the
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
007 ;;; host language, in this case Clojure.
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
008 ;;;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
009 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
005
|
||||
</span><br/>
|
||||
</body>
|
||||
</html>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,7 +29,7 @@
|
|||
style="width:18.181818181818183%;
|
||||
float:left;"> 32 </div></td>
|
||||
<td class="with-number">81.82 %</td>
|
||||
<td class="with-number">329</td><td class="with-number">39</td><td class="with-number">176</td>
|
||||
<td class="with-number">338</td><td class="with-number">40</td><td class="with-number">176</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="beowulf/cons_cell.clj.html">beowulf.cons-cell</a></td><td class="with-bar"><div class="covered"
|
||||
|
@ -39,14 +39,14 @@
|
|||
float:left;"> 98 </div></td>
|
||||
<td class="with-number">56.83 %</td>
|
||||
<td class="with-bar"><div class="covered"
|
||||
style="width:55.38461538461539%;
|
||||
float:left;"> 36 </div><div class="partial"
|
||||
style="width:4.615384615384615%;
|
||||
style="width:57.35294117647059%;
|
||||
float:left;"> 39 </div><div class="partial"
|
||||
style="width:4.411764705882353%;
|
||||
float:left;"> 3 </div><div class="not-covered"
|
||||
style="width:40.0%;
|
||||
style="width:38.23529411764706%;
|
||||
float:left;"> 26 </div></td>
|
||||
<td class="with-number">60.00 %</td>
|
||||
<td class="with-number">149</td><td class="with-number">15</td><td class="with-number">65</td>
|
||||
<td class="with-number">61.76 %</td>
|
||||
<td class="with-number">156</td><td class="with-number">15</td><td class="with-number">68</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="beowulf/core.clj.html">beowulf.core</a></td><td class="with-bar"><div class="covered"
|
||||
|
@ -63,7 +63,7 @@
|
|||
style="width:10.204081632653061%;
|
||||
float:left;"> 5 </div></td>
|
||||
<td class="with-number">89.80 %</td>
|
||||
<td class="with-number">77</td><td class="with-number">3</td><td class="with-number">49</td>
|
||||
<td class="with-number">80</td><td class="with-number">3</td><td class="with-number">49</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="beowulf/host.clj.html">beowulf.host</a></td><td class="with-bar"><div class="covered"
|
||||
|
@ -74,7 +74,7 @@
|
|||
style="width:100.0%;
|
||||
float:left;"> 1 </div></td>
|
||||
<td class="with-number">100.00 %</td>
|
||||
<td class="with-number">9</td><td class="with-number">1</td><td class="with-number">1</td>
|
||||
<td class="with-number">5</td><td class="with-number">1</td><td class="with-number">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="beowulf/read.clj.html">beowulf.read</a></td><td class="with-bar"><div class="covered"
|
||||
|
@ -91,13 +91,13 @@
|
|||
style="width:18.253968253968253%;
|
||||
float:left;"> 23 </div></td>
|
||||
<td class="with-number">81.75 %</td>
|
||||
<td class="with-number">301</td><td class="with-number">28</td><td class="with-number">126</td>
|
||||
<td class="with-number">312</td><td class="with-number">30</td><td class="with-number">126</td>
|
||||
</tr>
|
||||
<tr><td>Totals:</td>
|
||||
<td class="with-bar"></td>
|
||||
<td class="with-number">72.95 %</td>
|
||||
<td class="with-bar"></td>
|
||||
<td class="with-number">79.38 %</td>
|
||||
<td class="with-number">79.52 %</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,3 @@
|
|||
<!DOCTYPE html PUBLIC ""
|
||||
"">
|
||||
<html><head><meta charset="UTF-8" /><title>beowulf.core documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Beowulf</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to beowulf</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>beowulf</span></div></div></li><li class="depth-2 branch"><a href="beowulf.bootstrap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bootstrap</span></div></a></li><li class="depth-2 branch"><a href="beowulf.cons-cell.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cons-cell</span></div></a></li><li class="depth-2 branch current"><a href="beowulf.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="beowulf.host.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>host</span></div></a></li><li class="depth-2"><a href="beowulf.read.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>read</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="beowulf.core.html#var--main"><div class="inner"><span>-main</span></div></a></li><li class="depth-1"><a href="beowulf.core.html#var-cli-options"><div class="inner"><span>cli-options</span></div></a></li><li class="depth-1"><a href="beowulf.core.html#var-repl"><div class="inner"><span>repl</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">beowulf.core</h1><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main & opts)</code></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/core.clj#L49">view source</a></div></div><div class="public anchor" id="var-cli-options"><h3>cli-options</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/core.clj#L10">view source</a></div></div><div class="public anchor" id="var-repl"><h3>repl</h3><div class="usage"><code>(repl prompt)</code></div><div class="doc"><div class="markdown"><p>Read/eval/print loop.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/core.clj#L22">view source</a></div></div></div></body></html>
|
||||
<html><head><meta charset="UTF-8" /><title>beowulf.core documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Beowulf</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to beowulf</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>beowulf</span></div></div></li><li class="depth-2 branch"><a href="beowulf.bootstrap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bootstrap</span></div></a></li><li class="depth-2 branch"><a href="beowulf.cons-cell.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cons-cell</span></div></a></li><li class="depth-2 branch current"><a href="beowulf.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch"><a href="beowulf.host.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>host</span></div></a></li><li class="depth-2"><a href="beowulf.read.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>read</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="beowulf.core.html#var--main"><div class="inner"><span>-main</span></div></a></li><li class="depth-1"><a href="beowulf.core.html#var-cli-options"><div class="inner"><span>cli-options</span></div></a></li><li class="depth-1"><a href="beowulf.core.html#var-repl"><div class="inner"><span>repl</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">beowulf.core</h1><div class="doc"><div class="markdown"><p>Essentially, the <code>-main</code> function and the bootstrap read-eval-print loop.</p></div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main & opts)</code></div><div class="doc"><div class="markdown"><p>Parse options, print the banner, read the init file if any, and enter the read/eval/print loop.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/core.clj#L50">view source</a></div></div><div class="public anchor" id="var-cli-options"><h3>cli-options</h3><div class="usage"></div><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/core.clj#L11">view source</a></div></div><div class="public anchor" id="var-repl"><h3>repl</h3><div class="usage"><code>(repl prompt)</code></div><div class="doc"><div class="markdown"><p>Read/eval/print loop.</p></div></div><div class="src-link"><a href="https://github.com/simon-brooke/beowulf/blob/master/src/beowulf/core.clj#L23">view source</a></div></div></div></body></html>
|
|
@ -1,3 +1,3 @@
|
|||
<!DOCTYPE html PUBLIC ""
|
||||
"">
|
||||
<html><head><meta charset="UTF-8" /><title>beowulf.host documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Beowulf</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to beowulf</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>beowulf</span></div></div></li><li class="depth-2 branch"><a href="beowulf.bootstrap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bootstrap</span></div></a></li><li class="depth-2 branch"><a href="beowulf.cons-cell.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cons-cell</span></div></a></li><li class="depth-2 branch"><a href="beowulf.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch current"><a href="beowulf.host.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>host</span></div></a></li><li class="depth-2"><a href="beowulf.read.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>read</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">beowulf.host</h1><div class="doc"><div class="markdown"><p><strong>TODO</strong>: write docs</p></div></div></div></body></html>
|
||||
<html><head><meta charset="UTF-8" /><title>beowulf.host documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Beowulf</span> <span class="project-version">0.2.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>Introduction to beowulf</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>beowulf</span></div></div></li><li class="depth-2 branch"><a href="beowulf.bootstrap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bootstrap</span></div></a></li><li class="depth-2 branch"><a href="beowulf.cons-cell.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cons-cell</span></div></a></li><li class="depth-2 branch"><a href="beowulf.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-2 branch current"><a href="beowulf.host.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>host</span></div></a></li><li class="depth-2"><a href="beowulf.read.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>read</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">beowulf.host</h1><div class="doc"><div class="markdown"><p>provides Lisp 1.5 functions which can’t be (or can’t efficiently be) implemented in Lisp 1.5, which therefore need to be implemented in the host language, in this case Clojure.</p></div></div></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,14 @@
|
|||
(ns beowulf.bootstrap
|
||||
"Lisp as defined in Chapter 1 (pages 1-14) of the
|
||||
`Lisp 1.5 Programmer's Manual`; that is to say, a very simple Lisp language,"
|
||||
`Lisp 1.5 Programmer's Manual`; that is to say, a very simple Lisp language,
|
||||
which should, I believe, be sufficient in conjunction with the functions
|
||||
provided by `beowulf.host`, be sufficient to bootstrap the full Lisp 1.5
|
||||
interpreter..
|
||||
|
||||
The convention is adopted that functions in this file with names in
|
||||
ALLUPPERCASE are Lisp 1.5 functions (although written in Clojure) and that
|
||||
therefore all arguments must be numbers, symbols or `beowulf.cons_cell.ConsCell`
|
||||
objects."
|
||||
(:require [clojure.tools.trace :refer :all]
|
||||
[beowulf.cons-cell :refer [make-beowulf-list make-cons-cell NIL T F]]))
|
||||
|
||||
|
@ -17,8 +25,7 @@
|
|||
(declare EVAL)
|
||||
|
||||
(def oblist
|
||||
"The default environment; modified certainly be `LABEL` (which seems to
|
||||
be Lisp 1.5's EQuivalent of `SETQ`), possibly by other things."
|
||||
"The default environment."
|
||||
(atom NIL))
|
||||
|
||||
(def ^:dynamic *options*
|
||||
|
@ -26,11 +33,13 @@
|
|||
{})
|
||||
|
||||
(defmacro NULL
|
||||
"Returns `T` if and only if the argument `x` is bound to `NIL`; else `F`."
|
||||
[x]
|
||||
`(if (= ~x NIL) T F))
|
||||
|
||||
(defmacro ATOM
|
||||
"It is not clear to me from the documentation whether `(ATOM 7)` should return
|
||||
"Returns `T` if and only is the argument `x` is bound to and atom; else `F`.
|
||||
It is not clear to me from the documentation whether `(ATOM 7)` should return
|
||||
`T` or `F`. I'm going to assume `T`."
|
||||
[x]
|
||||
`(if (or (symbol? ~x) (number? ~x)) T F))
|
||||
|
@ -110,8 +119,8 @@
|
|||
(defn CDADDR [x] (uaf x (seq "dadd")))
|
||||
|
||||
(defn EQ
|
||||
;; For some reason providing a doc string for this function breaks the
|
||||
;; Clojure parser!
|
||||
"Returns `T` if and only if both `x` and `y` are bound to the same atom,
|
||||
else `F`."
|
||||
[x y]
|
||||
(if (and (= (ATOM x) T) (= x y)) T F))
|
||||
|
||||
|
@ -121,7 +130,7 @@
|
|||
`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"
|
||||
NOTE: returns `F` on failure, not `NIL`"
|
||||
[x y]
|
||||
(cond
|
||||
(= (ATOM x) T) (EQ x y)
|
||||
|
|
|
@ -3,11 +3,18 @@
|
|||
Lisp 1.5 lists do not necessarily have a sequence as their CDR, so
|
||||
cannot be implemented on top of Clojure lists.")
|
||||
|
||||
(def NIL (symbol "NIL"))
|
||||
(def NIL
|
||||
"The canonical empty list symbol."
|
||||
(symbol "NIL"))
|
||||
|
||||
(def T (symbol "T")) ;; true.
|
||||
(def T
|
||||
"The canonical true value."
|
||||
(symbol "T")) ;; true.
|
||||
|
||||
(def F (symbol "F")) ;; false as distinct from nil
|
||||
(def F
|
||||
"The canonical false value - different from `NIL`, which is not canonically
|
||||
false in Lisp 1.5."
|
||||
(symbol "F")) ;; false as distinct from nil
|
||||
|
||||
(deftype ConsCell [CAR CDR]
|
||||
clojure.lang.ISeq
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
(ns beowulf.core
|
||||
"Essentially, the `-main` function and the bootstrap read-eval-print loop."
|
||||
(:require [beowulf.bootstrap :refer [EVAL oblist *options*]]
|
||||
[beowulf.read :refer [READ]]
|
||||
[clojure.java.io :as io]
|
||||
|
@ -47,6 +48,8 @@
|
|||
(recur)))
|
||||
|
||||
(defn -main
|
||||
"Parse options, print the banner, read the init file if any, and enter the
|
||||
read/eval/print loop."
|
||||
[& opts]
|
||||
(let [args (parse-opts opts cli-options)]
|
||||
(println
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
(ns beowulf.host)
|
||||
(ns beowulf.host
|
||||
"provides Lisp 1.5 functions which can't be (or can't efficiently
|
||||
be) implemented in Lisp 1.5, which therefore need to be implemented in the
|
||||
host language, in this case Clojure.")
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;
|
||||
;;; This file provides Lisp 1.5 functions which can't be (or can't efficiently
|
||||
;;; be) implemented in Lisp 1.5, which therefore need to be implemented in the
|
||||
;;; host language, in this case Clojure.
|
||||
;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -1,4 +1,18 @@
|
|||
(ns beowulf.read
|
||||
"This provides the reader required for boostrapping. It's not a bad
|
||||
reader - it provides feedback on errors found in the input - but it isn't
|
||||
the real Lisp reader.
|
||||
|
||||
Intended deviations from the behaviour of the real Lisp reader are as follows:
|
||||
|
||||
1. It reads the meta-expression language `MEXPR` in addition to the
|
||||
symbolic expression language `SEXPR`, which I do not believe the Lisp 1.5
|
||||
reader ever did;
|
||||
2. It treats everything between a semi-colon and an end of line as a comment,
|
||||
as most modern Lisps do; but I do not believe Lisp 1.5 had this feature.
|
||||
|
||||
Both these extensions can be disabled by using the `--strict` command line
|
||||
switch."
|
||||
(:require [beowulf.bootstrap :refer [*options*]]
|
||||
[clojure.math.numeric-tower :refer [expt]]
|
||||
[clojure.string :refer [starts-with? upper-case]]
|
||||
|
@ -204,9 +218,7 @@
|
|||
|
||||
(defn gen-fn-call
|
||||
"Generate a function call from this simplified parse tree fragment `p`;
|
||||
returns `nil` if `p` does not represent a (MEXPR) function call.
|
||||
TODO: I'm not yet certain but it appears that args in mexprs are
|
||||
implicitly quoted; this function does not (yet) do that."
|
||||
returns `nil` if `p` does not represent a (MEXPR) function call."
|
||||
[p]
|
||||
(if
|
||||
(and (coll? p)(= :fncall (first p))(= :mvar (first (second p))))
|
||||
|
@ -297,5 +309,7 @@
|
|||
`(generate (simplify (parse ~s))))
|
||||
|
||||
(defn READ
|
||||
"An implementation of a Lisp reader sufficient for bootstrapping; not necessarily
|
||||
the final Lisp reader."
|
||||
[input]
|
||||
(gsp (or input (read-line))))
|
||||
|
|
Loading…
Reference in a new issue