Hi all,
I'm a newbie with tools.emitter.jvm, so there must be something obvious I'm
missing, but I can't make this simple example work:
(in-ns 'user)
=> #<Namespace user>
(require '[clojure.tools.emitter.jvm :as e])
=> nil
(e/eval '(println "a") {:debug? true})
// class version 50.0 (50)
// access flags 0x31
public final class user$ extends clojure/lang/AFunction {
// compiled from: user$
// access flags 0x9
public static <clinit>()V
RETURN
MAXSTACK = 0
MAXLOCALS = 0
// access flags 0x1
public <init>()V
ALOAD 0
INVOKESPECIAL clojure/lang/AFunction.<init> ()V
RETURN
MAXSTACK = 1
MAXLOCALS = 1
// access flags 0x1
public invoke()Ljava/lang/Object;
L0
GETSTATIC user$.const__ : Lclojure/lang/Var;
INVOKEVIRTUAL clojure/lang/Var.getRawRoot ()Ljava/lang/Object;
CHECKCAST clojure/lang/IFn
LDC "a"
INVOKEINTERFACE clojure/lang/IFn.invoke
(Ljava/lang/Object;)Ljava/lang/Object;
ARETURN
LOCALVARIABLE this Lclojure/lang/AFunction; L0 L0 0
MAXSTACK = 2
MAXLOCALS = 1
}
NoSuchFieldError const__ user$.invoke (user$:-1)
The example in
https://github.com/clojure/tools.emitter.jvm#example-usage
(e/eval '(+ 1 2) {:debug? true})
works correctly in my REPL, so the problem does not seem to be related to
var resolution;
also, the generated bytecode seems to be inconsistent (no field const__ is
generated).
I'm using the last published version ("0.1.0-beta5")
thanks in advance for any help.
Francesco
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.