How does the array type field work? Do you have to call array_fix_type_field yourself, or is it supposed to be up to date when you get it in a function?
The type field is supposed to include all types in the array at all times. However, there is no guarantee that all types in the type field exists in the array, except right after you call array_fix_type_field().
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2004-04-29 02:28: Subject: type_field
How does the array type field work? Do you have to call array_fix_type_field yourself, or is it supposed to be up to date when you get it in a function?
/ Martin Nilsson (räfsfiskal)
So it is better to use something like the following than checking each element in a loop yourself?
if(a->type_field & ~BIT_STRING) { array_fix_type_field(a); if(a->type_field & ~BIT_STRING) Pike_error("Argument is not array(string).\n"); }
/ Martin Nilsson (räfsfiskal)
Previous text:
2004-04-29 19:38: Subject: type_field
The type field is supposed to include all types in the array at all times. However, there is no guarantee that all types in the type field exists in the array, except right after you call array_fix_type_field().
/ Fredrik (Naranek) Hubinette (Real Build Master)
Yes, that would seem to be a good idea.
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2004-04-29 19:53: Subject: type_field
So it is better to use something like the following than checking each element in a loop yourself?
if(a->type_field & ~BIT_STRING) { array_fix_type_field(a); if(a->type_field & ~BIT_STRING) Pike_error("Argument is not array(string).\n"); }
/ Martin Nilsson (räfsfiskal)
pike-devel@lists.lysator.liu.se