deftype makes no extender?

1 view
Skip to first unread message

alux

unread,
Sep 3, 2010, 6:49:23 AM9/3/10
to Clojure
Hello,

shouldnt the type x be listed a extender of xx here? Or why not?

Thanks, alux

(defprotocol xx "example" (xxx [x] "some x'es"))

(deftype x [] xx (xxx [x] :xxx))

(extenders xx)

=> nil


Meikel Brandmeyer

unread,
Sep 3, 2010, 7:10:38 AM9/3/10
to Clojure
Hi,

On 3 Sep., 12:49, alux <alu...@googlemail.com> wrote:

> shouldnt the type x be listed a extender of xx here? Or why not?

No. It shows up if you actually use extend to the extend the protocol
to the type.

Sincerely
Meikel

alux

unread,
Sep 3, 2010, 7:50:51 AM9/3/10
to Clojure
Yes, thats what I see.
I just dont think this is very sensible.

Thank you Meikel!

Greetings, alux

Stuart Halloway

unread,
Sep 3, 2010, 10:05:33 AM9/3/10
to clo...@googlegroups.com
Let's back up: what are you trying to do with 'extenders'?

Stu

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

alux

unread,
Sep 8, 2010, 5:36:11 AM9/8/10
to Clojure
Hello Stuart, sorry to answer so late, got holidays, happily.

I tried to use the function extenders to list the implementations, so
to say, of the protocol.
That was playing around, not a use case taken from reality. If I try
to make a use case up, hm, I may need it in the development
environment, to find functions to ponder their use.

Regards, alux

Stuart Halloway

unread,
Sep 8, 2010, 10:05:31 AM9/8/10
to clo...@googlegroups.com
The first rule of open dispatch club is "you never get a complete list of club members." :-) This is also true for e.g. Java interfaces: there is no API call for "reflectively show me all implementers of this interface."

The IDE/tools use case is a real one, but it will need to be solved in the same way IDEs currently find all implementers of an interface: the information is in the environment, not in the core of the language.

Stu

alux

unread,
Sep 8, 2010, 11:24:07 AM9/8/10
to Clojure
Hi Stu,

I like your "open dispatch club" ;-)

Yes, after some thinking this is rather clear - every single something
had to be scanned whether it implements a protocol; ehm, and rescanned
when a new protocol is defined.

Well, I drop that request ;-)

Thank you for the illumination,

alux
Reply all
Reply to author
Forward
0 new messages