Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > Re: Canonical I...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 80 of 111 Topic 13038 of 13900
Post > Topic >>

Re: Canonical Indentation

by Kent M Pitman <pitman@[EMAIL PROTECTED] > Jul 18, 2008 at 12:23 PM

Benjamin Teuber <beteub@[EMAIL PROTECTED]
> writes:

> On 18 Jul., 03:23, Joost Diepenmaat <jo...@[EMAIL PROTECTED]
> wrote:
> 
> > Isn't that why &body is for?
> 
> Right, but I'm not sure whether this is enough - maybe there happens
> to be a macro with two bodies or some other reason for different
> indentation. Question to the experienced guys: Did you ever stumble
> across a macro where &body alone wasn't enough to specify a good
> indentation?

It's extremely rare and usually not an issue, not because it can't be
wanted but because Lisp syntax doesn't really allow for it.

The problem comes that if you wanted multiple bodies, there would be 
no obvious cue about how to divide them.  So usually what you do is
like what COND does where you do:

  (defmacro my-cond (&body clauses)
    ...
    (dolist (clause clauses)
       ... (destructuring-bind (test &body forms) clause ...) ...)
    ...)

Or else you just take one as a form and make the user use progn, as in:

  (defmacro my-multiple-value-bind (bindings value-form &body forms) ...)

where in practice one often occasionally wishes for 

  (defmacro my-multiple-value-bind (bindings &body value-forms 
                                             &more-body other-forms)
    ...)

The fact is that &body is not the source of any problem, it just reminds
you
that there are inherent limitations with positionally supplied semantics.
That problem is a problem of the universe, not even of Lisp. e.g., it
comes
up with regular expressions, for example, when you try to juxtapose to * 
wildcards and either combinatoric answers come up or the string doesn't
compile, depending on the tool.  It's also the reason that if you're
wanting
something scanf-like, as in (setf (format nil "~D" x) "3"), you can't 
allow cases like (setf (format nil "~D~D" x y) "357") to set multiple
values
because you can't know what the partitioning is. &body is just another
case
of this broad class of issues.
 




 111 Posts in Topic:
The Fundamental Problems of Lisp
"xahlee@[EMAIL PROTE  2008-07-13 07:53:38 
some corrections Re: The Fundamental Problems of Lisp
Vassil Nikolov <vnikol  2008-07-13 12:31:07 
Re: some corrections Re: The Fundamental Problems of Lisp
rpw3@[EMAIL PROTECTED] (  2008-07-13 20:36:01 
Re: some corrections Re: The Fundamental Problems of Lisp
Vassil Nikolov <vnikol  2008-07-13 23:04:14 
Re: some corrections Re: The Fundamental Problems of Lisp
pjb@[EMAIL PROTECTED] (P  2008-07-14 11:34:08 
Re: The Fundamental Problems of Lisp
Gene <gene.ressler@[EM  2008-07-13 10:14:46 
Re: The Fundamental Problems of Lisp
jon.harrop.ms.sharp@[EMAI  2008-07-13 11:09:53 
Re: The Fundamental Problems of Lisp
Evans Winner <thorne@[  2008-07-13 14:11:03 
Re: some corrections Re: The Fundamental Problems of Lisp
Paul Foley <see@[EMAIL  2008-07-15 01:51:18 
Re: The Fundamental Problems of Lisp
"xahlee@[EMAIL PROTE  2008-07-14 15:48:43 
Re: The Fundamental Problems of Lisp
Matthias Buelow <mkb@[  2008-07-16 01:47:27 
Re: The Fundamental Problems of Lisp
"John Thingstad"  2008-07-15 21:04:13 
Re: The Fundamental Problems of Lisp
"xahlee@[EMAIL PROTE  2008-07-15 13:32:50 
Re: The Fundamental Problems of Lisp
Christophe <christophe  2008-07-15 14:03:37 
Re: The Fundamental Problems of Lisp
Christophe <christophe  2008-07-15 14:09:01 
Re: The Fundamental Problems of Lisp
"xahlee@[EMAIL PROTE  2008-07-15 17:01:17 
The Fundamental Confusion of Xah
"joswig@[EMAIL PROTE  2008-07-15 19:13:22 
Re: The Fundamental Confusion of Xah
Evans Winner <thorne@[  2008-07-21 16:53:00 
Re: The Fundamental Confusion of Xah
Cor Gest <cor@[EMAIL P  2008-07-21 23:44:49 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-21 22:32:25 
Re: The Fundamental Confusion of Xah
Rainer Joswig <joswig@  2008-07-22 09:03:10 
Re: The Fundamental Confusion of Xah
"John Thingstad"  2008-07-22 09:49:45 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-22 07:16:27 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-22 16:43:20 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-22 13:38:23 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-22 22:51:17 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-25 23:57:14 
Re: The Fundamental Confusion of Xah
"xahlee@[EMAIL PROTE  2008-07-15 22:33:10 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-07-16 02:04:14 
Re: The Fundamental Problems of Lisp
Tamas K Papp <tkpapp@[  2008-07-16 09:30:32 
Re: The Fundamental Confusion of Xah
"joswig@[EMAIL PROTE  2008-07-16 04:43:03 
Re: The Fundamental Confusion of Xah
pjb@[EMAIL PROTECTED] (P  2008-07-16 17:02:33 
Re: The Fundamental Confusion of Xah
Rainer Joswig <joswig@  2008-07-16 17:29:58 
Re: The Fundamental Confusion of Xah
Vassil Nikolov <vnikol  2008-07-16 19:44:17 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-28 14:21:39 
Re: The Fundamental Confusion of Mr. Frog
Rainer Joswig <joswig@  2008-07-28 23:43:34 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-29 00:50:08 
Re: The Fundamental Confusion of Xah
parnell <parnell.flynn  2008-07-29 08:13:07 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-30 15:09:05 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-07-31 05:36:18 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-31 21:46:13 
Re: The Fundamental Confusion of Xah
Duane Rettig <duane@[E  2008-08-01 00:17:21 
Re: The Fundamental Confusion of Xah
Kenny <kentilton@[EMAI  2008-08-01 03:58:33 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-08-01 11:13:56 
Re: The Fundamental Confusion of Xah
Duane Rettig <duane@[E  2008-08-01 11:54:13 
Re: The Fundamental Confusion of Xah
"John Thingstad"  2008-08-01 10:14:19 
Re: The Fundamental Confusion of Xah
Pascal Costanza <pc@[E  2008-08-01 11:08:02 
Re: The Fundamental Confusion of Xah
"Dimiter \"malk  2008-08-04 16:58:40 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-07-31 05:40:29 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-31 21:49:53 
Re: The Fundamental Confusion of Xah
namekuseijin <namekuse  2008-07-31 13:23:50 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-01 01:43:46 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-01 01:55:15 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-08-01 11:22:32 
Re: The Fundamental Confusion of Xah
pjb@[EMAIL PROTECTED] (P  2008-08-01 14:26:18 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-08-01 18:50:11 
Re: The Fundamental Confusion of Xah
namekuseijin <namekuse  2008-08-01 09:16:45 
Re: The Fundamental Confusion of Xah
namekuseijin <namekuse  2008-08-01 09:23:07 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-01 12:14:50 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-08-02 06:06:25 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-01 12:23:26 
Re: The Fundamental Confusion of Xah
"Thomas F. Burdick&q  2008-08-02 03:17:27 
Re: The Fundamental Confusion of Xah
Christophe <christophe  2008-08-02 07:32:34 
Re: The Fundamental Confusion of Xah
viper-2 <visionat@[EMA  2008-07-16 07:13:48 
Re: The Fundamental Confusion of Xah
Rainer Joswig <joswig@  2008-07-16 16:59:24 
Re: The Fundamental Confusion of Xah
viper-2 <visionat@[EMA  2008-07-16 09:56:08 
Re: The Fundamental Confusion of Xah
"xahlee@[EMAIL PROTE  2008-07-16 15:46:03 
Re: The Fundamental Confusion of Xah
Peter Keller <psilord@  2008-07-17 00:13:47 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-18 21:34:00 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-23 02:19:07 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-23 21:52:02 
Re: The Fundamental Confusion of Xah
viper-2 <visionat@[EMA  2008-07-16 16:54:19 
Re: The Fundamental Confusion of Xah
"joswig@[EMAIL PROTE  2008-07-16 17:07:31 
Re: The Fundamental Confusion of Xah
Benjamin Teuber <beteu  2008-07-17 18:09:46 
Re: The Fundamental Confusion of Xah
Joost Diepenmaat <joos  2008-07-18 03:23:31 
Re: The Fundamental Confusion of Xah
Kenny <kentilton@[EMAI  2008-07-18 02:13:16 
Re: The Fundamental Confusion of Xah
pjb@[EMAIL PROTECTED] (P  2008-07-18 07:32:44 
Canonical Indentation
Benjamin Teuber <beteu  2008-07-18 02:14:24 
Re: Canonical Indentation
pjb@[EMAIL PROTECTED] (P  2008-07-18 11:49:18 
Re: Canonical Indentation
Kent M Pitman <pitman@  2008-07-18 12:23:31 
Canonical Indentation
Benjamin Teuber <beteu  2008-07-18 02:15:32 
Canonical Indentation
Benjamin Teuber <beteu  2008-07-18 02:16:20 
Re: Canonical Indentation
"Tobias C. Rittweile  2008-07-19 13:44:25 
Re: Canonical Indentation
Kent M Pitman <pitman@  2008-07-19 11:04:38 
Re: Canonical Indentation
Vassil Nikolov <vnikol  2008-07-19 11:26:30 
Re: Canonical Indentation
Pascal Costanza <pc@[E  2008-07-20 14:00:46 
Re: Canonical Indentation
Kent M Pitman <pitman@  2008-07-20 08:50:08 
Re: Canonical Indentation
pjb@[EMAIL PROTECTED] (P  2008-07-19 18:44:54 
Re: Canonical Indentation
"Tobias C. Rittweile  2008-07-19 17:39:44 
Re: Canonical Indentation
"Tobias C. Rittweile  2008-07-19 17:59:04 
Re: Canonical Indentation
Rainer Joswig <joswig@  2008-07-19 19:39:52 
Re: Canonical Indentation
"Tobias C. Rittweile  2008-07-19 18:04:31 
Re: Canonical Indentation
Vassil Nikolov <vnikol  2008-07-19 21:32:03 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-21 03:14:32 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-21 14:35:01 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-21 15:58:31 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-22 12:26:02 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-22 16:04:04 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-26 00:10:04 
Re: The Fundamental Confusion of Xah
George Neuner <gneuner  2008-07-26 00:05:02 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-26 15:16:20 
Re: The Fundamental Confusion of Xah
Matthias Buelow <mkb@[  2008-07-28 13:22:44 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-28 16:52:46 
Re: The Fundamental Confusion of Xah
Matthias Buelow <mkb@[  2008-07-29 13:47:24 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-28 20:15:15 
Re: The Fundamental Confusion of Xah
"John Thingstad"  2008-07-28 22:47:28 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-24 05:42:09 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-21 08:01:13 
Re: The Fundamental Confusion of Xah
Jon Harrop <jon@[EMAIL  2008-07-21 17:06:42 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-21 12:57:37 
Re: The Fundamental Confusion of Xah
Vend <vend82@[EMAIL PR  2008-07-21 13:05:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 18:07:10 CST 2008.