[squeak-dev] [Tools] (Object >> #inspect) now returns the tool
instead of the object
Tobias Pape
Das.Linux at gmx.de
Tue May 19 16:55:58 UTC 2015
On 19.05.2015, at 18:21, Chris Muller <asqueaker at gmail.com> wrote:
> That logic is sound except from one POV: which is that #inspect and
> #explore are used as a debugging tools for _users_. For years, I've
> been able to simply put one word "inspect" in a strategic place in my
> application code to help me debug it. Now, I'm forced to add
> parentheses, cascades and, in some cases, even temp vars (!!) just to
> avoid getting a SystemWindow tangled up into my domain model.
>
> For you as a UI-framework developer, I can understand there might be
> case or two where you would want to debug SystemWindow stuff. But
> that is the 0.1% usage case. The 99.9% usage case is Squeak users are
> interacting with their own domain model and they want to use #inspect
> as a debugging tool.
>
> What do other Smalltalks return from #inspect? If you want to be
> consistent how about we be consistent with them?
>
That's compatibility and portability, not consistency.
Alas, we seldom have them all.
-t
> On Tue, May 19, 2015 at 3:50 AM, marcel.taeumel <Marcel.Taeumel at hpi.de> wrote:
>> Hi, there! :)
>>
>> I just want to mention and explain, why (Object >> #inspect) now returns the
>> tool window instead of the object as in 4.5.
>>
>> The Tools package adds several convenient methods to the base system:
>>
>> Object >> #explore
>> Object >> #inspect
>> Object >> #browse
>> Behavior >> #browse
>>
>> All but #inspect returned the created tool. So I went for consistency. But
>> in particular, those methods should return the tool because because
>> otherwise the programmer has no simple means to access the created
>> window/tool programmatically. Model and object are, however, always
>> accessible (via #model or just #self).
>>
>> So if you got code like this:
>>
>> self someObjects add: myObject inspect.
>>
>> Please change it to:
>>
>> self someObjects add: myObject inspect; yourself.
>>
>> Or even better to:
>>
>> myObject inspect.
>> self someObjects add: myObject.
>>
>> I think that it is good practice/style to use #yourself if you want to get
>> the receiver back in a chain of calls:
>>
>> self myMorphs add: (MyMorph new color: Color yellow; yourself).
>>
>> Best,
>> Marcel
>>
>>
>>
>> --
>> View this message in context: http://forum.world.st/Tools-Object-inspect-now-returns-the-tool-instead-of-the-object-tp4827263.html
>> Sent from the Squeak - Dev mailing list archive at Nabble.com.
More information about the Squeak-dev
mailing list
|