On 08.06.2009, at 04:26, Stuart Sierra wrote:
>> If it is, it would be very useful to have something that is the
>> ancestor of everything (like T in common lisp).
>
> This has been thought about, at least: http://clojure.org/todo
> I think the question is... what should the universal ancestor be? For
> classes, it's java.lang.Object. But "derive" allows you to create
> relationships outside the Java class hierarchy. So for now, defining
> your own "root" ancestor is the way to proceed.
See also my patch that creates such a universal root type (the
keyword :root):
http://groups.google.com/group/clojure/browse_thread/thread/
bc5193304c1ab2e3/77e5d53d8ccd6b10?lnk=gst&q=%3Aroot#77e5d53d8ccd6b10
Of course, it is not a good idea to write code relying on an
unofficial patch, I don't even use it myself for production code. But
the patch illustrates that this can be done, and my tests have not
shown any undesirable side effects.
Konrad.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---