camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder" <ammul...@alumni.princeton.edu>
Subject Re: Failing Unit Tests
Date Thu, 03 Jul 2008 15:37:45 GMT
On Thu, Jul 3, 2008 at 9:43 AM, James Strachan <james.strachan@gmail.com> wrote:
>> So as I understand the Jython situation now, when writing a Jython
>> expression, you must always prefix it with "result = ".  I think
>> that's a workaround we could document and say it works.
>
> Yeah - I wonder if thats a strange limitation of jython? If so we
> should maybe shove the result = part into the internals
>
> Similarly I noticed the ruby stuff needed $ to prefix the variable
> names; I wonder if we can avoid that? So they kinda appear as
> instance, rather than global variables etc? Not a biggie, just
> wondering

It seems like a couple of the languages have some idiosyncrasies that
mean that it's not really invisible what language you're using, JSR or
not.  Dave said there was a different way to call the Python to get a
result back, so we might be able to avoid that.  I'm not sure about
the Ruby -- it looks like the context variables become global
variables.

One possibility in both cases might be to put some extra script code
around what the user provides, but I'm afraid that might only work in
simple cases (e.g. not if the user's "expression" includes functions
and whatnot).  Maybe a simple helper function would work, where our
helper function invokes the user's script (with "eval" or whatever)
and captures the result and then gives us back the result in some way
we expect?

Thanks,
       Aaron

Mime
View raw message