"Michael Lazzaro" <[EMAIL PROTECTED]> wrote > (A) How shall C-like primitive types be specified, e.g. for binding > to/from C library routines, etc? > > Option 1: specify as property > > my numeric $a is ctype("unsigned long int"); # standard C type > my numeric $b is ctype("my_int32"); # user-defined > my numeric $c is ctype("long double"); > > my int $a is range(1000..1255) is unchecked; # auto-infer 8bit
Just to clarify: I think of the latter (C<range>) for efficient packing into arrays (e.g. a 5-bit range can be packed efficiently, even though there is no 5-bit c-type): binding to C routines is probably best done explicity. The C<unchecked> property would enable performance optimizations. Checked-ranges probably catch a few more bugs, though. Dave.