What's difficult when it comes to understanding multimethods, records, types, and protocols? I'm writing a chapter on multimethods, records, types, and protocols for the book Clojure for the Brave and True, and I'd love to hear about what kinds of pitfalls I should be sure to cover :)
Thanks!
Daniel
--
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
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
As recently mentioned on another thread, this also means that you cannot have two different protocols with the same method names in the same namespace. This may be surprising, especially from an OO background, where it is very natural to have two types with the same operations.
On Monday, 27 October 2014, Sven Richter <sve...@googlemail.com> wrote:
Hi Daniel,--
When running through tutorials and blog posts it did not occur to me that the functions of a defprotocol are namespaced to where they are defined. Meaning, calling these functions I have to use their original namespace.
It is obvious when one reads the official documentation, but one does not always do this first, so that wsa one pitfall I ran into.
Best Regards,
Sven
Am Sonntag, 26. Oktober 2014 16:48:29 UTC+1 schrieb Daniel Higginbotham:What's difficult when it comes to understanding multimethods, records, types, and protocols? I'm writing a chapter on multimethods, records, types, and protocols for the book Clojure for the Brave and True, and I'd love to hear about what kinds of pitfalls I should be sure to cover :)
Thanks!
Daniel
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
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
The differences between OOP and multimethods should be stressed.I just wrote about this on my blog, and those who mostly worked with OOP kept wondering, how do you get inheritance of functionality?
OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them.
Thanks for the responses! This is very helpful.
--
--
As recently mentioned on another thread, this also means that you cannot have two different protocols with the same method names in the same namespace. This may be surprising, especially from an OO background, where it is very natural to have two types with the same operations.
On Monday, 27 October 2014, Sven Richter <sve...@googlemail.com> wrote:
Hi Daniel,--
When running through tutorials and blog posts it did not occur to me that the functions of a defprotocol are namespaced to where they are defined. Meaning, calling these functions I have to use their original namespace.
It is obvious when one reads the official documentation, but one does not always do this first, so that wsa one pitfall I ran into.
Best Regards,
Sven
Am Sonntag, 26. Oktober 2014 16:48:29 UTC+1 schrieb Daniel Higginbotham:What's difficult when it comes to understanding multimethods, records, types, and protocols? I'm writing a chapter on multimethods, records, types, and protocols for the book Clojure for the Brave and True, and I'd love to hear about what kinds of pitfalls I should be sure to cover :)
Thanks!
Daniel
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
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.