Faking Clojures

Roger Kapsi <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
Hey,

I have an interesting problem here and I'm wondering if ASM can help
me. I want to write a method that takes two arguments. A clojure alike
function and a list of arguments. The function receives the arguments
at some future point in time when it's executed.

The tricky part is, the execution happens on some remote machine. That
means I want to extract the function's bytecode, send it along with
the arguments to some remote machine, turn it back into a class and
execute it.

I've done something similar with Runnables in the past (with plain
Java) but it was overall to fragile to be practical.

Thanks,
 Roger


public interface Function {
    public void invoke(Object[] args);
}

Object[] args = new Object[] { "Hello", "World!" };
doSomething(new Function() {
    public void invoke(Object[] arguments) {
        System.out.println(Arrays.asList(args));
    }
}, args);
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.