Re: Multimethod Reflection Question

2009-02-06 Thread David Nolen
Oops not paying attention you are right. Hash map comes first as the function. Works like a charm. 2009/2/6 Craig Andera > > > (methods multifn) > > > > Returns a hash-map where the keys are vectors if the dispatch values of > the > > multimethods were vectors, weird and cool :) > > How does on

Re: Multimethod Reflection Question

2009-02-06 Thread David Nolen
Hmm, for example, this does not work: ([:spinoza/object :spinoza-example-three/serializable] (methods archive)) I get the following exception: java.lang.IllegalArgumentException: Key must be integer even though: (= [:spinoza/object :spinoza-example-three/serializable] (ffirst (methods archive)

Re: Multimethod Reflection Question

2009-02-06 Thread Craig Andera
> (methods multifn) > > Returns a hash-map where the keys are vectors if the dispatch values of the > multimethods were vectors, weird and cool :) > How does one check for the existence of a key in a hash-map if the key is > vector? I tried several things and nothing obvious seemed to work. Vecto

Multimethod Reflection Question

2009-02-06 Thread David Nolen
(methods multifn) Returns a hash-map where the keys are vectors if the dispatch values of the multimethods were vectors, weird and cool :) How does one check for the existence of a key in a hash-map if the key is vector? I tried several things and nothing obvious seemed to work. Thanks, David -

Re: Multimethod Reflection?

2009-01-20 Thread David Nolen
d > > call methodTable. It seems to me it would pretty simple to expose this > > field (or a copy of it anyway) so that multimethod reflection can take > > place. > > (responds? astruct amultifn) > > > > It's seems to me to be a minor change that would add a co

Re: Multimethod Reflection?

2009-01-20 Thread Rich Hickey
a copy of it anyway) so that multimethod reflection can take > place. > (responds? astruct amultifn) > > It's seems to me to be a minor change that would add a considerable amount > of reflective power to multimethods, as well providing support for something > like who-sp

Multimethod Reflection?

2009-01-20 Thread David Nolen
Looking at the multimethod implementation (MultiFn.java) I noticed that multimethod keeps an internal persistent map of dispatch values in a field call methodTable. It seems to me it would pretty simple to expose this field (or a copy of it anyway) so that multimethod reflection can take place