public
Created

  • Download Gist
tardis_closure.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
my $c;
{
my $a = 42;
$c = { say $a };
}
 
$c()
 
#############################################
This is SIC v2010.11
 
block 'B0':
`var '$c'
$0 = closure-from-block 'B1'
call $0
$1 = fetch [0, 0]
call $1
 
block 'B1':
`var '$a'
$0 = 42
store [0, 0], $0
$1 = closure-from-block 'B2'
store [-1, 0], $1
 
block 'B2':
$0 = fetch [-1, 0]
say $0

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.