Re: [Sisc-users] s2j question: calling a class' main function
Brought to you by:
mradestock,
scgmille
From: <scg...@fr...> - 2003-11-01 20:00:23
|
On Sat, Nov 01, 2003 at 08:49:51AM -0700, Luke Call wrote: > I'm trying to learn to use s2j as a scripting language. Any comments on= =20 > that topic in general are welcome, as I learn.... >=20 > But my main question for now is: How do I use s2j to call a class' main= =20 > method? This is what I've got so far, along w/ the error message: >=20 >=20 > (import s2j) >=20 > ((generic-java-method '|main|) (java-class '|org.onemodel.AllTests|)=20 > (java-array-new (java-class '|java.lang.String|) 1)) >=20 > Error: no applicable method for args (#<java java.lang.Class=20 > org.onemodel.AllTests> #<java java.lang.String[]=20 > [Ljava.lang.String;@2e242b>) in generic procedure #0=3D#<procedure> >=20 Calling any static method (including main methods) requires that the=20 generic function be applied to the typed null for the class which has the method. For example: (define-generic-java-method main) (define-java-class <org.onemodel.all-tests>) (main (java-null <org.onemodel.all-tests>)) Scott |