This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with invoke with method determined at runtime


On 01/07/2012 12:37 PM, Bill Robinson wrote:
Aha! Thanks very much!

So what I'm after really is:

test.scm containing:

(define-simple-class TestClass ()
   ((test (arg :: int)) :: void
    (java.lang.System:out:format "test %d\n" arg)))

(let ((t ::TestClass (TestClass))
       (method 'test))
   (invoke t 'test 1)
   (invoke t method 2))

Thanks! I checked this testcase in as testsuite/reflect1.scm. Can't have too many tests :-)

I did change:
       (method 'test))
to
      (method (string-copy "test")))
to reduce the risk that (hypothetical future) compiler optimizations
might change it to compile-time reflection instead.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]