The Trunk: Kernel-cmm.937.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Kernel-cmm.937.mcz

commits-2
Chris Muller uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-cmm.937.mcz

==================== Summary ====================

Name: Kernel-cmm.937
Author: cmm
Time: 5 August 2015, 8:06:28.072 pm
UUID: 191e34d9-22d7-4e46-ac5d-cb3cd9baf203
Ancestors: Kernel-cmm.936

- #hasBreakpoint is now needed by Kernel, but must be able to operate independently of System's BreakpointManager.

=============== Diff against Kernel-cmm.936 ===============

Item was changed:
+ ----- Method: CompiledMethod>>hasBreakpoint (in category '*Kernel-tool support') -----
- ----- Method: CompiledMethod>>hasBreakpoint (in category 'testing') -----
  hasBreakpoint
+ ^ self class environment
+ at: #BreakpointManager
+ ifPresent: [:bpm | bpm methodHasBreakpoint: self]
+ ifAbsent: [false]!
- ^false!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-cmm.937.mcz

Levente Uzonyi-2
I still think that we shouldn't use the Environments' Dictionary API in
new code. IMHO #classNamed: is the right selector to use here:

  (self class environment classNamed: #BreakpointManager) ifNotNil: [ :breakPointManager |
  ^breakPointManager methodHasBreakpoint: self ].
  ^false

Levente

On Thu, 6 Aug 2015, [hidden email] wrote:

> Chris Muller uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-cmm.937.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-cmm.937
> Author: cmm
> Time: 5 August 2015, 8:06:28.072 pm
> UUID: 191e34d9-22d7-4e46-ac5d-cb3cd9baf203
> Ancestors: Kernel-cmm.936
>
> - #hasBreakpoint is now needed by Kernel, but must be able to operate independently of System's BreakpointManager.
>
> =============== Diff against Kernel-cmm.936 ===============
>
> Item was changed:
> + ----- Method: CompiledMethod>>hasBreakpoint (in category '*Kernel-tool support') -----
> - ----- Method: CompiledMethod>>hasBreakpoint (in category 'testing') -----
>  hasBreakpoint
> + ^ self class environment
> + at: #BreakpointManager
> + ifPresent: [:bpm | bpm methodHasBreakpoint: self]
> + ifAbsent: [false]!
> - ^false!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-cmm.937.mcz

Tobias Pape

On 06.08.2015, at 18:29, Levente Uzonyi <[hidden email]> wrote:

> I still think that we shouldn't use the Environments' Dictionary API in new code. IMHO #classNamed: is the right selector to use here:
>
> (self class environment classNamed: #BreakpointManager) ifNotNil: [ :breakPointManager |
> ^breakPointManager methodHasBreakpoint: self ].
> ^false

Then again, nil checks aren't nice code, either…

Best regards
        -Tobias

>
> Levente
>
> On Thu, 6 Aug 2015, [hidden email] wrote:
>
>> Chris Muller uploaded a new version of Kernel to project The Trunk:
>> http://source.squeak.org/trunk/Kernel-cmm.937.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-cmm.937
>> Author: cmm
>> Time: 5 August 2015, 8:06:28.072 pm
>> UUID: 191e34d9-22d7-4e46-ac5d-cb3cd9baf203
>> Ancestors: Kernel-cmm.936
>>
>> - #hasBreakpoint is now needed by Kernel, but must be able to operate independently of System's BreakpointManager.
>>
>> =============== Diff against Kernel-cmm.936 ===============
>>
>> Item was changed:
>> + ----- Method: CompiledMethod>>hasBreakpoint (in category '*Kernel-tool support') -----
>> - ----- Method: CompiledMethod>>hasBreakpoint (in category 'testing') -----
>> hasBreakpoint
>> + ^ self class environment
>> + at: #BreakpointManager
>> + ifPresent: [:bpm | bpm methodHasBreakpoint: self]
>> + ifAbsent: [false]!
>> - ^false!



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-cmm.937.mcz

Levente Uzonyi-2
On Thu, 6 Aug 2015, Tobias Pape wrote:

>
> On 06.08.2015, at 18:29, Levente Uzonyi <[hidden email]> wrote:
>
>> I still think that we shouldn't use the Environments' Dictionary API in new code. IMHO #classNamed: is the right selector to use here:
>>
>> (self class environment classNamed: #BreakpointManager) ifNotNil: [ :breakPointManager |
>> ^breakPointManager methodHasBreakpoint: self ].
>> ^false
>
> Then again, nil checks aren't nice code, either…
I don't see any problem with it, because this is how the API works (and
was designed to work, so it's not just an accident). It returns nil when
the requested class doesn't exist.

Levente

>
> Best regards
> -Tobias
>
>>
>> Levente
>>
>> On Thu, 6 Aug 2015, [hidden email] wrote:
>>
>>> Chris Muller uploaded a new version of Kernel to project The Trunk:
>>> http://source.squeak.org/trunk/Kernel-cmm.937.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: Kernel-cmm.937
>>> Author: cmm
>>> Time: 5 August 2015, 8:06:28.072 pm
>>> UUID: 191e34d9-22d7-4e46-ac5d-cb3cd9baf203
>>> Ancestors: Kernel-cmm.936
>>>
>>> - #hasBreakpoint is now needed by Kernel, but must be able to operate independently of System's BreakpointManager.
>>>
>>> =============== Diff against Kernel-cmm.936 ===============
>>>
>>> Item was changed:
>>> + ----- Method: CompiledMethod>>hasBreakpoint (in category '*Kernel-tool support') -----
>>> - ----- Method: CompiledMethod>>hasBreakpoint (in category 'testing') -----
>>> hasBreakpoint
>>> + ^ self class environment
>>> + at: #BreakpointManager
>>> + ifPresent: [:bpm | bpm methodHasBreakpoint: self]
>>> + ifAbsent: [false]!
>>> - ^false!
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-cmm.937.mcz

Tobias Pape

On 06.08.2015, at 19:13, Levente Uzonyi <[hidden email]> wrote:

> On Thu, 6 Aug 2015, Tobias Pape wrote:
>
>>
>> On 06.08.2015, at 18:29, Levente Uzonyi <[hidden email]> wrote:
>>
>>> I still think that we shouldn't use the Environments' Dictionary API in new code. IMHO #classNamed: is the right selector to use here:
>>>
>>> (self class environment classNamed: #BreakpointManager) ifNotNil: [ :breakPointManager |
>>> ^breakPointManager methodHasBreakpoint: self ].
>>> ^false
>>
>> Then again, nil checks aren't nice code, either…
>
> I don't see any problem with it, because this is how the API works (and was designed to work, so it's not just an accident). It returns nil when the requested class doesn't exist.
>

For me the conveyed meaning is: 'The class named #BreakpointManager is nil'.
But then again, I don't really like nil-ful interfaces generally. But that's just my 2ct.

I'd just say that the Dictionary interface on Environments it not worse that its nil-ful
interface.

Best
        -Tobias

> Levente
>
>>
>> Best regards
>> -Tobias
>>
>>>
>>> Levente
>>>
>>> On Thu, 6 Aug 2015, [hidden email] wrote:
>>>
>>>> Chris Muller uploaded a new version of Kernel to project The Trunk:
>>>> http://source.squeak.org/trunk/Kernel-cmm.937.mcz
>>>>
>>>> ==================== Summary ====================
>>>>
>>>> Name: Kernel-cmm.937
>>>> Author: cmm
>>>> Time: 5 August 2015, 8:06:28.072 pm
>>>> UUID: 191e34d9-22d7-4e46-ac5d-cb3cd9baf203
>>>> Ancestors: Kernel-cmm.936
>>>>
>>>> - #hasBreakpoint is now needed by Kernel, but must be able to operate independently of System's BreakpointManager.
>>>>
>>>> =============== Diff against Kernel-cmm.936 ===============
>>>>
>>>> Item was changed:
>>>> + ----- Method: CompiledMethod>>hasBreakpoint (in category '*Kernel-tool support') -----
>>>> - ----- Method: CompiledMethod>>hasBreakpoint (in category 'testing') -----
>>>> hasBreakpoint
>>>> + ^ self class environment
>>>> + at: #BreakpointManager
>>>> + ifPresent: [:bpm | bpm methodHasBreakpoint: self]
>>>> + ifAbsent: [false]!
>>>> - ^false!



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-cmm.937.mcz

Eliot Miranda-2
Hi All,

Sent from my iPhone

> On Aug 6, 2015, at 10:42 AM, Tobias Pape <[hidden email]> wrote:
>
>
>> On 06.08.2015, at 19:13, Levente Uzonyi <[hidden email]> wrote:
>>
>>> On Thu, 6 Aug 2015, Tobias Pape wrote:
>>>
>>>
>>>> On 06.08.2015, at 18:29, Levente Uzonyi <[hidden email]> wrote:
>>>>
>>>> I still think that we shouldn't use the Environments' Dictionary API in new code. IMHO #classNamed: is the right selector to use here:
>>>>
>>>>    (self class environment classNamed: #BreakpointManager) ifNotNil: [ :breakPointManager |
>>>>        ^breakPointManager methodHasBreakpoint: self ].
>>>>    ^false
>>>
>>> Then again, nil checks aren't nice code, either…
>>
>> I don't see any problem with it, because this is how the API works (and was designed to work, so it's not just an accident). It returns nil when the requested class doesn't exist.
>>
>
> For me the conveyed meaning is: 'The class named #BreakpointManager is nil'.
> But then again, I don't really like nil-ful interfaces generally. But that's just my 2ct.
>
> I'd just say that the Dictionary interface on Environments it not worse that its nil-ful
> interface.
>
> Best
>    -Tobias
>
>> Levente
>>
>>>
>>> Best regards
>>>    -Tobias
>>>
>>>>
>>>> Levente
>>>>
>>>>> On Thu, 6 Aug 2015, [hidden email] wrote:
>>>>>
>>>>> Chris Muller uploaded a new version of Kernel to project The Trunk:
>>>>> http://source.squeak.org/trunk/Kernel-cmm.937.mcz
>>>>>
>>>>> ==================== Summary ====================
>>>>>
>>>>> Name: Kernel-cmm.937
>>>>> Author: cmm
>>>>> Time: 5 August 2015, 8:06:28.072 pm
>>>>> UUID: 191e34d9-22d7-4e46-ac5d-cb3cd9baf203
>>>>> Ancestors: Kernel-cmm.936
>>>>>
>>>>> - #hasBreakpoint is now needed by Kernel, but must be able to operate independently of System's BreakpointManager.

Why is BreakpointManager needed by Kernel?  I went to some effort to make the reference to BreakpointManager an override in System and Kernel's version of hasBreakpoint as ^false.  Isn't this better than that horrible self class environment at: #BreakpointManager screed?


>>>>>
>>>>> =============== Diff against Kernel-cmm.936 ===============
>>>>>
>>>>> Item was changed:
>>>>> + ----- Method: CompiledMethod>>hasBreakpoint (in category '*Kernel-tool support') -----
>>>>> - ----- Method: CompiledMethod>>hasBreakpoint (in category 'testing') -----
>>>>> hasBreakpoint
>>>>> +    ^ self class environment
>>>>> +        at: #BreakpointManager
>>>>> +        ifPresent: [:bpm | bpm methodHasBreakpoint: self]
>>>>> +        ifAbsent: [false]!
>>>>> -    ^false!
>
>
>