On Thu, Mar 22, 2012 at 8:04 PM, Chris Gray <chrismg
...@gmail.com> wrote:
> So does that mean that you think the types on protocol methods should
> be dropped? Because I'm okay with that solution as well. I prefer
> the solution that I've posted because it is simple and works the same
> way as typehints on regular functions, but if there's a good reason
> not to allow hints on protocol methods, it shouldn't be too hard to
> drop them.
> Cheers,
> Chris
> On Thu, Mar 22, 2012 at 5:17 PM, David Nolen <dnolen.li...@gmail.com>
> wrote:
> > As far as I know, protocol methods are not meant to be hinted.
> > On Thu, Mar 22, 2012 at 6:40 PM, Chris Gray <chrismg...@gmail.com>
> wrote:
> >> Hello,
> >> I noticed that code like the following
> >> (defprotocol ProtocolToTestMethodArgHints
> >> (method-with-multiple-sigs [this ^long arg1 ^boolean arg2] [this
> ^boolean
> >> arg1 ^boolean arg2 ^boolean arg3]))
> >> (deftype TypeToTestMethodHints []
> >> ProtocolToTestMethodArgHints
> >> (method-with-multiple-sigs [this ^long arg1 ^boolean arg2] arg1)
> >> (method-with-multiple-sigs [this ^boolean arg1 ^boolean arg2 ^boolean
> >> arg3] arg2))
> >> would cause the compiler to throw an exception. (Basically because
> >> defprotocol kept the typehints and deftype threw them away.)
> >> I decided to fix it by having deftype keep the typehints. I guess it
> >> would also work if we had defprotocol throw them away.
> >> Which solution is "right"? Discuss! :)
> >> Cheers,
> >> Chris
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Clojure Dev" group.
> >> To post to this group, send email to clojure-dev@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> clojure-dev+unsubscribe@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/clojure-dev?hl=en.
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Clojure Dev" group.
> > To post to this group, send email to clojure-dev@googlegroups.com.
> > To unsubscribe from this group, send email to
> > clojure-dev+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/clojure-dev?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "Clojure Dev" group.
> To post to this group, send email to clojure-dev@googlegroups.com.
> To unsubscribe from this group, send email to
> clojure-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/clojure-dev?hl=en.