Add implicit block to do macro
This commit is contained in:
parent
e6cb6bd047
commit
46d904535a
2 changed files with 9 additions and 2 deletions
|
@ -920,7 +920,7 @@ sub macro_do {
|
|||
|
||||
my $body = macro_progn($ts);
|
||||
|
||||
return sub {
|
||||
return create_block("nil", sub {
|
||||
my $octx = shift;
|
||||
my $ictx = ctx_create($octx);
|
||||
|
||||
|
@ -946,7 +946,7 @@ sub macro_do {
|
|||
}
|
||||
|
||||
return $result_form->($ictx);
|
||||
}
|
||||
});
|
||||
}
|
||||
$macros{do} = \¯o_do;
|
||||
|
||||
|
|
7
t/do.t
7
t/do.t
|
@ -11,3 +11,10 @@
|
|||
(comment lst)
|
||||
lst)
|
||||
(list 1 2 3)))
|
||||
|
||||
(expect "do - has implicit block nil"
|
||||
(equal 'ok
|
||||
(block nil
|
||||
(do () (t)
|
||||
(return 'fail))
|
||||
'ok)))
|
||||
|
|
Loading…
Reference in a new issue