Hi!

On 17 Sep., 18:15, rjf <fate...@gmail.com> wrote:
> \begin{sarcasm}
> I'm sure glad that python/sage is so easy to read.
> \end{sarcasm}

Yeah, I know that kind of sarcasm from my 15 year old son.

> I was suggesting the use of STRINGS as indexes.

Do I understand correctly: You suggest to use the name of a global
variable for indexing additional information on that variable? Of
course, thatwould be a valid basic approach. So, I am not adding that
my son sometimes needs to be reminded that problems are there to be
solved, not just to be commented.

If you have a global variable Foo, then you could certainly use the
string "Foo" (that is a key in globals() anyway) to index some
dictionary of additional data.

But how would that be better than using id(Foo) as index? In
particular, how would that solve the problem of garbage collection?
I.e., if the variable Foo is removed, how would the system know that
any additional data stored under the name "Foo" ought to be removed as
well.

That's why storing additional data as an attribute of Foo would be
better w.r.t garbage collection. However, the problem is the missing
feature of setting arbitrary attributes to many classes in Sage.

So, what exactly is your suggestion? By what mechanism would you add
arbitrary data D related with an arbitrary (global) variable V, such
that D is garbage collected as soon as V is? And would that mechanism
be practical, or would it require to rewrite Sage from scratch?

Best regards,
Simon

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