This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: C-like identity?
- To: Ian Bicking <ianb at colorstudy dot com>
- Subject: Re: C-like identity?
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 31 Jul 2000 04:55:26 +0200
- Cc: Marius Vollmer <mvo at zagadka dot ping dot de>, guile at sourceware dot cygnus dot com
- Cc: djurfeldt at nada dot kth dot se
- References: <20000730123732.C401@lothlorien> <871z0b8fkv.fsf@zagadka.ping.de><20000730211343.A425@localhost>
- Reply-To: djurfeldt at nada dot kth dot se
Ian Bicking <ianb@colorstudy.com> writes:
> > But it's very widely recognized already. You could use a different
> > keyword, of course, like "function".
>
> Well, that's kind of already taken. I suppose `lambda' is better than
> making something up, but this is the one place where I'd rather not
> have a keyword.
But what a minute,
A named function has syntax
function NAME ARGLIST BODY
ARGLIST :== `(' [ ARG1 {, ARGn} ] `)'
BODY :== `{' { STATEMENT1 } `}'
You don't want a keyword for creating anonymous functions, and you
want `function' to keep its role. Maybe we can simply remove the NAME
for anonymous functions:
function ARGLIST BODY
Although this means extending the `function' syntax to work also
non-top-level, such syntax shouldn't be ambiguous, or?
The fact that it isn't context-free can be fixed by reserving
`function' as a keyword, which probably is a good idea anyway.