Re: adding metadata to java objects

2011-11-17 Thread Ben Mabey
On 11/17/11 4:21 AM, Chas Emerick wrote: Ben, It's a good idea, but it's going to bite you: - what if the class in question has fields or package-private methods that are touched by Java code? Yeah, there are some use cases where this would fall apart in. Assuming that you use only public

Re: adding metadata to java objects

2011-11-17 Thread Chas Emerick
Ben, It's a good idea, but it's going to bite you: - what if the class in question has fields or package-private methods that are touched by Java code? - what if the class take ctor arguments? - what if the ctor has side effects? - Chas On Nov 16, 2011, at 11:28 AM, Ben Mabey wrote: > Hi, > I

Re: adding metadata to java objects

2011-11-17 Thread Chas Emerick
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 mutabl

Re: adding metadata to java objects

2011-11-16 Thread Ben Smith-Mannschott
On Wed, Nov 16, 2011 at 22:32, Alan Malloy wrote: > On Nov 16, 11:53 am, Ben Smith-Mannschott > wrote: >> On Wed, Nov 16, 2011 at 17:28, Ben Mabey wrote: >> > Hi, >> > I would like to be able to add metadata to arbitrary java objects that have >> > already been instantiated.  I know that you can

Re: adding metadata to java objects

2011-11-16 Thread Alan Malloy
On Nov 16, 11:53 am, Ben Smith-Mannschott wrote: > On Wed, Nov 16, 2011 at 17:28, Ben Mabey wrote: > > Hi, > > I would like to be able to add metadata to arbitrary java objects that have > > already been instantiated.  I know that you can use proxy to add metadata to > > objects that you create b

Re: adding metadata to java objects

2011-11-16 Thread Ben Smith-Mannschott
On Wed, Nov 16, 2011 at 17:28, Ben Mabey wrote: > Hi, > I would like to be able to add metadata to arbitrary java objects that have > already been instantiated.  I know that you can use proxy to add metadata to > objects that you create but in my case the object already exists (i.e. it is > return