Re: Type Metadata

2010-10-24 Thread Chris Dow
On Oct 23, 9:44 pm, Shantanu Kumar wrote: > How about using protocols to fetch metadata? SQLRat uses this > approach:http://bitbucket.org/kumarshantanu/sqlrat/wiki/tutorial/EntityDefinition Adding extra fields to mapped records is looking like the best solution to what I'm trying to accomplish.

Re: Type Metadata

2010-10-24 Thread David Nolen
On Sat, Oct 23, 2010 at 5:44 PM, Chris Dow wrote: > Is there any way to attach Clojure defined 'metadata' to to types? I > am trying to write a ORM for records and would like some way to attach > 'metadata' to types for the sake of mapping configuration. Clojure's > built-in metadata apppears t

Re: Type Metadata

2010-10-23 Thread Shantanu Kumar
On Oct 24, 2:44 am, Chris Dow wrote: > Is there any way to attach Clojure defined 'metadata' to to types?  I > am trying to write a ORM for records and would like some way to attach > 'metadata' to types for the sake of mapping configuration.  Clojure's > built-in metadata apppears to be intende

Type Metadata

2010-10-23 Thread Chris Dow
Is there any way to attach Clojure defined 'metadata' to to types? I am trying to write a ORM for records and would like some way to attach 'metadata' to types for the sake of mapping configuration. Clojure's built-in metadata apppears to be intended only for instances of types. I could use Java

Re: PATCH: printing a ref with type metadata

2009-03-28 Thread Konrad Hinsen
On 27.03.2009, at 22:25, srader wrote: > Thanks for the explanation and the patch. But instead of patching > print-method, maybe vary-meta should be patched to handle refs? That doesn't make sense to me. vary-meta takes a value object and returns another value object with identical value but d

Re: PATCH: printing a ref with type metadata

2009-03-27 Thread srader
Thanks for the explanation and the patch. But instead of patching print-method, maybe vary-meta should be patched to handle refs? Scott On Mar 27, 7:07 am, Konrad Hinsen wrote: > On Mar 27, 2009, at 12:55, Konrad Hinsen wrote: > > > I'd say yes. Here's what happens: Typing "foo" at the REPL cau

PATCH: printing a ref with type metadata

2009-03-27 Thread Konrad Hinsen
On Mar 27, 2009, at 12:55, Konrad Hinsen wrote: > I'd say yes. Here's what happens: Typing "foo" at the REPL causes a > call to clojure.core/print-method. This is a multimethod that > dispatches on the result of clojure.core/type, which is the value of > the :type tag in the metadata if there is

Re: printing a ref with type metadata

2009-03-27 Thread Konrad Hinsen
On Mar 26, 2009, at 22:44, srader wrote: > When I type the following in at the REPL: > > (def foo (ref {} :meta {:type :t})) > > and then try to print it, I get the following error: > > java.lang.ClassCastException: clojure.lang.Ref (NO_SOURCE_FILE:0) > [Thrown class clojure.lang.Compiler$Compi

printing a ref with type metadata

2009-03-27 Thread srader
Hi, When I type the following in at the REPL: (def foo (ref {} :meta {:type :t})) and then try to print it, I get the following error: java.lang.ClassCastException: clojure.lang.Ref (NO_SOURCE_FILE:0) [Thrown class clojure.lang.Compiler$CompilerException] Is this a bug? Thanks, Scott --~