Re:Common Lisp in the 21st Century
by ruricolist on Monday February 10, 2014 @04:46PM
(#7214105)
One could make the argument (I think so, at least) that if the number of associations you are dealing with is small enough to write out literally, then using a hash table is a mistake. It might be one of Common Lisp's strengths that is has ways to represent small tables efficiently and thus avoids the "hash addiction" that haunts languages where hash tables are used for everything.
But even if a more compact way of constructing hash tables is called for, why a literal syntax instead of a more compact constructor? E.g. you could write
(dict "name" "andrew" "location" "sf")
with a compiler macro that produces exactly the above code.
But even if a more compact way of constructing hash tables is called for, why a literal syntax instead of a more compact constructor? E.g. you could write
with a compiler macro that produces exactly the above code.