Changes between Initial Version and Version 1 of Ticket #13447, comment 76


Ignore:
Timestamp:
09/21/12 06:42:22 (7 years ago)
Author:
nbruin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13447, comment 76

    initial v1  
    77> // ** redefining my_awesome_sage_ring **
    88> }}}
    9 I think what your code does, is look up if there is a Singular variable that points to `currRing`. If so, you use that one and you let the sage variable `my_awesome_sage_ring` dangling in the system. If you don't find a Singular variable pointing to `currRing` then you (re)create the variable `my_awesome_ring` to refer to `currRing`. But it could be that that variable is alive and well, happily pointing at some other ring (that once was `currRing`). I think the system probably has good reason to complain.
     9I think what your code does, is look up if there is a Singular variable that points to `currRing`. If so, you use that one and you let the Singular variable `my_awesome_sage_ring` dangling in the system. If you don't find a Singular variable pointing to `currRing` then you (re)create the variable `my_awesome_ring` to refer to `currRing`. But it could be that that variable is alive and well, happily pointing at some other ring (that once was `currRing`). I think the system probably has good reason to complain.
    1010
    1111What you should probably do is create `my_awesome_sage_ring`, keep a pointer to it, and refcount rings that you let it point to. Now you're simply holding a singular variable reference to a ring. When you need `currRingHdl` to point somewhere, you can do that via `my_awesome_sage_ring`. If you need to NULL `currRingHdl`, you can do so without consequence. You still keep your own pointer to `my_awesome_sage_ring`.