method allocate

Documentation for method allocate assembled from the following types:

role Blob

From Blob

(Blob) method allocate

Defined as:

multi method allocate($elems --> Blob:D)
multi method allocate($elems$pattern --> Blob:D)

Returns a newly created Blob object with the given number of elements. Optionally takes a second argument that indicates the pattern with which to fill the Blob: this can be a single integer value, or any Iterable that generates integer values, including another Blob. The pattern will be repeated if not enough values are given to fill the entire Blob.

my Blob $b0 = Blob.allocate(10,0);
$b0.say# OUTPUT: «Blob:0x<00 00 00 00 00 00 00 00 00 00>␤»