"Aleksei Guzev" <aleksei.guzev / bigfoot.com> writes:

> Just now I met a funny problem with NUM2LONG macro.
> 
> I've written a line like the following
> 
>  return NUM2LONG( fn( x ) );
> 
> Function fn has vivid side effect and NUM2LONG calls it twice ( see
> its definition ) :) Do not do like above!

Patient: Doctor, it hurts when I type this.

Doctor: Then don't type that.


Just call rb_num2long(fn(x)) directly.



Dave