Created
July 11, 2010 12:46
-
-
Save masak/471521 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The below code represents `my $a = 3; while --$a { say my $b; say $a; $b = 42 }`. | |
$ cat example.sic | |
This is SIC v2010.08 | |
block 'B0': | |
`lexvar '$a' | |
$0 = 3 | |
store [0, 0], $0 | |
`label L0 | |
$1 = fetch [0, 0] | |
dec $1 | |
store [0, 0], $1 | |
jf $1, L1 | |
$2 = closure-from-block 'B1' | |
call $2 | |
jmp L0 | |
`label L1 | |
block 'B1': | |
`lexvar '$b' | |
$0 = fetch [0, 0] | |
say $0 | |
$1 = fetch [-1, 0] | |
say $1 | |
$2 = 42 | |
store [0, 0], $2 | |
$ perl6 new-runtime example.sic | |
Any() | |
2 | |
Any() | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment