Alternative formulations of keywords John Cowan (11 Apr 2006 22:35 UTC)
Re: Alternative formulations of keywords Marc Feeley (12 Apr 2006 01:58 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 02:54 UTC)
Re: Alternative formulations of keywords Per Bothner (12 Apr 2006 03:05 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 03:12 UTC)
Re: Alternative formulations of keywords Eli Barzilay (12 Apr 2006 03:17 UTC)
Re: Alternative formulations of keywords Eli Barzilay (12 Apr 2006 03:20 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 03:27 UTC)
Re: Alternative formulations of keywords Per Bothner (12 Apr 2006 03:20 UTC)
Re: Alternative formulations of keywords Marc Feeley (12 Apr 2006 04:20 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 04:32 UTC)
Re: Alternative formulations of keywords Marc Feeley (12 Apr 2006 05:11 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 12:16 UTC)
Re: Alternative formulations of keywords Eli Barzilay (12 Apr 2006 12:29 UTC)
Re: Alternative formulations of keywords Marc Feeley (12 Apr 2006 13:07 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 13:36 UTC)
Re: Alternative formulations of keywords Marc Feeley (12 Apr 2006 14:25 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 14:28 UTC)
Re: Alternative formulations of keywords Marc Feeley (12 Apr 2006 14:57 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 16:26 UTC)
Re: Alternative formulations of keywords Per Bothner (12 Apr 2006 16:49 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 16:56 UTC)
Re: Alternative formulations of keywords Eli Barzilay (12 Apr 2006 13:37 UTC)
Re: Alternative formulations of keywords Marc Feeley (12 Apr 2006 04:54 UTC)
Re: Alternative formulations of keywords John Cowan (12 Apr 2006 16:07 UTC)

Re: Alternative formulations of keywords Eli Barzilay 12 Apr 2006 13:36 UTC

On Apr 12, Marc Feeley wrote:
>
> Most Scheme systems allow separate compilation (think of "load").
> If one file contains:
>
> (define (f #!key (x 11) (y 22)) (+ x y))
> (define (g z) (f y: z))
>
> and the other contains:
>
> (set! f (lambda (#!key (y 33) (z 44)) (* y z)))
>
> You have the same problem.  So it doesn't suffice for the function
> definition to be global.

IIUC, John's proposal can be implemented using modules in PLT as
follows:

  (define (foo x #!key y z)
    ...)

is translated to

  (define (hidden-foo x y z)
    ...)
  (define-syntax (foo stx)
    ... analyze stx for keyword syntaxes, and construct a call for
    ... hidden-foo with plain arguments)

where hidden-foo is an identifier that is not accessible outside the
macro.  When I wrote our library, I considered this approach, but it
seems like it's much less useful, basically a completely different
mechanism for only named arguments.  It didn't take us long to reach
exactly this conclusion:

> The way I see it you are forbidding the use of higher-order functions
> in combination with named optional parameters.  That would be a
> serious limitation for a functional language like Scheme.

--
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!