On Fri, Aug 11, 2006 at 10:56:45AM +0900, gwtmp01 / mac.com wrote:
> Is there supposed to be a semantic difference between the '=' and '=='
> operator in what you are trying to accomplish or are you just trying to
> implement '=' as a proc and '==' as a method?

The latter. It's just an example. They are operators in a templating language
we use at work.

> 
> Does this help at all?
> 
> def equals(a, b)
>   return a == b ? 1 : 0
> end
> 
> OPS = {
>   '=' => proc { |a, b| return a == b ? 1 : 0 },
>   '==' => method(:equals),
> }
> 
> puts OPS['='].call(1, 1)
> puts OPS['=='].call(1, 2)

It sure does. But I could have sworn I tried that, which is why I posted :-/
Guess not.

Thanks Gary!

-- 
Jos Backus
jos at catnook.com