Advanced file port operations: please review. John Cowan (01 Nov 2019 23:01 UTC)
Re: Advanced file port operations: please review. hga@xxxxxx (02 Nov 2019 00:14 UTC)
Re: Advanced file port operations: please review. John Cowan (02 Nov 2019 02:19 UTC)
Re: Advanced file port operations: please review. Shiro Kawai (02 Nov 2019 10:15 UTC)
Re: Advanced file port operations: please review. John Cowan (02 Nov 2019 14:36 UTC)
Port settings Lassi Kortela (02 Nov 2019 10:28 UTC)
Re: Port settings John Cowan (02 Nov 2019 14:00 UTC)
Re: Port settings Lassi Kortela (02 Nov 2019 14:13 UTC)
Re: Advanced file port operations: please review. hga@xxxxxx (02 Nov 2019 15:43 UTC)
Re: Advanced file port operations: please review. John Cowan (02 Nov 2019 18:15 UTC)
SRFI 177 as a dependency for keywords in other places Lassi Kortela (02 Nov 2019 23:00 UTC)
Re: SRFI 177 as a dependency for keywords in other places Marc Nieper-Wißkirchen (03 Nov 2019 08:33 UTC)
Keyword arguments in R7RS-large and SRFIs Lassi Kortela (03 Nov 2019 09:16 UTC)
Re: Keyword arguments in R7RS-large and SRFIs Amirouche Boubekki (03 Nov 2019 14:28 UTC)
Re: Keyword arguments in R7RS-large and SRFIs Lassi Kortela (03 Nov 2019 15:53 UTC)
Re: Keyword arguments in R7RS-large and SRFIs John Cowan (03 Nov 2019 19:30 UTC)
How and Why keyword arguments are useful or harmful? Amirouche Boubekki (03 Nov 2019 20:11 UTC)
Re: How and Why keyword arguments are useful or harmful? Amirouche Boubekki (03 Nov 2019 20:14 UTC)
Re: How and Why keyword arguments are useful or harmful? Lassi Kortela (03 Nov 2019 20:26 UTC)
Re: How and Why keyword arguments are useful or harmful? Lassi Kortela (03 Nov 2019 20:30 UTC)
R7RS-large keyowrds Lassi Kortela (03 Nov 2019 22:18 UTC)
Re: R7RS-large keyowrds John Cowan (03 Nov 2019 22:29 UTC)
Re: R7RS-large keyowrds Lassi Kortela (03 Nov 2019 22:34 UTC)
Re: R7RS-large keyowrds Marc Nieper-Wißkirchen (06 Nov 2019 10:49 UTC)
Re: R7RS-large keyowrds John Cowan (06 Nov 2019 17:49 UTC)
Re: R7RS-large keyowrds Marc Nieper-Wißkirchen (06 Nov 2019 18:08 UTC)
Re: R7RS-large keyowrds John Cowan (06 Nov 2019 18:10 UTC)
Re: R7RS-large keyowrds Marc Feeley (06 Nov 2019 18:16 UTC)
Re: R7RS-large keyowrds Marc Nieper-Wißkirchen (06 Nov 2019 18:17 UTC)
Re: R7RS-large keyowrds John Cowan (06 Nov 2019 20:23 UTC)
Re: R7RS-large keyowrds Marc Nieper-Wißkirchen (06 Nov 2019 18:16 UTC)
Re: R7RS-large keyowrds Marc Feeley (06 Nov 2019 17:59 UTC)
Re: R7RS-large keyowrds Lassi Kortela (09 Nov 2019 12:29 UTC)
Re: R7RS-large keyowrds Marc Nieper-Wißkirchen (09 Nov 2019 12:53 UTC)
Re: How and Why keyword arguments are useful or harmful? Amirouche Boubekki (04 Nov 2019 03:31 UTC)
Re: How and Why keyword arguments are useful or harmful? Amirouche Boubekki (04 Nov 2019 04:10 UTC)
Re: How and Why keyword arguments are useful or harmful? Amirouche Boubekki (04 Nov 2019 03:43 UTC)
Re: How and Why keyword arguments are useful or harmful? Marc Nieper-Wißkirchen (06 Nov 2019 13:25 UTC)
When is a feature necessary Lassi Kortela (03 Nov 2019 22:06 UTC)
Re: When is a feature necessary Lassi Kortela (03 Nov 2019 22:13 UTC)
Re: SRFI 177 as a dependency for keywords in other places Marc Nieper-Wißkirchen (06 Nov 2019 10:21 UTC)
Re: SRFI 177 as a dependency for keywords in other places Lassi Kortela (09 Nov 2019 11:55 UTC)
Re: SRFI 177 as a dependency for keywords in other places Marc Nieper-Wißkirchen (09 Nov 2019 13:40 UTC)
Re: SRFI 177 as a dependency for keywords in other places Marc Nieper-Wißkirchen (09 Nov 2019 13:13 UTC)

Re: SRFI 177 as a dependency for keywords in other places Marc Nieper-Wißkirchen 06 Nov 2019 10:21 UTC

Am So., 3. Nov. 2019 um 22:32 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
>
>
>
> On Sun, Nov 3, 2019 at 3:33 AM Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:
>
>>
>> I strongly suggest not to do this for any API that is for inclusion
>> into R7RS-large.
>
>
> What do you suggest for the proposed file-open for SRFI 170, with its required argument "pathname" and its six other arguments?  My original design used a p-list, but that loses performance on Schemes with native keywords already.  Other examples are arising soon.

I have taken a look at your
https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/FilesAdvancedCowan.md.
I hope this is what you have had in mind.

The "settings" argument is used for procedures opening files, which
are non-trivial themselves. Thus, I don't think the loss of
performance when plists are used will be noticeable in any way;
furthermore, an optimizing compiler should be able to compile it
efficiently when the called procedure is known at the call site.

As many procedures share the same settings argument, a better
solution, though, seems to be to define an opaque "settings" type.
Values of the settings type are created by a special form provided by
the advanced files API. An example:

(call-with-input-file pathname (file-settings exclusive (encoding 'utf-8)) proc)

The "file-settings" keyword can be implemented as a syntax-rules or as
an er-macro-transformer/syntax-case macro.

Under the hood, the implementation can use plists or record types or
some other fast native device to implement the opaque "settings" type.
The implementation in schemes with native keyword arguments can even
macro-overload "call-with-input-file" so that the above is expanded
into "(call-with-input-file pathname proc exclusive: #t encoding:
'utf-8)".

This approach has two advantages: It can be made type-safe (the
implementation can complain at compile-time when an unknown or
misspelled setting is used), and port settings can be forwarded
because they are general Scheme types.

Besides, the call above looks much nicer than "(call/kw
call-with-input-file pathname proc exclusive: #t encoding: 'utf8))"
(or any other of the discussed alternative syntaxes for SRFI 177)
because of the necessity of "call/kw".

>
>>
>> (I'm not arguing against using SRFI 177 to implement an API. But new
>> APIs definitely do not need keywords, even not to be pretty.)
>
>
> R7RS-large is not about what is *needed*, nor is R7RS-small.  All we *need* are lambdas, or if we must have lists, all we *need* for them is pair?, cons, car, cdr, set-car!, and set-cdr!.  Remember the goals of R7RS-large from our charter: "a language that embodies the essential character of Scheme, that is large enough to address the practical needs of mainstream software development, and that can be extended and integrated with other systems."

I was referring to the idea that the main advantage of keyword
arguments is that parameters can be added to API calls in a
backward-compatible way. Under this assumption, one should think twice
whether newly designed APIs shall make use of keyword arguments.

So far, R7RS-large already includes a huge number of procedures. None
of these make use of keyword arguments but the solve the perceived
problem in other, not less elegant, ways. Confer my example of
"set-copy" and "set-filter" in SRFI 113, for example. If R7RS-large
had had keyword arguments from the start, only "set-copy" would have
been needed.

If keyword arguments suddenly go into widespread use in the middle of
the standardization process of R7RS-large, we end up with a not very
uniform overall API of R7RS-large.

Scheme is not Python (where keyword arguments have been baked in from
the start) and has nevertheless been an elegant language and has been
able to support elegant APIs without any keyword arguments. It is not
so clear to me why this isn't true anymore.

Marc