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

2010-06-02 Thread pugs-commits
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.pod2010-06-02 16:51:06 UTC (rev 31050)
+++ docs/Perl6/Spec/S02-bits.pod2010-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 @@
 
 NameIs really
 =
+buf1Buf[bit]
 buf8Buf[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)
-BlobAn undifferentiated mass of bits
+BlobAn undifferentiated mass of ints, an immutable Buf
 Instant A point on the continuous atomic timeline
 DurationThe 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 CBlob type is like an immutable buffer, and therefore
+responds both to array and (some) stringy operations.  Note that,
+like a CBuf, its size is measured in whatever the base unit is,
+which is not always bytes.  If you have a Cmy 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
-BlobStringy
+BlobStringy Positional
 Instant Real
 DurationReal
 HardRoutine Routine



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

2010-06-02 Thread Darren Duncan

pugs-comm...@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


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

2010-06-02 Thread Jon Lang
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