develooper Front page | perl.perl6.language | Postings from June 2010

r31052 -[S02] add native blob types

From:
pugs-commits
Date:
June 2, 2010 10:54
Subject:
r31052 -[S02] add native blob types
Message ID:
20100602175421.1063.qmail@feather.perl6.nl
Author: lwall
Date: 2010-06-02 19:54:21 +0200 (Wed, 02 Jun 2010)
New Revision: 31052

Modified:
   docs/Perl6/Spec/S02-bits.pod
Log:
[S02] add native blob types


Modified: docs/Perl6/Spec/S02-bits.pod
===================================================================
--- docs/Perl6/Spec/S02-bits.pod	2010-06-02 17:30:34 UTC (rev 31051)
+++ docs/Perl6/Spec/S02-bits.pod	2010-06-02 17:54:21 UTC (rev 31052)
@@ -1345,8 +1345,17 @@
 responds both to array and (some) stringy operations.  Note that,
 like a C<Buf>, its size is measured in whatever the base unit is,
 which is not always bytes.  If you have a C<my Blob[bit] $blob>,
-then C<$blob.elems> returns the number of bits in it.
+then C<$blob.elems> returns the number of bits in it.  As with buffers,
+various native types are automatically derived from native unsigned int types:
 
+    blob1       Blob[bit], a bit string
+    blob2       Blob[uint2], a DNA sequence?
+    blob4       Blob[uint4], a hex string
+    blob8       Blob[uint8], a byte string
+    blob16      Blob[uint16]
+    blob32      Blob[uint32]
+    blob64      Blob[uint64]
+
 These types do (at least) the following roles:
 
     Class       Roles




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About