From: Gregory Brown Date: 2007-01-20T10:37:52+09:00 Subject: Re: auto assign arguments? On 1/18/07, Daniel DeLorme wrote: > Gregory Brown wrote: > > On 1/18/07, David Chelimsky wrote: > > > >> Does this seem like a good thing to propose? > > > > -1. I see @a and @b to be part of the classe's instance variables, so > > Why the class' instance variables? That doesn't fit with the current pattern: > > class C > def initialize(v = nil) > @default = v > end > def otherdefault > 42 > end > def ultimate(v = @default || otherdefault) > v > end > end > C.new.ultimate #=> 42 > C.new(54).ultimate #=> 54 Hmm... you're right. I can see that now (and have used it!) Still, I do think the RCR would make things more messy, but would be all for something in core or the standard library that could allow me to enable the behavior on the fly for any given class. (Though I'm not strongly invested one way or the other)