My OO example from earlier deals with this case by completely removing any
need to manually derive tags.  This is done by having CLJOS keep it's own
internal hierarchy (via make-hierarchy) rather than using the default one.
 By modifying metadata on the vars holding structs created by defclass
(using alter-meta!) and tagging instances as described in existing Clojure
literature you can provide functions to shuffle away the annoyance of
dealing with keywords and their namespaces entirely.
On Mon, Jan 19, 2009 at 7:29 PM, Jason Wolfe <jawo...@berkeley.edu> wrote:

>
> I've been doing some OO-type Clojure programming, and have run into
> the following (quite minor) annoyance:
>
> I've defined a struct with a :class of ::Foo in namespace
> my.long.namespace.foo.
>
> In another namespace my.long.namespace.bar, I want to define a
> subclass of this struct.
> In this namespace, I require [...foo :as foo], so that I can refer to
> multimethods like foo/method1.
>
> However, it seems I'm still required to write
> (derive ::Bar :my.long.namespace.foo/Foo)
> when I'd like to write
> (derive ::Bar :foo/Foo)
>
>  I'm not sure if this is even feasible, since given my limited
> experience it seems that aliases for symbols are handled at resolution-
> time and not read-time, and that wouldn't work for keywords.   On the
> other hand, this state of affairs seems to be possibly-confusing and a
> perhaps-needless difference between symbols and keywords.  What do
> others think about this?
>
> Thanks,
> Jason
> >
>

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