Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Dangling Closing Parentheses vs. Stacked Closing Parentheses
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dorai Sitaram  
View profile  
 More options Mar 28 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: d...@goldshoe.gte.com (Dorai Sitaram)
Date: 2000/03/28
Subject: Re: Dangling Closing Parentheses vs. Stacked Closing Parentheses
In article <4u2hrgif8....@beta.franz.com>,
Duane Rettig  <du...@franz.com> wrote:

>I've seen most of the style arguments based on philosophy posted
>on this thread, but there is one argument I have not yet seen.
>The most convincing argument for me to run with the first style is
>what the lisp itself says:

>user(1): (pprint '(defun build-upward-closures ()
>  (loop for k from *maxplay* downto 0 do
>    (setf (aref *upward-closures* k)
>          (let ((result (ash 1 k)))
>            (loop for i from 0 below *n* do
>              (let ((k1 (logior k (ash 1 i))))
>                (when (> k1 k)
>                  (setf result (logior result (aref *upward-closures* k1)))
>                )
>              )
>            )
>            result
>          )
>    )
>  )))

>(defun build-upward-closures ()
>  (loop for k from *maxplay* downto 0 do
>        (setf (aref *upward-closures* k)
>              (let ((result (ash 1 k)))
>                (loop for i from 0 below *n* do
>                      (let ((k1 (logior k (ash 1 i))))
>                        (when (> k1 k)
>                          (setf result
>                                (logior result
>                                        (aref *upward-closures* k1))))))
>                result))))
>user(2):

>In general, any lisp code that can be manipulated as data is
>easier to work with if it matches the result of its pretty-printed
>output.  Now it is true that the pretty printer can be customized,
>and thus you're not going to get exactly the same output if you
>change, say, indentation rules and other attributes.  But for all of
>its customizability, I know of no way to tell the pretty-printer to
>dangle its closing parens.  Was this an oversight, or by design?

Well, the CLISP pretty-printer gives this "semi-dangled" output:

(defun build-upward-closures nil
  (loop for k from *maxplay* downto 0 do
    (setf (aref *upward-closures* k)
      (let ((result (ash 1 k)))
        (loop for i from 0 below *n* do
          (let ((k1 (logior k (ash 1 i))))
            (when (> k1 k)
              (setf result (logior result (aref *upward-closures* k1)))
        ) ) )
        result
) ) ) )

Ie, rparens are either on the same line as their
corresponding lparen, or they are clumped together on a
line of their own, where they line up (column-wise)
with an lparen above them.  But if you look closer, you
will realize with a jolt that the lparen that an rparen
lines up with is _not_ its matching lparen...  I guess
the rparens don't quite "disappear" as previous
articles advised, but they do fade into a
quantum-mechanical interchangeability, losing the
identity that we give to the more substantial parts of
the code.

(
  (
    (
) ) )

--d


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.