[plt-scheme] discrepancy in srfi-13
Dimitry Gashinsky wrote:
> I am using srfi-13 and noticed that there is a discrepancy between
> what the spec says and the implementation.
>
> plt implementation says:
> string-delete char/char-set/pred string [start end]
> string-filter char/char-set/pred string [start end]
>
> spec at srfi.schemers.org says:
> string-filter s char/char-set/pred [start end] -> string
> string-delete s char/char-set/pred [start end] -> string
>
> Which one is portable to other schemes?
The reason for this is probably:
<http://srfi.schemers.org/srfi-13/post-mail-archive/msg00002.html>
which reveals that the srfi-spec says one thing and the reference
implementation does another.
If we compare the order of arguments with
| string-for-each| proc s [start end] -> unspecified
we see that it is common to have s and [start end] close together.
/It seems to me that this simple a typing error in the srfi spec./
Something else is fishy though. The PLT implementation says
(define (string-filter criterion s . maybe-start+end)
(let-string-start+end (start end) 'string-filter s maybe-start+end
(if (procedure? criterion)
...
and the reference implementation says
(define (string-filter criterion s . maybe-start+end)
(let-string-start+end (start end) string-filter s maybe-start+end
(if (procedure? criterion)
...
Why is string-filter quoted in one and not the other?
I couldn't find any mentioning of this at the post discussion list.
<http://srfi.schemers.org/srfi-13/post-mail-archive/maillist.html>
--
Jens Axel Søgaard