Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ar.287.mcz
==================== Summary ====================
Name: Collections-ar.287
Author: ar
Time: 1 February 2010, 7:16:54.576 pm
UUID: 3840f8bc-07e3-6f4c-a3d6-8b52f89973aa
Ancestors: Collections-edc.285, Collections-edc.286
Merge Collections-edc.286 with some changes:
- Implement both beginsWithAnyOf: as well as endsWithAnyOf:
- Push the implementation up to SequenceableCollection
- Simplify the implementation (using #anySatisfy:)
- Add comments (also in beginsWith: and endsWith:)
- Add tests
=============== Diff against Collections-edc.285 ===============
Item was changed:
----- Method: SequenceableCollection>>beginsWith: (in category 'testing') -----
beginsWith: aSequenceableCollection
+ "Answer true if the receiver starts with the argument collection"
-
(aSequenceableCollection isEmpty or: [self size < aSequenceableCollection size]) ifTrue: [^false].
aSequenceableCollection withIndexDo: [:each :index | (self at: index) ~= each ifTrue: [^false]].
^true!
Item was changed:
----- Method: SequenceableCollection>>endsWith: (in category 'testing') -----
endsWith: aSequenceableCollection
+ "Answer true if the receiver ends with the argument collection"
-
| start |
(aSequenceableCollection isEmpty or: [self size < aSequenceableCollection size]) ifTrue: [^false].
start := self size - aSequenceableCollection size.
aSequenceableCollection withIndexDo: [:each :index | (self at: start + index) ~= each ifTrue: [^false]].
^true!
Item was added:
+ ----- Method: SequenceableCollection>>endsWithAnyOf: (in category 'testing') -----
+ endsWithAnyOf: aCollection
+ "Return true if the receiver ends with any of the elements in aCollection."
+ ^aCollection anySatisfy:[:suffix| self endsWith: suffix].!
Item was added:
+ ----- Method: SequenceableCollection>>beginsWithAnyOf: (in category 'testing') -----
+ beginsWithAnyOf: aCollection
+ "Return true if the receiver starts with any of the elements in aCollection."
+ ^aCollection anySatisfy:[:prefix| self beginsWith: prefix].!
Item was removed:
- ----- Method: String>>beginsWithAnyOf: (in category 'comparing') -----
- beginsWithAnyOf: aCollection
- aCollection do:[:suffix|
- (self beginsWith: suffix) ifTrue:[^true].
- ].
- ^false!
Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ar.287.mcz
==================== Summary ====================
Name: Collections-ar.287
Author: ar
Time: 1 February 2010, 7:16:54.576 pm
UUID: 3840f8bc-07e3-6f4c-a3d6-8b52f89973aa
Ancestors: Collections-edc.285, Collections-edc.286
Merge Collections-edc.286 with some changes:
- Implement both beginsWithAnyOf: as well as endsWithAnyOf:
- Push the implementation up to SequenceableCollection
- Simplify the implementation (using #anySatisfy:)
- Add comments (also in beginsWith: and endsWith:)
- Add tests
=============== Diff against Collections-edc.285 ===============
Item was changed:
----- Method: SequenceableCollection>>beginsWith: (in category 'testing') -----
beginsWith: aSequenceableCollection
+ "Answer true if the receiver starts with the argument collection"
-
(aSequenceableCollection isEmpty or: [self size < aSequenceableCollection size]) ifTrue: [^false].
aSequenceableCollection withIndexDo: [:each :index | (self at: index) ~= each ifTrue: [^false]].
^true!
Item was changed:
----- Method: SequenceableCollection>>endsWith: (in category 'testing') -----
endsWith: aSequenceableCollection
+ "Answer true if the receiver ends with the argument collection"
-
| start |
(aSequenceableCollection isEmpty or: [self size < aSequenceableCollection size]) ifTrue: [^false].
start := self size - aSequenceableCollection size.
aSequenceableCollection withIndexDo: [:each :index | (self at: start + index) ~= each ifTrue: [^false]].
^true!
Item was added:
+ ----- Method: SequenceableCollection>>endsWithAnyOf: (in category 'testing') -----
+ endsWithAnyOf: aCollection
+ "Return true if the receiver ends with any of the elements in aCollection."
+ ^aCollection anySatisfy:[:suffix| self endsWith: suffix].!
Item was added:
+ ----- Method: SequenceableCollection>>beginsWithAnyOf: (in category 'testing') -----
+ beginsWithAnyOf: aCollection
+ "Return true if the receiver starts with any of the elements in aCollection."
+ ^aCollection anySatisfy:[:prefix| self beginsWith: prefix].!
Item was removed:
- ----- Method: String>>beginsWithAnyOf: (in category 'comparing') -----
- beginsWithAnyOf: aCollection
- aCollection do:[:suffix|
- (self beginsWith: suffix) ifTrue:[^true].
- ].
- ^false!
Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ar.287.mcz
==================== Summary ====================
Name: Collections-ar.287
Author: ar
Time: 1 February 2010, 7:16:54.576 pm
UUID: 3840f8bc-07e3-6f4c-a3d6-8b52f89973aa
Ancestors: Collections-edc.285, Collections-edc.286
Merge Collections-edc.286 with some changes:
- Implement both beginsWithAnyOf: as well as endsWithAnyOf:
- Push the implementation up to SequenceableCollection
- Simplify the implementation (using #anySatisfy:)
- Add comments (also in beginsWith: and endsWith:)
- Add tests
=============== Diff against Collections-edc.285 ===============
Item was changed:
----- Method: SequenceableCollection>>beginsWith: (in category 'testing') -----
beginsWith: aSequenceableCollection
+ "Answer true if the receiver starts with the argument collection"
-
(aSequenceableCollection isEmpty or: [self size < aSequenceableCollection size]) ifTrue: [^false].
aSequenceableCollection withIndexDo: [:each :index | (self at: index) ~= each ifTrue: [^false]].
^true!
Item was changed:
----- Method: SequenceableCollection>>endsWith: (in category 'testing') -----
endsWith: aSequenceableCollection
+ "Answer true if the receiver ends with the argument collection"
-
| start |
(aSequenceableCollection isEmpty or: [self size < aSequenceableCollection size]) ifTrue: [^false].
start := self size - aSequenceableCollection size.
aSequenceableCollection withIndexDo: [:each :index | (self at: start + index) ~= each ifTrue: [^false]].
^true!
Item was added:
+ ----- Method: SequenceableCollection>>endsWithAnyOf: (in category 'testing') -----
+ endsWithAnyOf: aCollection
+ "Return true if the receiver ends with any of the elements in aCollection."
+ ^aCollection anySatisfy:[:suffix| self endsWith: suffix].!
Item was added:
+ ----- Method: SequenceableCollection>>beginsWithAnyOf: (in category 'testing') -----
+ beginsWithAnyOf: aCollection
+ "Return true if the receiver starts with any of the elements in aCollection."
+ ^aCollection anySatisfy:[:prefix| self beginsWith: prefix].!
Item was removed:
- ----- Method: String>>beginsWithAnyOf: (in category 'comparing') -----
- beginsWithAnyOf: aCollection
- aCollection do:[:suffix|
- (self beginsWith: suffix) ifTrue:[^true].
- ].
- ^false!
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-dtl.166.mcz
==================== Summary ====================
Name: Tools-dtl.166
Author: dtl
Time: 1 February 2010, 8:04:57.707 pm
UUID: 3361fc54-f770-4131-8132-2c4d7d91344a
Ancestors: Tools-dtl.165
FileChooser fixes (class examples were broken).
Implement FileChooser class>>new to bypass new behavior in superclass
FileList, not appropriate for FileChooser. Correct spelling errors in method names.
Note: FileChooser is unreferenced in the image. It was introduced in
Squeak 3.9, but is not used in Squeak 3.9 or Squeak trunk. It has a rather
Etoys look about it, but does not appear to be used in Etoys.
=============== Diff against Tools-dtl.165 ===============
Item was changed:
----- Method: FileChooser class>>example3 (in category 'examples') -----
example3
"Open file chooser with a system window UI that has a caption pane and shows only picture files."
"FileChooser example3"
| fc stream |
fc := FileChooser new.
+ fc initializeAsSystemWindowWithCaptionPane.
- fc initalizeAsSystemWindowWithCaptionPane.
fc setCaption: 'Select a picture file' translated.
fc setSuffixes: {'png' . 'gif' . 'bmp' . 'jpg' . 'jpeg' }.
stream := fc open.
stream ifNotNil: [(Form fromBinaryStream: stream) asMorph openInHand].!
Item was changed:
----- Method: FileChooser class>>example2 (in category 'examples') -----
example2
"Open file chooser with a system window UI."
"FileChooser example2"
| fc stream |
fc := FileChooser new.
+ fc initializeAsSystemWindow.
- fc initalizeAsSystemWindow.
stream := fc open.
stream inspect.!
Item was added:
+ ----- Method: FileChooser>>initializeAsSystemWindowWithCaptionPane (in category 'initialization') -----
+ initializeAsSystemWindowWithCaptionPane
+ self initializeBasicParameters.
+ self createSystemWindowUIWithCaptionPane.!
Item was added:
+ ----- Method: FileChooser>>initializeAsSystemWindow (in category 'initialization') -----
+ initializeAsSystemWindow
+ self initializeBasicParameters.
+ self createSystemWindowUI.!
Item was changed:
----- Method: FileChooser class>>example1 (in category 'examples') -----
example1
"Open file chooser with the standard dialog box UI."
"FileChooser example1"
| fc stream |
fc := FileChooser new.
+ fc initializeAsDialogBox.
- fc initalizeAsDialogBox.
stream := fc open.
stream inspect.!
Item was added:
+ ----- Method: FileChooser>>initializeBasicParameters (in category 'initialization') -----
+ initializeBasicParameters
+ self showShortFileNames: true.
+ self setDirectory: FileDirectory default.!
Item was added:
+ ----- Method: FileChooser>>initializeAsDialogBox (in category 'initialization') -----
+ initializeAsDialogBox
+ self initializeBasicParameters.
+ self createDialogBoxUI.
+ self morphicView
+ useRoundedCorners;
+ color: Preferences menuColor;
+ adoptPaneColor: Preferences menuLineColor.
+ self
+ setCaptionColor: Preferences menuTitleColor;
+ setButtonColor: Preferences menuColor.!
Item was added:
+ ----- Method: FileChooser class>>new (in category 'instance creation') -----
+ new
+ "Superclass may attempt to initialize to a specific default directory. Bypass
+ that behavior."
+
+ ^ self basicNew initialize!
Item was changed:
----- Method: FileChooser class>>example4 (in category 'examples') -----
example4
"Open file chooser with a customized dialog box UI. The order of the messages is important. In general, call the initialize method first, then modify things, and finally call open."
"FileChooser example4"
| fc stream |
fc := FileChooser new.
+ fc initializeAsDialogBox.
- fc initalizeAsDialogBox.
fc setDirectory: FileDirectory root.
fc setSuffixes: {'png' . 'gif' . 'bmp' . 'jpg' . 'jpeg' }.
fc setCaption: 'Select a picture file' translated.
fc morphicView
borderColor: Color black;
borderWidth: 2;
color: Color white.
fc setPaneColor: Color gray muchLighter.
fc captionPane color: Color orange muchLighter.
fc okButton color: Color green muchLighter.
fc cancelButton color: Color blue muchLighter.
fc morphicView position: 20@20.
stream := fc open.
stream ifNotNil: [(Form fromBinaryStream: stream) asMorph openInHand].!
Item was removed:
- ----- Method: FileChooser>>initalizeAsDialogBox (in category 'initialization') -----
- initalizeAsDialogBox
- self initalizeBasicParameters.
- self createDialogBoxUI.
- self morphicView
- useRoundedCorners;
- color: Preferences menuColor;
- adoptPaneColor: Preferences menuLineColor.
- self
- setCaptionColor: Preferences menuTitleColor;
- setButtonColor: Preferences menuColor.!
Item was removed:
- ----- Method: FileChooser>>initalizeAsSystemWindow (in category 'initialization') -----
- initalizeAsSystemWindow
- self initalizeBasicParameters.
- self createSystemWindowUI.!
Item was removed:
- ----- Method: FileChooser>>initalizeAsSystemWindowWithCaptionPane (in category 'initialization') -----
- initalizeAsSystemWindowWithCaptionPane
- self initalizeBasicParameters.
- self createSystemWindowUIWithCaptionPane.!
Item was removed:
- ----- Method: FileChooser>>initalizeBasicParameters (in category 'initialization') -----
- initalizeBasicParameters
- self showShortFileNames: true.
- self setDirectory: FileDirectory default.!
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-dtl.166.mcz
==================== Summary ====================
Name: Tools-dtl.166
Author: dtl
Time: 1 February 2010, 8:04:57.707 pm
UUID: 3361fc54-f770-4131-8132-2c4d7d91344a
Ancestors: Tools-dtl.165
FileChooser fixes (class examples were broken).
Implement FileChooser class>>new to bypass new behavior in superclass
FileList, not appropriate for FileChooser. Correct spelling errors in method names.
Note: FileChooser is unreferenced in the image. It was introduced in
Squeak 3.9, but is not used in Squeak 3.9 or Squeak trunk. It has a rather
Etoys look about it, but does not appear to be used in Etoys.
=============== Diff against Tools-dtl.165 ===============
Item was changed:
----- Method: FileChooser class>>example3 (in category 'examples') -----
example3
"Open file chooser with a system window UI that has a caption pane and shows only picture files."
"FileChooser example3"
| fc stream |
fc := FileChooser new.
+ fc initializeAsSystemWindowWithCaptionPane.
- fc initalizeAsSystemWindowWithCaptionPane.
fc setCaption: 'Select a picture file' translated.
fc setSuffixes: {'png' . 'gif' . 'bmp' . 'jpg' . 'jpeg' }.
stream := fc open.
stream ifNotNil: [(Form fromBinaryStream: stream) asMorph openInHand].!
Item was changed:
----- Method: FileChooser class>>example2 (in category 'examples') -----
example2
"Open file chooser with a system window UI."
"FileChooser example2"
| fc stream |
fc := FileChooser new.
+ fc initializeAsSystemWindow.
- fc initalizeAsSystemWindow.
stream := fc open.
stream inspect.!
Item was added:
+ ----- Method: FileChooser>>initializeAsSystemWindowWithCaptionPane (in category 'initialization') -----
+ initializeAsSystemWindowWithCaptionPane
+ self initializeBasicParameters.
+ self createSystemWindowUIWithCaptionPane.!
Item was added:
+ ----- Method: FileChooser>>initializeAsSystemWindow (in category 'initialization') -----
+ initializeAsSystemWindow
+ self initializeBasicParameters.
+ self createSystemWindowUI.!
Item was changed:
----- Method: FileChooser class>>example1 (in category 'examples') -----
example1
"Open file chooser with the standard dialog box UI."
"FileChooser example1"
| fc stream |
fc := FileChooser new.
+ fc initializeAsDialogBox.
- fc initalizeAsDialogBox.
stream := fc open.
stream inspect.!
Item was added:
+ ----- Method: FileChooser>>initializeBasicParameters (in category 'initialization') -----
+ initializeBasicParameters
+ self showShortFileNames: true.
+ self setDirectory: FileDirectory default.!
Item was added:
+ ----- Method: FileChooser>>initializeAsDialogBox (in category 'initialization') -----
+ initializeAsDialogBox
+ self initializeBasicParameters.
+ self createDialogBoxUI.
+ self morphicView
+ useRoundedCorners;
+ color: Preferences menuColor;
+ adoptPaneColor: Preferences menuLineColor.
+ self
+ setCaptionColor: Preferences menuTitleColor;
+ setButtonColor: Preferences menuColor.!
Item was added:
+ ----- Method: FileChooser class>>new (in category 'instance creation') -----
+ new
+ "Superclass may attempt to initialize to a specific default directory. Bypass
+ that behavior."
+
+ ^ self basicNew initialize!
Item was changed:
----- Method: FileChooser class>>example4 (in category 'examples') -----
example4
"Open file chooser with a customized dialog box UI. The order of the messages is important. In general, call the initialize method first, then modify things, and finally call open."
"FileChooser example4"
| fc stream |
fc := FileChooser new.
+ fc initializeAsDialogBox.
- fc initalizeAsDialogBox.
fc setDirectory: FileDirectory root.
fc setSuffixes: {'png' . 'gif' . 'bmp' . 'jpg' . 'jpeg' }.
fc setCaption: 'Select a picture file' translated.
fc morphicView
borderColor: Color black;
borderWidth: 2;
color: Color white.
fc setPaneColor: Color gray muchLighter.
fc captionPane color: Color orange muchLighter.
fc okButton color: Color green muchLighter.
fc cancelButton color: Color blue muchLighter.
fc morphicView position: 20@20.
stream := fc open.
stream ifNotNil: [(Form fromBinaryStream: stream) asMorph openInHand].!
Item was removed:
- ----- Method: FileChooser>>initalizeAsDialogBox (in category 'initialization') -----
- initalizeAsDialogBox
- self initalizeBasicParameters.
- self createDialogBoxUI.
- self morphicView
- useRoundedCorners;
- color: Preferences menuColor;
- adoptPaneColor: Preferences menuLineColor.
- self
- setCaptionColor: Preferences menuTitleColor;
- setButtonColor: Preferences menuColor.!
Item was removed:
- ----- Method: FileChooser>>initalizeAsSystemWindow (in category 'initialization') -----
- initalizeAsSystemWindow
- self initalizeBasicParameters.
- self createSystemWindowUI.!
Item was removed:
- ----- Method: FileChooser>>initalizeAsSystemWindowWithCaptionPane (in category 'initialization') -----
- initalizeAsSystemWindowWithCaptionPane
- self initalizeBasicParameters.
- self createSystemWindowUIWithCaptionPane.!
Item was removed:
- ----- Method: FileChooser>>initalizeBasicParameters (in category 'initialization') -----
- initalizeBasicParameters
- self showShortFileNames: true.
- self setDirectory: FileDirectory default.!
David T. Lewis uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-dtl.166.mcz
==================== Summary ====================
Name: Tools-dtl.166
Author: dtl
Time: 1 February 2010, 8:04:57.707 pm
UUID: 3361fc54-f770-4131-8132-2c4d7d91344a
Ancestors: Tools-dtl.165
FileChooser fixes (class examples were broken).
Implement FileChooser class>>new to bypass new behavior in superclass
FileList, not appropriate for FileChooser. Correct spelling errors in method names.
Note: FileChooser is unreferenced in the image. It was introduced in
Squeak 3.9, but is not used in Squeak 3.9 or Squeak trunk. It has a rather
Etoys look about it, but does not appear to be used in Etoys.
=============== Diff against Tools-dtl.165 ===============
Item was changed:
----- Method: FileChooser class>>example3 (in category 'examples') -----
example3
"Open file chooser with a system window UI that has a caption pane and shows only picture files."
"FileChooser example3"
| fc stream |
fc := FileChooser new.
+ fc initializeAsSystemWindowWithCaptionPane.
- fc initalizeAsSystemWindowWithCaptionPane.
fc setCaption: 'Select a picture file' translated.
fc setSuffixes: {'png' . 'gif' . 'bmp' . 'jpg' . 'jpeg' }.
stream := fc open.
stream ifNotNil: [(Form fromBinaryStream: stream) asMorph openInHand].!
Item was changed:
----- Method: FileChooser class>>example2 (in category 'examples') -----
example2
"Open file chooser with a system window UI."
"FileChooser example2"
| fc stream |
fc := FileChooser new.
+ fc initializeAsSystemWindow.
- fc initalizeAsSystemWindow.
stream := fc open.
stream inspect.!
Item was added:
+ ----- Method: FileChooser>>initializeAsSystemWindowWithCaptionPane (in category 'initialization') -----
+ initializeAsSystemWindowWithCaptionPane
+ self initializeBasicParameters.
+ self createSystemWindowUIWithCaptionPane.!
Item was added:
+ ----- Method: FileChooser>>initializeAsSystemWindow (in category 'initialization') -----
+ initializeAsSystemWindow
+ self initializeBasicParameters.
+ self createSystemWindowUI.!
Item was changed:
----- Method: FileChooser class>>example1 (in category 'examples') -----
example1
"Open file chooser with the standard dialog box UI."
"FileChooser example1"
| fc stream |
fc := FileChooser new.
+ fc initializeAsDialogBox.
- fc initalizeAsDialogBox.
stream := fc open.
stream inspect.!
Item was added:
+ ----- Method: FileChooser>>initializeBasicParameters (in category 'initialization') -----
+ initializeBasicParameters
+ self showShortFileNames: true.
+ self setDirectory: FileDirectory default.!
Item was added:
+ ----- Method: FileChooser>>initializeAsDialogBox (in category 'initialization') -----
+ initializeAsDialogBox
+ self initializeBasicParameters.
+ self createDialogBoxUI.
+ self morphicView
+ useRoundedCorners;
+ color: Preferences menuColor;
+ adoptPaneColor: Preferences menuLineColor.
+ self
+ setCaptionColor: Preferences menuTitleColor;
+ setButtonColor: Preferences menuColor.!
Item was added:
+ ----- Method: FileChooser class>>new (in category 'instance creation') -----
+ new
+ "Superclass may attempt to initialize to a specific default directory. Bypass
+ that behavior."
+
+ ^ self basicNew initialize!
Item was changed:
----- Method: FileChooser class>>example4 (in category 'examples') -----
example4
"Open file chooser with a customized dialog box UI. The order of the messages is important. In general, call the initialize method first, then modify things, and finally call open."
"FileChooser example4"
| fc stream |
fc := FileChooser new.
+ fc initializeAsDialogBox.
- fc initalizeAsDialogBox.
fc setDirectory: FileDirectory root.
fc setSuffixes: {'png' . 'gif' . 'bmp' . 'jpg' . 'jpeg' }.
fc setCaption: 'Select a picture file' translated.
fc morphicView
borderColor: Color black;
borderWidth: 2;
color: Color white.
fc setPaneColor: Color gray muchLighter.
fc captionPane color: Color orange muchLighter.
fc okButton color: Color green muchLighter.
fc cancelButton color: Color blue muchLighter.
fc morphicView position: 20@20.
stream := fc open.
stream ifNotNil: [(Form fromBinaryStream: stream) asMorph openInHand].!
Item was removed:
- ----- Method: FileChooser>>initalizeAsDialogBox (in category 'initialization') -----
- initalizeAsDialogBox
- self initalizeBasicParameters.
- self createDialogBoxUI.
- self morphicView
- useRoundedCorners;
- color: Preferences menuColor;
- adoptPaneColor: Preferences menuLineColor.
- self
- setCaptionColor: Preferences menuTitleColor;
- setButtonColor: Preferences menuColor.!
Item was removed:
- ----- Method: FileChooser>>initalizeAsSystemWindow (in category 'initialization') -----
- initalizeAsSystemWindow
- self initalizeBasicParameters.
- self createSystemWindowUI.!
Item was removed:
- ----- Method: FileChooser>>initalizeAsSystemWindowWithCaptionPane (in category 'initialization') -----
- initalizeAsSystemWindowWithCaptionPane
- self initalizeBasicParameters.
- self createSystemWindowUIWithCaptionPane.!
Item was removed:
- ----- Method: FileChooser>>initalizeBasicParameters (in category 'initialization') -----
- initalizeBasicParameters
- self showShortFileNames: true.
- self setDirectory: FileDirectory default.!
A new version of Rio-Kernel was added to project Rio:
http://www.squeaksource.com/Rio/Rio-Kernel-razavi_acm_org.89.mcz
==================== Summary ====================
Name: Rio-Kernel-razavi_acm_org.89
Author: razavi(a)acm.org
Time: 1 February 2010, 12:54:12 pm
UUID: 5961bbaa-13a3-e744-bc92-089381610d68
Ancestors: Rio-Kernel-lr.88
Fixed the missing #new in:
RioLocalExecutive class >> newForWin32
^ RioLocalDosExecutive new
=============== Diff against Rio-Kernel-lr.88 ===============
Item was changed:
----- Method: RioLocalExecutive class>>newForWin32 (in category 'image start up ') -----
newForWin32
+ ^ RioLocalDosExecutive new!
- ^ RioLocalDosExecutive!
David T. Lewis uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-dtl.315.mcz
==================== Summary ====================
Name: Morphic-dtl.315
Author: dtl
Time: 31 January 2010, 9:07:08.899 pm
UUID: 8b66934c-739d-4523-99a2-1617ef7e1312
Ancestors: Morphic-dtl.314, Morphic-ul.314
Merge Morphic-ul.314 and Morphic-dtl.314
=============== Diff against Morphic-dtl.314 ===============
Item was changed:
----- Method: TextEditor>>selectionAsStream (in category 'accessing-selection') -----
selectionAsStream
"Answer a ReadStream on the text in the paragraph that is currently
selected."
+ ^ReadWriteStream
+ on: paragraph string
+ from: self startIndex
+ to: self stopIndex - 1!
- ^ReadStream
- on: (paragraph string copyFrom: self startIndex to: self stopIndex - 1)!
Item was changed:
----- Method: SmalltalkEditor>>tallySelection (in category 'do-its') -----
tallySelection
"Treat the current selection as an expression; evaluate it and return the time took for this evaluation"
| result rcvr ctxt valueAsString v |
self lineSelectAndEmptyCheck: [^ -1].
(model respondsTo: #doItReceiver)
ifTrue: [FakeClassPool adopt: model selectedClass. "Include model pool vars if any"
rcvr := model doItReceiver.
ctxt := model doItContext]
ifFalse: [rcvr := ctxt := nil].
result := [ | cm |
cm := rcvr class evaluatorClass new
compiledMethodFor: self selectionAsStream
in: ctxt
to: rcvr
notifying: self
ifFail: [FakeClassPool adopt: nil. ^ #failedDoit]
logged: false.
Time millisecondsToRun:
+ [v := cm valueWithReceiver: rcvr arguments: #() ].
- [v := cm valueWithReceiver: rcvr arguments: (Array with: ctxt)].
]
on: OutOfScopeNotification
do: [ :ex | ex resume: true].
FakeClassPool adopt: nil.
"We do not want to have large result displayed"
valueAsString := v printString.
(valueAsString size > 30) ifTrue: [valueAsString := (valueAsString copyFrom: 1 to: 30), '...'].
PopUpMenu
inform: 'Time to compile and execute: ', result printString, 'ms res: ', valueAsString.
!