Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1 @@
(defun compose (f g) (lambda (x) (funcall f (funcall g x))))

View file

@ -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

View file

@ -0,0 +1,2 @@
(defun compose (f g)
(eval `(lambda (x) (funcall ',f (funcall ',g x)))))

View file

@ -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))))