From: gnuist006
Subject: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <b00bb831.0209281146.5c955ff0@posting.google.com>
What is professional way of commenting in lisp, esp blocks of codes?
Do we have #ifdef's?

And also on indenting style, especially the closing parens of the blocks?

thanks

From: Christopher Browne
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <an51mg$b1j69$1@ID-125932.news.dfncis.de>
A long time ago, in a galaxy far, far away, ·········@hotmail.com (gnuist006) wrote:
> What is professional way of commenting in lisp, esp blocks of codes?

M-x comment-region

> Do we have #ifdef's?

Look at *FEATURES*

And consider things like...
#+clisp (expression-to-evaluate-when-using-CLISP)
#+cmu (expression-to-evaluate-when-using-CMU/CL)
#+unix (expression-to-evaluate-when-on-UNIX)
#+PC386 (expression-to-evaluate-when-on-IA-32)

> And also on indenting style, especially the closing parens of the blocks?

Use a decent editor (such as Emacs) that indents the code for you.
And put the closing parens immediately after whatever they are closing

(let ((a 1)
      (b 2))
  (format t "A plus B is ~D~%" (+ a b)))
-- 
(reverse (concatenate 'string ·············@" "sirhc"))
http://www.ntlug.org/~cbbrowne/lisp.html
"They're deleting the word `gullible' from modern dictionaries,
presumably because it's too difficult a concept for the modern man or
woman to understand."
From: Thomas A. Russ
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <ymiptuvc9cx.fsf@sevak.isi.edu>
> A long time ago, in a galaxy far, far away, ·········@hotmail.com (gnuist006) wrote:
> > What is professional way of commenting in lisp, esp blocks of codes?

Well, there is one convention based on the number of preceding semi
colons:

        Line comment:   single  ;    at the end of the line
Code Section comment:   double  ;;   indented with code
    Function comment:  triple   ;;;  flush left, 
                                     precedes the function definition
File Section comment: quadruple ;;;; flush left.

Example:

;;;;  This is some example comment code

;;;  Factorial, the recursive version
(defun fact-recurse (x)
  (if (= x 0)
      1                 ; By definition
      (* x (fact-recurse (1- x)))))

;;; Factorial, the iterative version
(defun fact-iterate (x)
  ;; Define an accumulator
  (let ((f 1))
     ;; Now iterate and accumlate the product
     (dotimes (i x)
        (setq f (* i f)))
     f))           ; Return the result



Note that there is also the use of the documentation string in place of
the function comment.  This can be useful for certain IDEs and to allow
runtime lookup of comments.

-- 
Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu    
From: Marco Antoniotti
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <y6c1y7a1dw8.fsf@octagon.valis.nyu.edu>
···@sevak.isi.edu (Thomas A. Russ) writes:

> > A long time ago, in a galaxy far, far away, ·········@hotmail.com (gnuist006) wrote:
> > > What is professional way of commenting in lisp, esp blocks of codes?
> 
> Well, there is one convention based on the number of preceding semi
> colons:
> 
>         Line comment:   single  ;    at the end of the line
> Code Section comment:   double  ;;   indented with code
>     Function comment:  triple   ;;;  flush left, 
>                                      precedes the function definition
> File Section comment: quadruple ;;;; flush left.

Thanks.  I never quite figured out what to make of the quadruple #\;.

It must also be pointed out that (X)Emacs assumes the above convention
when you invoke the commenting and indenting commands.

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
715 Broadway 10th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Joe Marshall
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <65wmb6y8.fsf@ccs.neu.edu>
Marco Antoniotti <·······@cs.nyu.edu> writes:

> 
> Thanks.  I never quite figured out what to make of the quadruple #\;.
> 

The `atsign' program would extract the text from quadruple semicolon
for page headers.
From: Marco Antoniotti
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <y6cu1k6z1l2.fsf@octagon.valis.nyu.edu>
Joe Marshall <···@ccs.neu.edu> writes:

> Marco Antoniotti <·······@cs.nyu.edu> writes:
> 
> > 
> > Thanks.  I never quite figured out what to make of the quadruple #\;.
> > 
> 
> The `atsign' program would extract the text from quadruple semicolon
> for page headers.

Never heard of it.  What else did it do?  It is the reason for some of
the ELisp conventions as well? (Like the `autoload' stuff?)

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
715 Broadway 10th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Barry Margolin
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <duim9.3$M54.481@paloalto-snr1.gtei.net>
In article <···············@octagon.valis.nyu.edu>,
Marco Antoniotti  <·······@cs.nyu.edu> wrote:
>
>Joe Marshall <···@ccs.neu.edu> writes:
>
>> Marco Antoniotti <·······@cs.nyu.edu> writes:
>> 
>> > 
>> > Thanks.  I never quite figured out what to make of the quadruple #\;.
>> > 
>> 
>> The `atsign' program would extract the text from quadruple semicolon
>> for page headers.
>
>Never heard of it.  What else did it do?  It is the reason for some of
>the ELisp conventions as well? (Like the `autoload' stuff?)

It was mainly a cross-referencing utility.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Donald Fisk
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <3D9BB40D.53D464E2@enterprise.net>
"Thomas A. Russ" wrote:
> 
> > A long time ago, in a galaxy far, far away, ·········@hotmail.com (gnuist006) wrote:
> > > What is professional way of commenting in lisp, esp blocks of codes?
> 
> Well, there is one convention based on the number of preceding semi
> colons:
> 
>         Line comment:   single  ;    at the end of the line
> Code Section comment:   double  ;;   indented with code
>     Function comment:  triple   ;;;  flush left,
>                                      precedes the function definition
> File Section comment: quadruple ;;;; flush left.

There's also #| and |# (#|| and ||# sometimes look better in Emacs,
though)
for nestable block comments, and are used much like /* and */ in C,
and, as you point out, documentation strings.

> Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu

Le Hibou
-- 
Dalinian: Lisp. Java. Which one sounds sexier?
RevAaron: Definitely Lisp. Lisp conjures up images of hippy coders,
drugs,
sex, and rock & roll. Late nights at Berkeley, coding in Lisp fueled by
LSD.
Java evokes a vision of a stereotypical nerd, with no life or social
skills.
From: Thien-Thi Nguyen
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <kk9lm5lg7kl.fsf@glug.org>
·········@hotmail.com (gnuist006) writes:

> What is professional way of commenting in lisp, esp blocks of codes?

the professional way is to incite flames on c.l.l -- this distracts
people while you Write your block of Code.

thi
From: Frank A. Adrian
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <WcHl9.1075$do6.39619@news.uswest.net>
gnuist006 wrote:

> What is professional way of commenting in lisp, esp blocks of codes?

The professional way to write comments is to write the code clearly and 
concisely enough that the number of comments is minimized (with any luck to 
none whatsoever).  There are many good books on writing good code and many 
more that are bad books that try to get you to write a lot of bad code.  I 
hope you find the former.


> Do we have #ifdef's?

No.  C and C-family languages have #ifdefs.  If you try to put #ifdef into a 
Common Lisp program, you'll probably get an error message about i not being 
a proper subcharacter for the # dispatch character.  And what do you mean 
by we?  I don't seem to be aquainted with you.


> And also on indenting style, especially the closing parens of the blocks?
Most systems have editors that indent for you.  Try using them and their 
methods.

faa
From: Johan Kullstam
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <m3n0pz60b2.fsf@sysengr.res.ray.com>
"Frank A. Adrian" <·······@ancar.org> writes:

> gnuist006 wrote:
> 
> > What is professional way of commenting in lisp, esp blocks of codes?

> The professional way to write comments is to write the code clearly
> and concisely enough that the number of comments is minimized (with
> any luck to none whatsoever).  There are many good books on writing
> good code and many more that are bad books that try to get you to
> write a lot of bad code.  I hope you find the former.

I think comments in lisp are Like comments in most languages.  This
sums it up nicely,
  "[T]he purpose of a comment is to help you or another person
  understand the program at a later time."  -- octave info file

I like to provide a small sketch at *high level* of the general
strategy.  Implementation is left to actually code -- it's annoying
for me and often leads to comment/code skew to have to constantly redo
commentary for minor code tweaks.  For example if you make a sorting
algorithm, just say you are doing a heap, quick, insertion, bubble or
whatever you have.  Then I like to give notes about assumptions or
gotchas, e.g., doesn't work for negative index, won't accept NIL.
Also I comment on why I did it a particular way.

Here is an example of a comment I wrote for my own code.

;; use pascals triangle to calculate the coefficients
;; the loop constructs a row of triangle then destructively
;; modifies it to create the next row.
;; this is perhaps slow and conses a little but it is
;; numerically stable and accurate
;; consing restrained somewhat by re-using an array
;; array elements will be integers
;; specializing the array to fixnum is probably counterproductive
;; as the coefficients can easily grow into bignums
;; note specialization prevents later in-place coercing to ratio or float
(defun abinom (n &optional r)
  "(ABINOM N R) calculates the binomial coefficient for N choose R.
Omitted or NIL argument R returns Nth row of pascals triangle as an
integer array."
  (loop :with acc = (make-array (1+ n) :element-type 'integer)
        :for i :from 0 :to n
        :do (loop :for j0 :downfrom (- i 2) :to 0
                  :as j1 :downfrom (- i 1)
                  :do (setf (aref acc j1) (+ (aref acc j0) (aref acc j1)))
                  :finally (setf (aref acc i) 1))
        :finally (return (if r (aref acc r) acc))))

The code is a bit cryptic and non-obvious which is why I commented it
copiously.  Note, I am usually too lazy to do this good a job.

> 
> > Do we have #ifdef's?
> 
> No.  C and C-family languages have #ifdefs.  If you try to put #ifdef into a 
> Common Lisp program, you'll probably get an error message about i not being 
> a proper subcharacter for the # dispatch character.  And what do you mean 
> by we?  I don't seem to be aquainted with you.

The #ifdef thing seems to be less important in Lisp world.  But then I
am a Lisp novice.

There is a thing called FEATURE and it is used with sharpsign-plus (#+) and
sharpsign-minus (#-).

#+cmucl(expression)

will put in some optional code.

You can always use (if ...) and the compiler should optimize away
compile time known stuff -- hint trigger the if on a constant.


> > And also on indenting style, especially the closing parens of the
> > blocks?

Put enough closing parens all stacked together at the end of whatever
you are closing.  Lonely parens on a line by themselves is not right.

> Most systems have editors that indent for you.  Try using them and their 
> methods.

Yes, a good editor helps.  I like emacs.

-- 
Johan KULLSTAM <··········@attbi.com> sysengr
From: Thomas F. Burdick
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <xcvptuv49np.fsf@famine.OCF.Berkeley.EDU>
Johan Kullstam <··········@attbi.com> writes:

> I think comments in lisp are Like comments in most languages.  This
> sums it up nicely,
>   "[T]he purpose of a comment is to help you or another person
>   understand the program at a later time."  -- octave info file

I agree, with the one caveat that most languages don't have
docstrings.  In Lisp, it's a bit of an art to decide what goes in a
docstring and what goes in a comment.  Not that it's hard, but most
languages don't give you the choice.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Johan Kullstam
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <m3adlz5mcy.fsf@sysengr.res.ray.com>
···@famine.OCF.Berkeley.EDU (Thomas F. Burdick) writes:

> Johan Kullstam <··········@attbi.com> writes:
> 
> > I think comments in lisp are Like comments in most languages.  This
> > sums it up nicely,
> >   "[T]he purpose of a comment is to help you or another person
> >   understand the program at a later time."  -- octave info file
> 
> I agree, with the one caveat that most languages don't have
> docstrings.  In Lisp, it's a bit of an art to decide what goes in a
> docstring and what goes in a comment.  Not that it's hard, but most
> languages don't give you the choice.

Yes.  Matlab (and hence octave) is the only other language I know
which does have a docstring-like feature.

One annoyance I have is writing really long docstrings.  I'd like page
long ones sometimes.  How do I best format these things using emacs?

-- 
Johan KULLSTAM <··········@attbi.com> sysengr
From: Tim Bradshaw
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <ey3d6qvw8yb.fsf@cley.com>
* Johan Kullstam wrote:

> One annoyance I have is writing really long docstrings.  I'd like page
> long ones sometimes.  How do I best format these things using emacs?

We have a readmacro #[ ... ] which can (well, will) support various
cleverness for docstrings.  At the moment it really is nothing much
other than a place holder (and in particular you can set a flag which
causes #[ ... ] to just be discarded thus meaning that production code
can be `censored' if need be), but in due course I scheme to write a
little micro-markup language which will allow you describe things in a
slightly structured way which can then be pettily[1] converted into a
docstring, or extracted and converted into some kind of reference
manual type thing.

There's already a system for doing this - one of the MK tools - and it
suffers from a related problem to my thing, which is that you really
need to make the defining macros themselves do the work of handling
docstrings, so in order to make my thing work I need to shadow all the
defining macros with ones of my own.  You need to do this because only
the defining macro really knows enough about what kind of information
should be provided to the user - arglist, function name, class name,
superclass names, method spec including qualifiers &c.

The reason you can't (easily) do this without being the defining macro
- in particular the reason it's hard to do by just reading the files -
is you practically have to do exactly what LOAD does in terms of
setting packages and load-time evaluation and so on to have a hope in
hell of actually reading the source of a substantial program
successfully.  For instance almost the first thing weld (the system
I've been working on) does is change things so that DEFPACKAGE does
more than the standard CL:DEFPACKAGE does...

Fortunately there are a finite set of defining macros which allow
docstrings and the `wrapping' process is quite simple.

--tim

Footnotes: 
[1]  prettily, even
From: Laotseu
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <4f49d232.0209302329.3384205d@posting.google.com>
Johan Kullstam <··········@attbi.com> wrote in message news:<··············@sysengr.res.ray.com>...
> ···@famine.OCF.Berkeley.EDU (Thomas F. Burdick) writes:
> 
> > Johan Kullstam <··········@attbi.com> writes:
> > 
> > > I think comments in lisp are Like comments in most languages.  This
> > > sums it up nicely,
> > >   "[T]he purpose of a comment is to help you or another person
> > >   understand the program at a later time."  -- octave info file
> > 
> > I agree, with the one caveat that most languages don't have
> > docstrings.  In Lisp, it's a bit of an art to decide what goes in a
> > docstring and what goes in a comment.  Not that it's hard, but most
> > languages don't give you the choice.
> 
> Yes.  Matlab (and hence octave) is the only other language I know
> which does have a docstring-like feature.
> 

Python does too !-)

Laotseu
From: Kaz Kylheku
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <cf333042.0209291158.57c877c3@posting.google.com>
·········@hotmail.com (gnuist006) wrote in message news:<····························@posting.google.com>...
> What is professional way of commenting in lisp, esp blocks of codes?

It's the same as the amateur way, except that you get paid. 
Formatting Lisp is painfully simple. Some variations are possible, but
not much.

Given a list like (a b c d e f), how do you break it over the line?
There are three alternatives, depending on the semantics. If the list
is semantically flat, meaning that it's just a collection of items,
and the first item is not important in any special way, then you can
break it like this:

 (a b c
  d e f)

Real example:

  (defconstant *suits* '(:spade :club
                         :heart :diamond))

If the first item is significant, because for instance it's the name
of a function, then you can break it like this:

  (a b c d
     e f)

Real example:

  (list 'apple 'banana
        'pear 'peach)

In other words, the first element is offset by itself, and the rest of
the list lines up with the second item.  Lastly, if the list
introduces a block in which some forms are evaluated in an implicit
progn, then those forms are indented by your usual indentation amount,
and not lined up with anything that precedes them in the list:

  (let (a b c)
    (foo)) ;; indentation size of 2 spaces

Rather than:

  (let (a b c)
       (foo)) ;; lined up with (a b c)

Or:

  (if (expr)          rather than  (if (expr)
    (consequent)                       (consequent)
    (alternative))                     (alternative))

This is a matter of style; you see the ``rather than'' versions in
Lisp code.

> Do we have #ifdef's?

Read some books. You can't effectively learn Lisp by means of a
progression of questions such as this. Yes the Lisp reader has a
mechanism by which objects read from the input source can be
selectively ignored, under the control of special expressions. In fact
Lisp also gives you access to the entire language at read time via
read-time evaluation. When you type #. followed by an expression, that
expression is evaluated at read time.
 
> And also on indenting style, especially the closing parens of the blocks?

Thou shalt close parentheses on the same line, lest thou be ostracized
as a nuisance by other Lisp programmers.
From: Vassil Nikolov
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <kzbsmzs32ai.fsf@panix3.panix.com>
···@ashi.footprints.net (Kaz Kylheku) writes:

> ·········@hotmail.com (gnuist006) wrote in message news:<····························@posting.google.com>...
[...]
> > And also on indenting style, especially the closing parens of the blocks?
> 
> Thou shalt close parentheses on the same line, lest thou be ostracized
> as a nuisance by other Lisp programmers.

May I suggest:

Thou shalt not follow a left parenthesis with white space,
not precede a right parenthesis with white space, lest
thou piss off good people who try to read thy code.

---Vassil.
From: Christopher Browne
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <an81rk$bjqt5$1@ID-125932.news.dfncis.de>
Quoth Vassil Nikolov <··········@poboxes.com>:
> ···@ashi.footprints.net (Kaz Kylheku) writes:
>
>> ·········@hotmail.com (gnuist006) wrote in message news:<····························@posting.google.com>...
> [...]
>> > And also on indenting style, especially the closing parens of the blocks?
>> 
>> Thou shalt close parentheses on the same line, lest thou be ostracized
>> as a nuisance by other Lisp programmers.
>
> May I suggest:
>
> Thou shalt not follow a left parenthesis with white space,
> not precede a right parenthesis with white space, lest
> thou piss off good people who try to read thy code.

That's not nearly close enough to the King James.

More like:

  Thou shalt not follow thine left parenthesis with white space, and
  thou shalt close thine parentheses on the very same line.  

  Behold, against those who are disobedient, rebelling against these
  parenthetic statutes, I shall bring evil upon his house, cutting off
  his posterity, and he shall perish utterly, even unto the seventh
  generation of him that pisseth against the wall, and there shall be
  much weeping and gnashing of teeth.
-- 
(reverse (concatenate 'string ··········@" "enworbbc"))
http://www.ntlug.org/~cbbrowne/multiplexor.html
"...while I know many people who emphatically believe in
reincarnation, I have never met or read one who could satisfactorily
explain population growth." -- Spider Robinson
From: Kaz Kylheku
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <cf333042.0209292225.50c7d037@posting.google.com>
Vassil Nikolov <··········@poboxes.com> wrote in message news:<···············@panix3.panix.com>...
> ···@ashi.footprints.net (Kaz Kylheku) writes:
> 
> > ·········@hotmail.com (gnuist006) wrote in message news:<····························@posting.google.com>...
>  [...]
> > > And also on indenting style, especially the closing parens of the blocks?
> > 
> > Thou shalt close parentheses on the same line, lest thou be ostracized
> > as a nuisance by other Lisp programmers.
> 
> May I suggest:
> 
> Thou shalt not follow a left parenthesis with white space,
> not precede a right parenthesis with white space, lest
> thou piss off good people who try to read thy code.

I can condense that to: thou shalt not make adjacent to the concave
side of a parenthesis any character from the whitespace family. ;)
From: Christopher Browne
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <an9hpp$c32qt$1@ID-125932.news.dfncis.de>
Quoth ···@ashi.footprints.net (Kaz Kylheku):
> Vassil Nikolov <··········@poboxes.com> wrote in message news:<···············@panix3.panix.com>...
>> ···@ashi.footprints.net (Kaz Kylheku) writes:
>> 
>> > ·········@hotmail.com (gnuist006) wrote in message news:<····························@posting.google.com>...
>>  [...]
>> > > And also on indenting style, especially the closing parens of the blocks?
>> > 
>> > Thou shalt close parentheses on the same line, lest thou be ostracized
>> > as a nuisance by other Lisp programmers.
>> 
>> May I suggest:

>> Thou shalt not follow a left parenthesis with white space, not
>> precede a right parenthesis with white space, lest thou piss off
>> good people who try to read thy code.

> I can condense that to: thou shalt not make adjacent to the concave
> side of a parenthesis any character from the whitespace family. ;)

.. That suggests nicely the wording similar to "thou shalt not
uncover the nakedness of the concave side of a parenthesis" ...
-- 
(concatenate 'string "aa454" ·@freenet.carleton.ca")
http://cbbrowne.com/info/languages.html
"The right honorable  gentleman is reminiscent of  a  poker.  The only
difference is that a poker gives  off the occasional signs of warmth."
-- Benjamin Disraeli on Robert Peel
From: Will Deakin
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <an7ni7$50m$1@venus.btinternet.com>
Kaz Kylheku wrote:
> Thou shalt close parentheses on the same line, lest thou be ostracized
> as a nuisance by other Lisp programmers.
Moreover, if any man shall would consider and in consideration speak 
that the parentheses shalt be replaced or let cry that lisp doth suffer 
too many of these parentheses or that these parentheses should be 
replaced by the curly bracket or the square bracket or the colon or the 
semi-colon or by indentation, then shall the nations of usenet hear of 
thy shame and a cry fill the land and call a day of vengeance: and the 
sword shall devour, and it shall be satiate and made drunk with their blood.

(Apologies to the King James translation of Jeramiah 46:10,12.)

;)w
From: Hannah Schroeter
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <ana67i$b1m$1@c3po.schlund.de>
Hello!

gnuist006 <·········@hotmail.com> wrote:
>What is professional way of commenting in lisp, esp blocks of codes?

; Comment to the end of line

#|
block comment
|#

>Do we have #ifdef's?

* #ifdef

debugger invoked on condition of type READER-ERROR:
  READER-ERROR at 1166 on #<TWO-WAY-STREAM
                            :INPUT-STREAM #<SYNONYM-STREAM
                                            :SYMBOL SB-SYS:*STDIN* {283428A9}>
                            :OUTPUT-STREAM #<SYNONYM-STREAM
                                             :SYMBOL SB-SYS:*STDOUT*
                                             {280C88A9}>>:
no dispatch function defined for #\I

-> no.

>And also on indenting style, especially the closing parens of the blocks?

(block foo)

>thanks

SCNR,

Hannah.
From: Fred Gilham
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <u7ptuvhy3i.fsf@snapdragon.csl.sri.com>
>And also on indenting style, especially the closing parens of the
>blocks?

Today I happened to see some code formatted as follows:

(defun foo ()
  (let ((bar 2))
    (dotimes (i bar)
      (print i)
  ) )
  (let ((baz 3))
    (dotimes (j baz)
      (print j)
) ) )

I didn't really like it (it has intrusive paren sickness).  At first I
thought it was just a matter of taste.  Then I suddenly realized how
I'd been tricked, and decided that while it was still a taste issue,
it had become a matter of good taste vs. bad.

-- 
Fred Gilham                                        ······@csl.sri.com
I can't escape the sensation that I have already been thinking in Lisp
all my programming career, but forcing the ideas into the constraints
of bad languages, which explode those ideas into a bewildering array
of details, most of which are workarounds for the language.
                                                       --Kaz Kylheku
From: Joe Marshall
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <znty9s9t.fsf@ccs.neu.edu>
Fred Gilham <······@snapdragon.csl.sri.com> writes:

> Today I happened to see some code formatted as follows:
> 
> (defun foo ()
>   (let ((bar 2))
>     (dotimes (i bar)
>       (print i)
>   ) )
>   (let ((baz 3))
>     (dotimes (j baz)
>       (print j)
> ) ) )

Huge bug in this style:

 (defun foo ()
   (let ((bar 2))

     V------------------------- this paren
     (dotimes (i bar)
       (print i)                visually matches
   ) )
     ^-------------------------- this paren
From: Fred Gilham
Subject: Re: What is professional way of commenting and indenting in lisp?
Date: 
Message-ID: <u7vg4mi348.fsf@snapdragon.csl.sri.com>
> Huge bug in this style:
> 
>  (defun foo ()
>    (let ((bar 2))
> 
>      V------------------------- this paren
>      (dotimes (i bar)
>        (print i)                visually matches
>    ) )
>      ^-------------------------- this paren

Exactly.  I'm not keen on using an indenting style that makes you feel
foolish when you finally realize what it's doing.  :-)

-- 
Fred Gilham                     ······@csl.sri.com
"I'm an expert at installing free software.  I've installed software
packages that had 412 steps, the first two of which were 'Remove small
children and animals from the premises' and 'Don protective gloves and
mask'.  If you made a mistake you had to go back to the very
beginning, including getting the kids and animals back in the house."