On Feb 26, 4:00 am, Konrad Hinsen <konrad.hin...@laposte.net> wrote:
> On 26.02.2009, at 01:51, Rich Hickey wrote:
>
> > You raise interesting issues and I'd like to explore them further. I'm
> > not sure the issues you have with type-tag-or-class dispatch are all
> > that prohibitive. In any case, I've added a type function that returns
> > the :type metadata or the class if none:
>
> Thanks, that helps a lot! With a built-in universal dispatching
> function, most of my problems should be solved. Another useful
> function to have would be
>
> (defn type-instance?
> "Evaluates x and tests if it is an instance of the type or class t.
> Returns true or false"
> [t x]
> (identical? t (type x)))
>
> for type-based dispatching inside a function.
>
I'm pretty sure you'd want that to use isa?
Rich
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---