[squeak-dev] The Trunk: Collections-nice.929.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Fri Mar 5 08:23:11 UTC 2021


Hi Nicolas,

thank you for the quick response. :-)

Best,
Marcel
Am 04.03.2021 18:55:18 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.929.mcz

==================== Summary ====================

Name: Collections-nice.929
Author: nice
Time: 4 March 2021, 6:55:05.090663 pm
UUID: 6e327843-eedc-4eeb-ba1b-0e14d4f40e56
Ancestors: Collections-nice.928

Don't hardcode Interval and LimitedPrecisionInterval so as to enable subclassing.

Note: a subclass wanting to handle limited precision bounds or increment by itself should define:

limitedPrecisionSpecies
^self.

This is not the case of TextLineInterval that only ever see Integer bounds.

=============== Diff against Collections-nice.928 ===============

Item was changed:
----- Method: Interval class>>from:to: (in category 'instance creation') -----
from: startInteger to: stopInteger
"Answer an instance of me, starting at startNumber, ending at
stopNumber, and with an interval increment of 1."

^((startInteger hasLimitedPrecision or: [stopInteger hasLimitedPrecision])
+ ifTrue: [self limitedPrecisionSpecies]
+ ifFalse: [self]) basicNew
- ifTrue: [LimitedPrecisionInterval]
- ifFalse: [Interval]) basicNew
setFrom: startInteger
to: stopInteger
by: 1!

Item was changed:
----- Method: Interval class>>from:to:by: (in category 'instance creation') -----
from: startInteger to: stopInteger by: stepInteger
"Answer an instance of me, starting at startNumber, ending at
stopNumber, and with an interval increment of stepNumber."

^((startInteger hasLimitedPrecision or: [stopInteger hasLimitedPrecision or: [stepInteger hasLimitedPrecision]])
+ ifTrue: [self limitedPrecisionSpecies]
+ ifFalse: [self]) basicNew
- ifTrue: [LimitedPrecisionInterval]
- ifFalse: [Interval]) basicNew
setFrom: startInteger
to: stopInteger
by: stepInteger!

Item was added:
+ ----- Method: Interval class>>limitedPrecisionSpecies (in category 'instance creation') -----
+ limitedPrecisionSpecies
+ "Answer a class able to handle limited precision bounds or step"
+
+ ^LimitedPrecisionInterval!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210305/1f707a6a/attachment.html>


More information about the Squeak-dev mailing list