naresh.yadav | 6 Jun 17:05

Methods with Variable Number Of Arguments not supported in version jel-0.9.11

hi,
     I am using JDK 1.5 new feature to define methods taking any number of
     arguments  Method i had defined is :>
	public long sum(long... args) {
      	long sum = 0 ;
      	for(long arg : args) {
    	      	sum = sum + arg;
      	}
      	return sum;
      }

      using in expression as :>
		Evaluator.compile("sum(1,2)",lib);

      Getting following error :>
Exception in thread "main" gnu.jel.CompilationException: Function "sum" exists
but parameters "sum(byte,byte)" can not be accepted by it.

     I had tried with version jel-0.9.11. Please Help me i need this feature.

     Thanks & Regards
     Naresh Yadav
Picon

Re: Methods with Variable Number Of Arguments not supported in version jel-0.9.11

This feature in JDK 1.5 is merely a syntactic sugar around passing the array 
arguments. The real function (which is generated in classfile) simply accepts 
arrays of the corresponding type (the one before ellipsis). The current 
version of JEL does not have the sugar, but the function with variable number 
of arguments still can be called if you feed an array to it (e.g. created by 
another function).

Yes, right now I do have a plans to make a major overhaul of JEL to make use 
of new great software tools (like ant, junit, etc), which have evolved since 
JEL was around; and also to switch to newer classfile format (looking at 
other new features of JDK 1.5 as well). But I can't guarantee the timeframe, 
this can take a month, may be longer (because of my other business). The 
timeframe can be set with a modest "bribe" (please contact me directly if 
this is an option).

With the best regards,
                                   Konstantin.

On Tuesday 06 of June 2006 18:05, naresh.yadav <at> metrixline.com wrote:
> hi,
>      I am using JDK 1.5 new feature to define methods taking any number of
>      arguments  Method i had defined is :>
> 	public long sum(long... args) {
>       	long sum = 0 ;
>       	for(long arg : args) {
>     	      	sum = sum + arg;
>       	}
>       	return sum;
>       }
>
(Continue reading)


Gmane