Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inter-dependent forms inside eval-when #24

Open
bamboospirit opened this issue Feb 14, 2017 · 5 comments
Open

Inter-dependent forms inside eval-when #24

bamboospirit opened this issue Feb 14, 2017 · 5 comments

Comments

@bamboospirit
Copy link

bamboospirit commented Feb 14, 2017

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.

@varjagg
Copy link
Collaborator

varjagg commented Feb 15, 2017

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.

@bamboospirit
Copy link
Author

bamboospirit commented Feb 17, 2017

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

varjagg added a commit to varjagg/cl-jpeg that referenced this issue Oct 2, 2017
@varjagg
Copy link
Collaborator

varjagg commented Oct 2, 2017

Hi,

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

@bamboospirit
Copy link
Author

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]

@varjagg
Copy link
Collaborator

varjagg commented Oct 4, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants