Re: Keyword arguments in R7RS-large and SRFIs
Lassi Kortela 03 Nov 2019 15:53 UTC
Thanks for commenting :)
>> SRFI 167 (just being finalized) has good examples:
>>
>> (make-engine open close in-transaction ref set delete range-remove range
>> prefix-range hook-on-transaction-begin hook-on-transaction-commit pack
>> unpack)
>
> This is a write-once use-many expression, so it is not a good
> candidate for keywords.
>
>>
>> (engine-in-transaction engine okvs proc [failure [success [make-state
>> [config]]]])
>>
>> (engine-range engine okvs start-key start-include? end-key end-include?
>> [config])
>
> In those, only config is really a candidate to keyword arguments the
> others have well-known default values:
>
> failure -> raise
> success -> values
> make-state -> make-default-state
>
> That is it is easy to customize.
I would use keywords based solely on how many arguments the procedures
take, without regard to the purpose of those arguments. When one
procedure has 5 or more arguments, I start to lose track of which is which.
But I see your point, keywords aren't ready yet and it's your SRFI :)