Re: [Sbcl-bugs] 2.5.11: SB-WALKER:MACROEXPAND-ALL may expose special form SB-C::WITH-SOURCE-FORM

Stas Boukarev <[email protected]>
Newsgroups gmane.lisp.steel-bank.devel
Message-ID <CAF63=10Nps7w15+_34irn_EanSM2KuroGBvDSvuLH0+n9cgURg@mail.gmail.com>
It's a macro that expands to PROGN. No code walkers should get confused.

On Sun, Dec 7, 2025 at 3:18 PM Bohong Huang via Sbcl-bugs
<[email protected]> wrote:
>
> Hello SBCL developers,
>
> In the latest 2.5.11 version, I found that my `cffi-ops` (a code
> walker-based library that provides convenience for writing CFFI code) is
> broken because it relys on MACROEXPAND-ALL.
>
> Consider the following code:
>
>
> (defmacro a ()
>   '(+ 1 1))
>
> (defmacro b ()
>   (print
>    (sb-walker:macroexpand-all
>     '(typecase 0
>       (fixnum (a))))))
>
> (defun main ()
>   (b))
>
>
> When compiling (MAIN), the printed result is:
>
>
> (IF (SB-C::WITH-SOURCE-FORM (FIXNUM (A)) (TYPEP 0 'FIXNUM))
>     (+ 1 1)
>     NIL)
>
>
> This exposes the non-portable special form SB-C::WITH-SOURCE-FORM, which
> may confuse some custom code walkers because they don't know which part
> is the real code - for example, they might mistakenly treat illegal
> expressions like (FIXNUM (A)) as the code, leading to other problems.
>
> It can be confirmed that this issue does not exist in version 2.5.10.
>
> Thanks in advance for your time. Any thoughts on this issue? Looking
> forward to your reply.
>
> Best regards,
> Bohong Huang
>
>
>
> _______________________________________________
> Sbcl-bugs mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-bugs


_______________________________________________
Sbcl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.