Nicolas Cellier uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-nice.448.mcz
==================== Summary ====================
Name: Tools-nice.448
Author: nice
Time: 24 February 2013, 9:20:11.082 pm
UUID: 6d5eb1d5-ae18-44eb-95a8-4fbdf02a2e66
Ancestors: Tools-nice.447
FakeClassPool is obsolete in Squeak, remove recent reference to it.
Note: we should deprecate this class
=============== Diff against Tools-nice.447 ===============
Item was changed:
----- Method: Debugger>>runUntil (in category 'code pane menu') -----
runUntil
"Step until an expression evaluates to other than false, reporting an erroer if it doesn't evaluate to true.
Remember the expression in an inst var. If shift is pressed when the expression is supplied, don't update the UI.
If shift is pressed while stepping, stop stepping. Using a user interrupt to break out would be more natural
but Squeak currently doesn't provide a UserInterrupt expection. It should do."
| expression receiver context method value lastUpdate updateUI breakOnShift |
expression := UIManager default
request: 'run until expression is true (shift to disable ui update; shift to break).'
initialAnswer: (untilExpression ifNil: 'boolean expression').
(expression isNil or: [expression isEmpty]) ifTrue:
[^self].
updateUI := breakOnShift := Sensor shiftPressed not.
untilExpression := expression.
context := self selectedContext.
receiver := context receiver.
- FakeClassPool adopt: receiver class.
method := receiver class evaluatorClass new
compiledMethodFor: untilExpression
in: context
to: receiver
notifying: nil
+ ifFail: [^ #failedDoit]
- ifFail: [FakeClassPool adopt: nil. ^ #failedDoit]
logged: false.
lastUpdate := Time millisecondClockValue.
- FakeClassPool adopt: nil.
[self selectedContext == context
and: [(value := receiver with: context executeMethod: method) == false]] whileTrue:
[self doStep.
Time millisecondClockValue - lastUpdate > 50 ifTrue:
[updateUI ifTrue: [World displayWorldSafely].
breakOnShift
ifTrue: [Sensor shiftPressed ifTrue: [^self]]
ifFalse: [Sensor shiftPressed ifFalse: [breakOnShift := true]].
lastUpdate := Time millisecondClockValue]].
(value ~~ false and: [value ~~ true]) ifTrue:
[UIManager default inform: 'expression ', (untilExpression contractTo: 40), ' answered ', (value printString contractTo: 20), '!!!!']!
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.641.mcz
==================== Summary ====================
Name: Morphic-nice.641
Author: nice
Time: 24 February 2013, 7:46:46.389 pm
UUID: d7085035-2ec9-4937-a927-80ad6419a36c
Ancestors: Morphic-nice.640
Correct blinkPrevParen: (only in absence of Shout).
simplify an initialization.
=============== Diff against Morphic-nice.640 ===============
Item was changed:
----- Method: MorphicProject>>initializeMenus (in category 'enter') -----
initializeMenus
+ "Menu setting for these classes may have been modified by another
- "Menu setting for these classes may have have been modified by another
Morphic project, e.g. SimpleMorphic. Ensure that they are restored to the
expected menus."
+ Editor initialize.!
- TextEditor initialize.
- SmalltalkEditor initialize!
Item was changed:
----- Method: TextEditor>>blinkPrevParen: (in category 'parenblinking') -----
+ blinkPrevParen: aCharacter
- blinkPrevParen: aKeyboardEvent
"Used if not Shout"
| openDelimiter closeDelimiter level string here hereChar |
string := paragraph string.
here := pointBlock stringIndex.
+ openDelimiter := aCharacter.
- openDelimiter := aKeyboardEvent keyCharacter.
closeDelimiter := '([{' at: (')]}' indexOf: openDelimiter).
level := 1.
[level > 0 and: [here > 1]]
whileTrue:
[hereChar := string at: (here := here - 1).
hereChar = closeDelimiter
ifTrue:
[level := level - 1.
level = 0
ifTrue: [^ self blinkParenAt: here]]
ifFalse:
[hereChar = openDelimiter
ifTrue: [level := level + 1]]]!
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-nice.502.mcz
==================== Summary ====================
Name: Collections-nice.502
Author: nice
Time: 24 February 2013, 7:30:26.441 pm
UUID: 493d78e4-ccce-434c-98ae-90f22102cdce
Ancestors: Collections-fbs.501
Let String combinations produce Strings rather than Array of Characters.
This is not perfect for WideString which are not necessarily simplified to ByteString, but IMO better than Array.
=============== Diff against Collections-fbs.501 ===============
Item was changed:
----- Method: SequenceableCollection>>combinations:atATimeDo: (in category 'enumerating') -----
combinations: kk atATimeDo: aBlock
"Take the items in the receiver, kk at a time, and evaluate the block for each combination. Hand in an array of elements of self as the block argument. Each combination only occurs once, and order of the elements does not matter. There are (self size take: kk) combinations."
+ " (1 to: 5) combinations: 3 atATimeDo: [:each | Transcript cr; show: each printString]"
- " 'abcde' combinations: 3 atATimeDo: [:each | Transcript cr; show: each printString]"
| aCollection |
aCollection := Array new: kk.
self combinationsAt: 1 in: aCollection after: 0 do: aBlock!
Item was added:
+ ----- Method: String>>combinations:atATimeDo: (in category 'enumerating') -----
+ combinations: kk atATimeDo: aBlock
+ "Gather the combinations into a String rather than an Array"
+
+ " 'abcde' combinations: 3 atATimeDo: [:each | Transcript cr; show: each printString]"
+
+ | aCollection |
+ aCollection := String new: kk.
+ self combinationsAt: 1 in: aCollection after: 0 do: aBlock!
Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-nice.245.mcz
==================== Summary ====================
Name: KernelTests-nice.245
Author: nice
Time: 24 February 2013, 5:34:23.518 pm
UUID: 2a95d1b1-1e90-45e5-9b95-7f5e8a7cf92f
Ancestors: KernelTests-nice.244
Reduce the number of hardcoded constants used by #raisedTo:modulo: tests too.
=============== Diff against KernelTests-nice.244 ===============
Item was changed:
----- Method: IntegerTest>>testMontgomeryMultiplication (in category 'testing - arithmetic') -----
testMontgomeryMultiplication
| a m mInv |
m := 15485863.
+ mInv := m montgomeryDigitBase - ((m bitAnd: m montgomeryDigitMax) reciprocalModulo: m montgomeryDigitBase).
+ a := (m montgomeryDigitBase raisedTo: m montgomeryNumberOfDigits) \\ m.
- mInv := 256 - ((m bitAnd: 255) reciprocalModulo: 256).
- a := (256 raisedTo: m digitLength) \\ m.
#(483933 3871465 8951195) do: [:s |
(s montgomeryTimes: a modulo: m mInvModB: mInv) ifNotNil: [:s1 |
| s2 sa ssa |
self assert: s = s1.
sa := s montgomeryTimes: (a * a \\ m) modulo: m mInvModB: mInv.
self assert: sa = (s * a \\ m).
ssa := sa montgomeryTimes: sa modulo: m mInvModB: mInv.
self assert: ssa = (s * s * a \\ m).
s2 := ssa montgomeryTimes: 1 modulo: m mInvModB: mInv.
self assert: s2 = (s * s \\ m)]].!