On Dec 16, 2008, at 6:29 PM, Mark Volkmann wrote:
If I create a new sequence by adding data to an existing one, does Clojure allow the two sequences to share data as opposed to copying the original sequence? For example, (def coll1 [1 2]) (def coll2 (cons 3 coll1)) Does coll2 share the data in coll1 or have a copy of it?
It shares the data--which is safe because of immutability and efficient because Rich designed and implemented Clojure's persistent data structures carefully and well.
I recommend Rich's presentations on blip tv or iTunes to everyone who's interested in Clojure. They give good overviews and discuss a lot about why things are the way they are in Clojure.
--Steve
smime.p7s
Description: S/MIME cryptographic signature