[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Destructuring lambdas in T?



    Date: Fri, 1 Nov 85 11:05:00 EST
    From: Ashwin Ram <Ram at YALE.ARPA>

    ... The minor problem is that foo now looks ugly (try pretty-printing
    it.)  Isn't there a way to define-compilator a new lambda-form, say
    dlambda (for destructuring lambda), so that the transformation is
    completely transparent?

I won't go over the reasons that adding a new special form to a language
is to be avoided, but what you say does suggest what would be a good
feature of PP and the "standard compiler": right now, I think, only the
expression for the body of a LAMBDA, and the bound variable list, is
remembered in the closure for the LAMBDA.  What should be stored instead
is the original form which eventually macro-expanded into the
LAMBDA-expression.  This way you could do what you want with a macro and
not be bothered by seeing expansions instead of original forms.