Skip to content

Instantly share code, notes, and snippets.

@ruoso
Created May 16, 2009 18:36
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 ruoso/112766 to your computer and use it in GitHub Desktop.
Save ruoso/112766 to your computer and use it in GitHub Desktop.
my $capture;
my $back;
my $interpreter;
my $name = $capture."positional"(1);
my $invocant = $capture."positional"(0);
my $exists = $invocant."exists"($name);
my $void;
my $ret;
if $exists {goto than} else {goto else};
than:
$ret = $invocant."postcircumfix:{ }"($name);
$void = $back."setr"($ret);
$void = $interpreter."goto"($back);
else:
my $outer = $invocant."outer"();
my $outer_true = $outer."true"();
my $outer_cell = $outer."FETCH"();
if $outer_true {goto than2} else {goto else2};
than2:
$ret = $outer_cell."lookup"($name);
$void = $back."setr"($ret);
$void = $interpreter."goto"($back);
else2:
$void = $invocant."lookup_fail"($name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment