William Stein wrote:

> Incidentally, if we did allow automatic creation of symbolic
> variables, and default calling of symbolic expressions, then
> doing something like this would happen
> all the time and confuse the crap out of people:
>
> sage: function_name_with_slight_typo(10)
> 10

Well, that's weird, but it's not weird because of automatically
creating a variable for function_name_with_slight_typo.
Calling symbolic expressions -- that's weird.

> I think it would be interesting to have at least the capability
> of a mode where variable names are made symbolic if
> not previously used, at least if the calling behavior were redefined
> as above.  This would have be done by somehow parsing the
> input, finding all undefined variables, defining them, etc....
> It's techincaly possible.  Maybe Fernando Perez and I can
> try to make a demo of something like this at Sage Days 11.

I would be inclined to plug in a custom top-level interpreter loop
which just catches NameError and instantiates suitable variables
and reevaluates the input when that happens. Is there a way to
get Python to parse the input without evaluating it? (Isn't there
an AST package or s.t.l.t. which could do that?) Then you could
(I guess) detect undefined variables without causing side-effects
from any part of the input. Just a guess -- I'm no expert on Python.

FWIW

Robert Dodier

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to