scheme/list requests [was: Re: [plt-dev] Re: more requests for typed-scheme]
On May 2, David Van Horn wrote:
> Matthias Felleisen wrote:
> > Everyone, please find things you find useful in srfi/1 :-)
>
> I'd like to see SRFI 1's make-list in scheme/list:
>
> (make-list n [fill]) -> list?
>
> I vote for it. Sam votes for everything. Matthias sent me code
> that uses it, so he probably votes for it. Is 2.5 votes enough?
I'm voting against it: unlike `make-vector' and `make-string', a
`make-list' would return an immutable value, so what would you use it
for? (My (unconfirmed) guess is that it wasn't included in r5rs for
this reason: mutation is allowed, so adding it would encourage
encourage bad code that uses that mutation where a vector is more
fitting.)
On May 2, Jens Axel Soegaard wrote:
> > Matthias Felleisen wrote:
> >> Everyone, please find things you find useful in srfi/1 :-)
>
> I used span the other day. I know some find the name unfortunate,
> but I wouldn't mind to write, say, list-span instead of span.
Last time I polled for this, I had zero replies. Here it is again:
I added `count', and made the `srfi/1' version reprovide it. [...]
It'll also be easy to add `take-while' and `drop-while' -- but the
others are more problematic, at least IMO:
* list-index: does it *have* to have this name? Perhaps we can use a
better name? (This already happened -- we have `append*' which Ryan
suggested, which is the same as `concatenate' in srfi/1 -- and I
think that `append*' makes much more sense).
* span, break: these are even worse -- not only are the names vague
enough to not tell me what they do, they're names that are very
popular in other contexts. It's even two very different contexts,
so the potential damage is doubled. (The damage being unexpected
names propagating through to packages that already have those
names.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!