Message7778

Author amak
Recipients amak, dturanski, fwierzbicki
Date 2013-02-25.23:58:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361836723.26.0.686590468432.issue1798@psf.upfronthosting.co.za>
In-reply-to
Content
The fundamental issue here is that jython (identically to cpython) treats expressions differently from statements.

"eval" expects to receive an expression, and returns a value.

http://docs.python.org/2/library/functions.html#eval

"exec" expects to receive statements, and does not return a value.

http://docs.python.org/2/reference/simple_stmts.html#exec

JSR 223 is different: it treats has no "exec", and uses "eval" for both of the purposes that jython separates into "eval" and "exec".

Object eval(String script)
 - Executes the specified script.

http://docs.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html#eval%28java.lang.String%29

Our implementation of JSR 223/javax.script is obviously missing this subtlety.
History
Date User Action Args
2013-02-25 23:58:43amaksetmessageid: <1361836723.26.0.686590468432.issue1798@psf.upfronthosting.co.za>
2013-02-25 23:58:43amaksetrecipients: + amak, fwierzbicki, dturanski
2013-02-25 23:58:43amaklinkissue1798 messages
2013-02-25 23:58:43amakcreate