Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
(defun compose (f g) (lambda (x) (funcall f (funcall g x))))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
>(defun compose (f g) (lambda (x) (funcall f (funcall g x))))
|
||||
COMPOSE
|
||||
>(let ((sin-asin (compose #'sin #'asin)))
|
||||
(funcall sin-asin 0.5))
|
||||
0.5
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(defun compose (f g)
|
||||
(eval `(lambda (x) (funcall ',f (funcall ',g x)))))
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
CL-USER> (defmacro compose (fn-name &rest args)
|
||||
(labels ((rec1 (args)
|
||||
(if (= (length args) 1)
|
||||
`(funcall ,@args x)
|
||||
`(funcall ,(first args) ,(rec1 (rest args))))))
|
||||
`(defun ,fn-name (x) ,(rec1 args))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue