2014-08-14 11:53 GMT+02:00 Marko Rauhamaa <ma...@pacujo.net>: >> Scheme already has a nice representation for associactions, namely the >> assoc lists. However, they are a bit problematic, because they are >> ordered by nature and hence there's not much one can do with their >> linear access time. > > When we are talking about the representation of a mapping, it will be a > full content dump, thus O(n) regardless. You don't gain anything by > adding substructure to the assoc list.
We're talking about access time, so in this particular case -- about assoc-ref and the like; not about printing. And about having an efficient representation for sets, because obviously sets can be represented using lists as well, although inefficiently. > When you read in the collection, you can put it in the data structure of > your choice (with alist->hash-table, for example). Of course I can. But that isn't something that I wish to do. It simply adds another layer of indirection, which is irrelevant to programmer's intention. Using dictionaries is programmers' daily bread, yet Scheme has no common way for doing that (unlike Perl, PHP, Python, JavaScript, Clojure and other popular languages).