Patrick R. Michaud wrote:
On Tue, Oct 25, 2005 at 01:53:52PM +0200, Leopold Toetsch wrote:

The C<newsub> opcode will be removed RSN.

Please read docs/compiler_faq.pod for replacing C<newsub>.


How do I get an anonymous coroutine into a register?

PGE currently does something similar to the following:

As these 2 .subs are generated in one bunch and compiled ...

    .sub _pge_rule
        .param pmc mob

... drop the var decl:

        .local pmc corou

        newsub corou, .Coroutine, _pge_rule_coroutine

and use a .Sub constant (.Sub is ok despite the PMC is a Coroutine).

          .const .Sub corou = "_pge_rule_coroutine"

The coroutine label is resolved at compile-time.

        setattribute mob, "PGE::Match\x0&:corou", corou
        ...
    .end

    .sub _pge_rule_coroutine

    .sub _pge_rule_coroutine :anon

Pm

leo

Reply via email to