Open jannschu opened 12 years ago
Just magically vanished. I'm really puzzled.
hmmm... I don't think you're doing anything wrong. I can't reproduce it though:
[508,0] seesaw-test $ ls lib/
clojure-1.3.0.jar j18n-1.0.0.jar swing-worker-1.1.jar
filters-2.0.235.jar miglayout-3.7.4.jar swingx-1.6.1.jar
forms-1.2.1.jar seesaw-1.3.0.jar
[509,0] seesaw-test $ lein repl
REPL started; server listening on localhost port 21326
user=> (use 'seesaw.core)
nil
user=> (invoke-later nil)
nil
user=>
I guess I have to ask why are you passing nil
to invoke-later
anyway? :)
oops. I should have refreshed the page and seen your second comment before looking into it. Let me know if you have any more issues.
I've had a similar issue. I put it in my core.clj file like so:
(ns seesaw-playground.core (:use seesaw.core))
(defn -main [& args](invoke-later %28-> %28frame :title "Hello", :content "Hello, Seesaw", :on-close :exit) pack! show!)))
My project.clj is:
(defproject seesaw-playground "1.0.0-SNAPSHOT" :description "FIXME: write" :dependencies [[org.clojure/clojure "1.3.0"] [seesaw "1.3.0"]] :main seesaw-playground.core)
But when I call lein run on the command-line I get:
Exception in thread "main" clojure.lang.ArityException: Wrong number of args (1) passed to: invoke$invoke-later at clojure.lang.AFn.throwArity(AFn.java:437) at clojure.lang.RestFn.invoke(RestFn.java:412) at clojure.lang.Var.invoke(Var.java:401) at seesaw_playground.core$_main.doInvoke(core.clj:6) at clojure.lang.RestFn.invoke(RestFn.java:397) at clojure.lang.Var.invoke(Var.java:397) at user$eval36.invoke(NO_SOURCE_FILE:1) at clojure.lang.Compiler.eval(Compiler.java:6465) at clojure.lang.Compiler.eval(Compiler.java:6455) at clojure.lang.Compiler.eval(Compiler.java:6431) at clojure.core$eval.invoke(core.clj:2795) at clojure.main$eval_opt.invoke(main.clj:296) at clojure.main$initialize.invoke(main.clj:315) at clojure.main$null_opt.invoke(main.clj:348) at clojure.main$main.doInvoke(main.clj:426) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:405) at clojure.lang.AFn.applyToHelper(AFn.java:163) at clojure.lang.Var.applyTo(Var.java:518) at clojure.main.main(main.java:37)
Oddly enough, the program doesn't crash, and the Hello window opens up fine.
I noticed, that deleting the compiled files (.class) solves the problem. Some before/after results:
(var-get seesaw.core/invoke-later) => <invoke/invoke-later fn obj>
(var-get seesaw.core/invoke-later) =>
Runtime Exception: Can't take value of a macro: #'seesaw.core/invoke-now
Create new project (with leiningen). Add seesaw to deps, load deps.
Open lein repl
and run (compile 'seesaw.core)
. Close REPL, open a new one:
(use 'seesaw.core)
(invoke-later) ; => warning
Give this fix a try. I honestly don't know what's going on, but switching from a def
alias to a defmacro
wrapper seemed to fix it.
This works. I created a simple example showing the problem (http://pastebin.com/raw.php?i=2GFGY2NW) and tested it with Clojure 1.3.0 and Clojure 1.4.0-master-SNAPSHOT. Both are broken. Seems to be a bug.
Thanks for following up on this. Assuming you're compj
on IRC, I saw you asking about it there. It would be nice if a fix ended up in 1.4.
There is a ticket & patch: http://dev.clojure.org/jira/browse/CLJ-1021
I tried this one in a fresh project (Clojure/seesaw 1.3):
lein repl
:Then:
No idea what's wrong, I'm very new to Clojure. But this works:
Am I making a mistake?