This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
ModuleMethod:numArgs
- To: <kawa at sourceware dot cygnus dot com>
- Subject: ModuleMethod:numArgs
- From: "Patrick Barta" <patr at jhmi dot edu>
- Date: Fri, 3 Mar 2000 08:11:24 -0500
in updating to kawa 1.6.64, i ran into a problem.
i have some code that switches on the number of arguments in a procedure,
looking something like this:
public class myProc extends ProcedureN {
....
public Object apply1(Object arg1) {
....
if (arg1 instanceof Procedure1) {
.... do something
} else if (arg2 instanceof Procedure2) {
... do something different
}
this code worked fine in the previous version of kawa.
under the new version, if the code is compiled, everything works fine, but
the new version dies when the same command is given at the command line.
i.e.,
(my-proc (lamda (x) (+ x 2))
is ok in compiled code, but not in interpreted code.
The problem is that the lambda is a lambda in my compiled code, but a
ModuleMethod in interpreted code. Because ModuleMethod extends ProcedureN,
the old code clearly isn't going to work across compiled/interpreted code.
I thought of checking ModuleMethod:numArgs (), but it returns 4097!
I know that i could do something ugly, like surrounding an apply1() and and
apply3() with try blocks, but that seems to be extreme.
thanks
patr