I agree, if one hasn’t taken steps preventing keys from being numericnote, use of assoc
is to be preferred. The latter is much slower at runtime than (the “dictionary” application of) item of
though, which may become an issue when a larger database is involved. Besides, using assoc
is slightly less convenient. I recently wrote a simple block (lookup
) implementing item of
for dictionary applications and supporting numeric keys.
Note: a simple measure is adding a non-numeric prefix (such as: “$”) to each and every key.