Re: Program design

2010-08-19 Thread Nicolas Oury
A big part of inheritance can be done by using defrecord, keywords and functions instead of method, and getting read of the abstract class. (defrecord Orange [:mass :energy :juice]) (defrecord Apple [:mass :energy :juice : family]) (defn get-juice [fruit] (:juice fruit)) -- You received this

Re: Program design

2010-08-19 Thread Mark Engelberg
On Wed, Aug 18, 2010 at 5:20 PM, Patrick Moriarty wrote: > You should look at Clojure 1.2 protocols and records which provides an easy > way to do polymorphism on types. > See http://clojure.org/protocols. Protocols don't offer inheritance. The original poster specifically mentioned porting code

Re: Program design

2010-08-19 Thread Patrick Moriarty
You should look at Clojure 1.2 protocols and records which provides an easy way to do polymorphism on types. See http://clojure.org/protocols. On 18 August 2010 08:25, Mark Engelberg wrote: > I think the easiest way to port OO code would be to use Clojure's > multimethods, dispatching on the ty

Re: Program design

2010-08-18 Thread Mark Engelberg
I think the easiest way to port OO code would be to use Clojure's multimethods, dispatching on the type of the first argument. -- 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 post