On Fri, Apr 09, 2004 at 02:24:16PM +0900, Phil Tomson wrote:
>   def :=(value)  #not currently possible, but it would be cool
>     check_value(value)
>     @value = value
>   end
>
> [...]
>
> This would allow you to do:
> 
>   b = Ternary.new
>   b := 2
>   b := 42 #raise exception

I think << operator is very expressive in that case, and
world peace conformant.   Am I wrong?


   def <<(value)
     check_value(value = value.to_i)
     @value = value
   end
...

b = Ternary.new
b << 2
b << 42

-- 
bSanyI