The problem is not as simple as I thought at first. After digging for a while, I think I found the constraint which leads to the behavior I observed:
On 1 Feb., 11:12, Pat LeSmithe <qed...@gmail.com> wrote: > On 01/27/2010 02:31 PM, xtian wrote: > > In the Sage 4.3.1 interpreter, an attached file gets re-read > > exactly two times when changed. Subsequent changes > > (saved to disk, of course) do not trigger re-reading the file. > Could you please give a specific example (e.g., file contents, commands > to evaluate in sequence) that exhibits the problem? Create a file (e.g. foo.sage) with the following content: print "foo" print "bar" print "baz" Now, attach the file to your Sage session: ---------------------------------------------------------------------- | Sage Version 4.3.1, Release Date: 2010-01-20 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: attach foo.sage foo bar baz Any change you do to foo.sage (and save the file to disk) will make Sage to re-read the file, just as expected. Now, insert 'reset()' as the first line into foo.sage, so that it reads: reset() print "foo" print "bar" print "baz" Save the file and hit return. Sage re-reads the file. Now, do some more changes to foo.sage, but leave the first line as-is, e.g. comment out one 'print' line, save, hit return in the sage interpreter. >From now on, for me the Sage interpreter does no longer re-read foo.sage when I change and save it. Seems reset() does something with the Sage machine state which the new attach() code in Sage 4.3.1 does not like. I used to put reset() in the first line of my scripts since I started working with Sage, but the effect seen here started to show with 4.3.1. Best regards, xtian -- 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