Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

r31051 -[S02] refine Blobs to simply be immutable Bufs, with similar generic characteristics

0 views
Skip to first unread message

pugs-c...@feather.perl6.nl

unread,
Jun 2, 2010, 1:30:34 PM6/2/10
to perl6-l...@perl.org
Author: lwall
Date: 2010-06-02 19:30:34 +0200 (Wed, 02 Jun 2010)
New Revision: 31051

Modified:
docs/Perl6/Spec/S02-bits.pod
Log:
[S02] refine Blobs to simply be immutable Bufs, with similar generic characteristics


Modified: docs/Perl6/Spec/S02-bits.pod
===================================================================
--- docs/Perl6/Spec/S02-bits.pod 2010-06-02 16:51:06 UTC (rev 31050)
+++ docs/Perl6/Spec/S02-bits.pod 2010-06-02 17:30:34 UTC (rev 31051)
@@ -13,8 +13,8 @@

Created: 10 Aug 2004

- Last Modified: 21 May 2010
- Version: 216
+ Last Modified: 2 Jun 2010
+ Version: 217

This document summarizes Apocalypse 2, which covers small-scale
lexical items and typological issues. (These Synopses also contain
@@ -666,6 +666,8 @@
Callable
Positional
Associative
+ Buf
+ Blob

=item *

@@ -915,6 +917,7 @@

Name Is really
==== =========
+ buf1 Buf[bit]
buf8 Buf[uint8]
buf16 Buf[uint16]
buf32 Buf[uint32]
@@ -1258,7 +1261,7 @@
Parcel Arguments in a comma list
Slicel Arguments in a semicolon list (or equiv, like Z)
Capture Function call arguments (right-hand side of a binding)
- Blob An undifferentiated mass of bits
+ Blob An undifferentiated mass of ints, an immutable Buf
Instant A point on the continuous atomic timeline
Duration The difference between two Instants
HardRoutine A routine that is committed to not changing
@@ -1338,6 +1341,12 @@
$duration * 2 # ok, a duration twice as long
2 * $duration # same

+The C<Blob> type is like an immutable buffer, and therefore
+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.
+
These types do (at least) the following roles:

Class Roles
@@ -1361,7 +1370,7 @@
Signature
Parcel Positional
Capture Positional Associative
- Blob Stringy
+ Blob Stringy Positional
Instant Real
Duration Real
HardRoutine Routine

Darren Duncan

unread,
Jun 2, 2010, 1:51:16 PM6/2/10
to perl6-l...@perl.org
pugs-c...@feather.perl6.nl wrote:
> Author: lwall
> Date: 2010-06-02 19:30:34 +0200 (Wed, 02 Jun 2010)
> New Revision: 31051
>
> Modified:
> docs/Perl6/Spec/S02-bits.pod
> Log:
> [S02] refine Blobs to simply be immutable Bufs, with similar generic characteristics
<snip>

Thank you for this change; it was essentially what I wanted with the Blob type.

> @@ -666,6 +666,8 @@
> Callable
> Positional
> Associative
> + Buf
> + Blob

<snip>

However, I believe a further change is needed.

With the above addition, you have both Buf and Blob roles as well as Buf and
Blob types.

I think you need to make each of those just a role or a type, and then add
another named entity which is the counterpart role or type.

For example, as you have Stringy as a role with the Str type, maybe you can have
Blobby with the Blob.

And maybe Buffy with the Buf? The Perl community already seems to like such
puns, so why not?

Or otherwise clarify what Buf and Blob each are.

-- Darren Duncan

Jon Lang

unread,
Jun 2, 2010, 2:52:22 PM6/2/10
to Darren Duncan, perl6-l...@perl.org
Darren Duncan wrote:
> With the above addition, you have both Buf and Blob roles as well as Buf and
> Blob types.
>
> I think you need to make each of those just a role or a type, and then add
> another named entity which is the counterpart role or type.
>
> For example, as you have Stringy as a role with the Str type, maybe you can
> have Blobby with the Blob.
>
> And maybe Buffy with the Buf?  The Perl community already seems to like such
> puns, so why not?

I second the notion of a separate role, like Str vs. Stringy.
However, the idea here is that a Blob is an immutable Buf. AFAICT,
the roles are agnostic concerning mutability: you have Positional,
which applies to both Arrays and Lists (IIRC). So you'd have one of
Blobby or Buffy, but not both. Or perhaps you'd have another name for
it that captures the essentials that Blobs abd Bufs share, without
"privileging" one over the other. Or not.

--
Jonathan "Dataweaver" Lang

0 new messages