Ok, I quite agree with you. Indeed my little tests did not show any significant difference.<br><br>Laurent<br><br><div class="gmail_quote">On Fri, Nov 20, 2009 at 17:32, Carl Eastlund <span dir="ltr"><<a href="mailto:carl.eastlund@gmail.com">carl.eastlund@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Fri, Nov 20, 2009 at 11:25 AM, Laurent <<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>> wrote:<br>
><br>
> On Fri, Nov 20, 2009 at 17:14, Carl Eastlund <<a href="mailto:carl.eastlund@gmail.com">carl.eastlund@gmail.com</a>><br>
> wrote:<br>
>><br>
>> On Fri, Nov 20, 2009 at 10:55 AM, Joe Marshall <<a href="mailto:jmarshall@alum.mit.edu">jmarshall@alum.mit.edu</a>><br>
>> wrote:<br>
>> > On Fri, Nov 20, 2009 at 5:57 AM, Laurent <<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> I have the following (simplified) code :<br>
>> >><br>
>> >> (define (f1 x)<br>
>> >> (let ([y (foo x)])<br>
>> >> (bar x y y)<br>
>> >> (plop y x y)<br>
>> >> (baz x y)))<br>
>> >><br>
>> >> (define (f2 x)<br>
>> >> (let ([y (foo x)])<br>
>> >> (baz x y)))<br>
>> ><br>
>> > (define (wrapper receiver)<br>
>> > (lambda (x)<br>
>> > (let ((y (foo x)))<br>
>> > (receiver x y)<br>
>> > (baz x y))))<br>
>> ><br>
>> > (define f1<br>
>> > (wrapper<br>
>> > (lambda (x y)<br>
>> > (bar x y y)<br>
>> > (plop y x y) )))<br>
>> ><br>
>> > (define f2<br>
>> > (wrapper<br>
>> > (lambda (x y) #f)))<br>
>><br>
>> Oops. Joe, of course, has the best solution. No need for "macrology"<br>
>> when "functionality" does the job. Pardon the puns.<br>
><br>
> But this introduces a (little?) run-time cost, doesn't it?<br>
<br>
</div></div>Two responses. One, code clarity is almost always more important than<br>
tiny runtime costs. Two, no it doesn't, as long as the compiler is<br>
even halfway intelligent about inlining and constant propagation.<br>
Trust the compiler. If it's good, it's often smarter about optimizing<br>
your code than you are. If it's bad, your code is never going to run<br>
fast anyway.<br>
<font color="#888888"><br>
--Carl<br>
</font></blockquote></div><br>