Added (times i fn) to prelude

This commit is contained in:
Devine Lu Linvega
2019-07-21 09:20:04 +09:00
parent aaa77de890
commit 3ea7fff85f
4 changed files with 104 additions and 88 deletions

View File

@@ -1,11 +1,20 @@
;
(echo "Loading prelude.lisp")
; translate
(defn translate
(r p)
(clone
r
(rect
(of p :x)
(of p :y)
(of r :w)
(of r :h))))
(r p)
(clone r
(rect
(of p :x)
(of p :y)
(of r :w)
(of r :h))))
; times
(defn times
(v f)
(
(f v)
(if
(gt v 1)
(times
(sub v 1) f))))