Group: comp.lang.ruby
From: Rick DeNatale
Date: Sunday, February 10, 2008 12:33 PM
Subject: Re: Inheriting from / Delegating to Integer - Currency class implementation

On 2/10/08, Rick DeNatale wrote:
> On 2/10/08, Alex Shulgin wrote:
they are exactly the same as in the Integer class.
> >
> > Huh?.. And what is the result for $5 divided by $1? ;)
>
> What, do you want me to do all of the OP's work for him for free?

Actually, I rather blithely skipped over the real point in Alex's question.

Although my code shows how to do coercion via double dispatching in
Ruby, it ignores the domain question of what does it mean to add an
integer to a currency.

$5 + 1 what?

It's not clear that an integers and currency really SHOULD be
compatible in this way.

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Safety Articles | Usenet Groups | Usenet News | Bluegrass