Hi,<br><br>> ad hoc polymorphism, aka generics (the better word to avoid confusion):
if you want (length '(1 2 4)) == (length "123") == (length (vector 1 2
3)),<br>> then the historical response is that such functions violates the
carefully chosen middl ground of Scheme, which wants the readers (of
code) to <br>> understand from the function length, string-length,
vector-length that the program is currently dealing with lists, strings,
or vectors.<br><br>Thanks for the quick answer to Matthias. I read it shortly after it was sent, but I did not have the time to reply. What I mean by polymorphism is what Matthias described as generics. So I am speaking about length applied to anything that is a collection of things.<br>
<br>Somehow I fail to see the more pros than cons for this "middle ground choice", but I don't intend to criticize it. I want explore whether I can change the implementation of the core functions to make them generic. Say I want to create a new language "generic scheme". :)<br>
<br>@Greg, I know sequences and the functions around it, and they are indeed part of what I'm looking for. Essentially, I am speaking about replacing the core scheme functions, which work with lists, with generic versions that work with sequences. Before plunging into it, I would like to know other oppinions (whether it's possible and/or what are the implications, drawbacks).<br>
<br>Regarding the generic interfaces that are currently experimental, I can imagine this is a much awaited feature in racket. I wonder whether performance will be an aspect that will be considered or not. As far as I know this kind of functionality is usually implemented at a low level (in the VM). I will keep an eye on the progress. :)<br>
<br><br><br><br>