Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> among the Lisps, though tellingly not the case with Scheme, the association list was already in place

An association list is just a list which elements are conses. I'm fairly certain that cons, car and cdr were part of Scheme since the beginning and they are all you need to build assoc and friends. Scheme lacked a proper hashtable datatype though, which was present in some other Lisps.



Agreed. I was thinking of property lists which are not part of Scheme symbols. Would that I had been clearer.


he was talking about scope here. hashes do not help much.

assoc lists were important to implement dynamic environments simple and fast, which is not so easy with hash tables. In assoc lists you tolerate duplicates, but by putting new at the beginning you override/"shadow" the old ones, until you leave scope and use the old assoc list. and share the data! with hashes you have to actively delete or copy the tables. non-efficient and very complicated.


They're really neat. When I learned about them it emphasised that it's amazing what a handful of cons cells and some thin air can do.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: