From: <da...@da...> - 2003-01-07 03:02:35
|
I found this today, and it seems usefull. are there any gotchas to this method oc creating new class in jscheme? Sometimes you want to make a subclass just to override the paint method. the jar file is here.. http://www.csg.is.titech.ac.jp/~chiba/javassist/ ------------ a simple test ----------- (import "javassist.*") (define pool (javassist.ClassPool.getDefault)) (define cc (.makeClass pool "Silly")) (define m (CtNewMethod.make "public int silly(int dx) { return 2+dx; }" cc)) (.addMethod cc m) (define cloader (Loader. pool)) (define anewclass (.loadClass cloader "Silly")) (define ss1 (.newInstance anewclass)) (.silly ss 1) |