Skip to content

Instantly share code, notes, and snippets.

@aperiodic
Created April 9, 2012 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aperiodic/2341911 to your computer and use it in GitHub Desktop.
Save aperiodic/2341911 to your computer and use it in GitHub Desktop.
Strange error when using quil with SimpleOpenNI
Exception in thread "Animation Thread" java.lang.ClassCastException: quil.applet.proxy$processing.core.PApplet$IMeta$c506c738 cannot be cast to clojure.lang.IDeref
at clojure.core$deref.invoke(core.clj:2078)
at quil_kinect.core$setup.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Var.invoke(Var.java:397)
at quil.applet$applet$setup_fn__2190.invoke(applet.clj:192)
at quil.applet$applet$fn__2265.invoke(applet.clj:290)
at quil.applet.proxy$processing.core.PApplet$IMeta$c506c738.setup(Unknown Source)
at processing.core.PApplet.handleDraw(Unknown Source)
at quil.applet.proxy$processing.core.PApplet$IMeta$c506c738.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at quil.applet.proxy$processing.core.PApplet$IMeta$c506c738.run(Unknown Source)
at java.lang.Thread.run(Thread.java:680)
@aperiodic
Copy link
Author

This error arises when running the code in the derefs branch of my quil-kinect project. It appears than anything def'd in the core namespace will not implement the usual core protocols. For example, trying to defn and then invoking the resultant function causes a cast exception when casting to clojure.lang.IFn.

The fault lies with the processing SimpleOpenNI library, since not importing it causes this issue to go away. The source for what's being imported is available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment