(defmacro fbind-1 (bindings &body body &environment env) (let ((bindings (mapcar (lambda (b) (append b (list (gensym)))) bindings))) (macroexpand `(alexandria:once-only ,(mapcar (lambda (b) `(,(third b) ',(second b))) bindings) ;; Dance around with BINDINGS since we're doubly quoted. ;; We're using LIST to force double evaluation! `(flet ,(list ,@(mapcar (lambda (b) ``(,',(first b) (&rest args) (apply ,,(third b) args))) bindings)) ;; Take the value of BODY immediately but fully splice it only later ;; on. ,@',body)) env))) ;; but this is equivalent to: (defmacro fbind-1 (bindings &body body &environment env) (let ((bindings (mapcar (lambda (b) (append b (list (gensym)))) bindings))) `(alexandria:once-only ,(mapcar (lambda (b) `(,(third b) ',(second b))) bindings) ;; Dance around with BINDINGS since we're doubly quoted. ;; We're using LIST to force double evaluation! `(flet ,(list ,@(mapcar (lambda (b) ``(,',(first b) (&rest args) (apply ,,(third b) args))) bindings)) ;; Take the value of BODY immediately but fully splice it only later ;; on. ,@',body)))) ;; There's no need to use EVAL in macro (or macroexpand the result), since this is already done automatically by the compiler!