some progress eh

Ok, whatever. I just remember how class serialization/deserialization was so much of a trouble. But now, wow, I have a class, turn it into bytes, pass to another node, where I convert it back to
Function
- and then I call
it.public void testDeserializationAndEval() throws Exception { byte[] bytes = readHex(sampleCode); Class c = loadClass("water.util.SampleClosure", bytes); assertEquals("X=42", evalFunction(c, 42)); } String sampleCode = "ca fe ba be 00 00 00 33 00 2d 0a 00 0b 00 1d 07 \n" + "00 1e 0a 00 02 00 1d 08 00 1f 0a 00 02 00 20 0a \n" + ...
(you probably recognize "cafebabe", right?)
|
</> |