On 9/10/10 9:03 AM, Laurent PETIT wrote:
Got it. You cannot invoke (import) (or (ns)) from within the function
definition. The function is already being evaluated, and it's "too
late".
This works fine for me:
(do
(import '(javax.swing JOptionPane))
((fn []
(println "Hello World")
I've also used the with-ns package in contrib to fix this.
On Sep 10, 9:03 am, Laurent PETIT wrote:
> Got it. You cannot invoke (import) (or (ns)) from within the function
> definition. The function is already being evaluated, and it's "too
> late".
>
> This works fine for me:
>
> (do
> (import
Got it. You cannot invoke (import) (or (ns)) from within the function
definition. The function is already being evaluated, and it's "too
late".
This works fine for me:
(do
(import '(javax.swing JOptionPane))
((fn []
(println "Hello World")
(println (+ 2 2))
(JOptionPane/showMess
Try printing out the *ns* variable in the fn. Chances are your code
is being created in a different *ns* than it is being run. You can
also try using the fully qualified path to get to JOptionPane, that
may help too.
On Sep 9, 9:43 pm, "Paul D. Fernhout"
wrote:
> I'm just trying out Clojure a b