Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support for catch tags in slime
  • Loading branch information
alanruttenberg authored and easye committed Feb 27, 2022
1 parent 3c6092f commit fc29139
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/abcl-introspect/abcl-introspect.lisp
Expand Up @@ -378,6 +378,9 @@ above have used annotate local functions"
for symbol = (jss:get-java-field binding "symbol" t)
for value = (jss:get-java-field binding "value" t)
for special = (jss:get-java-field binding "specialp" t)
if (member symbol '(:catch))
collect `(,symbol ,value) into them
else
unless (find symbol them :key 'second)
collect (list (if special
:special-variable
Expand Down
1 change: 1 addition & 0 deletions src/org/armedbear/lisp/Keyword.java
Expand Up @@ -51,6 +51,7 @@ public final class Keyword
CAPITALIZE = internKeyword("CAPITALIZE"),
CAPITALIZE_FIRST = internKeyword("CAPITALIZE-FIRST"),
CASE = internKeyword("CASE"),
CATCH = internKeyword("CATCH"),
CAUSE = internKeyword("CAUSE"),
CHAR = internKeyword("CHAR"),
COMMON = internKeyword("COMMON"),
Expand Down
3 changes: 3 additions & 0 deletions src/org/armedbear/lisp/Primitives.java
Expand Up @@ -3805,7 +3805,9 @@ public LispObject execute(LispObject args, Environment env)
thread.pushCatchTag(tag);
LispObject body = args.cdr();
LispObject result = NIL;
Environment ext = new Environment(env,Keyword.CATCH,tag);
try {
thread.envStack.push(ext);
return progn(body, env, thread);
} catch (Throw t) {
if (t.tag == tag) {
Expand All @@ -3816,6 +3818,7 @@ public LispObject execute(LispObject args, Environment env)
throw ret;
}
finally {
while (thread.envStack.pop() != ext) {};
thread.popCatchTag();
}
}
Expand Down

0 comments on commit fc29139

Please sign in to comment.