In Clojure one can write
(:foo {:foo 3 :bar 5})
which evaluates to 3. Is there any way to extend Common Lisp so that a ke开发者_开发知识库yword will act as a function that looks itself up?
There are no easy, obvious or trivial ways to do that in a general way in portable Common Lisp, AFAIK.
Related functionality (for arrays) was provided in some earlier Lisp dialects, but it was not included in Common Lisp.
精彩评论