I found that if I define a protocol like this:

(defprotocol IProc
  (procMethod [this] "some method"))

I can invoke it on a type either
(procMethod object)
or 
(.procMethod object)

Note the prefix dot in the second case. 

I like this "dot" version because that means I can replace a record field 
with a method with the same name and things will work as usual, like 
"property" in Python. However, I think someone mentioned that the dot 
version is just a JVM implementation detail that got exposed so it seems I 
cannot rely on it as part of the language. Is that the case? Thank you.






-- 
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

Reply via email to