Fixed not copying the default keyword args
This commit is contained in:
+4
-2
@@ -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
@@ -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)))))
|
||||
|
||||
Reference in New Issue
Block a user