On Jan 22, 2:48 am, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> Thanks for the thread links.  This is basically what I suspected -- if
> you want to use structs in multimethods, you have to roll your own
> constructor which adds some kind of "type" tag to either the hashmap
> or the metadata.
>
> It just seems like a common case, so I was hoping there was a more
> convenient way.  But I guess that's what macros are for...

For now, yes. Struct bases are largely an implementation detail at
this point. I don't want people marrying the current implementation.
Doing something more for structs is on the agenda, but just what is an
open question.

It's pretty easy to write a trivial struct system, much harder to
address performance, interop, compilability, dynamicity etc
constraints.

As a simple case, if a defstruct is re-evaluated, will objects created
after that be of the same 'type' as objects created before? What if
fields have been added/removed? There are people using structs right
now who are very interested in the interface they present to Java
clients.

I'd prefer people experiment with libraries built on the existing
facilities, with an open mind as to the possibilities of categorizing
things other than by their structure.

Rich


--~--~---------~--~----~------------~-------~--~----~
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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to