3 ms·
By "lists", you mean "linked lists as implemented with pairs"? What's the practical difference between lists and the seq abstraction (immutability aside)? It's
by rsanders 13y ago
By "lists", you mean "linked lists as implemented with pairs"? What's the practical difference between lists and the seq abstraction (immutability aside)? It's true that Clojure provides a lot of data types, but none that would be unfamiliar to a CL programmer. And you can handle all of them more or less like lists, and as a bonus you can use the same set of functions to do so.
I would think that the immutability of these data structures would be a bigger difference, both conceptually and in the difficulty of porting CL code into Clojure.
- hga 13y agoYes, as implemented with pairs, syntactically with parens. None, except vectors and maps (and sets and regexs and ...) being syntactically first class, and being used heavily, not just in special form syntax but in real use. For a whole lot of programming, maps are where it's at for your data structures. True, these shouldn't be unfamiliar to a CL programmer (although the pervasive use of maps might well be, don't remember how much association lists and properly lists were used). As someone who adopted the mostly functional Scheme style I don't find the enforced immutability a bigger difference, but I could well see that being true for CL programmers. And for many/some? the bias against OO vs. CL's CLOS, which many claim is the very best OO system ever (as far as I know the only popular one with a MOP).
- gtrak 13y agothe practical difference between lists and seqs is laziness (details like chunking, too).