Add implict tagbody to dolist

This commit is contained in:
madmaurice 2021-04-10 22:38:54 +02:00
parent e2df0bcefe
commit d5f4e2b6bb
2 changed files with 15 additions and 2 deletions

View File

@ -1134,7 +1134,7 @@ sub macro_dotimes {
slurp_token($ts, RPAREN, "Expected ) after count-form or result-form in dotimes");
my $body = macro_progn($ts);
my $body = macro_tagbody($ts);
return create_block(
"nil",

View File

@ -1,4 +1,4 @@
(plan 5)
(plan 6)
(expect "dotimes - executes body n times"
(let ((pings 0))
@ -28,3 +28,16 @@
(dotimes (i -3)
(throw 'test 'fail))
'ok)))
(defun nop () nil)
(expect "dotimes - implicit tagbody"
(equal 'ok
(catch 'test
(dotimes (e 1)
nil
(go end)
middle
(throw 'test 'fail)
end)
'ok)))