isHealthy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

isHealthy

Stéphane Ducasse
Hi igor

this is strange I have a dictionary whose array contains nil  and still isHealthy returns true.
can an array of a dictionary contains nil?

Stef


Reply | Threaded
Open this post in threaded view
|

Re: isHealthy

Igor Stasenko
On 13 April 2011 16:49, Stéphane Ducasse <[hidden email]> wrote:
> Hi igor
>
> this is strange I have a dictionary whose array contains nil  and still isHealthy returns true.
> can an array of a dictionary contains nil?
>

no, it can't .
And how you end up with dictionary which having array = nil? During
initialization, it allocates and initializes array,
so, normally, there is no way how it could be nil.


> Stef
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: isHealthy

Henrik Sperre Johansen
On 14.04.2011 10:09, Igor Stasenko wrote:

> On 13 April 2011 16:49, Stéphane Ducasse<[hidden email]>  wrote:
>> Hi igor
>>
>> this is strange I have a dictionary whose array contains nil  and still isHealthy returns true.
>> can an array of a dictionary contains nil?
>>
> no, it can't .
> And how you end up with dictionary which having array = nil? During
> initialization, it allocates and initializes array,
> so, normally, there is no way how it could be nil.
Ehm, the array can _contain_ nil(the empty slot marker) (and it will in
all cases, if it's working correctly), it cannot _be_ nil though.

isHealthy has nothing to do with this though, it checks if all elements
(non-nil entries in the array) are at positions which are valid.

Cheers,
Henry

Reply | Threaded
Open this post in threaded view
|

Re: isHealthy

Stéphane Ducasse
In reply to this post by Igor Stasenko
I do not know. This is in RPackage and I do not know what to do.

>> Hi igor
>>
>> this is strange I have a dictionary whose array contains nil  and still isHealthy returns true.
>> can an array of a dictionary contains nil?
>
> no, it can't .
> And how you end up with dictionary which having array = nil? During
> initialization, it allocates and initializes array,
> so, normally, there is no way how it could be nil.

Reply | Threaded
Open this post in threaded view
|

Re: isHealthy

Igor Stasenko
In reply to this post by Henrik Sperre Johansen
On 14 April 2011 10:18, Henrik Sperre Johansen
<[hidden email]> wrote:

> On 14.04.2011 10:09, Igor Stasenko wrote:
>>
>> On 13 April 2011 16:49, Stéphane Ducasse<[hidden email]>
>>  wrote:
>>>
>>> Hi igor
>>>
>>> this is strange I have a dictionary whose array contains nil  and still
>>> isHealthy returns true.
>>> can an array of a dictionary contains nil?
>>>
>> no, it can't .
>> And how you end up with dictionary which having array = nil? During
>> initialization, it allocates and initializes array,
>> so, normally, there is no way how it could be nil.
>
> Ehm, the array can _contain_ nil(the empty slot marker) (and it will in all
> cases, if it's working correctly), it cannot _be_ nil though.
>
> isHealthy has nothing to do with this though, it checks if all elements
> (non-nil entries in the array) are at positions which are valid.
>\

Err.. maybe i misunderstood?

i meant

dict array == nil

should not happen, but

(dict array at: someindex ) == nil

is quite normal.

> Cheers,
> Henry

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: isHealthy

Stéphane Ducasse
>>>> Hi igor
>>>>
>>>> this is strange I have a dictionary whose array contains nil  and still
>>>> isHealthy returns true.
>>>> can an array of a dictionary contains nil?
>>>>
>>> no, it can't .
>>> And how you end up with dictionary which having array = nil? During
>>> initialization, it allocates and initializes array,
>>> so, normally, there is no way how it could be nil.
>>
>> Ehm, the array can _contain_ nil(the empty slot marker) (and it will in all
>> cases, if it's working correctly), it cannot _be_ nil though.
>>
>> isHealthy has nothing to do with this though, it checks if all elements
>> (non-nil entries in the array) are at positions which are valid.
>> \
>
> Err.. maybe i misunderstood?
>
> i meant
>
> dict array == nil
> should not happen, but
> (dict array at: someindex ) == nil
> is quite normal.

I do not know I have a do: loop and some elements are nil and break the loop.

Stef



Reply | Threaded
Open this post in threaded view
|

Re: isHealthy

Henrik Sperre Johansen
On 14.04.2011 11:04, Stéphane Ducasse wrote:

>>>>> Hi igor
>>>>>
>>>>> this is strange I have a dictionary whose array contains nil  and still
>>>>> isHealthy returns true.
>>>>> can an array of a dictionary contains nil?
>>>>>
>>>> no, it can't .
>>>> And how you end up with dictionary which having array = nil? During
>>>> initialization, it allocates and initializes array,
>>>> so, normally, there is no way how it could be nil.
>>> Ehm, the array can _contain_ nil(the empty slot marker) (and it will in all
>>> cases, if it's working correctly), it cannot _be_ nil though.
>>>
>>> isHealthy has nothing to do with this though, it checks if all elements
>>> (non-nil entries in the array) are at positions which are valid.
>>> \
>> Err.. maybe i misunderstood?
>>
>> i meant
>>
>> dict array == nil
>> should not happen, but
>> (dict array at: someindex ) == nil
>> is quite normal.
> I do not know I have a do: loop and some elements are nil and break the loop.
>
> Stef

do: iterates the values in the Dictionary, and yes, it's perfectly valid
to have a pair someKey -> nil in the dictionary.
Why you have it (ie who put it there), and if it should be valid in your
case, you'd have to figure out :)

Cheers,
Henry

Reply | Threaded
Open this post in threaded view
|

Re: isHealthy

Stéphane Ducasse
Ok in fact I should have check do: first and I will change thses users of do: to replace with doValues:
because I was following a wrong road because of it.

Stef



>>>
>>> dict array == nil
>>> should not happen, but
>>> (dict array at: someindex ) == nil
>>> is quite normal.
>> I do not know I have a do: loop and some elements are nil and break the loop.
>>
>> Stef
>
> do: iterates the values in the Dictionary, and yes, it's perfectly valid to have a pair someKey -> nil in the dictionary.
> Why you have it (ie who put it there), and if it should be valid in your case, you'd have to figure out :)
>
> Cheers,
> Henry
>