Fork me on GitHub

Relative beginner here, is there any way I can add metadata to a Java object? (a JRuby instance to be exact) I’d like to make sure that when I reuse the object (for parsing text in this case), I’m sure it has been loaded with the right properties and so is suitable for reuse. I tried using a ref to attach meta, but that doesn’t seem to work.


nicorikken: only if it implements the IMeta interface


refs do not implement IMeta, so they don't help there


oh weird - they claim to implement IMeta, but I can't seem to attach or retrieve metadata...


a bit strange how Clojure implements multiple dispatch, defmulti, is there an alternate syntax which does it in a single expression? like the let syntax?

Alex Miller (Clojure team)19:05:29

It's implemented that way to be open for later extension

Alex Miller (Clojure team)19:05:11

It's not too hard to get what you want in a macro though and I know I've seen impls in the past but can't remember where


ah ha, that makes sense


what doesn’t make sense it atom’s crazy automatic indentation when pasting Clojure code examples into the editor 😞


on a completely unrelated note