[squeak-dev] Object>>printOn: refined.

Marcel Taeumel marcel.taeumel at hpi.de
Tue Jun 2 14:35:41 UTC 2020


>I think Object>>printOn: is fine as is. Please don't touch it. :)

Sorry, for the confusion. You are right. Especially since "super printOn: stream" is frequently used. 

I am talking about #defaultLabelForInspector. Trygve raised a very important concern.

Best,
Marcel
Am 02.06.2020 16:30:54 schrieb Tobias Pape <das.linux at gmx.de>:

> On 02.06.2020, at 15:09, Marcel Taeumel wrote:
>
> Hmm... one could add an increasing number, to be reset on system startup. "Hello sir! This is array number 12 you have there. I wonder how much arrays you will come across today?" :-D
>
> "No, sir. Yesterday's array number 12 is long gone."
>
I think Object>>printOn: is fine as is. Please don't touch it. :)

Best regards
-Tobias

> Best,
> Marcel
>> Am 02.06.2020 15:05:52 schrieb Tobias Pape :
>>
>>
>> > On 02.06.2020, at 14:49, Marcel Taeumel wrote:
>> >
>> > > Teaching user to think in these numbers is, IMHO, not the right direction.
>> >
>> > It is important to teach users about object identity somehow.
>>
>> Maybe, but if so, not by telling people that/how/.. objects map to numbers :)
>> -t
>>
>> >
>> > Best,
>> > Marcel
>> >> Am 02.06.2020 14:38:46 schrieb Tobias Pape :
>> >>
>> >> Hi
>> >>
>> >> > On 02.06.2020, at 14:10, Trygve Reenskaug wrote:
>> >> >
>> >> > I find it frustrating to open 3 inspectors on different objects, all of them titled 'aString' (or whatever),
>> >> > IMO, it is much better to open them on the 3 objects: [1234] aString, [3456] a String, [4567 a String.
>> >> > The numbers in square brackets stand for the objects oop, actually its identityHash. They can be a 7-digit numbers; much too long for my short-time memory to hold many of them. I therefore truncate the number to 4 digits, accepting that I may, in rare cases, get 2 objects with the same identifier.
>> >> >
>> >> > I'm running 'Squeak5.3'.
>> >> > Object>>printOn: aStream
>> >> > "Append to the argument, aStream, a sequence of characters that identifies the receiver."
>> >> > " The previous version identified the class, not the instance "
>> >> > " This new version identifies the instance with its oop. "
>> >> > " I arbitrarily truncate the oop to 4 digits to simplify reading. "
>> >> >
>> >> > | title |
>> >> > title := self class name.
>> >> > aStream
>> >> > nextPutAll: '[' , (self asOop printString truncateTo: 4) , ']' ;
>> >> > nextPutAll: (title first isVowel ifTrue: ['an '] ifFalse: ['a ']);
>> >> > nextPutAll: title
>> >>
>> >> I'd rather not increase any complexity in Object.
>> >> Besides, both oop and identityHash are too low-level for the average work-flow.
>> >> Teaching user to think in these numbers is, IMHO, not the right direction.
>> >>
>> >> -1.
>> >>
>> >> Best regards
>> >> -Tobias
>> >>
>> >>
>> >
>>
>>
>>
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200602/1fda6e25/attachment.html>


More information about the Squeak-dev mailing list