r31624 -[S05] redirect to new char class syntax with patch from cosimo++

2010-07-11 Thread pugs-commits
Author: lwall
Date: 2010-07-11 18:53:20 +0200 (Sun, 11 Jul 2010)
New Revision: 31624

Modified:
   docs/Perl6/Spec/S05-regex.pod
Log:
[S05] redirect to new char class syntax with patch from cosimo++


Modified: docs/Perl6/Spec/S05-regex.pod
===
--- docs/Perl6/Spec/S05-regex.pod   2010-07-11 12:05:45 UTC (rev 31623)
+++ docs/Perl6/Spec/S05-regex.pod   2010-07-11 16:53:20 UTC (rev 31624)
@@ -16,8 +16,8 @@
 
 Created: 24 Jun 2002
 
-Last Modified: 9 Jul 2010
-Version: 127
+Last Modified: 11 Jul 2010
+Version: 128
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -809,6 +809,9 @@
 C[...] is no longer a character class.
 It now delimits a non-capturing group.
 
+A character class is now specified using C [...] .
+See also LExtensible metasyntax.
+
 =item *
 
 C{...} is no longer a repetition quantifier.



r31625 -[S12] Nail down class representations sooner to make jnthn++ happier

2010-07-11 Thread pugs-commits
Author: lwall
Date: 2010-07-11 19:03:32 +0200 (Sun, 11 Jul 2010)
New Revision: 31625

Modified:
   docs/Perl6/Spec/S12-objects.pod
Log:
[S12] Nail down class representations sooner to make jnthn++ happier


Modified: docs/Perl6/Spec/S12-objects.pod
===
--- docs/Perl6/Spec/S12-objects.pod 2010-07-11 16:53:20 UTC (rev 31624)
+++ docs/Perl6/Spec/S12-objects.pod 2010-07-11 17:03:32 UTC (rev 31625)
@@ -13,8 +13,8 @@
 
 Created: 27 Oct 2004
 
-Last Modified: 10 Jul 2010
-Version: 105
+Last Modified: 11 Jul 2010
+Version: 106
 
 =head1 Overview
 
@@ -2031,6 +2031,31 @@
 The application may only request that the optimizer close and finalize
 unmarked classes.
 
+=head1 Representations
+
+By default Perl 6 assumes that all objects have a representation
+of CP6opaque.  This may be overridden with a trait:
+
+class Mammal is repr(P6Hash) {...}
+
+Whether implicit or explicit, the representation is considered to be
+fixed for the class after declaration, and the optimizer is free to
+optimize based on this guarantee.  It is illegal to create an object
+of the same type with any other representation.  If you wish to allow
+objects to be created with run-time specified representations, you
+must specifically pessimize the class:
+
+class Mammal is repr(*) {...}
+
+All non-native representations are required to support undefined type
+objects that may contain unthrown exceptions (CFailure objects);
+while this can be implemented using an alternate representation,
+Perl 6 doesn't think of it that way.  All normal objects in Perl 6
+may be used as a specific object (proper noun) if they are defined,
+or as a generic object (common noun) whether or not they are defined.
+You get this representation polymorphism for free independently of
+the restriction above.
+
 =head1 Interface Consistency
 
 By default, all methods and submethods that do not declare an explicit
@@ -2142,7 +2167,7 @@
 parents   list of parent classes
 roles list of roles
 disambig  how to deal with ambiguous method names from roles
-layoutP6opaque, P6hash, P5hash, P5array, PyDict, Cstruct, etc.
+repr  P6opaque, P6hash, P5hash, P5array, PyDict, Cstruct, etc.
 
 These are for the standard PerlĀ 6 Meta-Object Protocol, but other MOPs
 may define other traits.  The identifier should probably be accessed



r31626 -[S12] discuss pessimizing optimizations with augment

2010-07-11 Thread pugs-commits
Author: lwall
Date: 2010-07-11 19:09:44 +0200 (Sun, 11 Jul 2010)
New Revision: 31626

Modified:
   docs/Perl6/Spec/S12-objects.pod
Log:
[S12] discuss pessimizing optimizations with augment


Modified: docs/Perl6/Spec/S12-objects.pod
===
--- docs/Perl6/Spec/S12-objects.pod 2010-07-11 17:03:32 UTC (rev 31625)
+++ docs/Perl6/Spec/S12-objects.pod 2010-07-11 17:09:44 UTC (rev 31626)
@@ -2047,6 +2047,13 @@
 
 class Mammal is repr(*) {...}
 
+An Caugment is allowed to do this as long as it is before the
+main CCHECK time, at which point the compiler commits to its
+optimization strategies.  Compilers are not required to support
+run-time pessimizations (though they may).  Compilers may also generate
+both optimal and pessimal code paths and choose which to run based
+on run-time information, as long as correct semantics are maintained.
+
 All non-native representations are required to support undefined type
 objects that may contain unthrown exceptions (CFailure objects);
 while this can be implemented using an alternate representation,



r31627 -[S32/Temporal] Changed to use a different way of specifying time zones, which is hopefully saner than my last proposal.

2010-07-11 Thread pugs-commits
Author: Kodi
Date: 2010-07-11 19:56:33 +0200 (Sun, 11 Jul 2010)
New Revision: 31627

Modified:
   docs/Perl6/Spec/S32-setting-library/Temporal.pod
Log:
[S32/Temporal] Changed to use a different way of specifying time zones, which 
is hopefully saner than my last proposal.

Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod
===
--- docs/Perl6/Spec/S32-setting-library/Temporal.pod2010-07-11 17:09:44 UTC 
(rev 31626)
+++ docs/Perl6/Spec/S32-setting-library/Temporal.pod2010-07-11 17:56:33 UTC 
(rev 31627)
@@ -15,8 +15,8 @@
 
 Created: 19 Mar 2009
 
-Last Modified: 8 Apr 2010
-Version: 7
+Last Modified: 11 July 2010
+Version: 8
 
 The document is a draft.
 
@@ -88,11 +88,12 @@
 All four of the aforementioned forms of Cnew accept two additional named
 arguments. C:formatter is a callable object that takes a CDateTime and
 returns a string. The default formatter creates an ISO 8601 timestamp (see
-below). C:timezone is a callable object that takes a CDateTime and
-returns a two-element list giving the difference from UTC in (possibly both
-negative, but not of opposite signs) hours and minutes. Alternatively,
-C:timezone can be a two-element list, which is interpreted as a static
-offset from UTC. The default time zone is C(0, 0) (i.e., UTC).
+below). C:timezone is a callable object that takes a CDateTime to
+convert and a CBool that specifies the direction of the conversion: to
+UTC if true, from UTC if false. The C:timezone signifies the necessary
+conversion by returning an integer giving the difference from UTC in
+seconds. Alternatively, C:timezone can be a number, which is interpreted
+as a static offset from UTC. The default time zone is C0 (i.e., UTC).
 
 A shorter way to send in date and time information is to provide a
 single string with a full ISO 8601 date and time. The example from above
@@ -100,14 +101,16 @@
 
 my $moonlanding = DateTime.new( '1969-07-16T20:17:00Z' ); # UTC time
 
-The general form is C[date]T[time][offset], with [date] given as
-C-MM-DD and [time] given as Chh:mm:ss. The final CZ is a short
+The general form is C[date]T[time][offset], with C[date] given as
+C-MM-DD and C[time] given as Chh:mm:ss. The final CZ is a short
 form for C+, meaning UTC. (Note that while this form of Cnew
 accepts all of C+, C-, and CZ, the default formatter for
-CDateTime always expresses UTC as CZ.) The general notation for the C
-offset  is C+hhmm or C-hhmm. As before, a C:formatter argument is
-permitted. The C:timezone, if not supplied, is assumed to be a static
-offset equal to the offset in the given timestamp.
+CDateTime always expresses UTC as CZ.) The general notation for the
+C[offset] is C+hhmm or C-hhmm. The time zone of the new object is
+assumed to be a static offset equal to the C[offset]. The C[offset] is
+optional; if omitted, a C:timezone argument is permitted; if this too is
+omitted, UTC is assumed. Finally, the constructor also accepts a
+C:formatter argument.
 
 With all the above constructors, if you attempt to pass in values that
 are outside of the ranges specified in the list above, you'll get an
@@ -155,8 +158,8 @@
 
 The method Coffset returns the object's current offset from UTC: if
 C$dt.timezone does CCallable, C$dt.offset is equivalent to
-C$dt.timezone($dt); otherwise, C$dt.offset is equivlent to
-C@($dt.timezone).
+C$dt.timezone($dt, True); otherwise, C$dt.offset returns
+C$dt.timezone as is.
 
 =head2 Set methods
 
@@ -181,9 +184,9 @@
 local time zone is adjusted accordingly:
 
 my $dt = DateTime.new('2005-02-01T15:00:00+0900');
-say $dt.hour; # 15
-$dt.timezone = (6, 0);
-say $dt.hour; # 12
+say $dt.hour;# 15
+$dt.timezone = 6 * 60 * 60;  # 6 hours ahead of UTC
+say $dt.hour;# 12
 
 The Ctruncate method allows you to clear a number of time values
 below a given resolution:
@@ -197,6 +200,9 @@
 Monday of the week in which it occurs, and the time components are all
 set to 0.
 
+For the convenience of method chaining, Cset and Ctruncate return the
+calling object.
+
 =head1 Date
 
 CDate objects are immutable and represent a day without a time component.



r31630 -S02 : add initial formats for Blob (or Buf) literals

2010-07-11 Thread pugs-commits
Author: Darren_Duncan
Date: 2010-07-12 03:01:55 +0200 (Mon, 12 Jul 2010)
New Revision: 31630

Modified:
   docs/Perl6/Spec/S02-bits.pod
Log:
S02 : add initial formats for Blob (or Buf) literals

Modified: docs/Perl6/Spec/S02-bits.pod
===
--- docs/Perl6/Spec/S02-bits.pod2010-07-11 22:26:48 UTC (rev 31629)
+++ docs/Perl6/Spec/S02-bits.pod2010-07-12 01:01:55 UTC (rev 31630)
@@ -13,8 +13,8 @@
 
 Created: 10 Aug 2004
 
-Last Modified: 9 Jul 2010
-Version: 218
+Last Modified: 11 Jul 2010
+Version: 219
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -3189,6 +3189,19 @@
 
 =item *
 
+Blob literals look similar to integer literals with radix markers, but are
+distinct in their details.  A Blob literal has 1 format with 3 radix
+options:
+
+0b00101110100010  base 2, 1 bit per column
+0o523504376   base 8, 3 bits per column
+0xA705E   base 16, 4 bits per column
+
+TODO:  Expand this for more generality.  Meanwhile, this existing
+definition covers the common cases of specifying in bits and hexits.
+
+=item *
+
 Characters indexed by hex numbers can be interpolated into strings
 by introducing with C\x, followed by either a bare hex number
 (C\x263a) or a hex number in square brackets (C\x[263a]).



Re: r31630 -S02 : add initial formats for Blob (or Buf) literals

2010-07-11 Thread Darren Duncan

pugs-comm...@feather.perl6.nl wrote:

 =item *
 
+Blob literals look similar to integer literals with radix markers, but are

+distinct in their details.  A Blob literal has 1 format with 3 radix
+options:
+
+0b00101110100010  base 2, 1 bit per column
+0o523504376   base 8, 3 bits per column
+0xA705E   base 16, 4 bits per column
+
+TODO:  Expand this for more generality.  Meanwhile, this existing
+definition covers the common cases of specifying in bits and hexits.


Note that another option might be substitution of a quotation-pair for the :

0b'00101110100010'  base 2, 1 bit per column
0o'523504376'   base 8, 3 bits per column
0x'A705E'   base 16, 4 bits per column

But the general idea is that a Blob/Buf literal ought to look like something 
between an integer and a string.


There is also still the need to cover something that looks like a list of 
integers, for the general case of a Blob/Buf literal, and yet it should have an 
appearance more like that of a scalar/number/string/etc than of an array/etc.


Any thoughts on this?

-- Darren Duncan