definterface vs. defprotocol type hints

233 views
Skip to first unread message

blais

unread,
Dec 11, 2011, 11:15:28 AM12/11/11
to Clojure
Hi,

Why is it that defprotocol ignores type hints, while definterface
deals with them? Both macros expand to a call to
gen-interface--defprotocol just adds a bit more to that. I don't see
why it wouldn't be possible.

Is it just a historical artifact?

Alan Malloy

unread,
Dec 11, 2011, 4:24:56 PM12/11/11
to Clojure

Protocols are for consumption by Clojure functions, which aren't
supposed to be statically typed; interfaces are for consumption by
Java classes, which are required to be statically typed.

Reply all
Reply to author
Forward
0 new messages