Re: a noob question

From: Paul F. Dietz (dietz_at_dls.net)
Date: 01/23/05


Date: Sun, 23 Jan 2005 16:38:48 -0600

Michael Beattie wrote:
> Why is it that some macros or whatever have double parens around them?
> Like...
>
> (let ((x 2))) ; this has 2 parens around the x=2 assignment
>
> or
>
> (do ((i 0 (+ i 1))) ; there's 2 parens around the i=0 and the increment
> ((> i 10) 'done) ; 2 parens around the "end" condition
> (print i))
>
> I guess part of the question is "what exactly is the template for the do
> or let macro?"

Because these can have more than one binding.

   (let ((x 1) (y 2)) (+ x y)) ==> 3

The end condition of DO is grouped with the end form(s), so it doesn't get
confused with the body of the DO.

        Paul



Relevant Pages

  • Re: A speakable (kind of) SUO-KIF ?
    ... m> very few nested parens. ... m> lispy version of Lojban, ... idiomatic syntax is the way to go for a logical language. ... With macros, I hope, one could adapt the syntax to the ...
    (comp.lang.lisp)
  • Re: tail recursion guidelines
    ... since I'm at the recursion part of Touretzky's tutorial book. ... answered my question with iterative solutions. ... >> If macros are the solution, that would be interesting, too, but I'm ... parens in one place where most other languages I'm used to use them. ...
    (comp.lang.lisp)
  • Re: a noob question
    ... > Why is it that some macros or whatever have double parens around ... like this when you're setting multiple things at once. ... (list blah foo bar)) ...
    (comp.lang.lisp)
  • Re: RAD vs. performance
    ... the parens are not good imo. ... What I like most about Lisp is having full-fledged macros, ... is whether there's another language that has enough features and syntax ...
    (comp.lang.misc)
  • Re: a noob question
    ... Paul F. Dietz wrote: ... > Michael Beattie wrote: ... >> Why is it that some macros or whatever have double parens around them? ...
    (comp.lang.lisp)