4 ms·
Common Lisp has hash-tables, vectors, and sets .. had it, in an ANSI-specified document since 1984. The implementation details of these is, well, implementation
by mahmud 14y ago
Common Lisp has hash-tables, vectors, and sets .. had it, in an ANSI-specified document since 1984. The implementation details of these is, well, implementation dependent, be they HAMT or whatever.
The language provides a wealth of tools out of the box, but it's the job of the programmer to choose more appropriate tools for the problems at hand.
The following is the Common Lisp specification. 12+ implementations, half of them industrial strength, more than half commercial vendors, and everyone of them has to adhere to this spec:
http://www.franz.com/support/documentation/8.2/ansicl/ansicl.htm http://www.franz.com/support/documentation/8.2/ansicl/ansicl...
- jules 14y agoNote that CL's data structures are mutable, whereas Clojure's are persistent.
- swah 14y agoGoogle search saver: immutable = persistent
- swannodette 14y agoBut does Common Lisp allow multiple implementations of those data structures to exist in the same program actually allowing programmers to utilize the best tool for the job?
- mahmud 14y agoAre you seriously asking me if a programming language allows for the implementation of data-structures? If you mean can users extend the core CL data-types, no, but you have a wealth of tools to do that yourself; use generic functions to implement whatever interface you wish, then provide for specific implementations.
- swannodette 14y agobut you have a wealth of tools to do that yourself That's the problem. With Clojure you don't have to invent interfaces and then convince other libraries to use them. All the data structures are built upon well considered language level protocols that anyone can implement preventing pointless API proliferation.
- mahmud 14y agoClojure has the benefit of hindsight; it is one of the newest programming languages and it is not constrained by a published standard, nor does it need to cater to tens of vendors or any existant code-bases (Nearly every user of Clojure is on github ;-)
- honr 14y agoI think wise people prefer programming in good languages that enjoy the benefit of hindsight. Common Lisp does not have the luxury of hindsight, and can hardly change its specification to reflect modern theoretical and practical PL results. Personally, I slightly prefer Clojure over SBCL.