cl-jpeg
cl-jpeg copied to clipboard
Inter-dependent forms inside eval-when
Eval this to reproduce the bug:
- (load "~/quicklisp/dists/quicklisp/software/cl-jpeg-20170124-git/package.lisp")
- (load "~/quicklisp/dists/quicklisp/software/cl-jpeg-20170124-git/jpeg.lisp")
+q-luminance+ is unbound
To fix it separate the macro forms that are dependent upon each other. Perhaps the define-constant macro also needs to be wrapped in an eval-when.
Thanks for the report! I'll look into this.
BTW, what's the usecase with loading the codec without building via ASDF? Asking because if the implementation does not perform implicit compilation of the source, the performance would be terrible.
I used (asdf:operate 'asdf:monolithic-compile-bundle-op :mysystem) to obtain a .fasl bundle that has all the .fasl from all the required systems concatenated. Loading this bundle is equivalent to loading each .fasl from all the systems :yoursystem depends on, which is almost the same thing as loading the .lisp files one by one.. That's how i came across this bug
Getting this: READ error during LOAD:
The variable CL-JPEG::OPTIMIZE is unbound.
(in form starting at line: 130, column: 0, position: 5178) [Condition of type SB-C::INPUT-ERROR-IN-LOAD]
The project has been split into several files now, and jpeg.lisp depends on conditions.lisp and globals.lisp. When I do:
(load "package.lisp")
(compile-file "globals.lisp")
(compile-file "conditions.lisp")
(compile-file "jpeg.lisp")
…then in a fresh lisp process:
(load "package.lisp")
(load "globals.fasl")
(load "conditions.fasl")
(load "jpeg.fasl")
…it seems to work.