Re: OOP question re: The Language of the System

2014-01-19 Thread Mars0i
This is peripheral to the real focus of this thread, but it's worth noting the parallel between objects and closures. You can implement encapsulation with closures--although it's less useful if without mutability. Scheme was supposedly designed as a language for exploration of object-oriented

Re: OOP question re: The Language of the System

2014-01-19 Thread Jonah Benton
Will just add, in re: an earlier thread on this talk, one way to view this is in re: the lifespan of the data. Building and evolving the components that deal with live data passed around between them is easier and more fluid when working with maps than with working with types. One can add a field

Re: OOP question re: The Language of the System

2014-01-19 Thread Jonah Benton
I'm curious for the response re: #3 as well, but one pain point I've experienced with protocols vs multimethods is that as a system evolves, retaining the semantics that led me to bundle functions together into a protocol in the first place has sometimes been difficult, a source of incidental compl

Re: OOP question re: The Language of the System

2014-01-19 Thread Softaddicts
If you implement an API returning custom types or records, consumers will have to adhere to the same implementation in their own implementations, The so called freedom becomes a cage for others, they are stuck with your implementation and it leaks out in places were they should not. Using generic

Re: OOP question re: The Language of the System

2014-01-19 Thread Sam Ritchie
can you elaborate on #3? What constraints did you run into with type-based dispatch that a multimethod that dispatched on :op allowed you to get around? It seems like, if that's your pattern, lifting the :op field up into an actual record type would only give you MORE freedom. You rely on the c

Re: OOP question re: The Language of the System

2014-01-19 Thread Timothy Baldridge
A couple of things on this subject: 1) protocols were invented primarily for their speed. If one was going to write Clojure in Clojure it would be a little hard to implement PersistentHashMaps using pure data. You have to start with something. Thus deftype and defprotocol were born. 2) Unlike in

Re: OOP question re: The Language of the System

2014-01-19 Thread James Reeves
On 19 January 2014 19:55, Brian Craft wrote: > http://www.youtube.com/watch?v=ROor6_NGIWU > > Around 56:28 Rich is talking about whether components pass a data > structure, or "an object that has all these verbs and knows how to do stuff > ...". > > Clojure data types also have verbs, in protocol