On Mar 21, 2009, at 2:01 AM, Craig Citro wrote: >> I think that better way is to use maxima commands op, args, length, >> atomp >> > > I think that for objects which come from Maxima, this is the right > thing to do. However, not all symbolic objects in Sage are wrappers > for Maxima objects -- in the case of expressions using pynac, the code > above actually moves them over to Maxima (via strings and pexpect) and > then ask for their length there (which probably ultimately uses the > commands you mention). This is less than desirable, hence my claim > that it was a terrible way to calculate the length. :) > > I think a first step might be to introduce a __len__ method for > symbolic objects, but then, I'm not always sure what it should return.
I would argue that this is a good reason not to implement it :). Something like nops would be trivial to implement though, and probably a good idea. - Robert > For instance, what's the "length" of sin(x^2-y+3)? I could see > reasonable arguments for 1 or 4, or maybe even 3. Probably the > semantics should be decided by the people who actually use the > symbolics a lot, which isn't me ... which is why I haven't filed a > trac ticket -- I have no idea what to suggest such a method should do. > > -cc > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---