Hi Richard, On 17 Sep., 20:09, rjf <fate...@gmail.com> wrote: > Data need not be stored in random access memory. A disk file might be > quite adequate, > since documentation presumably is not needed in a hurry, nor is it > needed in huge > quantities.
I think the application Stan had in mind was indeed to add documentation on the fly, interactively, and in large quantities. If I understood him correctly, he wants to create a system with many variables, and wants to store information about what each variable is referring to *in that particular aplication*, what units are used, and so on. I am sure Stan is aware that he could create a dictionary, containing information on each variable, indexed by either the variable itself or by its name or by its address in memory. If it is indexed by name, then of course such dictionary could easily be stored on disk. However, he also asked whether he can store the data [citing Stan's post] "so that I could then type the name of the variable further down in the document followed by a question mark to see that information again". And that's where things start to become interesting. Can one use/ modify the existing stuff in sage.misc.sageinspect for that purpose? If "yes": Is the additional comfort of not having to create one's own dictionary and simply appending "?" to retrieve the information, really worth the effort? > Humans have a limited ability to read documentation. Here, the purpose is to support the human memory by a brief reminder that, say, the variable t_max denotes the maximal temperature of a solar flare, measured in Kelvin. The idea is to use the same infrastructure that is also used for documentation, but it isn't documentation as it is currently used in Sage. > Or if you insist on having different > documentation > for each element in an array. Yes, if you understand "documentation" in the sense of "reminder what a particular variable is referring to", then I think that's exactly Stan's idea: Have different documentation for each variable. > There are perhaps alternatives (e.g. "weak hash tables") that would > work with GC, Strings can't be used as weak keys. Is there a way to create a dictionary such that data stored under a key K are garbage-collected as soon as K is removed from globals().keys()? 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