[squeak-dev] Inspector "Copy name"

K K Subbu kksubbu.ml at gmail.com
Tue Dec 17 12:32:13 UTC 2019


Marcel,

When I tried

Class allSubInstances inspect. "try copyname on index 2 in the inspector"

I got a subscript out of bounds error in line 10. This happens because:

aClass isVariable. "false"

aClass is OrderedCollection, so why would this check fail?

Also, copyName just copies the name referencing an instance variable to 
clipboard. Why check if this is scalar or a collection? E.g. If I select 
"submorphs" and do a copyName, I expect to be able to paste "submorphs" 
not "submorphs at: 1".

Regards .. Subbu

On 17/12/19 4:44 PM, Marcel Taeumel wrote:
> Looks like that #copyName works similar to #storeOn:? There are 10 
> implementors of #copyName to learn from.
> 
> I would rather not remove that feature. Instead, extract it to 
> CollectionInspector to avoid that #isKindOf: check.
> 
> Best,
> Marcel
>>
>> Am 16.12.2019 19:55:33 schrieb Thiede, Christoph 
>> <christoph.thiede at student.hpi.uni-potsdam.de>:
>>
>> Hi all,
>>
>>
>> as you might know, I'm currently refactoring the inspectors (@Chris - 
>> the idea with InspectorFieldSpec was fabulous, it improves the overall 
>> design a lot!). One short question regarding the menu action "Copy name":
>>
>>
>>
>>
>> As you can see in the screenshot, the current implementation has a 
>> weird edge case:
>>
>>
>> sel := ...
>>
>> *(self selection isKindOf: Collection)
>> *
>>
>> *ifTrue: [sel := '(' , sel , ' at: 1)'].*
>> ^ sel
>>
>>
>> I cannot see any sense in it. In my eyes, it's just confusing. Can I 
>> remove that edge case?
>>
>>
>> Best,
>>
>> Christoph
>>
> 
> 



More information about the Squeak-dev mailing list