On Tue, 16 Oct 2018, oleg_komashko(a)ukr.net wrote:
Dear Allin,
This is the way I was afraid of the most.
Is it possible to have some substitute?
Say, getvalues(int ID) similar to getinfo()?
Context: Oleh pointed out that it's possible, within a function, to
reference series that were not "given to" the function via any
argument (by using numeric series IDs). This breaks the encapsulation
or modularity that hansl functions are supposed to exhibit, and under
certain conditions can thoroughly muddle the "main" and function
namespaces such that (for example) it becomes impossible to define a
matrix "x" within a function if there already exists a series "x" at
the main level of a script.
My first thought for fixing this (now in git) was to limit access to
series IDs within functions: the function gets to "see" only the IDs
of series that were passed via a series-pointer argument or as members
of a list argument. I messed this up at first, forgetting to allow
universal access to series 0 ("const"), but after Oleh's reminder
that's now fixed in git.
Now Oleh implies that this change will break some of his functions.
I'm willing to consider an alternative fix but I think we need to be
clear on the rationale for allowing access to series not given to a
function via arguments. (I take it that is what Oleh wants.)
Allin