Shinmera / qtools

Qtools is a collection of utilities to aid development with CommonQt
https://shinmera.github.io/qtools
zlib License
209 stars 17 forks source link

"#1# is not a symbol or lambda expression." on Windows with CCL #4

Closed nandryshak closed 9 years ago

nandryshak commented 9 years ago

I have a file like this:

(ql:quickload '(:qtools :qtcore :qtgui))

(defpackage #:qtools-intro
  (:use #:cl+qt)
  (:export #:main))

(in-package #:qtools-intro)
(named-readtables:in-readtable :qtools)

(define-widget main-window (QWidget)
  ())

(with-main-window (window (make-instance 'main-window)))

When loading it with ccl -l test.lisp I get this error:

While compiling an anonymous function :
In the form (#1=(:UNDERFLOW :OVERFLOW :INVALID :INEXACT) PROGN
             (QTOOLS:WITH-FINALIZING
               ((QTOOLS-INTRO::WINDOW
                 (QTOOLS:ENSURE-QOBJECT
                   (MAKE-INSTANCE 'QTOOLS-INTRO::MAIN-WINDOW))))
               ((LAMBDA NIL
                  (QT:OPTIMIZED-CALL
                    T
                    QTOOLS-INTRO::WINDOW
                    "show")))
               ((LAMBDA NIL
                  (QT:OPTIMIZED-CALL
                    T
                    QT:*QAPPLICATION*
                    "exec"))))), #1# is not a symbol or lambda expression.
   [Condition of type CCL::COMPILE-TIME-PROGRAM-ERROR]

Using Clozure Common Lisp Version 1.10-r16196 (WindowsX8632)

However, simply using CommonQt works fine:

(ql:quickload :qt)
(named-readtables:in-readtable :qt)
(qt:with-main-window (window (#_new QWidget)))
Shinmera commented 9 years ago

Are you using the latest Quicklisp dist version?

nandryshak commented 9 years ago

Yes I am, just installed everything Qt related today. I think this problem may be namespace/package related, maybe on my part. This works fine:

(ql:quickload :qtools)
(named-readtables:in-readtable :qtools)
(qtools:define-widget main-window (QWidget)
  ())
(qt:with-main-window (window (make-instance 'main-window)))
Shinmera commented 9 years ago

If I am correct in interpreting the error it's to do with an obscure reader macro related thing in the with-main-window macro. Try cloning from git and see if that works.

nandryshak commented 9 years ago

Cloning qt-libs and qtools from git works, thanks!

Shinmera commented 9 years ago

The next QL release should be on the coming weekend, so you should be able to switch back away from GIT then. Thanks for reporting.