Re: SRFI 284: define-typed
Dr. Arne Babenhauserheide 27 Sep 2026 11:04 UTC
Artyom Bologov <xxxxxx@aartaka.me> writes:
>> sph-sc style is supported by the implementation, but not part of the
>> SRFI. While I like it, and while it might enable rest arguments (though
>> my experiment with implementing them failed today), it is also more
>> error-prone.
>
> I see. Is there an extension space in the SRFI that’d accommodate that
> syntax?
>> 1. <argtypes> -> <form>: a single return type, checked by whatever the form evaluates to.
>> 2. <argtypes> (-> <form>): a list of return types, checked by whatever the form evaluates to.
>> 3. <argtypes> (-> <form> <form> <form> ...): multiple return types, checked by whatever the forms evaluate to.
>
> That sounds perfect! I like how -> becomes a reliable anchor for things,
> it’s quite elegant!
Thank you :-)
It’s the result of discussing in IRC – and then discussing with you here.
> <predicate-form> might be better explained as “_a form returning_ a
> procedure with one argument that…” but that’s really minor. Also, I
> think that “predicate” is clear enough to not really need an explanation
> about return values and number of args.
Fixed, thank you!
>> <formals> = as per R7RS section 4.1.4 https://standards.scheme.org/r7rs-html5/index.html#4.1.4
>
> These are unused now, I believe.
yepp, removed :-)
>> <body> = as per R7RS section 4.1.4
>>
>> Is it clear this way?
>
> It is!
>
> This would make a nice addition to the document, thank you!
I added it and created a PR.
https://github.com/scheme-requests-for-implementation/srfi-284/pull/2
Thank you!
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
https://www.draketo.de