From: dblack@... Date: 2006-07-25T05:48:29+09:00 Subject: Re: I'll have the duck! Hi -- On Tue, 25 Jul 2006, transfire@gmail.com wrote: > I wonder then, if we take up John Carter's notion on duck as mixin, > then Enumerable can be defined as: > > ducktype :each do > def collect > each{ |e| yield(e) } > end > ... > end > > Although clearly the distinction between a mixin and a ducktype is the > ducktypes global influence. Quite powerful! Yet, I do imagine that with > this is place someone would call for selector namepsaces to reign in > the abundant flocks ;) Onefurther step would have to be taken, at the > very least. a means of constraining them to specific scopes. Perhaps > that's a simple as limiting them the module space they are defined in? > > In any case very interesting. I really wonder just how far one can take > this shift in paradigm? If it's a shift in paradigm, then it isn't "duck typing" (which is a term invented to describe aspects of programming in Ruby). Please choose a different animal :-) David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy http://www.manning.com/black => RUBY FOR RAILS (reviewed on Slashdot, 7/12/2006!) http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log dblack@wobblini.net => me