William Stein wrote:
> On Sun, Nov 1, 2009 at 11:09 PM, Stan Schymanski <schym...@gmail.com> wrote:
>> I would love to have a script that converts old names in a whole
>> worksheet to new names. Every time someone deprecates an old name, he
>> could add the relevant line to the script.
>>
>> Would that be possible? What I would love even more, is a notebook
>> conversion function such as the one that converted my old notebook to
>> the sage 4.2 format, but I suppose this is not possible for more
>> complicated changes than just names. MMA asks the user to "Scan notebook
>> for possible issues" if you open an old notebook with a new version of
>> MMA, but this is not always helpful.
> 
> Wow, this is the most interesting suggestion I've heard so far related
> to deprecation and renaming of functions in Sage.    It would be great
> if we had a framework for doing the above... if it's possible.  It's
> hard to imagine how it could be though, given how incredibly dynamic
> Python is.  It seems like the easiest thing is to just run your code
> and view the deprecation warnings that are emitted.  This would work
> so long as we never remove anything we deprecate, which seems silly.
> 
> So, it would be cool to have something like you describe, but I have
> no idea how to implement it, or even if it is possible.


Could we use the compiler module 
(http://docs.python.org/library/compiler.html) to parse the file and 
walk the nodes in the ast, replacing or modifying things as needed?

Thanks,

Jason



-- 
Jason Grout


--~--~---------~--~----~------------~-------~--~----~
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