Protocols are very similar to Java interfaces: they specify a set of
functions/methods without providing an implementation. The big
distinction is in more dynamic usage. Rich Hickey's description at
http://clojure.org/protocols is well written.


On Aug 12, 7:52 pm, Tim Daly <d...@axiom-developer.org> wrote:
> I find that I'm horribly confused at this point about what a
> protocol "is". Can someone use some other comp. sci. terms to
> define this idea? I thought of them as Java interfaces with
> default methods but clearly I'm wrong.
>
>
>
> Sean Devlin wrote:
> > I've posted a follow up to my article yesterday about protocols & code
> > reuse.  In today's article I discuss what I've termed partially
> > implemented protocols, which is geared toward providing a default
> > implementation.  Granted, it's a bit ugly and I'll be the first to
> > admit that it starts to confuse the difference between a protocol &
> > implementation.  Still, it cuts down on the bookkeeping required.
>
> >http://fulldisclojure.blogspot.com/2010/08/partially-implemented-prot...
>
> > Have fun
> > Sean
>
> > On Aug 12, 3:16 pm, Nicolas Oury <nicolas.o...@gmail.com> wrote:
>
> >> Can I erase my last mails?
>
> >> I just discovered (.bar (Foo. 5)) => 5
>
> >> It is a bit embarrassing. Sorry about that. (I am not a Java person, I 
> >> reckon)
>
> >> As far as traits are concerned, I think they can be made with a couple
> >> of macros.
> >> I might try to have a go over the week-end.
>
> >> Best,
>
> >> Nicolas.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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