commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@4quarters.com>
Subject Re: [jexl] - checking for unresolved variables
Date Mon, 12 Jan 2004 15:05:15 GMT
Getting to this thread a few days late.  Will read.

Initial comments - you need to be sure that you don't get fooled by a 
sequence of expressions that will resolve ok - IOW, an assignment

    a = b;

w/ 'b' in the context should result in 'OK' for an unresolved check 
even though a isn't in the context to start.

I'm sure that's occurred to someone - I'll read the thread now :)

geir



On Jan 9, 2004, at 12:03 PM, Bill Horsman wrote:

> Hi,
>
> I'm successfully using JEXL to evaluate formulae that my users write. 
> It
> works well, but the default behaviour is to ignore any variable that is
> not defined. I would like it to a) throw an exception and b) provide
> structured feedback on what variables were unknown.
>
> For instance, if I define "a = 3" and then evaluate the expression "a +
> b" I get the answer "3". What I want is an exception with a method 
> like:
>
> String[] getUnresolvedVariables();
>
> That would give me ["b"] back.
>
> I'm quite happy to code the changes myself, but I just wanted to check
> whether:
>
> a) this functionality already exists (I've looked but I can't find it)
>
> b) there's a better way of doing this
>
> c) anyone can provide any hints about where to start (I'm confident
> enough to launch into this unaided, but wise enough to know that I will
> do it better with a little guidance).
>
> Cheers,
> Bill Horsman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


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


Mime
View raw message