Am 27.10.2015 um 21:26 schrieb Allin Cottrell:
On Tue, 27 Oct 2015, Riccardo (Jack) Lucchetti wrote:
> On Tue, 27 Oct 2015, Sven Schreiber wrote:
>
>>
>> Given the backwards-compatibility issues especially with 'null' as an
>> established initializer for lists (less so for bundles), maybe the
>> best solution is to rename isnull(), for example to isobj() -- or to
>> be precise, 'isnull(X)' would be equivalent to '!isobj(X)'.
>> The alias isnull() could be deprecated eventually.
>>
>> (And BTW/OT: perhaps 'isobj(b.X)' could also be an alias for
>> 'inbundle(b, "X")'.)
>
> If we ever decide to do this, I'd rather have exists() than isobj()
> (more intuitive name IMHO).
I was about to say much the same ;-) I was thinking of either exists()
or defined(), but I think I prefer exists().
No problem with exists() here.
Given that 'null' now will get a clearly defined meaning of "empty", and
it applies already to list, bundle, string, and apparently also various
arrays, why not go all the way and apply it to matrix, too? Such that
'matrix m = null' would be equivalent to 'matrix m = {}'. (Currently it
produces an error.)
Perhaps even with series. 'series s = null' for example could mean that
_all_ of its values would be re-set to NA, which would be different from
'series s = NA', which AFAIK only applies to the active sample. In this
way 'series s = null' would be equivalent to:
delete s
series s # or series s = NA ?
thanks,
sven