#1138: Create a 'vivify' opcode
-----------------------------+----------------------------------------------
Reporter: Austin_Hastings | Type: todo
Status: new | Priority: normal
Milestone: | Component: core
Version: 1.7.0 | Severity: medium
Keywords: | Lang:
Patch: | Platform:
-----------------------------+----------------------------------------------
Comment(by pmichaud):
There's a slight flaw in my proposal above with using 'fetch' and 'vivify'
on lexicals -- a LexPad PMC only holds the lexicals for the current sub,
and not any of its outer subs. I can think of three easy-ish amendments
to the proposal that resolve this:
(1) Provide "fetch_lex" and "vivify_lex" forms of the opcodes for working
with lexicals.
(2) Create a PMC type that provides a hash interface for an entire
lexical scope (instead of just the current lexpad), and use that as the
argument to 'fetch' and 'vivify'.
(3) Have a special sentinel value for the aggregate parameter in 'fetch'
and 'vivify' that indicates lexical scopes are to be used:
.const PMC lexical = ...some sentinel...
$P0 = fetch lexical['$a'], default
Pm
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1138#comment:3>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets