res = hv_exists(hv, "0", 1) && hv_iterinit(hv) == 1;
XSRETURN_IV(res);
+void
+list(SV *sv)
+PROTOTYPE: $
+PREINIT:
+ HV *hv;
+ IV res;
+CODE:
+ if (!SvOK(sv))
+ XSRETURN_IV(0);
+ if (!SvROK(sv)) {
+ res = strEQ(SvPV_nolen(sv), "list");
+ XSRETURN_IV(res);
+ }
+ hv = (HV *) SvRV(sv);
+ res = hv_exists(hv, "list", 4) && hv_iterinit(hv) == 1;
+ XSRETURN_IV(res);
+
void
count(SV *sv)
PROTOTYPE: $
$n eq 'null' ? substr(ppname($_[0]->targ), 3) : $n
}
-sub list ($) {
- my $r = $_[0];
- return 0 unless defined $r;
- return $r eq 'list' unless ref $r;
- return $r->{list} and 1 == scalar keys %$r;
-}
-
sub normalize ($) {
my $r = $_[0];
return unless defined $r;