Email list hosting service & mailing list manager

Quick vote about portable keyword argument syntax Lassi Kortela (01 Nov 2019 19:44 UTC)
Re: Quick vote about portable keyword argument syntax Marc Feeley (01 Nov 2019 20:12 UTC)
The name of "keyword-call" Lassi Kortela (01 Nov 2019 20:45 UTC)
Re: The name of "keyword-call" Lassi Kortela (01 Nov 2019 20:51 UTC)
Re: The name of "keyword-call" John Cowan (01 Nov 2019 20:54 UTC)
Re: The name of "keyword-call" Lassi Kortela (01 Nov 2019 20:59 UTC)
Re: The name of "keyword-call" John Cowan (01 Nov 2019 21:29 UTC)
lambda* Lassi Kortela (01 Nov 2019 21:47 UTC)
Re: lambda* John Cowan (01 Nov 2019 21:48 UTC)
Re: lambda* Lassi Kortela (01 Nov 2019 21:59 UTC)
curry/partial Lassi Kortela (01 Nov 2019 22:18 UTC)
Re: curry/partial John Cowan (01 Nov 2019 22:47 UTC)
Re: The name of "keyword-call" Marc Nieper-Wißkirchen (02 Nov 2019 16:22 UTC)
Re: The name of "keyword-call" Lassi Kortela (02 Nov 2019 23:16 UTC)
Re: The name of "keyword-call" hga@xxxxxx (01 Nov 2019 21:34 UTC)
Re: Quick vote about portable keyword argument syntax Per Bothner (01 Nov 2019 20:57 UTC)
Re: Quick vote about portable keyword argument syntax Lassi Kortela (01 Nov 2019 21:06 UTC)
Re: Quick vote about portable keyword argument syntax Marc Nieper-Wißkirchen (02 Nov 2019 16:21 UTC)
Re: Quick vote about portable keyword argument syntax Marc Nieper-Wißkirchen (02 Nov 2019 16:42 UTC)
Re: Quick vote about portable keyword argument syntax John Cowan (02 Nov 2019 16:48 UTC)
Re: Quick vote about portable keyword argument syntax Marc Nieper-Wißkirchen (02 Nov 2019 16:57 UTC)
Re: Quick vote about portable keyword argument syntax Lassi Kortela (02 Nov 2019 23:28 UTC)
Re: Quick vote about portable keyword argument syntax Lassi Kortela (02 Nov 2019 23:47 UTC)
Re: Quick vote about portable keyword argument syntax John Cowan (03 Nov 2019 02:36 UTC)
Re: Quick vote about portable keyword argument syntax Marc Nieper-Wißkirchen (03 Nov 2019 08:48 UTC)
Re: Quick vote about portable keyword argument syntax Lassi Kortela (03 Nov 2019 09:56 UTC)
Re: Quick vote about portable keyword argument syntax Marc Nieper-Wißkirchen (03 Nov 2019 10:27 UTC)
Re: Quick vote about portable keyword argument syntax Lassi Kortela (03 Nov 2019 11:17 UTC)
Re: Quick vote about portable keyword argument syntax Marc Nieper-Wißkirchen (03 Nov 2019 11:31 UTC)
Re: Quick vote about portable keyword argument syntax Lassi Kortela (03 Nov 2019 12:41 UTC)
Re: Quick vote about portable keyword argument syntax Marc Nieper-Wißkirchen (03 Nov 2019 15:20 UTC)
Re: Quick vote about portable keyword argument syntax Lassi Kortela (03 Nov 2019 15:40 UTC)
Re: Quick vote about portable keyword argument syntax Lassi Kortela (03 Nov 2019 15:50 UTC)
Re: Quick vote about portable keyword argument syntax John Cowan (03 Nov 2019 19:39 UTC)

Re: Quick vote about portable keyword argument syntax Lassi Kortela 01 Nov 2019 21:06 UTC

>> (keyword-call foo 1 2 (e 5 c 3 d 4))
>
> I don't like this syntax - it awkwardly separates the keyword
> arguments from positional arguments.  Better would be:
>
> (keyword-call foo 1 2 (e 5) (c 3) (d 4))
>
> I realize this may be more difficult, and might have some
> problems with ambiguity.

That's the reason it was done that way. The initial goal was to have a
portable fallback implementation using a syntax-rules macro. The popular
tail-patterns extension can match anything of the form:

(foo ... (an inner list as the last element of the outer list))

The syntax (keyword-call foo ... (keys ...)) takes advantage of that.

Using syntax-rules with tail-patterns would also support:

(keyword-call foo 1 2 ((e 5) (c 3) (d 4)))

But one could argue that's the worst of both worlds :p

>> And who would prefer option 2 where all of these are supported:
>>
>> (keyword-lambda (a b :key c d e) <lambda body ...>)
>>
>> (keyword-call foo 1 2 e: 5 c: 3 d: 4)     ; In all Schemes
>> (keyword-call foo 1 2 :e 5 :c 3 :d 4)     ; In all Schemes
>> (keyword-call foo 1 2 #:e 5 #:c 3 #:d 4)  ; In Schemes that have #:

> Partly because this is closer to Kawa, it would be my preference.

I'm also leaning toward option 2, and John already suggested in another
thread to drop the requirement to be implenentable using syntax-rules.
I'll be happy to submit a new draft of the SRFI using this syntax is
nobody is opposed to it.

It's extra-nice that this is the same syntax that several Schemes are
already using for keyword calls, only with keyword-call (or call/kw)
prepended to the front. So it's easy to convert code back and forth.