On Nov 17, 2011, at 1:01 AM, Ben Smith-Mannschott wrote:

>> (def o (Object.))
>> 
>> (def om (with-meta* o {:foo true}))
>> 
>> (def whatever (with-meta* o {:foo false}))
>> 
>> (meta* om) ;=> {:foo false}
>> 
>> Doesn't really support Clojure's concept of metadata if it's shared
>> global mutable state.
> 
> Yes, that's true. Though it wouldn't occur to me to expect some random
> POJO to behave as if it were persistent WRT metadata. POJOs generally
> conflate state and identity and are mutable. That's life. If that's a
> problem, then you'll need to wrap it in something that supports
> metadata.

Mechanisms like what Ben proposed have been discussed before, but declined for 
core (which is probably a good decision).  However, something is generally 
better than nothing.

meta* isn't clojure.core/meta, so it can have weaker/different semantics 
without apologizing for it, IMO.

- Chas



-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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

Reply via email to