On Wed, Jul 31, 2002 at 01:18:48AM +0900, Pit Capitain wrote:
> On 30 Jul 2002, at 21:48, Jim Freeze wrote:
> 
> Hi Jim,
> 
> could you tell us why you want to use Proc objects in class 
> constants? Couldn't you just use methods, as in
> 
>   class Func
>     def F1( x ) x end
>     def F2( x ) x**2 end
>     ...
> 
>     def initialize( func )
>       if func.to_s =~ /^F\d+$/
>         @func = method( func )
>       else
>         raise "unknown"
>       end
>     end
> 
>     def compute(x)
>        @func.call(x)
>     end
>   end
> 
> Regards,
> Pit

Yes, I think that is what I want.


-- 
Jim Freeze
If only I had something clever to say for my comment...
~