Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro named-let (name bindings &body body)
- `(labels ((,name ,(mapcar (lambda (x) (if (listp x) (first x) x)) bindings)
- ,@body))
- (,name ,@(mapcar (lambda (x) (if (listp x) (second x) nil)) bindings))))
- ;; (named-let fact ((n 10))
- ;; (if (< n 1) 1 (* n (fact (1- n)))))
- ;; --> 3628800
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement