I wasn't very clear -- I'm with you on this (though honestly this is actually identical to OGNL except that WOOGNL requires the leading "~".

... and the surrounding quotes, no? And, thus escaping quotes within the expression.
Actually, no. One of the changes I made a while back to Wonder's parser (around the time all the helper function stuff went in) is that surrounding quotes are not required on OGNL expressions anymore -- the leading ~ is enough. Additionally, OGNL supports single quotes in addition to double quotes, so if you prefer using the surrounding quotes, you can use single quotes to avoid escaping (I found this out later, actually).

Our web designer doesn't use WOLips at all, so validation is a moot point, though helpful when I svn up :-)
:)

The choice is quite easy:
if (KEY_PATH_PTN.matcher(expression).matches()
   ||CONSTANT_PTN.matcher(expression).matches())
        // normal eval
else
        // eval as groovy expresion
Oh true .. Pretty straightforward.

Or... just eval it all as a groovy expression. I've not done any performance tests to see which is better.
Yeah I've never profiled OGNL for this either. It's supposed to be a lot better with caching in the newer versions, and honestly keypath eval in WO is doing almost the same thing anyway, though I guess with groovy and OGNL both you would lose NSKeyValueCoding support?

Now, which do you prefer? (Leaving aside inline stuff)
well, like I mentioned above, with WOOGNL you can also do:
        value = ~"Hello Max" + name;
or
        value = ~'Hello Max' + name;
so it's really just the extra leading ~, but still, it's a handy idea to just automatically check the patterns for it.

ms

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to