we can now quote with '
This commit is contained in:
+16
-6
@@ -5,12 +5,22 @@
|
||||
"Checks if the argument is nil."
|
||||
(= x nil)))
|
||||
|
||||
(define append
|
||||
(lambda (obj sequence)
|
||||
(if (nil? sequence)
|
||||
(list obj)
|
||||
(if (nil? (rest sequence))
|
||||
))))
|
||||
(define last
|
||||
(lambda (seq)
|
||||
"Returns the last element of the given sequence."
|
||||
(if (nil? seq)
|
||||
seq
|
||||
(if (not (= (type (rest seq)) :pair))
|
||||
(first seq)
|
||||
(last (rest seq))))))
|
||||
|
||||
(define n-times
|
||||
(lambda (times action)
|
||||
(if (<= times 0)
|
||||
nil
|
||||
(prog
|
||||
(eval action)
|
||||
(n-times (- 1 times) action)))))
|
||||
|
||||
(define range
|
||||
(lambda (:keys from :defaults-to 0 to)
|
||||
|
||||
Reference in New Issue
Block a user