Lisp HUG Maillist Archive

Compiler warning

Hi

I see the following behavior

LAZY 27 > (defun bar (x) (let ((f 'gnao)) (if x 42 (funcall f 40 2))))
BAR

LAZY 28 > (compile 'bar)

The following function is undefined:
GNAO which is referenced by BAR
BAR
NIL
NIL



This is a summary case.  What I really have is a more complex macro  
that expands in somethin like that.

So, it looks like the compiler is constant folding the reference to F  
and then issuing the warning.
Is that the case?  Any suggestion about how to avoid it?

Thanks

--
Marco Antoniotti



Re: Compiler warning

On 4 Apr 2008, at 14:57, Marco Antoniotti wrote:
>
>
> This is a summary case.  What I really have is a more complex macro  
> that expands in somethin like that.
>
> So, it looks like the compiler is constant folding the reference to  
> F and then issuing the warning.
> Is that the case?  Any suggestion about how to avoid it?

Why would you want to?  This is code which could fail at runtime, so  
the compiler is helpfully telling you that.


Updated at: 2020-12-10 08:43 UTC