I am currently giving some lectures about Clojure to a group of
students. One of the Lisp features I promote to them is the ability to
write language in the language itself. So during the lecture when I
talked about multimethods one student asked if one could write own
multimethods implementation if Clojure didn't have them. I went all
like "Sure, you just..." and stuck. My first thought was to save
multimethod into an atom and the list of methods into metadata of that
atom, but as I found out atoms cannot hold metadata.
Desperately I looked into Clojure sources for implementation of
multimethods and saw that it is done using the MultiFn Java object. I
guess this is done for performance and there is still a way do this in
pure Clojure (I mean, in pure Lisp).
Thanks in advance for helping!

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to