This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Reader option to permit brackets as parentheses


Michael Vanier wrote:

> For that matter, it would be interesting to have a dialect 
> that used indentation as an alternative for parens like 
> python does.

Is that what python is? Sounds like a _very_ bad idea to have code
meaning depending on whitespace.

Mike.. Take what I say with a grain of salt. I'm just one voice and one
opinion. However, in R5RS...

"The following five characters are reserved for future extensions to the
language: [ ] { } | "

I'd love to know what extensions they have in mind.

IMHO the correct way to read lisp is by looking at the indentation. You
therefore need to write it with a lisp-aware editor which can do this
for you. The reason people find lisp hard to read is that they havn't
comprehended this fact. In fact all languages are hard to read without
correct indentation, but in the case of lisp it is impossible. I can see
how students may find [] as a method to better help match up parens, but
maybe that is because they don't understand how to look at the
indentation? With lisp there is more information in the indentation than
in the code :-)


> 
> Mike
> 
> > Chris Bitmead <cbitmead@ozemail.com.au> writes:
> >
> > <snip>
> >
> > > I fail to see how it makes more readable code. Apart from anything else
> > > your code will look alien to every other scheme programmer on the
> > > planet. Can that be more readable? It would also make writing the code
> >
> > This isn't at *all* true.  LOTS of scheme programmers are brought up
> > using instructional Scheme environments that permit [] as parentheses,
> > and are accustomed to having certain constructs in [] instead of ().
> >
> > > more difficult. When to use a [] and when to use () ? You'll spend half
> > > your day exchanging bracket types trying to make it more asthetically
> > > pleasing. Write a text editor that does colour matching on parenthesis
> > > or something.
> >
> > Clearly you aren't convinced, and I believe you're probably in the
> > majority among this list's readers, but I've lately been teaching scheme
> > in an undergraduate programming languages course here at the UW and the
> > students definitely seem to like the ability to use [], and find my
> > examples more clear when I reliably and consistently use [] in certain
> > special forms (e.g., let bindings).
> >
> > Bottom line is I thought the option would be nice.  I'd expect it to be
> > pretty easy to verify empirically that programmers (especially novice
> > ones) can better understand Scheme programs that use [] reliably and
> > consistently.  (And I hypothesize little harm by random use of paird []
> > instead of () ).
> >
> > So... my lips are sealed until I either have time to run the experiment
> > or can reference someone who has studied the issue empirically. :-)
> >
> > Greg
> >

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]