[r6rs-discuss] Proposed features for small Scheme, part 4F: more symmetry
cowan at ccil.org
Wed Nov 4 14:35:21 EST 2009
This is a proposal for a few new sequence procedures in R7RS small Scheme.
I am publishing this document to invite wide comment. There is nothing
official about it. I retain sole responsibility for it, including
I've published a little table at
http://docs.google.com/View?id=dc46qrdf_25hkqq95dd ; you can
always reach it from the "sequence procedures" link at the bottom
of http://tinyurl.com/thing-one . It shows the basic constructors,
predicates, length procedures, element accessors and mutators, and
converters for Scheme's three sequence data types: lists, strings,
and vectors. R5RS and even R6RS are pretty spotty about uniform support
for these fundamental datatypes, and I'm now adding a few proposals to
fill out the table so that all sequence types are equally provided for.
I had earlier proposed importing make-list from SRFI 1 as the basic
constructor for lists, and copy-vector from SRFI 43 as the copy
constructor for vectors. In addition, although string->vector and
vector->string are not part of any SRFI, they will be very useful if
strings become immutable.
I am now completing the table by proposing to add list-copy from SRFI 1.
In addition, empty-string? and empty-vector? provide the analogues of
null?, and list-set! provides the analogue of string-set! and vector-set!.
These last three are also not in any SRFI, but are likewise obvious.
(There is an analogue of list-set! in CL.)
These are all conservative extensions, and will make the procedure set
more symmetrical and thus easier for novices to learn.
John Cowan cowan at ccil.org http://ccil.org/~cowan
[R]eversing the apostolic precept to be all things to all men, I usually [before
Darwin] defended the tenability of the received doctrines, when I had to do
with the [evolution]ists; and stood up for the possibility of [evolution] among
the orthodox --thereby, no doubt, increasing an already current, but quite
undeserved, reputation for needless combativeness. --T. H. Huxley
More information about the r6rs-discuss