On 26 May 2011, at 02:07, Matthew D. Swank wrote:
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.
Why does it not solve the problem? Your definition shows that adding such a feature is just a matter of defining a macro, so it's more or less at the same level of adding a looping construct - it doesn't increase the expressiveness of the language (in the sense of Felleisen's macro-expressiveness).
So, what "problem" do you have in mind here?
Pascal
-- Pascal Costanza The views expressed in this email are my own, and not those of my employer.