cl-jpeg icon indicating copy to clipboard operation
cl-jpeg copied to clipboard

Inter-dependent forms inside eval-when

Open bamboospirit opened this issue 8 years ago • 5 comments

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.

bamboospirit avatar Feb 14 '17 09:02 bamboospirit

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.

varjagg avatar Feb 15 '17 20:02 varjagg

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

bamboospirit avatar Feb 17 '17 11:02 bamboospirit

Hi,

Could you please check if this branch fixes the issue for you?

varjagg avatar Oct 02 '17 20:10 varjagg

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]

bamboospirit avatar Oct 04 '17 03:10 bamboospirit

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.

varjagg avatar Oct 04 '17 18:10 varjagg