On 10/3/07, Trevor Harrison <[EMAIL PROTECTED]> wrote:
> I'm brand new to JEXL, and ran into something a little strange that
> took me quite a while to wrap my head around.
>
> I was playing around with different expressions to see what was valid,
> and ran into a problem with this:
>
> i = 0; while ( i < 10 ) i = i + 1;
>
> which only executes the i = 0; and then returns without evaluating
> anything else.
>
> I was a little confused, because I was expecting behavior similar to
> the block { } feature.
>
> So, I tried
> { i = 0; while ( i < 10 ) i = i + 1 }
>
> which didn't compile.
>
> However, this does:
>
> if ( true ) { i = 0; while ( i < 10 ) i = i + 1; }
>
> which seems to work just fine.  Just a little strange that there isn't
> an implicit block around the entire expression.
>
> Is there a better way to do this?
>
<snip/>

Use the ScriptFactory [1] instead.

-Rahul

[1] 
http://commons.apache.org/jexl/apidocs-1.1/org/apache/commons/jexl/package-summary.html


> -Trevor
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to