Squeak 6 kernel changes, ContextPart+MethodContext -> Context

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

Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Eliot Miranda-2
Hi All,

    another change planned for Squeak 6 is eliminating ContextPart & MethodContext in favor of Context.  In reviewing the (very few) changes necessary I came across the following:

MethodContext>>printString
"Answer an emphasized string in case of a breakpoint method"

^(self method notNil and: [self method hasBreakpoint])
ifTrue:[(super printString , ' [break]') asText allBold]
ifFalse:[super printString] 

Seriously?  I don't object to modifying [Method]Conext>>printOn: to include [break] but having printString answer a text seems completely broken to me, and overriding printString is a hack; printOn: being the operative method for producing self-descriptions.  Should we nuke it and add [break] to printOn:? Or...?

_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Hannes Hirzel
Hi Eliot

Good catch.

As the method name #printString says it should return a string.

But

     (super printString , ' [break]') asText allBold

returns an instance of the class Text which is wrong in this context.

What about just

    super printString , ' [break]')

?


--Hannes


BTW the method has been there since 2007....

On 3/29/17, Eliot Miranda <[hidden email]> wrote:

> Hi All,
>
>     another change planned for Squeak 6 is eliminating ContextPart &
> MethodContext in favor of Context.  In reviewing the (very few) changes
> necessary I came across the following:
>
> MethodContext>>printString
> "Answer an emphasized string in case of a breakpoint method"
>
> ^(self method notNil and: [self method hasBreakpoint])
> ifTrue:[(super printString , ' [break]') asText allBold]
> ifFalse:[super printString]
>
> Seriously?  I don't object to modifying [Method]Conext>>printOn: to include
> [break] but having printString answer a text seems completely broken to me,
> and overriding printString is a hack; printOn: being the operative method
> for producing self-descriptions.  Should we nuke it and add [break] to
> printOn:? Or...?
>
> _,,,^..^,,,_
> best, Eliot
>

Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Levente Uzonyi
In reply to this post by Eliot Miranda-2
On Wed, 29 Mar 2017, Eliot Miranda wrote:

> Hi All,
>     another change planned for Squeak 6 is eliminating ContextPart & MethodContext in favor of Context.  In reviewing the (very few) changes
> necessary I came across the following:
>
> MethodContext>>printString
> "Answer an emphasized string in case of a breakpoint method"
>
> ^(self method notNil and: [self method hasBreakpoint])
> ifTrue:[(super printString , ' [break]') asText allBold]
> ifFalse:[super printString] 
>
> Seriously?  I don't object to modifying [Method]Conext>>printOn: to include [break] but having printString answer a text seems completely broken
> to me, and overriding printString is a hack; printOn: being the operative method for producing self-descriptions.  Should we nuke it and add
> [break] to printOn:? Or...?
Nuke it. AFAIK breakpoints never worked.

Levente

>
> _,,,^..^,,,_
> best, Eliot
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Tobias Pape

> On 29.03.2017, at 23:16, Levente Uzonyi <[hidden email]> wrote:
>
> On Wed, 29 Mar 2017, Eliot Miranda wrote:
>
>> Hi All,
>>    another change planned for Squeak 6 is eliminating ContextPart & MethodContext in favor of Context.  In reviewing the (very few) changes
>> necessary I came across the following:
>> MethodContext>>printString
>> "Answer an emphasized string in case of a breakpoint method"
>> ^(self method notNil and: [self method hasBreakpoint])
>> ifTrue:[(super printString , ' [break]') asText allBold]
>> ifFalse:[super printString]
>> Seriously?  I don't object to modifying [Method]Conext>>printOn: to include [break] but having printString answer a text seems completely broken
>> to me, and overriding printString is a hack; printOn: being the operative method for producing self-descriptions.  Should we nuke it and add
>> [break] to printOn:? Or...?
>
> Nuke it. AFAIK breakpoints never worked.

which?

>
> Levente
>
>> _,,,^..^,,,_
>> best, Eliot
>


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Levente Uzonyi
The one which allows you to break at any instruction. There is "toggle
break on entry", which does nothing but recompile your method with `self
break` at the start. I find that feature hardly useful.

Levente

On Wed, 29 Mar 2017, Tobias Pape wrote:

>
>> On 29.03.2017, at 23:16, Levente Uzonyi <[hidden email]> wrote:
>>
>> On Wed, 29 Mar 2017, Eliot Miranda wrote:
>>
>>> Hi All,
>>>    another change planned for Squeak 6 is eliminating ContextPart & MethodContext in favor of Context.  In reviewing the (very few) changes
>>> necessary I came across the following:
>>> MethodContext>>printString
>>> "Answer an emphasized string in case of a breakpoint method"
>>> ^(self method notNil and: [self method hasBreakpoint])
>>> ifTrue:[(super printString , ' [break]') asText allBold]
>>> ifFalse:[super printString]
>>> Seriously?  I don't object to modifying [Method]Conext>>printOn: to include [break] but having printString answer a text seems completely broken
>>> to me, and overriding printString is a hack; printOn: being the operative method for producing self-descriptions.  Should we nuke it and add
>>> [break] to printOn:? Or...?
>>
>> Nuke it. AFAIK breakpoints never worked.
>
> which?
>
>>
>> Levente
>>
>>> _,,,^..^,,,_
>>> best, Eliot
>>

Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Tobias Pape

> On 29.03.2017, at 23:43, Levente Uzonyi <[hidden email]> wrote:
>
> The one which allows you to break at any instruction. There is "toggle break on entry", which does nothing but recompile your method with `self break` at the start. I find that feature hardly useful.
>

Well, there's WrappedBreakpoint, which can do that without recompiling…

> Levente
>
> On Wed, 29 Mar 2017, Tobias Pape wrote:
>
>>
>>> On 29.03.2017, at 23:16, Levente Uzonyi <[hidden email]> wrote:
>>> On Wed, 29 Mar 2017, Eliot Miranda wrote:
>>>> Hi All,
>>>>   another change planned for Squeak 6 is eliminating ContextPart & MethodContext in favor of Context.  In reviewing the (very few) changes
>>>> necessary I came across the following:
>>>> MethodContext>>printString
>>>> "Answer an emphasized string in case of a breakpoint method"
>>>> ^(self method notNil and: [self method hasBreakpoint])
>>>> ifTrue:[(super printString , ' [break]') asText allBold]
>>>> ifFalse:[super printString] Seriously?  I don't object to modifying [Method]Conext>>printOn: to include [break] but having printString answer a text seems completely broken
>>>> to me, and overriding printString is a hack; printOn: being the operative method for producing self-descriptions.  Should we nuke it and add
>>>> [break] to printOn:? Or...?
>>> Nuke it. AFAIK breakpoints never worked.
>>
>> which?
>>
>>> Levente
>>>> _,,,^..^,,,_
>>>> best, Eliot
>>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Levente Uzonyi
Inserting `self half` is still superior.

Levente

On Wed, 29 Mar 2017, Tobias Pape wrote:

>
>> On 29.03.2017, at 23:43, Levente Uzonyi <[hidden email]> wrote:
>>
>> The one which allows you to break at any instruction. There is "toggle break on entry", which does nothing but recompile your method with `self break` at the start. I find that feature hardly useful.
>>
>
> Well, there's WrappedBreakpoint, which can do that without recompiling…
>
>> Levente
>>
>> On Wed, 29 Mar 2017, Tobias Pape wrote:
>>
>>>
>>>> On 29.03.2017, at 23:16, Levente Uzonyi <[hidden email]> wrote:
>>>> On Wed, 29 Mar 2017, Eliot Miranda wrote:
>>>>> Hi All,
>>>>>   another change planned for Squeak 6 is eliminating ContextPart & MethodContext in favor of Context.  In reviewing the (very few) changes
>>>>> necessary I came across the following:
>>>>> MethodContext>>printString
>>>>> "Answer an emphasized string in case of a breakpoint method"
>>>>> ^(self method notNil and: [self method hasBreakpoint])
>>>>> ifTrue:[(super printString , ' [break]') asText allBold]
>>>>> ifFalse:[super printString] Seriously?  I don't object to modifying [Method]Conext>>printOn: to include [break] but having printString answer a text seems completely broken
>>>>> to me, and overriding printString is a hack; printOn: being the operative method for producing self-descriptions.  Should we nuke it and add
>>>>> [break] to printOn:? Or...?
>>>> Nuke it. AFAIK breakpoints never worked.
>>>
>>> which?
>>>
>>>> Levente
>>>>> _,,,^..^,,,_
>>>>> best, Eliot
>>>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Tobias Pape

> On 29.03.2017, at 23:56, Levente Uzonyi <[hidden email]> wrote:
>
> Inserting `self half` is still superior.

If i want to half myself, sure ;)

Well, I'd say, it depends. If I'm just exploring the system and dont want to change it, I typically use break on enty.

>
> Levente
>
> On Wed, 29 Mar 2017, Tobias Pape wrote:
>
>>
>>> On 29.03.2017, at 23:43, Levente Uzonyi <[hidden email]> wrote:
>>> The one which allows you to break at any instruction. There is "toggle break on entry", which does nothing but recompile your method with `self break` at the start. I find that feature hardly useful.
>>
>> Well, there's WrappedBreakpoint, which can do that without recompiling…
>>
>>> Levente
>>> On Wed, 29 Mar 2017, Tobias Pape wrote:
>>>>> On 29.03.2017, at 23:16, Levente Uzonyi <[hidden email]> wrote:
>>>>> On Wed, 29 Mar 2017, Eliot Miranda wrote:
>>>>>> Hi All,
>>>>>>  another change planned for Squeak 6 is eliminating ContextPart & MethodContext in favor of Context.  In reviewing the (very few) changes
>>>>>> necessary I came across the following:
>>>>>> MethodContext>>printString
>>>>>> "Answer an emphasized string in case of a breakpoint method"
>>>>>> ^(self method notNil and: [self method hasBreakpoint])
>>>>>> ifTrue:[(super printString , ' [break]') asText allBold]
>>>>>> ifFalse:[super printString] Seriously?  I don't object to modifying [Method]Conext>>printOn: to include [break] but having printString answer a text seems completely broken
>>>>>> to me, and overriding printString is a hack; printOn: being the operative method for producing self-descriptions.  Should we nuke it and add
>>>>>> [break] to printOn:? Or...?
>>>>> Nuke it. AFAIK breakpoints never worked.
>>>> which?
>>>>> Levente
>>>>>> _,,,^..^,,,_
>>>>>> best, Eliot
>


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Bert Freudenberg
On Thu, Mar 30, 2017 at 12:01 AM, Tobias Pape <[hidden email]> wrote:

> On 29.03.2017, at 23:56, Levente Uzonyi <[hidden email]> wrote:
>
> Inserting `self half` is still superior.

If i want to half myself, sure ;)

Well, I'd say, it depends. If I'm just exploring the system and dont want to change it, I typically use break on enty.

I'd like to have proper breakpoints that are as convenient as "self halt" but don't modify the method source.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Tobias Pape

> On 31.03.2017, at 15:46, Bert Freudenberg <[hidden email]> wrote:
>
> On Thu, Mar 30, 2017 at 12:01 AM, Tobias Pape <[hidden email]> wrote:
>
> > On 29.03.2017, at 23:56, Levente Uzonyi <[hidden email]> wrote:
> >
> > Inserting `self half` is still superior.
>
> If i want to half myself, sure ;)
>
> Well, I'd say, it depends. If I'm just exploring the system and dont want to change it, I typically use break on enty.
>
> I'd like to have proper breakpoints that are as convenient as "self halt" but don't modify the method source.
>

WrappedBreakpoint works for that if you just need the entry, tho
> - Bert -
>


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Jakob Reschke-2
In reply to this post by Tobias Pape
I use break on entry often because I do not like the method versions being cluttered with "halt versions".

Unfortunately the #breaks are slipping in anyway, when I then edit the code in the debugger and forget about the break. :-(

A confirmation dialog would be nice if a wrapped method is saved and the break is still in the source.

Am 31.03.2017 15:47 schrieb "Bert Freudenberg" <[hidden email]>:
On Thu, Mar 30, 2017 at 12:01 AM, Tobias Pape <[hidden email]> wrote:

> On 29.03.2017, at 23:56, Levente Uzonyi <[hidden email]> wrote:
>
> Inserting `self half` is still superior.

If i want to half myself, sure ;)

Well, I'd say, it depends. If I'm just exploring the system and dont want to change it, I typically use break on enty.

I'd like to have proper breakpoints that are as convenient as "self halt" but don't modify the method source.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: Squeak 6 kernel changes, ContextPart+MethodContext -> Context

Tobias Pape

> On 03.04.2017, at 20:09, Jakob Reschke <[hidden email]> wrote:
>
> I use break on entry often because I do not like the method versions being cluttered with "halt versions".
>
> Unfortunately the #breaks are slipping in anyway, when I then edit the code in the debugger and forget about the break. :-(

I think wrapped breakpoints would help here, too

>
> A confirmation dialog would be nice if a wrapped method is saved and the break is still in the source.
>
> Am 31.03.2017 15:47 schrieb "Bert Freudenberg" <[hidden email]>:
> On Thu, Mar 30, 2017 at 12:01 AM, Tobias Pape <[hidden email]> wrote:
>
>> On 29.03.2017, at 23:56, Levente Uzonyi <[hidden email]> wrote:
>>
>> Inserting `self half` is still superior.
>
> If i want to half myself, sure ;)
>
> Well, I'd say, it depends. If I'm just exploring the system and dont want to change it, I typically use break on enty.
>
> I'd like to have proper breakpoints that are as convenient as "self halt" but don't modify the method source.
>
> - Bert -
>