From: Futu Ranon on 4 Mar 2010 12:59 On Wed, 03 Mar 2010 09:43:19 -0500, Tamas K Papp <tkpapp(a)gmail.com> wrote: > On Wed, 03 Mar 2010 15:26:46 +0100, Giovanni Gigante wrote: > >> Futu Ranon wrote: >>> Is this "typical" style? >> >> Not very common, but possible. Personally, I adopted it when i realized >> that since in SLIME keywords are shown in a different color, this style >> makes the loop form somewhat easier to read (to my eyes, at least). > > At it also looks nice in other, similar macros, eg iterate (for all > the keywords but the first, where you can't use it). > > Tamas Ah, these and Pascal Bourguignon's explanation were very helpful. Thank you.
From: blandest on 5 Mar 2010 19:33 pjb(a)informatimago.com (Pascal J. Bourguignon) writes: > "Futu Ranon" <futuranon(a)gmail.com> writes: > >> In Pillsy's "Redirecting program output with SBCL's RUN-PROGRAM", I >> noticed the following: >> >>> (loop >>> :for line := (read-line o nil nil) >>> :while line >>> :collect line)) >> >> Is this "typical" style? I have always seen it in reading and in >> practice as: >> >>> (loop >>> for line = (read-line o nil nil) >>> while line >>> collect line)) >> >> Thank you. > > In case of interactive use, the former has the advantage of not > interning symbols such as FOR and WHILE which may be later imported by > a USE-PACKAGE form, thus avoiding conflict. This is what motivated to > use keywords in LOOP. (I had macros named FOR and WHILE in some utility > package). That is a good point, but how about variable names used in loop ? To me, avoiding intering symbols looks like a lost cause. Of course, if you are carefull, at least common words (like: 'for' and 'while') won't get interned.
First
|
Prev
|
Pages: 1 2 Prev: A couple of questions on lisp compiler/optimization art Next: uw-p and make-thread |