The Trunk: Tools-bf.397.mcz

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

The Trunk: Tools-bf.397.mcz

commits-2
Bert Freudenberg uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-bf.397.mcz

==================== Summary ====================

Name: Tools-bf.397
Author: bf
Time: 22 March 2012, 4:15:47.476 pm
UUID: 01d6b8f6-6a5a-40cb-bafd-c266b07ec665
Ancestors: Tools-bf.396

Preserve dependents when making new inspector. Otherwise, the new inspector becomes unresponsive.

=============== Diff against Tools-bf.396 ===============

Item was changed:
  ----- Method: Inspector>>inspect: (in category 'initialize-release') -----
  inspect: anObject
  "Initialize the receiver so that it is inspecting anObject. There is no current selection.
 
  Normally the receiver will be of the correct class (as defined by anObject inspectorClass),
  because it will have just been created by sedning inspect to anObject.   However, the
  debugger uses two embedded inspectors, which are re-targetted on the current receiver
  each time the stack frame changes.  The left-hand inspector in the debugger has its
  class changed by the code here.  Care should be taken if this method is overridden to
  ensure that the overriding code calls 'super inspect: anObject', or otherwise ensures that
  the class of these embedded inspectors are changed back."
 
  | c |
  c := anObject inspectorClass.
  self class ~= c ifTrue: [
  self class format = c format
  ifTrue: [self primitiveChangeClassTo: c basicNew]
+ ifFalse: [self becomeForward: (c basicNew copyFrom: self)]].
- ifFalse: [self becomeForward: c basicNew]].
  "Set 'object' before sending the initialize message, because some implementations
  of initialize (e.g., in DictionaryInspector) require 'object' to be non-nil."
 
  object := anObject.
  self initialize!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-bf.397.mcz

Eliot Miranda-2
re the confusion of copyFrom: (i.e. that it looks to be part of the copyFrom:to: family) could we please come up with a renaming of copyFrom:, e.g. copyStateFrom: or copyInstVarsFrom: and start using it so that some time we may have (c copyFrom: i) = (c copyFrom: i to: c size) ?

On Thu, Mar 22, 2012 at 8:16 AM, <[hidden email]> wrote:
Bert Freudenberg uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-bf.397.mcz

==================== Summary ====================

Name: Tools-bf.397
Author: bf
Time: 22 March 2012, 4:15:47.476 pm
UUID: 01d6b8f6-6a5a-40cb-bafd-c266b07ec665
Ancestors: Tools-bf.396

Preserve dependents when making new inspector. Otherwise, the new inspector becomes unresponsive.

=============== Diff against Tools-bf.396 ===============

Item was changed:
 ----- Method: Inspector>>inspect: (in category 'initialize-release') -----
 inspect: anObject
       "Initialize the receiver so that it is inspecting anObject. There is no current selection.

       Normally the receiver will be of the correct class (as defined by anObject inspectorClass),
       because it will have just been created by sedning inspect to anObject.   However, the
       debugger uses two embedded inspectors, which are re-targetted on the current receiver
       each time the stack frame changes.  The left-hand inspector in the debugger has its
       class changed by the code here.  Care should be taken if this method is overridden to
       ensure that the overriding code calls 'super inspect: anObject', or otherwise ensures that
       the class of these embedded inspectors are changed back."

       | c |
       c := anObject inspectorClass.
       self class ~= c ifTrue: [
               self class format = c format
                       ifTrue: [self primitiveChangeClassTo: c basicNew]
+                       ifFalse: [self becomeForward: (c basicNew copyFrom: self)]].
-                       ifFalse: [self becomeForward: c basicNew]].
       "Set 'object' before sending the initialize message, because some implementations
       of initialize (e.g., in DictionaryInspector) require 'object' to be non-nil."

       object := anObject.
       self initialize!





--
best,
Eliot



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-bf.397.mcz

Bert Freudenberg
On 22.03.2012, at 17:12, Eliot Miranda wrote:

> re the confusion of copyFrom: (i.e. that it looks to be part of the copyFrom:to: family) could we please come up with a renaming of copyFrom:, e.g. copyStateFrom: or copyInstVarsFrom: and start using it so that some time we may have (c copyFrom: i) = (c copyFrom: i to: c size) ?

Yeah let's do it. I think the old discussion settled on copyValuesFrom:

http://forum.world.st/copyFrom-vs-copySameFrom-td3851161.html

- Bert -