Changes between Version 7 and Version 8 of Ticket #173

Show
Ignore:
Timestamp:
11/28/10 16:22:06 (11 years ago)
Author:
pmichaud
Comment:

Note that the original code is missing a "capture_lex" instruction required for lexical capture. Correct code should be:

$ cat lex.pir
.sub main
    .const 'Sub' foosub = 'foo'
    capture_lex foosub
    .lex "x", $P0
    $P0 = new "Integer"
    $P0 = 42
    foo()
.end

.sub foo :outer("main")
    $P0 = find_lex "x"
    say $P0
.end
$ ./parrot lex.pir
42
$ ./parrot -o lex.pbc lex.pir
$ ./parrot lex.pbc
42
$ 

Pm

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #173 – description

    v7 v8  
    1  
    21lexicals can't be found in nested .subs. 
    32the following works in parrot, but the generated bytecode doesn't seem to work: