Skip to content

Instantly share code, notes, and snippets.

Created May 17, 2012 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2722178 to your computer and use it in GitHub Desktop.
Save anonymous/2722178 to your computer and use it in GitHub Desktop.
.sub main :main
.local pmc pirC
pirC = compreg 'PIR'
.local string code
code = <<"END_CODE"
.sub bar
say "hi"
.end
END_CODE
.local pmc compiled
compiled = pirC(code)
.local pmc sub
sub = compiled[0] # just want the first executable sub here.
sub() # works
$S0 = freeze sub
say "frozen"
$P2 = thaw $S0
say "thawed"
$P2()
.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment