El 21/06/15 a las 14:43, Sven Schreiber escribió:
> ... and the caller assigns the return value.
Part of my point is that there is no "the" (=one and only) return value
when we talk about lists. There is the name of the list and that is
assigned. Then there are names of the list members, and those *cannot*
be assigned (=renamed) under hansl's design.
Umm I don't know whether I am understanding you, and I hate to talk
about my Holt-Winters package again, but I think its is an example of
what are you saying.
It takes a series as a paramenter (reskwh from data9-3.gdt in the
example) and optionally, if you assign a name to the list, it produces
the list with two series reskwh_H and reskwh_W. Obviously they are being
renamed for every series you apply the package on so they can be
rebnamed under hansl's design.
I feel like I'm repeating "look at the return value of the names of the
list members" and keep getting the reply "check out the return value of
the list name itself", but those are completely independent under
current hansl design.
> function offers a list return and it is _not_ assigned by the caller,
> then all series defined within the function are discarded on exit, so
> there can be no series-name collision.
I understand that. But there still *can* be series-name collision if the
caller assigns a new list name.
Of course, if you call the function twice over the same series and
assign a name (may be different) for the generated list, the previous
series are overwritten.
I don't think it is a problem. In some sense I think it is a good
feature, for example if you want to repeat the analysis in different
conditions.
The problem that may occur of overwritting some important previous
series should be resolved by the package programmer who should select
the names for the generated series carefully.
I think in general is good to have a way of generating new series that
in some way may have names derived from an existing one, such as reskwh,
reskwh_H and reskwh_W, I don't think it is a good idea that the series
have prepended the name of the list.
--
Ignacio Díaz-Emparanza
Departamento de Economía Aplicada III (Econometría y Estadística)
Universidad del País Vasco - Euskalherriko Unibertsitatea, UPV/EHU
Tfno: (+34) 94 601 3732
http://www.ehu.eus/ea3