On Nov 14, 3:42 pm, Chouser <[EMAIL PROTECTED]> wrote: > On Fri, Nov 14, 2008 at 2:11 PM, Jeff Rose <[EMAIL PROTECTED]> wrote: > > Does my dispatch function have to inspect the passed in values to > > figure out which type of struct they are, or can I query that > > somehow? > > My understanding is that StructMaps are just Maps with an > implementation that's optimized to reduce memory usage. The different > basis types don't really function as "classes" of StractMaps or > anything. You can still add new keys to StructMaps, for example, just > like any other Map. So if you want some kind of 'type' data do > dispatch off of, you'll have to attach that yourself, either as > another key that all your Maps share or asmetadata. > > --Chouser
I have the same use case as Jeff Rose -- I want some generic methods on algebraic data types. Do you know of a reason to favor a data field over a metadata field, or vice versa, for the type tag? Thanks, Steve Huwig --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---