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


Chris Bitmead <cbitmead@ozemail.com.au> writes:

> Greg Badros wrote:
> 
> > You're looking at it in the wrong way-- other 
> > implementations permit square brackets, so allowing Guile 
> > to read that code natively increases the portability of 
> > the code.  
> 
> Allowing Guile to process C++ code would make it more portable too, but
> it does'nt mean that it's desirable. Anyway, if I remember right [] are
> reserved tokens for possible future use in the standard. If you use them
> like you would use () you are potentially digging yourself into a hole.
> And if they're not reserved tokens, they should be allowed as
> identifiers. I should be able to make a variable called [foo]][ if I
> want.

Actually no, although Guile will allow it. The standard enumerates
what characters are permitted in identifiers and [ and ] are not among
them. [] are reserved for future extension but I doubt they will ever
be given a specific meaning given how many implementations allow them
to be interchangable with () and the fact that RnRS standardization
requires consensus.

> Either way, making [] and () interchangable is a waste of the
> character namespace.
> 
> >Besides, several implementations let you
> > use [], and as you pointed out, it's easy enough to add to 
> > any other
> > system that doesn't support [], why not make it easy for 
> > Guile programmers to write more readable code?
> 
> 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
> 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.

For what it's worth, I have seen academic papers by RnRS authors use
[] interchangably with (). That's a fairly strong endorsement.

I hate to admit it but I actually found it somewhat more readable (the
usual convention is to use square brackets consisently with certain
special forms, e.g. cond and the let family).

 - Maciej


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