André Thieme wrote:
> On 8 Nov., 17:47, Phlex <[EMAIL PROTECTED]> wrote:
>   
>> Robert Pfeiffer wrote:
>>     
>>> Is there a benefit in implementing this as a macro instead of a
>>> function? The function version would be very simple:
>>>       
>>> (defn returning [returnval & body]
>>>    returnval)
>>>       
>> Well no, the forms are evaluated. It's usefull for side effects.
>>     
>
> In what way would the forms *not* get evaluated when using
> Roberts function returning?
>   
Ah I guess you're right, either way it would be nice to have the 
functionality available in clojure.
There must be some reason for CL to have it as a macro 
(call-argument-limit perhaps ?)
Also there's not function call overhead with a macro. Though that should 
not be a concern.
> Macros are much less often needed in a functional language
> which also comes with syntactic suger for (λ [args] ...) in form
> of #(...).
>   
ahwell that's a debate... sure you can do much with lambdas. Some would 
say that's a leaking abstraction.
I often implement some functionality as a higher order function, then 
wrap it around in a macro.
Like a do-trie macro around a map-trie function. it's just prettier !

Sacha


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to