spir wrote:
On Thu, 02 Dec 2010 08:54:43 -0800
Ali Çehreli acehr...@yahoo.com wrote:
bearophile wrote:
Pelle M.:
It doesn't exist for performance reasons, I think.
It's not a matter of performance. Walter thinks that in on
AAs searches on keys. And the keys of a dynamic
On 12/02/2010 01:07 PM, spir wrote:
Hello,
Is there an equivalent of 'in' for (non-associative) arrays? Cannot find any
'contains' function.
(Wouldn't it be nice to have in work for all arrays? What is the reason why it
only works with AAs?)
Denis
-- -- -- -- -- -- --
vit esse estrany ☣
Pelle M.:
It doesn't exist for performance reasons, I think.
It's not a matter of performance. Walter thinks that in on AAs searches on
keys. And the keys of a dynamic array are its indices. And searching for
indices in a dynamic array is not so useful. Therefore no in for
dynamic/static
It's not a matter of performance.
Well, it's also a matter of performance. The in done on arrays is a linear
search and I think Andrei thinks that in must be sublinear instead.
Bye,
bearophile
bearophile wrote:
Pelle M.:
It doesn't exist for performance reasons, I think.
It's not a matter of performance. Walter thinks that in on
AAs searches on keys. And the keys of a dynamic array are its
indices. And searching for indices in a dynamic array is not so
useful. Therefore no in
Ali Ãehreli:
If 'in' were to search among the values of arrays, then it wouldn't have
the same meaning with AAs.
But it's useful and the different semantics is very easy to remember and use.
Bye,
bearophile