block compile converted top level form error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
OS: Windows 10 x86-64
$ sbcl --version
SBCL 2.0.2
$ cat t.lisp
#+(and)
(let ((f (cl-user::rt-sym :sb-gmp :uninstall-
(when f
(format t "Uninstall GMP functions~%")
(funcall f)))
(defun fact (n &optional (p 1)) (if (zerop n) p (fact (1- n) (* p n))))
(print (time (integer-length (fact (expt 10 5)))))
$ cat q.lisp
(in-package :cl-user)
(defun rt-sym (package symbol)
(let ((p (find-package package)))
(when p
(find-symbol (symbol-name symbol) p))))
(ignore-errors (require :sb-gmp))
(let ((f (rt-sym :sb-gmp :install-
(when f
(format t "Install GMP functions~%")
(funcall f)))
(load (compile-file "t.lisp" :block-compile t))
## On linux:
$ sbcl --no-userinit --load q.lisp
Install GMP functions
; compiling file "/media/
; converting (LET (#) ...)
; converting (DEFUN FACT ...)
; converting (PRINT (TIME #))
; block compiling converted top level forms...
; wrote /media/
; compilation finished in 0:00:00.007
Uninstall GMP functions
Evaluation took:
4.701 seconds of real time
4.695745 seconds of total run time (4.591574 user, 0.104171 system)
[ Run times consist of 0.194 seconds GC time, and 4.502 seconds non-GC time. ]
99.89% CPU
13,204,004,684 processor cycles
9,925,321,808 bytes consed
1516705
## On windows:
$ sbcl --no-userinit --load q.lisp
Install GMP functions
; compiling file "D:/ws/
; converting (LET (#) ...)
; converting (DEFUN FACT ...)
; converting (PRINT (TIME #))
; block compiling converted top level forms...While evaluating the form starting at line 16, column 0
of #P"D:/ws/
debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {10010B00C3}>:
The value
NIL
is not of type
SB-C::NODE
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-
0: [RETRY ] Retry EVAL of current toplevel form.
1: [CONTINUE] Ignore error and continue loading file "D:\\ws\
2: [ABORT ] Abort loading file "D:\\ws\
3: Ignore runtime option --load "q.lisp".
4: Skip rest of --eval and --load options.
5: Skip to toplevel READ/EVAL/PRINT loop.
6: [EXIT ] Exit SBCL (calling #'EXIT, killing the process).
(SB-C::
0]
Changed in sbcl: | |
status: | New → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
Actually it fails on linux too, I had sbcl-2.0.1 on linux.
Adding (in-package :cl-user) to t.lisp "fixes" the problem.