Fixed not copying the default keyword args

This commit is contained in:
FelixBrendel
2018-11-15 15:45:20 +01:00
parent 319d6d2041
commit 3e8f883308
6 changed files with 112 additions and 69 deletions
+4 -2
View File
@@ -127,11 +127,13 @@ by the key 'from' and ends with the number defined in 'to'."
(defun range-while (:keys from :defaults-to 0 to)
"Returns a sequence of numbers starting with the number defined
by the key 'from' and ends with the number defined in 'to'."
(define result (list from))
(define result (list (copy from)))
(define head result)
(mutate from (incr from))
(while (< from to)
(prog
(append result (copy from))
(mutate head (pair (first head) (pair (copy from) nil)))
(define head (rest head))
(mutate from (incr from))))
result)
+7 -1
View File
@@ -1,4 +1,4 @@
(when 1 (breakpoint))
;; (when 1 (breakpoint))
;; (if (eval 1)
;; (apply prog ((breakpoint)))
@@ -7,3 +7,9 @@
;; (if (eval 1)
;; (eval (pair prog ((breakpoint)))))
;; nil))
(defun ! (n)
(if (< n 2)
1
(* n (! (- 1 n)))))