Am 23.06.2015 um 17:29 schrieb Allin Cottrell:
I've been thinking about this some more and my view is getting closer to
Sven's, at least in regard to the use of a call to a list-returning
function in the context of a function-argument slot.
If a call to list-returning function foo() is used in place of a
pre-defined list, in a call to a function that wants a list argument, I
think it's only reasonable to assume that the caller _does_ want the
side-effect of foo (possible addition of series to the dataset), even if
he or she has no non-transient use for the direct return value (as a
named list object).
It's probably redundant to say that I agree :-)
In CVS I've modified my check: we now bar the side-effect of a
list-returning function only if it is called by itself, without
assignment, as in plain
foo(<args>)
Thanks, I think this is a very reasonable compromise.
Now, I've mentioned that at present this bar does not apply to built-in
list-returning functions such as log(); they will have their
side-effects regardless. If my feet were held to the fire on the
inconsistency here, I think I'd want to generalize the bar to log() and co.
Now how do I ignite that fire ;-)
But a serious question (meaning I'm not sure of the answer): Taking the
log example, is there any difference between calling the function by
itself and using the command? I.e., for an existing list "somevars"
what's the difference between the hansl script lines:
logs somevars
and
log(somevars)
?
thanks,
sven