views:

161

answers:

0

Is there a way to get MVEL 2.0 ( http://mvel.codehaus.org/ ) to work with functions with optional parameters?

I would like to be able to eval this:

trunc('blahblah',2)

but also

trunc('blahblah',2,'[...]');

Now i have tried:

def trunc(param1,param2,param3) { ... impl ... }

That gives an exception if i try to call it with only 3 parameters. I also tried:

def trunc(param1,param2,param3) { ... impl ... } def trunc(param1,param2) { ... impl ... }

But the second one seems to completely overwrite the first definition.

Thanks