Nice idea.

On Wed, Jun 7, 2017 at 5:34 AM, Henrik Nergaard <draag...@outlook.com>
wrote:

> A simple way of having a "onlyMe" type is to throw another type of error
> and wrap the code execution with an #on:do: catching and resuming Halt.
>
> Here is an example:
>
> -----------------------------------------------
>
> | cls |
>
> cls := Halt subclass: #CustomHalt.
>
> cls class compile: 'onlyCustomHaltDuring: aBlock
>

This sending #class to a Class confused me for a bit.  I wonder if these
might be useful, just aliased to #class...
cls classSide compile: 'onlyCustomHaltDuring: aBlock
cls meta compile: 'onlyCustomHaltDuring: aBlock

cheers -ben


aBlock on: Halt - CustomHalt do: [ :ex | ex resume ]
> '.
>
> cls class compile: 'example
> self onlyCustomHaltDuring: [
> 0 crLog.
> Halt now.
> 1 crLog.
> Halt once.
> 2 crLog.
> CustomHalt now.
> 3 crLog.
> ]
> '.
>
> cls example
> -----------------------------------------------
>
>  Best regards,
>
> Henrik
> ------------------------------
> *Fra:* Pharo-dev <pharo-dev-boun...@lists.pharo.org> på vegne av Stephane
> Ducasse <stepharo.s...@gmail.com>
> *Sendt:* 5. juni 2017 20:57:43
> *Til:* Pharo Development List
> *Emne:* Re: [Pharo-dev] New and richer halt messages
>
> Could be but I like to have message too. Relying too much on tools is
> good but when suddently do not have tools because you are in a minimal
> kernel then having 3 extra messages should like a good win win situation.
>
> Stef
>
> On Mon, Jun 5, 2017 at 4:06 PM, Ben Coman <b...@openinworld.com> wrote:
> >
> >
> > On Mon, Jun 5, 2017 at 5:01 PM, Stephane Ducasse <
> stepharo.s...@gmail.com>
> > wrote:
> >>>
> >>> About
> >>> Halt only does not convey anything to me.
> >>> Halt onlyMe means clearly what is it
> >>
> >>
> >> To me it seems strange/awkward that code in one method will change
> global
> >> debugging state,
> >> and it would feel better via direct UI action to add a metalink (IIUC
> how
> >> that would work.)
> >> Plus also a global GUI tool to manage breakpoints/metalinks would be
> good.
> >>
> >> Yes but when you need you need it.
> >> Else what is the alternative:
> >> - remove all the halt during the execution.
> >> - execute yours
> >> - put back the halt if something wrong happens.
> >>
> >> or
> >> - create manually a global.
> >> - rewrite all your halt to depend on this global
> >> - turn on and off the global to get the desired effects...
> >
> >
> > or hypothetically something like...  right-click code and menu select
> "break
> > here, disable others"
> >
> > cheers -ben
> >
> >>
> >> Tedious, cumbersome and boring.
> >> We can do better.
> >>
> >>
> >>
> >>
> >>
> >> On Mon, Jun 5, 2017 at 4:09 AM, Ben Coman <b...@openinworld.com> wrote:
> >>>
> >>>
> >>>
> >>> On Mon, Jun 5, 2017 at 5:06 AM, Stephane Ducasse
> >>> <stepharo.s...@gmail.com> wrote:
> >>>>
> >>>> What we should consider is that well packaged methods can be in
> Object.
> >>>> The problem is when method in Object are used everywhere and that they
> >>>> have nothing to do there.
> >>>>
> >>>> About
> >>>> Halt only does not convey anything to me.
> >>>> Halt onlyMe means clearly what is it
> >>>
> >>>
> >>> To me it seems strange/awkward that code in one method will change
> global
> >>> debugging state,
> >>> and it would feel better via direct UI action to add a metalink (IIUC
> how
> >>> that would work.)
> >>> Plus also a global GUI tool to manage breakpoints/metalinks would be
> >>> good.
> >>>
> >>>
> >>>>
> >>>> For the
> >>>> Halt ifTest
> >>>> Halt ifNotTest
> >>>>
> >>>> Why not. But I would prefer to be really clear.
> >>>> I would prefer
> >>>>
> >>>> Halt ifInsideTest
> >>>> Halt ifOutsideTest
> >>>
> >>>
> >>> These sound good.
> >>> cheers -ben
> >>>
> >>>>
> >>>>
> >>>> Because we are not about a couple of characters.
> >>>>
> >>>> Stef
> >>>>
> >>>>
> >>>>
> >>>> On Sun, Jun 4, 2017 at 3:09 PM, Cyril Ferlicot D.
> >>>> <cyril.ferli...@gmail.com> wrote:
> >>>>>
> >>>>> Le 04/06/2017 à 11:40, Peter Uhnak a écrit :
> >>>>> > But then I wouldn't be able to write 1halt. :(
> >>>>> >
> >>>>> > Peter
> >>>>> >
> >>>>>
> >>>>> You can still add some startup script :)
> >>>>>
> >>>>> I have one compiling a "h" method in object calling halt to be able
> to
> >>>>> write "1h" :)
> >>>>>
> >>>>> --
> >>>>> Cyril Ferlicot
> >>>>> https://ferlicot.fr
> >>>>>
> >>>>> http://www.synectique.eu
> >>>>> 2 rue Jacques Prévert 01,
> >>>>> 59650 Villeneuve d'ascq France
> >>>>>
> >>>>
> >>>
> >>
> >
>
>

Reply via email to