On Monday, August 27, 2018 at 1:39:29 PM UTC-5, Didier wrote: > > I see, actually that makes a lot of sense. I always kind of disagreed with > the encapsulation is folly mentra. But if you add to it, of immutable data, > it makes more sense. > > A few more related questions. > > 1) I gathered the fields are made package restricted. Is that correct? >
I believe that's correct. Code in question is here: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L4358-L4360 > 2) It seems methods defined inline on deftype are different then the ones > defined with extend. Is there a performance implication here? It appears > the inline ones would be compiled to methods on the class. So are the > extend one compiled as seperate classes, and then dispatched too in a more > dynamic nature? > Yes, that's correct. Inline are compiled onto the class, extended (note, this is protocol-only) are external functions. Protocol method invocation uses a cache when determining the correct impl so while there is a performance difference but it's unlikely to be a critical factor in most cases. -- 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 --- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.