The Trunk: Morphic-dtl.315.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-dtl.315.mcz

commits-2
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.
  !