Re: [BangPypers] Clojure style multimethod functions in python

2010-08-25 Thread Vishal
Does anyone know of some speed performance comparison between multi-methods* vs* if-elif-else* vs* class based polymorphism ? Thanks and best regards, Vishal On Wed, Aug 25, 2010 at 11:15 AM, Baishampayan Ghose wrote: > >> Without making any change whatsoever to multi() and multi_method(), > >

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-24 Thread Baishampayan Ghose
>> Without making any change whatsoever to multi() and multi_method(), > the result of the following code : > > # Declare the existence of a multi method switcher > encounter = multi(lambda x,y : (x["Species"], y["Species"])) > > @multi_method(encounter, ("Bunny","Lion")) > def encounter(a1, a2): >

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Dhananjay Nene
On Mon, Aug 23, 2010 at 8:36 PM, Baishampayan Ghose wrote: > Dhananjay, > > > Could you help explain in light of the following (the argument lists are > in > > bold). The switcher function is provided exactly the same arguments as > the > > various multimethods. Probably something about clojure I

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Baishampayan Ghose
Dhananjay, > Could you help explain in light of the following (the argument lists are in > bold). The switcher function is provided exactly the same arguments as the > various multimethods. Probably something about clojure I am not aware of ? > > Dhananjay > > def multi(switcher_func): >    """ De

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Dhananjay Nene
On Mon, Aug 23, 2010 at 8:13 PM, Baishampayan Ghose wrote: > > While python's multimethod module allows function overloading based on > > types, here's another approach to do the same based on a switching > function > > (clojure style) or on a set of conditions. > > > > Clojure style multimethod f

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Baishampayan Ghose
> While python's multimethod module allows function overloading based on > types, here's another approach to do the same based on a switching function > (clojure style) or on a set of conditions. > > Clojure style multimethod functions in > python

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Rajeev J Sebastian
On Mon, Aug 23, 2010 at 6:35 PM, Dhananjay Nene wrote: > On Mon, Aug 23, 2010 at 4:26 PM, Rajeev J Sebastian < > rajeev.sebast...@gmail.com> wrote: > >> Probably better to use PEAK Rules >> >> Regards >> Rajeev J Sebastian >> > > That looks much more fully featured indeed. But I couldn't under

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Dhananjay Nene
On Mon, Aug 23, 2010 at 4:26 PM, Rajeev J Sebastian < rajeev.sebast...@gmail.com> wrote: > Probably better to use PEAK Rules > > Regards > Rajeev J Sebastian > That looks much more fully featured indeed. But I couldn't understand why features such as the one I "copy-pasted" below are relevant

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Dhananjay Nene
On Mon, Aug 23, 2010 at 4:26 PM, Rajeev J Sebastian < rajeev.sebast...@gmail.com> wrote: > Probably better to use PEAK Rules > > Regards > Rajeev J Sebastian > That looks much more fully featured indeed. But I couldn't understand why features such as the one I "copy-pasted" below are relevant

Re: [BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Rajeev J Sebastian
Probably better to use PEAK Rules Regards Rajeev J Sebastian On Mon, Aug 23, 2010 at 4:11 PM, Dhananjay Nene wrote: > While python's multimethod module allows function overloading based on > types, here's another approach to do the same based on a switching function > (clojure style) or on a

[BangPypers] Clojure style multimethod functions in python

2010-08-23 Thread Dhananjay Nene
While python's multimethod module allows function overloading based on types, here's another approach to do the same based on a switching function (clojure style) or on a set of conditions. Clojure style multimethod functions in python