Created
January 13, 2022 16:33
-
-
Save fogus/15738ac4cd82ee3fd0dc75445272e051 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; LISP-2 acting like LISP-1 (by Ron Garrett) | |
(defmacro define (name&args &body body) | |
(let ((name (car name&args)) | |
(args (cdr name&args))) | |
`(defun ,name ,args | |
(flet ,(mapcar (lambda (arg) `(,arg (&rest args) (apply ,arg args))) | |
args) | |
,@body)))) | |
? (DEFINE (F X) (X 1)) | |
F | |
? (f '1+) | |
2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment