commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dion Gillard" <dion.gill...@gmail.com>
Subject Re: [JEXL] Blocks and an Expression
Date Tue, 28 Feb 2006 23:57:42 GMT
On 3/1/06, Rahul Akolkar <rahul.akolkar@gmail.com> wrote:
<snip>
>
> > So, the question becomes, should we support multiple statements for an
> > expression (outside a block), or do we implement ASTJexlScript so that
> it
> > evaluates each of it's children in turn and returns the last value?
> >
> <snap/>
>
> Neither? ;-) Took a peek, the behavior is as advertised since a JEXL
> Expression is indeed a reference to a single expression, and those
> semantics need to persist. However, since we use the "script grammar"
> for the ExpressionFactory (whereas the grammar for scripts is really a
> superset of the expression grammar), we parse the (potential) script
> and pluck out the just first expression even if there are more. The
> fact that expressions beyond the first are silently ignored probably
> needs to be addressed. Short of teasing apart two grammars (and/or
> having a ScriptFactory), perhaps it will be sufficient to trivially
> log a warning when that happens.


A warning would be a good idea. I don't want to change the behaviour of
Expression to throw an exception if there is more than a single piece.

WDYT?
>
> As an independent question, why doesn't JEXL have Script as a first
> class entity like Expression (with a ScriptFactory to match)?


This sounds like a good thing to add to 1.1 - Loading and executing scripts.

-Rahul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>


--
http://www.multitask.com.au/people/dion/
Chuck Norris sleeps with a night light. Not because Chuck Norris is afraid
of the dark, but because the dark is afraid of Chuck Norris

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message