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

karl ramberg karlramberg at gmail.com
Fri Jun 5 12:41:33 UTC 2020


Hi,

What am I missing here  ?
All morphs already show their hash.

Morph new printString 'a Morph(3577889)'
Object new printString 'an Object'


Morph>>printOn: aStream
| aName |
super printOn: aStream.
(aName := self knownName) notNil
ifTrue: [aStream nextPutAll: '<' , aName , '>'].
aStream nextPutAll: '('.
aStream
print: self identityHash;
nextPutAll: ')'

On Fri, Jun 5, 2020 at 1:55 PM Thiede, Christoph <
Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:

> Preference would be better than enforcing this change, IMO.
> <http://www.hpi.de/>
>
> > It may also be sufficient to show the first N digits of the hash.
>
> Hm, how "unique" would that be? That could be confusing if you are
> inspecting two different objects that have similar hashes.
>
> Just another idea (but this one would probably rather belong into a new
> tool): By sending an universal message such as #flash to an object, all
> open inspectors/explorers could visually signalize that they are referring
> to this particular instance. Maybe this message could be sent also
> automatically whenever you focus an inspector as well ... Similar to that
> feature you know from many editors to highlight all occurrences of the
> selected token, just with windows:
>
> Best,
> Christoph
> ------------------------------
> *Von:* Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im
> Auftrag von Fabio Niephaus <lists at fniephaus.com>
> *Gesendet:* Freitag, 5. Juni 2020 13:48:18
> *An:* The general-purpose Squeak developers list
> *Betreff:* Re: [squeak-dev] Object>>printOn: refined.
>
>
>
> On Fri, 5 Jun 2020 at 1:45 pm, Thiede, Christoph <
> Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
>
>> Hi all,
>>
>>
>> personally, I am not convinced by displaying the identityHash in each and
>> every inspector window title as shown in Trygve's screenshot. They just
>> make the overall inspector experience a lot more cryptical, compared to a
>> rather small benefit. Also, in my image #asOop returns seven-digit numbers
>> which would cost too much space in the title bars. I think identity
>> comparison is only actually redundant in certain domains or situations,
>> most time you will only open a few inspectors at all.
>>
>>
>> Isn't there any possibility to show these IDs only on demand? Or can we
>> find a better way to visualize identity than numbers? Maybe a small
>> individual pixel pattern, or shorter IDs that are only unique amongst the
>> class of the inspected object?
>>
> Make it a preference? It may also be sufficient to show the first N digits
> of the hash. Could be just one preference: "Number of hash digits shown in
> inspectors".
>
> Fabio
>
>>
>> Also, please note that having the #reuseWindows preference enabled, this
>> hash is redundant at all because it is not possible to inspect the same
>> object twice.
>>
>>
>> Best,
>>
>> Christoph
>> <http://www.hpi.de/>
>> ------------------------------
>> *Von:* Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im
>> Auftrag von Chris Muller <ma.chris.m at gmail.com>
>> *Gesendet:* Donnerstag, 4. Juni 2020 21:58:51
>> *An:* Taeumel, Marcel
>> *Cc:* squeak-dev
>> *Betreff:* Re: [squeak-dev] Object>>printOn: refined.
>>
>>
>>> > You +1'd the idea of sending #asOop from #printOn:.
>>>
>>> Nope. I +1'd the idea to be applied to #defaultLabelForInspector because
>>> of that "super" issue.
>>>
>>
>> Ah, I beg your pardon.  My mistake.
>>  - Chris
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200605/4fb92e4d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pastedImage.png
Type: image/png
Size: 1174 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200605/4fb92e4d/attachment.png>


More information about the Squeak-dev mailing list