True.

However, the bigger issue is that writer and reader are now embedded in a
single method, and its impossible to do things like extend the writer to do
notifications and the like.

I guess a set_x(val) is the other alternative. Not sure which I dislike more
:-(


"Joel VanderWerf" <vjoel / path.berkeley.edu> wrote in message
news:4344B6AC.7070400 / path.berkeley.edu...
> itsme213 wrote:
> ..
> > I find this keeps breaking up an otherwise uniform style in code, and
almost
> > leads me towards abandoning #foo=(value) as a setter, and using
#foo(value)
> > instead (with some distinguished sentinel value to distinguish getter
from
> > setter, which I hate!)
>
> You can avoid the sentinal (at a small cost):
>
> def foo(*args)
>   case args.size
>   when 1
>     @foo = args[0]
>   when 0
>     @foo
>   else raise ArgumentError, "Too many args, #{args.size}"
>   end
> end
>
> -- 
>       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
>
>