Oct. 6th, 2016
some progress eh
Oct. 6th, 2016 01:51 pmPlaying with Java. С местным Чабой тоже собачусь, осторожненько. Он (Клиф Клик), конечно, титан, но тупой, весь такой из 85-го года, си на восьмибитном процессоре - это то, на чем он учился программировать. Кругом у него байтовые массивы, и он думает, что круто. Лезет с хуйней.
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
(you probably recognize "cafebabe", right?)
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<X,Y>
- 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?)