Re: Document and implementation disagree on argument order for char-set-unfold[!] Marc Nieper-Wißkirchen (09 Jul 2023 12:08 UTC)
(missing)

Re: Document and implementation disagree on argument order for char-set-unfold[!] Marc Nieper-Wißkirchen 09 Jul 2023 12:08 UTC

Am So., 9. Juli 2023 um 05:22 Uhr schrieb Arthur A. Gleckler
<xxxxxx@speechcode.com>:
>
> Thanks.
>
> Redirecting to the correct mailing list.  Also, adding Olin, the author, who isn't subscribed.
>
> I've fixed "complimented."  (See below.)
>
> The document is normative, so the implementation and tests should be updated to match.  I'd be grateful for a patch.

SRFI 1's "unfold", somehow the prototype, has the signature

unfold p f g seed [tail-gen]

so SRFI 14's sample implementation is "right", not the formal
specification. That it is a typo in the formal specification can be
seen from the examples following the description of
char-set-unfold(!). They also use the "right" order.

>
> On Sat, Jul 8, 2023 at 7:06 PM Bradley Lucier <xxxxxx@purdue.edu> wrote:
>>
>> The document says:
>>
>> char-set-unfold  f p g seed [base-cs] -> char-set
>> char-set-unfold! f p g seed base-cs -> char-set
>>
>> The sample implementation has
>>
>> (define (char-set-unfold p f g seed . maybe-base)
>> (define (char-set-unfold! p f g seed base-cset)
>>
>> The file srfi-14-tests.scm has
>>
>>             (char-set-unfold null? car cdr '(#\a #\e #\i #\o #\u #\u #\u)
>>             (char-set-unfold! null? car cdr '(#\a #\e #\i #\o #\u)
>>                  (char-set-unfold! null? car cdr '(#\a #\e #\i #\o #\u)
>>
>> which matches the implementation but not the document.
>>
>> What to do?
>>
>> Brad
>>
>> PS:  Also, change "complimented" to "complemented" in the document.