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

r29486 - in docs/Perl6/Spec: . S32-setting-library

From:
pugs-commits
Date:
January 8, 2010 15:56
Subject:
r29486 - in docs/Perl6/Spec: . S32-setting-library
Message ID:
20100108235553.4407.qmail@feather.perl6.nl
Author: lwall
Date: 2010-01-09 00:55:53 +0100 (Sat, 09 Jan 2010)
New Revision: 29486

Modified:
   docs/Perl6/Spec/S02-bits.pod
   docs/Perl6/Spec/S09-data.pod
   docs/Perl6/Spec/S32-setting-library/Temporal.pod
Log:
[S02,S09,S32] get rid of :by fossils


Modified: docs/Perl6/Spec/S02-bits.pod
===================================================================
--- docs/Perl6/Spec/S02-bits.pod	2010-01-08 22:49:13 UTC (rev 29485)
+++ docs/Perl6/Spec/S02-bits.pod	2010-01-08 23:55:53 UTC (rev 29486)
@@ -13,8 +13,8 @@
 
     Created: 10 Aug 2004
 
-    Last Modified: 19 Dec 2009
-    Version: 194
+    Last Modified: 8 Jan 2009
+    Version: 195
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -3037,7 +3037,7 @@
 topmost operator that is tighter in precedence than "loose unary"
 (see S03):
 
-    1 .. 100 :by(3)     # count to 100 by threes
+    1 == 100 :fuzz(3)     # calls: infix:<==>(1, 100, fuzz => 3)
 
 Within declarations the adverbial form is used to rename parameter declarations:
 

Modified: docs/Perl6/Spec/S09-data.pod
===================================================================
--- docs/Perl6/Spec/S09-data.pod	2010-01-08 22:49:13 UTC (rev 29485)
+++ docs/Perl6/Spec/S09-data.pod	2010-01-08 23:55:53 UTC (rev 29486)
@@ -13,8 +13,8 @@
 
     Created: 13 Sep 2004
 
-    Last Modified: 17 Nov 2009
-    Version: 36
+    Last Modified: 8 Jan 2010
+    Version: 37
 
 =head1 Overview
 
@@ -625,11 +625,11 @@
 If the array is defined with predeclared fixed indices (either standard
 or user-defined), the star means "all the defined indices":
 
-    my @results{1..100 :by(2)}   # Pre-specified indices
+    my @results{1,3...99}         # Pre-specified indices
         = 42, 86, 99, 1;
 
     say @results[*];              # Same as:  say @results[0..49]
-    say @results{*};              # Same as:  say @results{1..100 :by(2)}
+    say @results{*};              # Same as:  say @results{1,3...99}
 
 You can omit unallocated elements, either by using the C<:v> adverb:
 
@@ -756,7 +756,7 @@
 just like scalars -- the main caveat is that you have to use
 binding rather than assignment to set one without copying:
 
-    @b := @a[0..*:by(2)]
+    @b := @a[0,2,4 ... *]
 
 With PDLs in particular, this might alias each of the individual
 elements rather than the array as a whole.  So modifications to @b
@@ -788,7 +788,7 @@
 may be supplied as a semicolon-separated list of slice sublists.
 A three-dimensional slice might look like this:
 
-    @x[0..10; 1,0; 1..*:by(2)]
+    @x[0..10; 1,0; 1...*+2]
 
 It is up to the implementation of C<@x> to decide how aggressively
 or lazily this subscript is evaluated, and whether the slice entails
@@ -806,13 +806,13 @@
 For all multidimensional array types, it is expected that cascaded subscripts:
 
     @x[0][1][42]
-    @x[0..10][1,0][1..*:by(2)]
+    @x[0..10][1,0][1...*+2]
 
 will either fail or produce the same results as the equivalent
 semicolon subscripts:
 
     @x[0;1;42]
-    @x[0..10; 1,0; 1..*:by(2)]
+    @x[0..10; 1,0; 1...*+2]
 
 Built-in array types are expected to succeed either way, even if
 the cascaded subscript form must be implemented inefficiently by
@@ -880,42 +880,18 @@
     say "@x = @x[]";    # prints @x = 1 2 3
 
 Lists are lazy in Perl 6, and the slice lists are no exception.
-In particular, things like range objects are not flattened until they
+In particular, list generators are not flattened until they
 need to be, if ever.  So a PDL implementation is free to steal the
-values from these ranges and "piddle" around with them:
+values from these generators and "piddle" around with them:
 
-    @nums[$min..$max :by(3)]
-    @nums[$min..$max]
-    @nums[$min..*:by(3)]
-    @nums[1..*:by(2)]           # the odds
-    @nums[0..*:by(2)]           # the evens
+    @nums[$min ..^ $max]
+    @nums[$min ... *+3, $max]
+    @nums[$min ... *+3]
+    @nums[1...*+2]           # the odds
+    @nums[0...*+2]           # the evens
+    @nums[1,3...*]           # the odds
+    @nums[0,2...*]           # the evens
 
-That's all just the standard Perl 6 notation for ranges.  Additional
-syntactic relief is always available as long as it's predeclared
-somehow.  It's possible the range operator could be taught that C<:2>
-means C<:by(2)>, for instance.  (But I rather dislike the RFC-proposed
-C<0:10:2> notation that makes colon mean two different things so close
-together, plus it conflicts with Perl 6's general adverb notation if
-the next thing is alphabetic.  On top of which, we're using C<:2> as
-a general radix notation.)
-
-Another thing that's not going to fly easily is simply dropping out
-terms.  Perl depends rather heavily on knowing when it's expecting
-a term or an operator, and simply leaving out terms before or after
-a binary operator really screws that up.  For instance,
-
-    0..:by(2)
-
-parses as
-
-    0 .. (by => 2)
-
-rather than
-
-    0 .. Inf :by(2)
-
-That's why we have C<..*> to mean C<..Inf>.
-
 =head1 PDL signatures
 
 To rewrite a Perl 5 PDL definition like this:

Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod
===================================================================
--- docs/Perl6/Spec/S32-setting-library/Temporal.pod	2010-01-08 22:49:13 UTC (rev 29485)
+++ docs/Perl6/Spec/S32-setting-library/Temporal.pod	2010-01-08 23:55:53 UTC (rev 29486)
@@ -21,8 +21,8 @@
 =head1 VERSION
 
     Created: 19 Mar 2009 extracted from S29-functions.pod and S16-IO.pod
-    Last Modified: 9 Sep 2009
-    Version: 4
+    Last Modified: 8 Jan 2010
+    Version: 5
 
 The document is a draft.
 
@@ -173,30 +173,19 @@
 
 =head2 TimeRange
 
-This object represents a given period of time, it might be composed
-by:
+This object represents a given period of time, and may exclude either endpoint.
+It might be composed by:
 
-=over
+  $datetime1 .. $datetime2
+  $datetime1 ^.. $datetime2
+  $datetime1 ..^ $datetime2
 
-=item Start and end DateTime
+These may be iterated, but only on seconds.  To iterate with some
+other duration, you may use the series operator to produce a series
+of datetimes:
 
-=item Start DateTime and Duration
+  $datetime1 ... *+$duration, $datetime2
 
-=item Duration and end DateTime
-
-=back
-
-It might also contain a "step" Duration, which should allow iterating
-a set of values within the range. A TimeRange might be obtained with
-the infix:<..> operator and optionally using a :by adverb to indicate
-the step.
-
-For instance
-
-  $datetime .. $duration :by($step_duration)
-  $datetime ^.. $datetime :by($step_duration)
-  $duration ..^ $datetime :by($step_duration)
-
 =head2 Gregorian::Calendar
 
 Also known as the "civil" calendar. This is the calendar used in most




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