Changes between Initial Version and Version 1 of Ticket #9386, comment 10


Ignore:
Timestamp:
02/08/15 21:31:11 (7 years ago)
Author:
nbruin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9386, comment 10

    initial v1  
    22> Instead of storing the whole environment on a central place, i was thinking of having a modified `export` function that applies to all Sage, that stores the previous value if it is not already stored (with a special flag to remember that the variable did no exist, which seems slightly different than being the empty string)
    33
     4'''edit:''' better to store the relevant variable names in a separate variable `SAGE_SAVED_ENVIRONMENT_VARIABLES`. Then you don't have to scan all of the environment, meaning that you only have to make your script robust against strings that the script is meant to see (environments can in principle contain arbitrary null-terminated strings) '''/edit'''
     5
    46The restoring bit could be easy:
    5  - scan the entire environment for variable names of the form `SAGE_OLD_<name>`. For each of those:
     7 - scan the entire environment for variable names of the form `SAGE_OLD_<name>`. '''edit:''' rather, retrieve `<names>`s from `SAGE_SAVED_ENVIRONMENT_VARIABLES`. '''/edit''' For each of those:
    68 - If the value of `SAGE_OLD_<name>` is of the form `+<value>` then set `<name>=<value>`
    79 - If the value is empty, unset `<name>`