Re: SRFI 152 string-unfold contradictions Wolfgang Corcoran-Mathe 15 Oct 2026 20:09 UTC

John,

On 2026-10-15 14:59 -0400, John Cowan wrote:
> I have a dim memory that this came from foof and consequently may be
> provided by Chibi, or alternatively by Clinger and Larceny. There is no
> mention of it on the SRFI mailing list. In any case, correcting it would be
> a plausible PFI.

It must be from Larceny, then, because Chibi rejects all of the
following cases:

* ‘mapper’ returns a string,

* ‘base’ is a char,

* or ‘make-final’ returns a char.

In the abstract, I’m unsure about this polymorphism.  It breaks the
symmetry between the string unfolds and the SRFI 1 list unfolds.
Strings are not lists, however.  Returning strings from the mapper can
be useful in some cases, but I can’t see any reason for the
character-where-you’d-expect-a-string extensions.

I will try to check the other procedures of the SRFI against the sample
implementation.  There may be similar inconsistencies lurking.

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>