Hi
On Sat, Nov 8, 2008 at 5:10 PM, Robert Pfeiffer <
pfeiffer.rob...@googlemail.com> 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)
>
The macro does not alloca
p of my head:
multiple-value returns and special treatment at the top level), so
it'd be a bit weird and maybe even confusing for PROG1 or PROG2 to be
such.
Matthias
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
On Sat, Nov 8, 2008 at 8:48 PM, André Thieme
<[EMAIL PROTECTED]> wrote:
>
> On 8 Nov., 18:00, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> Am 08.11.2008 um 17:39 schrieb Meikel Brandmeyer:
>>
>> >> (defn returning [returnval & body]
>> >> returnval)
[...]
> I also don't see how the f
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]
>>>re
On Saturday 08 November 2008 10:44, André Thieme wrote:
> On 8 Nov., 18:32, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Am 08.11.2008 um 17:58 schrieb Randall R Schulz:
> > > Peasant? Or did you mean "pedant?"
> >
> > In german there is the word "Banause" which translates
> > acco
On 8 Nov., 18:00, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Am 08.11.2008 um 17:39 schrieb Meikel Brandmeyer:
>
> >> (defn returning [returnval & body]
> >> returnval)
>
> And another question, which a I got when I read the
> mail of Phlex: Is the order of evaluation of function
> ar
On 8 Nov., 18:32, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Am 08.11.2008 um 17:58 schrieb Randall R Schulz:
>
> > Peasant? Or did you mean "pedant?"
>
> In german there is the word "Banause" which translates
> according the dictionary to "peasant". It means something
> like the follo
y]
> > 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?
> user> (def *bleh* (ref nil))
> user> (prog1
> (dosync (ref-set *bleh* 3))
>
Hi,
Am 08.11.2008 um 17:58 schrieb Randall R Schulz:
Peasant? Or did you mean "pedant?"
In german there is the word "Banause" which translates
according the dictionary to "peasant". It means something
like the following:
Artist: "Oh! Look this beautiful picture! It's art!"
Banause: "It's jus
Hi,
Am 08.11.2008 um 17:39 schrieb Meikel Brandmeyer:
(defn returning [returnval & body]
returnval)
And another question, which a I got when I read the
mail of Phlex: Is the order of evaluation of function
arguments guaranteed to be from the left to the right?
Sincerely
Meikel
smime.p7s
D
On Saturday 08 November 2008 08:39, Meikel Brandmeyer wrote:
> Hi,
>
> Am 08.11.2008 um 17:10 schrieb Robert Pfeiffer:
> > 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]
> > retur
s usefull for side effects.
user> (def *bleh* (ref nil))
user> (prog1
(dosync (ref-set *bleh* 3))
(println (str "bleh is now " @*bleh*)))
bleh is now 3
3
A function would work :
(defn progz [return-value do-also-fn]
(do-also-fn)
return-value)
us
Hi,
Am 08.11.2008 um 17:10 schrieb Robert Pfeiffer:
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)
Although I'm a strong proponent of using macros only where they
are really n
Hello,
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)
This is just a K combinator with varargs.
Robert Pfeiffer
--~--~-~--~~~---~--~~
You recei
On Nov 8, 2008, at 5:55 AM, Phlex wrote:
> Hello,
>
> I was missing the prog1 macro from common lisp, so here it is.
>
> (defmacro prog1 [& body]
> " (prog1 forms*)
> Evaluates all the forms, returning the result of the first form"
> `(let [res
Hello,
I was missing the prog1 macro from common lisp, so here it is.
(defmacro prog1 [& body]
" (prog1 forms*)
Evaluates all the forms, returning the result of the first form"
`(let [result# ~(first body)]
~@(rest body)
result#))
user> (prog1 "a" &qu
16 matches
Mail list logo