There are two problems caused by not treating forms in the tagbody correctly.
1) ccl:macroexpand-all expands symbols that have a symbol-macro definition in tagbody when they are in the tag position.
2) ccl:macroexpand-all doesn't "protect" macroexpansion of the macros in tagbody that can becom a tag (symbols and integers).
The determination of which elements of the body are tags and which are statements is made prior to any macro expansion of that element. If a statement is a macro form and its macro expansion is an atom, that atom is treated as a statement, not a tag.
That means that
1) tag in tagbody should not be expanded.
2) (not-tag) expansion should be "protected" so that it doesn't become a tag, for example via progn.
There are two problems caused by not treating forms in the
tagbody
correctly.1)
ccl:macroexpand-all
expands symbols that have a symbol-macro definition intagbody
when they are in the tag position. 2)ccl:macroexpand-all
doesn't "protect" macroexpansion of the macros intagbody
that can becom a tag (symbols and integers).-- CLHS, tagbody: https://www.lispworks.com/documentation/HyperSpec/Body/s_tagbod.htm
That means that 1)
tag
intagbody
should not be expanded. 2)(not-tag)
expansion should be "protected" so that it doesn't become a tag, for example viaprogn
.Tested on CCL 1.13
This affects quite a few other implementations, see this table (two last columns): https://plaster.tymoon.eu/view/4637.