Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:partcl/partcl-nqp
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Dec 9, 2009
2 parents 23c00b1 + b191a3f commit f1aa741
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Partcl/commands/main.pm
Expand Up @@ -33,7 +33,12 @@ INIT {
}


our sub catch($code, $varname?) {
our sub catch(*@args) {
if +@args <1 || +@args >2 {
error('wrong # args: should be "catch command ?varName?"');
}
my $code := @args[0];

my $retval := 0; # TCL_OK
my $result;
try {
Expand All @@ -57,9 +62,9 @@ our sub catch($code, $varname?) {
$result := $!<message>;
}
};
if $varname {
if +@args == 2 {
my $lexpad := pir::find_dynamic_lex__Ps('%LEXPAD');
$lexpad{$varname} := $result;
$lexpad{@args[1]} := $result;
}
return $retval;
}
Expand Down

0 comments on commit f1aa741

Please sign in to comment.