#endif
/* FIXME
- * type constraints are already implemented by konobi
- * should be trivial to do coercions for the core types, too
- *
- * TypeConstraint::Class can compare SvSTASH by ptr, and if it's neq *then*
- * call ->isa (should handle vast majority of cases)
- *
- * base parametrized types are also trivial
- *
- * ClassName is get_stathpvn
- */
-
-/* FIXME
- * for a constructor we have ATTR *attrs, and iterate that, removing init_arg
- * we can preallocate the structure to the right size (maybe even with the
- * right HEs?), and do various other prehashing hacks to gain speed
- * */
-
-/* FIXME
* delegations and attribute helpers:
*
* typedef struct {
if ( SvIOK(sv) ) {
return 1;
} else if ( SvPOK(sv) ) {
+ /* FIXME i really don't like this */
int i;
STRLEN len;
char *pv = SvPV(sv, len);
char *end = pv + len;
+ char *tail = end;
errno = 0;
- i = strtol(pv, &end, 0);
- return !errno;
+ i = strtol(pv, &tail, 0);
+
+ if ( errno ) return 0;
+
+ while ( tail != end ) {
+ if ( !isspace(*tail++) ) return 0;
+ }
+
+ return 1;
}
return 0;
break;