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
 
Pierre R. Mai  
View profile  
 More options Mar 27 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: p...@acm.org (Pierre R. Mai)
Date: 2000/03/27
Subject: Re: Dangling Closing Parentheses vs. Stacked Closing Parentheses

Charles Hixson <charleshi...@earthlink.net> writes:
> Analogously, if one learns to read code in a particular way, one finds
> reading code in that way increasingly easy.  One who learns the C style
> finds that way easier and more obvious than one who has learned the common
> Lisp style.  And vice versa.  The problem is, mixing the styles of two

I actually think that one can train oneself to recognize and use
proficiently more than one indentation style, just as one can learn
to use different idioms in more than one human language (or computer
language).  When I'm a Lisp programmer, I want to see

(defun map-query-for-effect (function query-expression database)
  (multiple-value-bind (result-set columns)
      (database-query-result-set query-expression database)
    (when result-set
      (unwind-protect
           (do ((row (make-list columns)))
               ((not (database-store-next-row result-set database row))
                nil)
             (apply function row))
        (database-dump-result-set result-set database)))))

whereas in C, I'm quite comfortable with:

static void EventLoop(void)
{
  short err;
  int formID;
  FormPtr form;
  EventType event;

  do
    {
      EvtGetEvent(&event, 0);

      /* Give System and Menu a chance to handle the event */
      if (event.eType != keyDownEvent ||
          (event.data.keyDown.chr!=hard1Chr &&
           event.data.keyDown.chr!=hard2Chr &&
           event.data.keyDown.chr!=hard3Chr &&
           event.data.keyDown.chr!=hard4Chr))
        if (SysHandleEvent(&event))
          continue;

     if (MenuHandleEvent((void *)0, &event, &err))
        continue;

      if (event.eType == frmLoadEvent)
        {
          formID = event.data.frmLoad.formID;
          form = FrmInitForm(formID);
          FrmSetActiveForm(form);
          switch (formID)
            {
            case MainForm:
              FrmSetEventHandler(form, MainFormHandleEvent);
              break;
            }
        }

      FrmDispatchEvent(&event);

    } while(event.eType != appStopEvent);

}

Actually, I find that C needs much more whitespace to gain the same
amount of readability, at the loss of terseness.  Note also that C
usually nests much less than Lisp, so you get longer but flatter
functions.

> Mixed Case, but I didn't find it.  Actually, my preferred form is a kind
> of Java-ish form, with lots of mixed capitalization.  I suppose, however,
> that if I were to use Lisp very long, my search-image would change, and
> then it would seem more reasonable to use underscores to separate words
> rather than mixed case signals.  But right now it looks very ugly.  As do

Using underscores to seperate words is indeed very ugly.  That's why
no one does it in Lisp: Use hyphens: structure-editor, silly-function,
etc.

> Lots of Irritating Single Parenthesis.  I believe that there used to be a
> dialect of Lisp where one could signal "close all parenthesis back to the
> root" by using a ] character, but that seems to have disappeared.  I guess
> that it may have been a bit error prone.

It turned out that this functionality belongs in the editor, and not
the language.  That's why ] will close all outstanding parentheses in
many Lisp modes.  This way you get the benefits, without the trouble.
Try to ignore parens, and Lisp will turn into Lots of Indentation
Solves Paren-Proplems. ;)

Regs, Pierre.

--
Pierre Mai <p...@acm.org>         PGP and GPG keys at your nearest Keyserver
  "One smaller motivation which, in part, stems from altruism is Microsoft-
   bashing." [Microsoft memo, see http://www.opensource.org/halloween1.html]


 
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.