[squeak-dev] Inspector "Copy name"

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Dec 17 11:40:32 UTC 2019


Hi Marcel,


I'm not sure whether I understand you correctly. The current documentation comment of Inspector >> #copyName says:


"Copy the name of the current variable, so the user can paste it into the window below and work with is. If collection, do (xxx at: 1)."
(emphasis mine)


I like the feature and would never ask to remove it - but my question is, why do we have this edge case?

>From the screenshot below, if you store 42 in the current selected field, copyName will give you: (self basicAt: 1).

But if you replace its content with '42' (a string) instead, copyName will give you: ((self basicAt: 2) at: 1).


I can't find any #copyName implementation that handles this edge case outside of the inspectors. What is this edge case for? How helps it "store" the value?


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Dienstag, 17. Dezember 2019 12:14:39
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] Inspector "Copy name"

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":


[cid:5e312cc2-b0cb-473f-b58c-a3a408c5dfc9]


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191217/a68e89bd/attachment.html>


More information about the Squeak-dev mailing list