This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: Reader option to permit brackets as parentheses
- To: Craig Brozefsky <craig@red-bean.com>
- Subject: Re: Reader option to permit brackets as parentheses
- From: cwitty@newtonlabs.com (Carl R. Witty)
- Date: 02 Jul 1999 11:14:48 -0700
- Cc: Ingo Hohmann <ingo@2b1.de>, guile@sourceware.cygnus.com
- References: <qrrr9mu4tw7.fsf@elwha.cs.washington.edu> <3779AC8E.A5A1BA79@ozemail.com.au> <qrraeth3c92.fsf@elwha.cs.washington.edu> <377AC053.F3E9A1BB@ozemail.com.au> <qrrzp1h2fvx.fsf@elwha.cs.washington.edu> <199907010401.VAA21885@arathorn> <377B0CB8.A473C0D1@ozemail.com.au> <19990701203352.A1681@fuchur.2b1.de> <87r9mrsg6t.fsf@duomo.pukka.org>
Craig Brozefsky <craig@red-bean.com> writes:
> If you were to move to a whitespace structured language, imagine the
> difficulties of writing real macros! With the parenthesis based
> s-expression, where a program/function is a list, you can write macros
> programmatically, by creating lists.
>
> If you have to create something like whitespace delimited blocks, then
> your program for creating new forms will have to be much more complex,
> and are not as easy to produce. Even if you just mapped tabs onto
> parens, you would have to always be aware of your depth.
In Haskell (another language where whitespace is lexically
significant), any expression can also be written in a form where
whitespace is not lexically significant. There is a simple lexical
preprocessing phase that looks at the indentation of successive lines
and adds open and close braces and semicolons; if you use explicit
open and close braces, then the "layout rule" is not active.
I would strongly suggest that any whitespace structured Scheme follow
the same path: there should be a simple lexical preprocessor that adds
open and close parens, and you can always use the open and close
parens yourself. As in current Lisp-family languages, macros would
act on and return s-expressions, not ASCII strings; so I don't see why
they would be any more difficult to write than in current Scheme.
I must admit that I'm having a hard time imagining what a whitespace
structured Scheme would look like; I doubt if I'd use it (even though
I really like the Haskell layout rule).
Carl Witty
cwitty@newtonlabs.com