[plt-scheme] Unhygienic macro not needed?

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Fri Nov 20 11:14:40 EST 2009

On Fri, Nov 20, 2009 at 10:55 AM, Joe Marshall <jmarshall at alum.mit.edu> wrote:
> On Fri, Nov 20, 2009 at 5:57 AM, Laurent <laurent.orseau at gmail.com> wrote:
>>
>> I have the following (simplified) code :
>>
>> (define (f1 x)
>>   (let ([y (foo x)])
>>     (bar x y y)
>>     (plop y x y)
>>     (baz x y)))
>>
>> (define (f2 x)
>>   (let ([y (foo x)])
>>     (baz x y)))
>
> (define (wrapper receiver)
>  (lambda (x)
>    (let ((y (foo x)))
>      (receiver x y)
>      (baz x y))))
>
> (define f1
>   (wrapper
>     (lambda (x y)
>         (bar x y y)
>         (plop y x y) )))
>
> (define f2
>   (wrapper
>      (lambda (x y) #f)))

Oops.  Joe, of course, has the best solution.  No need for "macrology"
when "functionality" does the job.  Pardon the puns.

--Carl


Posted on the users mailing list.