=head1 TITLE pack/unpack C-like enhancements =head1 VERSION Maintainer: Ilya Zakharevich Date: 16 September 2000 Mailing List: perl6-language-data@perl.org Number: 247 Version: 1 Status: Developing =head1 ABSTRACT This RFC proposes C-like syntactic sugar to templates of pack/unpack. =head1 DESCRIPTION An alternative style of type specifiers is allowed in pack()/unpack() TEMPLATEs. This style is used in the parts of the TEMPLATE enclosed in braces, as in C<'{ C_STYLE_TEMPLATE }'>. Optionally, if TEMPLATE starts with C<'struct {'> (with possible intervening whitespace and comments) C is ignored. When this style is in scope, then =over 8 =item * the counts of the form C<32> are prohibited, use C<[32]> instead; =item * C should be used instead of C<(TEMPLATE)> for grouping; =item * instead of one-char type specifiers, the corresponding C-like specifiers C/C/C/C/C should be used. They may be preceeded by C/C/C/C/C, (C being the default). The type C should be used instead of C, with modifiers C/C if needed. C may be used to replace C<'x'>. C may be used as a prefix to replace C<'x!LEN'>; =item * C/C/C/C/C/C can be used too; =item * C9X syntax C (sp?) etc. can be used too; =item * C<[]> should be used instead of C<*>, as in C<'{ int[4]; short[] }'>; =item * if a type is put inside C<[]>, it should start with C, as in C<'{ string[ sizeof long ] }'> which is equivalent to C. =back =head1 MIGRATION ISSUES None. =head1 IMPLEMENTATION Straightforward. =head1 REFERENCES RFC 142: Enhanced Pack/Unpack RFC 246: pack/unpack uncontrovercial enhancements