[squeak-dev] Float hierarchy for 64-bit Spur

Bert Freudenberg bert at freudenbergs.de
Fri Nov 21 12:44:57 UTC 2014


On 21.11.2014, at 13:29, J. Vuletich (mail lists) <juanlists at jvuletich.org> wrote:

> Quoting Bert Freudenberg <bert at freudenbergs.de>:
>> 
>> I'd suggest BoxedDouble and ImmediateDouble as names for the concrete subclasses (*). Names do mean something. (**)
>> 
>> You're right about the FloatArray confusion. However, note that the IEEE standard calls it single and double. It's only C using "float" to mean "single precision".
>> 
>> I'd name the abstract superclass Float, for readability, and the isFloat test etc. Also: "Float pi" reads a lot nicer than anything else. I don't see the need for having a deep LimitedPrecisionReal - Float - BoxedDouble/ImmediateDouble deep hierarchy now.
>> 
>> If we ever add single-precision floats, we should name them BoxedSingle and ImmediateSingle. At that point we might want a Single superclass and a LimitedPrecisionReal supersuperclass, but we can cross that bridge when we get there.
>> 
>> - Bert -
>> 
>> (*) Since we're not going to see the class names often, we could even spell it out as BoxedDoublePrecisionFloat and ImmediateDoublePrecisionFloat. Only half joking. It would make the relation to the abstract Float very clear.
>> 
>> (**) We could also try to make the names googleable. I was surprised to not get a good hit for "boxed immediate". Only "boxed unboxed" finds it. Maybe there are two better words?
> 
> I very much agree with Bert. But I'd suggest SmallDouble instead of ImmediateDouble for consistency with SmallInteger.

Then it would have to be LargeDouble for consistency with LargeInteger, too. Which I don't find compelling.

Also, with the 64 bit format we get many more immediate objects. There already are immediate integers and characters, floats will be the third, there could be more, like immediate points. For those, the small/large distinction does not make sense. 

Maybe Eliot's idea of keeping "Float" in the name was best, but instead of "small" use "immediate":

	Float - BoxedFloat - ImmediateFloat

	A Float is either a BoxedFloat or an ImmediateFloat, depending on the magnitude of its exponent. 

- Bert -


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4142 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141121/3e34e279/smime.bin


More information about the Squeak-dev mailing list