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


> Mailing-List: contact guile-help@sourceware.cygnus.com; run by ezmlm
> Precedence: bulk
> Sender: guile-owner@sourceware.cygnus.com
> Cc: guile@cygnus.com
> From: Greg Badros <gjb@cs.washington.edu>
> Date: 30 Jun 1999 21:10:25 -0700
> 
> Michael Vanier <mvanier@bbb.caltech.edu> writes:
> 
> > I'm a bit puzzled as to how this works.  Are the []'s semantically
> > identical to ()'s?  In some old lisps the ] was used as a "super-paren"
> > that would close all open parens in the current form.  IIRC they faded from
> > popularity when paren-matching editors came around.  Can you give an
> > example where the [] syntax dramatically improves readability?
> 
> Yes, semantically identical to ();  a ] needs to close a [, etc., so
> some grouping errors are caught earlier as syntax errors.  The most
> profound benefit in my brief experience exploring this with cse341 is,
> e.g.,
> 
> (let ([a 1]
>       [b 2])
>    (list a b))
> 
> It seems a lot easier for students to grasp that there is a binding of
> values going on inside the first expression of the let special form.
> 
[snip]
> To me the more interesting issue is whether people benefit from being
> able to write code like this, or just for reading.  If it's just for
> reading, it'd be easy enough to just extend a pretty-printer or a style
> language (like a2ps's as I mentioned before) for nicer printing of
> Scheme code (and using other dimensions, e.g., color, seems promising
> too for helping matching in static code printouts). 
> 
> Greg
> 

I can easily see how this would help students.  People who are comfortable
with scheme would almost certainly find it more of a hindrance, because the
[]'s suggest that something special is going on (like a read-macro) when in
fact nothing is.  Hmm, wonder about

    let
	    a 1
	    b 2
	        list a b

? :-)

Mike


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