You can't actually wrap print that way, can you? Or rather, if that works
it wouldn't be specific to $*ERR.

On Thu, Oct 25, 2018 at 6:16 PM Brian Duggan <bdugg...@gmail.com> wrote:

> On Thursday, October 25, Richard Hainsworth wrote:
> > >&exit.wrap: -> $status { $exit-args = $status; fail }
> >
> > Is the call to 'fail' replicating the original action of &exit?
>
> No -- the call to fail is throwing an exception.  The idea
> is that the exception could then be caught in the test.
>
> > >&note.wrap: -> |c { $note-args = c; callsame; }
> > Does this mean that the next routine in a chain (in this case `exit note
> ...
> > `), so in fact `exit`, is called?
>
> No -- "callsame" is calling the original "note".
>
> > >$*ERR.^find_method('print').wrap: -> |c { True; }
> > This wrap I am not so clear about. Why is `^find_method('print') needed?
>
> Since callsame called note (above) note will still print
> to stderr -- if we want to intercept this, i.e. to not print
> to stderr, we can wrap the 'print' method of $*ERR.
>
> This is just one of doing it...maybe I did more wrapping than
> necessary :-)  And in any case, in a test suite, some of
> these wraps might have to be temporary. (so that they
> don't interfere with code in the test suite)
>
> Brian
>


-- 
brandon s allbery kf8nh
allber...@gmail.com

Reply via email to