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

The function XLIB::|Internal-Copy-GCONTEXT-TRAPEZOID-ALIGNMENT| is undefined. #78

Closed
TeMPOraL opened this issue Jul 30, 2017 · 3 comments

Comments

@TeMPOraL
Copy link

TeMPOraL commented Jul 30, 2017

There's a weird thing happening w/ recompiling vs. just loading CLX.

On a fresh SBCL 1.3.19 the following happens for me:

Rebuilding CLX:

CL-USER> (asdf:load-system :clx :force t)
T
CL-USER> xlib::*gcontext-extensions*
(#(:TRAPEZOID-ALIGNMENT :X XLIB::|Internal-Set-GCONTEXT-TRAPEZOID-ALIGNMENT|
   XLIB::|Internal-Copy-GCONTEXT-TRAPEZOID-ALIGNMENT|))

But after restarting and loading without rebuilding:

CL-USER> (asdf:load-system :clx)
T
CL-USER> xlib::*gcontext-extensions*
NIL

In both cases:

CL-USER> (describe 'XLIB::|Internal-Copy-GCONTEXT-TRAPEZOID-ALIGNMENT|)
XLIB::|Internal-Copy-GCONTEXT-TRAPEZOID-ALIGNMENT|
  [symbol]
; No value

i.e. the symbol is in particular not fbound. The entry in *gcontext-extensions* is, however, used later by CLX via funcall, resulting in the reported error.

The problem disappears (i.e. *gcontext-extensions* stays NIL after recompiling CLX) when I comment out loading demo/zoid.lisp and test/trapezoid.lisp in the ASD file, which suggests it's the zoid demo that's interfering with compilation of the library.

@uint
Copy link
Contributor

uint commented Aug 1, 2017

The demo and test files don't seem to be loaded automatically. As far as I can tell, the problem is that demo/zoid.lisp expands the define-gcontext-accessor macro during compilation, like so:

(define-gcontext-accessor trapezoid-alignment :default :x
  :set-function set-trapezoid-alignment)

The define-gcontext-accessor macro definition (in gcontext.lisp) has this eval-when block:

(eval-when (:compile-toplevel :load-toplevel :execute)
	 (defparameter ,internal-state-index
		       (add-gcontext-extension ',key-name ,default ',internal-set-function
					       ',internal-copy-function))
	 ) ;; end eval-when

I have no idea what to do with this, though. Just removing :compile-toplevel makes the whole thing fail to build.

@TeMPOraL
Copy link
Author

TeMPOraL commented Aug 1, 2017

My vote is to move demos and tests into separate systems (the latter probably depending on the former) - this way demos and tests will never unexpectedly pollute the Lisp image used to compile the CLX proper.

@dkochmanski
Copy link
Member

fixed.

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

3 participants