Re: guardWithTest

2009-05-24 Thread Charles Oliver Nutter
Arthur Peters wrote: > I'm a lurker, but I have a question. > > What makes guardWithTest better or faster than simply using a method > handle of a method with an if statement in it? > > Like: > Object meth(...args...) { > if(pred) > guard; > else > callTargetMethod; > } > > Can the

Re: guardWithTest

2009-05-24 Thread Arthur Peters
I'm a lurker, but I have a question. What makes guardWithTest better or faster than simply using a method handle of a method with an if statement in it? Like: Object meth(...args...) { if(pred) guard; else callTargetMethod; } Can the JVM optimize the guardWithTest version better? Do

Re: guardWithTest

2009-05-24 Thread Attila Szegedi
On 2009.05.22., at 6:59, Charles Oliver Nutter wrote: > Hello Fabio! > > Fabio Kung wrote: >> I don't know if this is how guardWithTest is intended to be used, >> but I >> found your code very clever. Making dynamic calls fall to the >> fallback >> implementation in the first time and after th