Re: [hackers-il] Evolution and Functional programming
- Chen Shapira <chen@...> writes:
> Usually it could take a while until evolution did its thing and we all haveHmm... We lost the tail, which would be useful for keeping balance
> bodies adapted to sitting and hitting keys,
while running in a savanna, but quite uncomfortable for sitting at
> And Functional Programming:Interesting question. I wonder if there is a pure-functuonal scheme
> How would you implement a hash table in a pure-functional language? (no side
implementation. I suppose it would be based on the concept of
"operational identity", i.e. objects are the same if they behave the
same. A hash table has to behave in a certain way w.r.t. insert,
delete, and search operations. I suppose that using chaining, i.e.
putting all the elements that hash to the same slot in a linked list,
we can do something. E.g. insertion will be consing, deletion can be
This is probably terribly inefficient, at least space-wise, but that's
the usual trade-off.
Disclaimer: I have no idea if what I wrote makes sense ;-)
Oleg Goldshmidt | Comgates Ltd. | ogoldshmidt@...
"... We work by wit, and not by witchcraft;
And wit depends on dilatory time." [Shakespeare]