On 05/25/2011 04:05 PM, Alessio Stalla wrote:
It's not about syntax, it's about a missing feature: the ability to bind a symbol's function "cell" to a value that's not known at compile time.
I've used this for pedagogical purposes: (defmacro f-let ((&rest bindings) &body body) (let* ((let-bindings (mapcar (lambda (binding) (list (gensym) (cadr binding))) bindings)) (flet-bindings (mapcar (lambda (binding let-binding) `(,(car binding) (&rest args) (apply ,(car let-binding) args))) bindings let-bindings))) `(let ,let-bindings (flet ,flet-bindings ,@body))))
but it hardly solves the problem.