Hello!
I have a question concerning whether it is correct to write
finally return var
in loop construct (where var is established with 'with' clause).
In CLISP it is correct way to return value of variable
while in CMUCL it is incorrect and one need to write
finally (return var)
I found in CLtL2 (Section 26.12.2) that "The Common Lisp return macro
(or the return loop construct) can be used after finally to return values
from a loop." So I think both constructs should be correct.
However few sentences earlier an "non-atomic expression" is mentioned.
Could anybody explain how these all should be treated?
Thanks,
Miroslaw Osys
Miroslaw Osys wrote:
> Hello!
>
> I have a question concerning whether it is correct to write
>
> finally return var
>
> in loop construct (where var is established with 'with' clause).
> In CLISP it is correct way to return value of variable
> while in CMUCL it is incorrect and one need to write
>
> finally (return var)
>
> I found in CLtL2 (Section 26.12.2) that "The Common Lisp return macro
> (or the return loop construct) can be used after finally to return values
> from a loop." So I think both constructs should be correct.
> However few sentences earlier an "non-atomic expression" is mentioned.
>
> Could anybody explain how these all should be treated?
See CLtS. The syntax for the FINALLY clause in LOOP is:
finally compound-form+
where a compound form is defined to be:
compound form n. a non-empty list which is a form: a special form,
a lambda form, a macro form, or a function form.
So
finally return <form>
is not syntactically correct.
Paul