-
Notifications
You must be signed in to change notification settings - Fork 209
unable to identify undefined values in class #903
Copy link
Copy link
Closed
Description
class L {
string m ;
int n ;
float o ;
}
void runit()
{
class L l = new(class L) ;
int x = 3 ;
printf("l: %O\n", l) ;
printf("nullp(l->m): %O\n", nullp(l->m)) ;
printf("undefinedp(l->n): %O\n", undefinedp(l->n)) ;
printf("typeof(l->o): %O\n", typeof(l->o)) ;
while(x--)
{
printf("%O",
sprintf("MEMBER #: %O\n", x) +
sprintf(sprintf("VALUE: %O\n", fetch_class_member(l, x))) +
sprintf(sprintf("TYPEOF: %O\n", typeof(fetch_class_member(l, x)))) +
sprintf(sprintf("NULLP: %O\n", nullp(fetch_class_member(l, x)))) +
sprintf(sprintf("UNDEFINEDP: %O\n", undefinedp(fetch_class_member(l, x))))
) ;
}
}results:
l: CLASS( 3 elements
0,
0,
0
)
nullp(l->m): 0
undefinedp(l->n): 0)
typeof(l->o): "int"
"MEMBER #: 2
VALUE: 0
TYPEOF: "int"
NULLP: 0
UNDEFINEDP: 0
""MEMBER #: 1
VALUE: 0
TYPEOF: "int"
NULLP: 0
UNDEFINEDP: 0
""MEMBER #: 0
VALUE: 0
TYPEOF: "int"
NULLP: 0
UNDEFINEDP: 0
"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels