On Sun, 08 Oct 2000 16:09:58 BST, Nick Ing-Simmons wrote: >Gurusamy Sarathy <gsar@ActiveState.com> writes: >>instead it should cast the IVX to NV and return that. Among other >>things, this means making SvNV() do something like this: >> >> #define SvNV(sv) (SvNOK(sv) ? SvNVX(sv) >> : (SvIOK(sv) ? (NV)SvIVX(sv) : sv_2nv(sv))) >> >>instead of this: >> >> #define SvNV(sv) (SvNOK(sv) ? SvNVX(sv) : sv_2nv(sv)) > >You could do all that inside sv_2nv() in the 1st instance >rather than replicating all the tests everywhere SvNV() occurs. If we do that, we'll need to have a way to distinguish whether sv_2nv() is being used in an lvalue or rvalue context, or perhaps assume the former and introduce a sv_2nv_force(). (I was assuming that sv_2nv() always forces NVness as it does now, while changing SvNV() to convert only when necessary.) Sarathy gsar@ActiveState.comThread Previous | Thread Next