This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: membership test problem


I vote to change it. The current behavior isn't intuitive. I have a script where I have to add one to the integer elements to workaround the problem, then subtract one later when I use the values. Kinda kludgey.

- Mike

Frank Ch. Eigler wrote:
Mike Mason <mmlnx@us.ibm.com> writes:

What should the following code print?  I expected TRUE, but got
FALSE.  Looks like if the array element value is 0, the membership
test fails.  Is this correct? [...]

Yes, Josh's explanation is correct, zero and "" are deemed to be null/absent values for purposes of array elements. (This could change though.)

(I could have sworn that I documented this behavior in the man page,
but now I can't find it.  It is in the tutorial.)

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]