This is the mail archive of the guile@sources.redhat.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: C-like identity?


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.

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