Implements to:by:do: and to:do: in BigInt.
Updated 1 year, 7 months ago
| Nicolas Roard | Reviewers | ||
| EtoileCore | |||
| TheRaven | |||
| None | Etoile trunk (etoile/trunk/Etoile) | ||
Implements Smalltalk's "for loops", to:by:do: and to:do:, allowing to do things such as: 1 to: 10 do: [:x| ETTranscript show: x; cr]
Most of the time, SmallInts will be the target for this kind of message. Please provide a SmallInt implementation as well, so we aren't constantly promoting SmallInt to BigInt for loops. See the implementation of timeRepeat_ in SmallIntMsgs.m.
-
Languages/SmalltalkKit/Support/BigInt.m (Diff revision 1) -
If you use ints as parameters here you are defining an ABI where this takes an int. You will not be able to define a version that takes an object parameter. If you use ids, SmallInts will automatically be boxed. Please use ids here.
Review request changed
Updated 1 year, 7 months ago (January 18th, 2009, 8:58 a.m.)
-
- added Diff r2
Improved the behaviour to properly deals with BigInts. Corresponding changes in SmallInt will follow in another patch.
Posted 1 year, 7 months ago (January 18th, 2009, 9:08 a.m.)
Is there a MsgSendSmallInt.m diff meant to be visible here?
-
Languages/SmalltalkKit/Support/BigInt.m (Diff revision 2) -
This won't work if other or by are something other than a BigInt.
-
Languages/SmalltalkKit/Support/BigInt.m (Diff revision 2) -
I wonder if it's worth having a special case here for where self and other fit into a signed int. The compiler can typically generate much more efficient code for adding a constant than for adding two variables.
Review request changed
Updated 1 year, 7 months ago (January 18th, 2009, 9:37 a.m.)
-
- added Diff r3
Added support for other classes than BigInt as parameters...