RE: [tcltk-perl] return of 1=>1.0 transformation error
Brought to you by:
hobbs
|
From: Jeff H. <je...@ac...> - 2004-04-28 16:31:06
|
> Tcl error 'bad grid value "1.0": must be a non-negative
> integer at d:/Perl56/site/lib/Tcl.pm line 363. ' while
> invoking scalar result call:
> "grid .lbl02 -row 1 -column 0" at
...
> perl-5.8.2 passes test without this error, 5.6.0 and 5.6.1 fail.
This is specifically supposed to be handled by this code in
TclObjFromSv:
else if (SvNOK(sv)) {
double dval = SvNV(sv);
int ival;
/*
* Account for some perl versions aggressive NOK-ness where
* an int was all that was intented.
*/
if (SvIOK(sv) && ((double)(ival = SvIV(sv)) == dval)) {
objPtr = Tcl_NewIntObj(ival);
} else {
objPtr = Tcl_NewDoubleObj(dval);
}
}
as it was an issue that 5.6 decided to aggressively promote
"1" with SvNOK as well as SvIOK, whereas 5.8 is corrected to
not do that.
Jeff
|