Loading ...
Sorry, an error occurred while loading the content.

Re: [hackers-il] Evolution and Functional programming

Expand Messages
  • Oleg Goldshmidt
    ... Hmm... We lost the tail, which would be useful for keeping balance while running in a savanna, but quite uncomfortable for sitting at a desk. ...
    Message 1 of 6 , Jan 14, 2001
    • 0 Attachment
      Chen Shapira <chen@...> writes:

      > Usually it could take a while until evolution did its thing and we all have
      > bodies adapted to sitting and hitting keys,

      Hmm... We lost the tail, which would be useful for keeping balance
      while running in a savanna, but quite uncomfortable for sitting at
      a desk.

      > And Functional Programming:
      > How would you implement a hash table in a pure-functional language? (no side
      > effects)

      Interesting question. I wonder if there is a pure-functuonal scheme
      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
      non-destructive, etc.

      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]
    Your message has been successfully submitted and would be delivered to recipients shortly.