Taylan Ulrich Bayırlı/Kammer scripsit:
> RnRS/SRFIs should specify what cannot be simply implemented as a
> portable library.
I profoundly disagree, and I think almost the whole history of Scheme
is on my side.
If that rule had applied to the R5RS pair API, it would consist of:
pair?, cons, car, cdr, set-car!, set-cdr!, null?. It would exclude:
cxr procedures, list?, list, length, append, reverse, list-tail, list-ref,
memq, memv, member, assq, assv, assoc. In short, some 85% of the R5RS
API. And of course 100% of SRFI 1.
So why do we include procedures like `length`? For programmers, it's
so it'll just Be There. It's ready for instant use on any conforming
platform. You don't have to decide what to call it.
By the same token, anyone reading your code sees `length` and (modulo a
redefinition) already knows what it does. The same applies to `fold`,
once you learn it.
That's why the work of defining SRFIs, even when completely portable, is
valuable. Any system that implements the SRFI (and if it *is* completely
portable, that's any system) provides predefined functionality using
predefined names. If you want sets (and programmers often do want sets), and you have SRFI 113 available,
you *have* sets. And the names were chosen (to the best of my ability)
so that you pretty much know how to use them if you know R7RS-small and
SRFI 1.
It is a comprehensive package in order to avoid the Curse of Lisp
<http://www.winestockwebdesign.com/Essays/Lisp_Curse.html>; see also
the rationale of SRFI 1.
> OTOH a hash table API is important because you can't implement it in
> portable Scheme in terms of a more fundamental feature.
And yet there *are* portable implementations of hash tables that provide
exactly that.
--
John Cowan http://www.ccil.org/~cowan xxxxxx@ccil.org
A witness cannot give evidence of his age unless he can remember being born.
--Judge Blagden