Author: masak
Date: 2010-06-02 12:10:26 +0200 (Wed, 02 Jun 2010)
New Revision: 31044

[S32/Containers] parameter no longer slurpy

Feedback from implementors suggests that this would be too inefficient.
Also, might be good to highlight that the array is an array in the
constructor. Also, this makes conversion back and forth Buf<->Array look
more symmetrical.

Modified: docs/Perl6/Spec/S32-setting-library/Containers.pod
--- docs/Perl6/Spec/S32-setting-library/Containers.pod  2010-06-02 10:10:22 UTC 
(rev 31043)
+++ docs/Perl6/Spec/S32-setting-library/Containers.pod  2010-06-02 10:10:26 UTC 
(rev 31044)
@@ -797,27 +797,31 @@
     class Buf does Positional does Stringy {...}
 A mutable container for an array of integer values in contiguous
-memory. The default constructor takes a slurpy array parameter of
+memory. The default constructor takes a single array parameter of
 integers, the largest of which determines the actual type. So
-<c3>, :16<B6>) # or
-, 182)         # which is exactly the same
+[:16<c3>, :16<B6>]) # or
+[195, 182])         # which is exactly the same
 returns a C<buf8> containing two C<uint8> items, while
 returns a C<buf16> which consists of a single C<uint16>.
 To explicit request a C<Buf> of a specific size, you can use
-, :size(16))     # returns a buf16
-, :size(8))     # dies, because 1024 >= 2**8
+[127], :size(16))     # returns a buf16
+[1024], :size(8))     # dies, because 1024 >= 2**8
 Subtypes with additional constraints like C<utf8> (which only allows valid
 UTF-8 byte sequences) exist and provide similar constructors. See
 L<S02/Built-In Data Types>.
+The array in the constructor used to be slurpy rather than positional, but
+the former was deemed to be too inefficient (during signature construction)
+for arrays of many elements.
 =head3 Methods

Reply via email to