[Seaside-dev] Issue 241 in seaside: WANumberPrinter>>#digitsOf:base: uses a Float as an Array index

codesite-noreply at google.com codesite-noreply at google.com
Fri Nov 14 18:21:03 UTC 2008


Issue 241: WANumberPrinter>>#digitsOf:base: uses a Float as an Array index
http://code.google.com/p/seaside/issues/detail?id=241

New issue report by wembley.instantiations:
This problem seems to be caused by another Squeak unique-ism -- only on
Squeak (I believe) is it legitimate to use a Float as an index into an
Array.  The ANSI Standard would declare this to be an error (see Section
5.7.8.4).

The signature of this method
   WANumberPrinter>>#digitsOf: anInteger base: aBaseInteger
would lead one to believe that its parameters should be Integers.  And the
method works quite nicely if they are (see
WAPrinterTest>>#testDigitsOfBase and WAPrinterTest>>#testDigitsOf:).

However, in actual usage, the parameters are always Floats.  Now it would
be easy enough to change the method signature to:
   WANumberPrinter>>#digitsOf: aNumber base: aBaseNumber
and then send #asInteger to the parameters before using them to index the
NumbersToCharacter array, but this doesn't feel right to me -- I think the
fix should be somewhere further upstream so that the parameters actually
are Integers.


Issue attributes:
	Status: New
	Owner: ----
	Labels: Type-Portability Priority-Medium Version-Seaside2.9

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


More information about the seaside-dev mailing list