On Jan 17, 9:53 am, Burcin Erocal <bur...@erocal.org> wrote:
> Are we also going to prevent people from defining callable expressions
> using the f(x) = x+1 syntax within functions?

That would be a corollary given how that gets preparsed. That might
have to change because the error message generated by "var" will be
incomprehensible when triggered by the preparsing of "f(x)=x+1". We
could just do that by preparsing to

__tmp__=var("x",ensure_error_messages_take_into_account_that_this_var_was_generated_by_the_preparsing_of_a_symbolic_function_definition=true);
f = symbolic_expression(x+Integer(1)).function(x)

For the error message, perhaps:

"var('x') cannot be used inside a function. Use x=SR.var('x')
instead."

And then for symbolic function definitions:

"this syntax for defining symbolic functions cannot be used inside a
function. Use ... instead."

For Keshav and injecting in "local" scope: Indeed, local scope is non-
injectable. "global" scope varies, though: each module ("imported
file") has its own globals dictionary.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to