[squeak-dev] The Trunk: Kernel-bf.565.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Apr 7 10:09:11 UTC 2011
Bert Freudenberg uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-bf.565.mcz
==================== Summary ====================
Name: Kernel-bf.565
Author: bf
Time: 7 April 2011, 12:08:35.536 pm
UUID: f5b1f9f1-3c3b-4dac-bec9-88df9a90cd0e
Ancestors: Kernel-ar.564
- make ObjectTracer/ObjectViewer work again (try the example in ObjectViewer class comment). BEWARE however, sending xxxUnTrace still sometimes locks up the image
- not sure why sentTo: doesn't work, had to switch to sendTo:
- optionally allow accessing the caught message, e.g.:
object evaluate: [:msg | Transcript cr; show: msg]
wheneverChangeIn: [x := x = false].
=============== Diff against Kernel-ar.564 ===============
Item was changed:
+ ProtoObject subclass: #ObjectTracer
- nil subclass: #ObjectTracer
instanceVariableNames: 'tracedObject recursionFlag'
classVariableNames: ''
poolDictionaries: ''
category: 'Kernel-Objects'!
!ObjectTracer commentStamp: '<historical>' prior: 0!
An ObjectTracer can be wrapped around another object, and then give you a chance to inspect it whenever it receives messages from the outside. For instance...
(ObjectTracer on: Display) flash: (50 at 50 extent: 50 at 50)
will give control to a debugger just before the message flash is sent.
Obviously this facility can be embellished in many useful ways.
See also the even more perverse subclass, ObjectViewer, and its example.
!
Item was removed:
- ----- Method: ObjectViewer class>>on:evaluate:wheneverChangeIn: (in category 'instance creation') -----
- on: viewedObject evaluate: block1 wheneverChangeIn: block2
- ^ self new xxxViewedObject: viewedObject evaluate: block1 wheneverChangeIn: block2!
Item was changed:
----- Method: ObjectViewer>>doesNotUnderstand: (in category 'very few messages') -----
doesNotUnderstand: aMessage
"Check for change after sending aMessage"
| returnValue newValue |
+ recursionFlag ifTrue: [^ aMessage sendTo: tracedObject].
- recursionFlag ifTrue: [^ aMessage sentTo: tracedObject].
recursionFlag := true.
+ returnValue := aMessage sendTo: tracedObject.
+ newValue := valueBlock valueWithPossibleArgument: aMessage.
- returnValue := aMessage sentTo: tracedObject.
- newValue := valueBlock value.
newValue = lastValue ifFalse:
+ [changeBlock valueWithPossibleArgument: aMessage..
- [changeBlock value.
lastValue := newValue].
recursionFlag := false.
^ returnValue!
More information about the Squeak-dev
mailing list
|