diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-25 22:43:12 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-25 22:43:12 -0700 |
commit | ddebbad496cdd19c6249211c8f00861161496124 (patch) | |
tree | 5bfeb26754d537d1a7f28e3e4df93a2a8c4bcd80 | |
parent | 1adad3382e607bd91a47d6411d6f23095c4c7234 (diff) | |
download | txr-ddebbad496cdd19c6249211c8f00861161496124.tar.gz txr-ddebbad496cdd19c6249211c8f00861161496124.tar.bz2 txr-ddebbad496cdd19c6249211c8f00861161496124.zip |
return and return-from must throw, not abort.
* eval.c (op_return, op_return_from): If uw_block_return
doesn't find a block, and just returns, then throw an
exception rather than aborting.
-rw-r--r-- | eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1833,6 +1833,7 @@ static val op_return(val form, val env) { val retval = eval(second(form), env, form); uw_block_return(nil, retval); + eval_error(form, lit("return: no anonymous block is visible"), nao); abort(); } @@ -1841,6 +1842,8 @@ static val op_return_from(val form, val env) val name = second(form); val retval = eval(third(form), env, form); uw_block_return(name, retval); + eval_error(form, lit("return-from: no block named ~s is visible"), + name, nao); abort(); } |