Re: prog1

2013-05-13 Thread Christophe Grand
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

Re: prog1

2008-11-08 Thread Matthias Benkard
On 8 Nov., 20:24, Phlex <[EMAIL PROTECTED]> wrote: > There must be some reason for CL to have it as a macro > (call-argument-limit perhaps ?) I don't know, but I suspect it might be matter of aesthetics. In CL, PROGN can't be a function for various reasons (off the top of my head: multiple-value

Re: prog1

2008-11-08 Thread Michael Wood
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

Re: prog1

2008-11-08 Thread Phlex
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

Re: prog1

2008-11-08 Thread Randall R Schulz
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

Re: prog1

2008-11-08 Thread André Thieme
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

Re: prog1

2008-11-08 Thread André Thieme
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

Re: prog1

2008-11-08 Thread André Thieme
On 8 Nov., 17:47, Phlex <[EMAIL PROTECTED]> wrote: > Robert Pfeiffer wrote: > > 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) > > Well no, the forms ar

Re: prog1

2008-11-08 Thread Meikel Brandmeyer
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

Re: prog1

2008-11-08 Thread Meikel Brandmeyer
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

Re: prog1

2008-11-08 Thread Randall R Schulz
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

Re: prog1

2008-11-08 Thread Phlex
Robert Pfeiffer wrote: > 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) > > > Well no, the forms are evaluated. It's usefull for side effects. user> (def

Re: prog1

2008-11-08 Thread Meikel Brandmeyer
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

Re: prog1

2008-11-08 Thread Robert Pfeiffer
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

Re: prog1

2008-11-08 Thread Stephen C. Gilardi
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 [result# ~(first body)] > ~@(rest body) > resu