The Trunk: Kernel-laza.428.mcz

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

The Trunk: Kernel-laza.428.mcz

commits-2
Alexander Lazarević uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-laza.428.mcz

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

Name: Kernel-laza.428
Author: laza
Time: 22 March 2010, 11:47:56.242 am
UUID: 5b1e683b-2d8c-4f21-b877-30e2426f1491
Ancestors: Kernel-ul.427

Order instance variables alphabetically

=============== Diff against Kernel-ul.427 ===============

Item was changed:
  ----- Method: Object>>longPrintOn:limitedTo:indent: (in category 'printing') -----
  longPrintOn: aStream limitedTo: sizeLimit indent: indent
  "Append to the argument, aStream, the names and values of all of the receiver's instance variables.  Limit is the length limit for each inst var."
 
+ self class allInstVarNames asSortedArray doWithIndex:
- self class allInstVarNames doWithIndex:
  [:title :index |
  indent timesRepeat: [aStream tab].
  aStream nextPutAll: title;
  nextPut: $:;
  space;
  tab;
  nextPutAll:
  ((self instVarAt: index) printStringLimitedTo: (sizeLimit -3 -title size max: 1));
  cr]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-laza.428.mcz

Levente Uzonyi-2
On Mon, 22 Mar 2010, [hidden email] wrote:

> Alexander Lazarević uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-laza.428.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-laza.428
> Author: laza
> Time: 22 March 2010, 11:47:56.242 am
> UUID: 5b1e683b-2d8c-4f21-b877-30e2426f1491
> Ancestors: Kernel-ul.427
>
> Order instance variables alphabetically
>
> =============== Diff against Kernel-ul.427 ===============
>
> Item was changed:
>  ----- Method: Object>>longPrintOn:limitedTo:indent: (in category 'printing') -----
>  longPrintOn: aStream limitedTo: sizeLimit indent: indent
>   "Append to the argument, aStream, the names and values of all of the receiver's instance variables.  Limit is the length limit for each inst var."
>
> + self class allInstVarNames asSortedArray doWithIndex:
> - self class allInstVarNames doWithIndex:
>   [:title :index |
>   indent timesRepeat: [aStream tab].
>   aStream nextPutAll: title;
>   nextPut: $:;
>   space;
>   tab;
>   nextPutAll:
>   ((self instVarAt: index) printStringLimitedTo: (sizeLimit -3 -title size max: 1));
>   cr]!

This won't work, because only the names are changed the indices are the
same, so #instVarAt: will give the wrong value. Also #asSortedArray should
be deprecated IMHO.


Levente

>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-laza.428.mcz

laza
Just stepped into it. Thanks

On Mon, Mar 22, 2010 at 11:57, Levente Uzonyi <[hidden email]> wrote:
On Mon, 22 Mar 2010, [hidden email] wrote:

Alexander Lazarevi&#263; uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-laza.428.mcz

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

Name: Kernel-laza.428
Author: laza
Time: 22 March 2010, 11:47:56.242 am
UUID: 5b1e683b-2d8c-4f21-b877-30e2426f1491
Ancestors: Kernel-ul.427

Order instance variables alphabetically

=============== Diff against Kernel-ul.427 ===============

Item was changed:
 ----- Method: Object>>longPrintOn:limitedTo:indent: (in category 'printing') -----
 longPrintOn: aStream limitedTo: sizeLimit indent: indent
       "Append to the argument, aStream, the names and values of all of the receiver's instance variables.  Limit is the length limit for each inst var."

+       self class allInstVarNames asSortedArray doWithIndex:
-       self class allInstVarNames doWithIndex:
               [:title :index |
               indent timesRepeat: [aStream tab].
               aStream nextPutAll: title;
                nextPut: $:;
                space;
                tab;
                nextPutAll:
                       ((self instVarAt: index) printStringLimitedTo: (sizeLimit -3 -title size max: 1));
                cr]!

This won't work, because only the names are changed the indices are the same, so #instVarAt: will give the wrong value. Also #asSortedArray should be deprecated IMHO.


Levente








Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-laza.428.mcz

Bert Freudenberg
In reply to this post by Levente Uzonyi-2
On 22.03.2010, at 11:57, Levente Uzonyi wrote:

>
> On Mon, 22 Mar 2010, [hidden email] wrote:
>
>> Alexander Lazarevi&#263; uploaded a new version of Kernel to project The Trunk:
>> http://source.squeak.org/trunk/Kernel-laza.428.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-laza.428
>> Author: laza
>> Time: 22 March 2010, 11:47:56.242 am
>> UUID: 5b1e683b-2d8c-4f21-b877-30e2426f1491
>> Ancestors: Kernel-ul.427
>>
>> Order instance variables alphabetically
>>
>> =============== Diff against Kernel-ul.427 ===============
>>
>> Item was changed:
>> ----- Method: Object>>longPrintOn:limitedTo:indent: (in category 'printing') -----
>> longPrintOn: aStream limitedTo: sizeLimit indent: indent
>> "Append to the argument, aStream, the names and values of all of the receiver's instance variables.  Limit is the length limit for each inst var."
>>
>> + self class allInstVarNames asSortedArray doWithIndex:
>> - self class allInstVarNames doWithIndex:
>> [:title :index |
>> indent timesRepeat: [aStream tab].
>> aStream nextPutAll: title;
>> nextPut: $:;
>> space;
>> tab;
>> nextPutAll:
>> ((self instVarAt: index) printStringLimitedTo: (sizeLimit -3 -title size max: 1));
>> cr]!
>
> This won't work, because only the names are changed the indices are the same, so #instVarAt: will give the wrong value. Also #asSortedArray should be deprecated IMHO.
>
>
> Levente

Also, instance variable order is significant so in a debug method I'd rather prefer to not see it changed - what's your reasoning here?

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-laza.428.mcz

laza
On Mon, Mar 22, 2010 at 12:17, Bert Freudenberg <[hidden email]> wrote:
Also, instance variable order is significant so in a debug method I'd rather prefer to not see it changed - what's your reasoning here?

Maybe I just can't see how it does help in a debugger to have the instance vars listed in the order they were defined. Usually I'm looking for names not slot indices? No?

(Truly wondering!)

Alex


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-laza.428.mcz

David T. Lewis
On Mon, Mar 22, 2010 at 12:55:55PM +0100, Alexander Lazarevi?? wrote:

> On Mon, Mar 22, 2010 at 12:17, Bert Freudenberg <[hidden email]>wrote:
>
> > Also, instance variable order is significant so in a debug method I'd
> > rather prefer to not see it changed - what's your reasoning here?
> >
>
> Maybe I just can't see how it does help in a debugger to have the instance
> vars listed in the order they were defined. Usually I'm looking for names
> not slot indices? No?
>
> (Truly wondering!)

Usually yes, but not always. See senders of #instVarAt:. If you were
debugging any of those methods, you would want to see the variables
listed in the correct order.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-laza.428.mcz

laza
So this is helpful in >1% of possible debugging sessions? Wouldn'tthe BasicInspector be sufficient for this?

Alex

On Mon, Mar 22, 2010 at 13:13, David T. Lewis <[hidden email]> wrote:
On Mon, Mar 22, 2010 at 12:55:55PM +0100, Alexander Lazarevi?? wrote:
> On Mon, Mar 22, 2010 at 12:17, Bert Freudenberg <[hidden email]>wrote:
>
> > Also, instance variable order is significant so in a debug method I'd
> > rather prefer to not see it changed - what's your reasoning here?
> >
>
> Maybe I just can't see how it does help in a debugger to have the instance
> vars listed in the order they were defined. Usually I'm looking for names
> not slot indices? No?
>
> (Truly wondering!)

Usually yes, but not always. See senders of #instVarAt:. If you were
debugging any of those methods, you would want to see the variables
listed in the correct order.

Dave





Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-laza.428.mcz

Bert Freudenberg
On 22.03.2010, at 15:42, Alexander Lazarević wrote:
> So this is helpful in >1% of possible debugging sessions? Wouldn'tthe BasicInspector be sufficient for this?
>
> Alex

I simply prefer to see objects as the author intended. Typically, instance variables are grouped by function. The order is not random.

I feel the same about source code - I want to see it as it was written, not what some pretty printer makes of it.

The way source code looks tells me something about the author. Same for instance variable order.

Besides, if you know the name of an instance variable, you can just press the initial letter to jump there. Improving that feature might be worthwhile ...

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-laza.428.mcz

laza
On Mon, Mar 22, 2010 at 16:06, Bert Freudenberg <[hidden email]> wrote:
On 22.03.2010, at 15:42, Alexander Lazarević wrote:
> So this is helpful in >1% of possible debugging sessions? Wouldn'tthe BasicInspector be sufficient for this?
>
> Alex

I simply prefer to see objects as the author intended. Typically, instance variables are grouped by function. The order is not random.

The order might not be random, but my perception is, that there is far less intention in the ordering.
 
I feel the same about source code - I want to see it as it was written, not what some pretty printer makes of it.

The way source code looks tells me something about the author. Same for instance variable order.

Well, in a debugging session I'd like to get the info about the state of objects as easily as possible, so that I can understand what is going on. _I_ am not trying to guess, if there is some intention in the ordering of instances vars and what the intention is, to quickly find the instance var I'm interested in.

But no biggie. There are surely other possibilities to get there and more pressing issues to solve.

Alex