On Thu, 07 Dec 2006 00:08:23 -0800, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
>> If we wanted, we could always add that later on top of what I >> proposed. >> It would just be: >> >> f = (sin(x)*cos(x+y+3)).function(x,y) >> >> or >> >> dummy = sin(x*) * cos(x+y+3) >> f = dummy.function(x,y) >> >> Either might be doable with the preprocessor, though I shudder... > I think either are very doable via the preprocessor, but we can hold > off for now. For fun, I'll think a little about that for a second, since it will be good for Bobby to put how this would work in the SEP. For example, we want to transform f(x,y) = sin(x)*cos(x+y+3) into f = (sin(x)*cos(x+y+3)).function(x,y) Possible logic to do this. If a statement (i.e., between ;'s or newlines) contains an equal sign and there is an open parenthesis to the left of the equals since, do this transformation: X(y) = z gets replaced by X = z.function(y) where here X, y, and z are (nearly) arbitrary strings. I think this is reasonable since in Python "if a statement (i.e., between ;'s or newlines) contains an equal sign and there is an open parenthesis to the left of the equals sign", then is a *syntax error*. We could possible also do var(y); X=z.function(y) where var(y) would define all formal indeterminates defined by the string y and inject them into the interpreter's scope. - William --~--~---------~--~----~------------~-------~--~----~ 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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---