Subject: [clisp-list] (random tester) Compiler error with flet/labels optional arguments: SYMBOL-VALUE: 1 is not a SYMBOL

From: "Paul F. Dietz" <[email-masked]>
Date: Thu Oct 30 21:19:07 2003

CL-TEST[51]> (compile
     nil
     '(lambda ()
        (labels ((%f10 (f10-1 &optional
                          (f10-2 (handler-bind nil 878))
                          (f10-3 (handler-case 10)))
                    -15))
            (%f10 -144))))

*** - SYMBOL-VALUE: 1 is not a SYMBOL
The following restarts are available:
USE-VALUE      :R1      You may input a value to be used instead.

1. Break CL-TEST[52]> backtrace

<1> #<SYSTEM-FUNCTION EXT:SHOW-STACK>
<2> #<COMPILED-CLOSURE SYSTEM::DEBUG-BACKTRACE>
<3> #<SYSTEM-FUNCTION SYSTEM::READ-EVAL-PRINT>
<4> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP-2-1>
<5> #<SYSTEM-FUNCTION SYSTEM::SAME-ENV-AS>
<6> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP-2>
<7> #<SYSTEM-FUNCTION SYSTEM::DRIVER>
<8> #<COMPILED-CLOSURE SYSTEM::BREAK-LOOP>
<9> #<SYSTEM-FUNCTION INVOKE-DEBUGGER>
<10> #<SYSTEM-FUNCTION ERROR> 0
<11> #<COMPILED-CLOSURE SYSTEM::CHECK-VALUE>
<12> #<SYSTEM-FUNCTION SYMBOL-VALUE>
<13> #<COMPILED-CLOSURE SYSTEM::NOTE-REFERENCES>
<14> #<COMPILED-CLOSURE SYSTEM::OPTIMIZE-SHORT>
<15> #<COMPILED-CLOSURE SYSTEM::OPTIMIZE-ALL>
<16> #<COMPILED-CLOSURE SYSTEM::COMPILE-TO-LAP>
<17> #<COMPILED-CLOSURE SYSTEM::PASS2>
<18> #<COMPILED-CLOSURE SYSTEM::PASS2>
<19> #<COMPILED-CLOSURE SYSTEM::COMPILE-LAMBDABODY>
<20> #<COMPILED-CLOSURE COMPILE>
Printed 20 frames
1. Break CL-TEST[52]>

Oddly enough, this call to COMPILE succeeds if (IN-PACKAGE "CL-USER")
has been executed.

	Paul

---

From: "Paul F. Dietz" <[email-masked]>
Date: Fri Oct 31 04:15:13 2003

I wrote:

( a test case )

The reason is was only working in the CL-TEST package was because I had
shadowed HANDLER-CASE and HANDLER-BIND.

Here's another randomly generated example showing the same bug, without
the package problems:

(funcall
    (compile nil
     '(lambda (a c)
        (flet ((%f10 (f10-1 f10-2) 10))
	 (flet ((%f4
		 (&optional
		  (f4-1 (ldb (byte 10 6)
			     (* 828
				(+ 30 (dpb c (byte 9 30) (%f10 1918433 34107)))
				)))
		  (f4-2 (setq a 0)))
		 2))
	   (%f4 -5)))))
    0 0)
[...]
*** - SYMBOL-VALUE: 1 is not a SYMBOL

The bug apparently requires two optional parameters to be present.

	Paul