#1895: [DEPRECATED] difference between :load and :init Sub flags
-------------------------+--------------------------------------------------
Reporter: plobsing | Owner: whiteknight
Type: deprecation | Status: assigned
Priority: normal | Milestone:
Component: imcc | Version: master
Severity: medium | Keywords: IMCC, Packfiles
Lang: | Patch:
Platform: all |
-------------------------+--------------------------------------------------
Comment(by whiteknight):
In the whiteknight/imcc_tag branch I have implemented a new PIR syntax
which could potentially be used to completely replace :load, :init, and
some other pragmata as well. It looks like this:
{{{
.sub 'foo' :tags("load", "init", "baz", "etc")
.end
}}}
You can provide any arbitrary string tags to a Sub. Then, if you have a
PackfileView PMC, you can get lists of subs by tag:
{{{
$P0 = load_bytecode "foo.pbc"
$P1 = $P0.'subs_by_flag'("load")
}}}
Notice that the load_bytecode_p_s opcode doesn't do any execution of Subs
automatically, unlike load_bytecode_s. This gives the user the ability to
tag subs however they want, get them whenever, and execute them at any
time. I think we are going to close this ticket, work on the new :tag
syntax, and eventually deprecate :load and :init flags in favor of this
new, more flexible alternative.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1895#comment:6>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets