On Tue, 16 Oct 2018, Sven Schreiber wrote:
Am 16.10.2018 um 16:03 schrieb Allin Cottrell:
> 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()?
>
> 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 think this was the correct fix, because the other trick was against the
rules.
> 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.)
I agree, in the sense that I think such a rationale must be very strong if
the important principle of function encapsulation were to be weakened.
I agree with Sven 100%.
The policy of function encapsulation must be kept at all costs (ok, with
the obvious exception of "const" and "time", that are generated on the
fly (actually, the same would hold for seasonal dummies as well, but we
doi have the seasonals() function for that).
If enforcing the principle with consistency breaks a package, I'm sorry,
but it's the lesser of two evils. A package can always be updated with
little difficulty.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------