Re: Difference between defrecord and extend

2012-06-24 Thread Daniel Skarda
Chas, once again thank you for very detailed explanation :) I have not seen all the implications of language implementation on top of JVM. I spent some time thinking about the issue and now I see all design choices and trade-offs, especially when type/prototype system must be fast and thread safe

Re: Difference between defrecord and extend

2012-06-24 Thread Chas Emerick
Dan, Re: (2), yes, using higher-order functions effectively is a big part of functional programming. But, no, passing a var to HOFs in every case instead of dereferencing its value is not a good blanket policy. You need to have a clear notion of what you want to happen and what the contract o

Re: Difference between defrecord and extend

2012-06-24 Thread Daniel Skarda
Chas, thank you for the explanation, it confirmed my vague thoughts I had after quick review of Clojure source code and inspection of values in prototype maps before and after the change. I understand the difference, however I think there are three points to consider from Clojure design point

Re: Difference between defrecord and extend

2012-06-23 Thread Chas Emerick
Dan, This difference is due to the subtleties around how protocols are implemented, and between passing a var vs. capturing a var's state at a particular time. If you change `transmogrify` to this (note the #'), the `(foo* (BarRec.))` succeeds: (def foo* (transmogrify #'foo "Bar")) Pr