Hi Steve,

Metadata is data that does not contribute to an equality relationship.  
In most  scenarios different types are considered not equal, and so  
should be modelled as data.

Stuart

>
> 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 whichtypeof 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'datado
>> dispatch off of, you'll have to attach that yourself, either as
>> another key that all your Maps share or as metadata.
>>
> I've actually got the same use case as Jeff Rose -- I want some
> generic methods on algebraic data types. Is there any reason to prefer
> a data field over a metadata field, or vice versa, for the type tag?
>
> -- Steve
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to