4 ms·
Yes, Clojure does have many purely functional data structures built in to its core. I don't know the precise implementations, or if they're written in Clojure o
by noelwelsh 13y ago
Yes, Clojure does have many purely functional data structures built in to its core. I don't know the precise implementations, or if they're written in Clojure or Java, but I believe they're based on the work of Phil Bagwell.
Every functional language implementation I know of has many of these data structures available as a library somewhere.
You certainly could implement these data structures in Ruby, though it's likely they wouldn't mesh as well as in a more functional language.
This Stackexchange answer has links to many papers if you're interested in more:
http://cstheory.stackexchange.com/questions/1539/whats-new-in-purely-functional-data-structures-since-okasaki http://cstheory.stackexchange.com/questions/1539/whats-new-i...
- mtrimpe 13y agoClojure was also the first mainstream (non-PF) language to implement Okasaki's as first class data structures. I know Scala quickly followed suit, since I remember Odersky bragging in a meetup that he went out of his way to find the scientists that improved on Okasaki's work and based Scala's data structures on their work instead.