On Tue, 23 Oct 2018, oleg_komashko(a)ukr.net wrote:
I've just checked:
It's already present in 2018a
(I have several portable versions for checking)
23 жовтня 2018, 14:39:04, від "Sven Schreiber" <svetosch(a)gmx.net>:
Am 23.10.2018 um 13:31 schrieb oleg_komashko(a)ukr.net:
If we create a function having a name coinsiding
with the name of a local variable in a package,
Right (confirmed), this shouldn't happen.
Hmm, so what do we think ought to happen? Should this warning be
scrapped altogether, or should its scope be confined in some way? (And
if so, what way?)
Mostly, defining a variable with the same name as a "visible" function
won't cause trouble, since the identifier will be handled differently
depending on whether it's immediately followed by left parenthesis.
But that can mess up with lags:
function void den(scalar x)
series den = normal() # warning but no error
series denlag = den(-1) # fails
-> "The function den does not return any value".
One possible thought is that function-package code shouldn't "see"
user-defined functions outside of its own space. But that's probably
too restrictive: what about package dependencies, and packaged
functions that take a user-function as a "callback" argument?