r31678 -[S32/Temporal] DateTime.new(Numeric) - DateTime.new(Int), since time no longer returns fractional seconds.
Author: Kodi Date: 2010-07-14 16:02:34 +0200 (Wed, 14 Jul 2010) New Revision: 31678 Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod Log: [S32/Temporal] DateTime.new(Numeric) - DateTime.new(Int), since time no longer returns fractional seconds. Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod === --- docs/Perl6/Spec/S32-setting-library/Temporal.pod2010-07-14 12:50:51 UTC (rev 31677) +++ docs/Perl6/Spec/S32-setting-library/Temporal.pod2010-07-14 14:02:34 UTC (rev 31678) @@ -15,8 +15,8 @@ Created: 19 Mar 2009 -Last Modified: 12 Jul 2010 -Version: 10 +Last Modified: 14 Jul 2010 +Version: 11 The document is a draft. @@ -57,7 +57,7 @@ =head1 Ctime -Returns the current POSIX time as an Int. Use the Cnow function for an +Returns the current POSIX time as an CInt. Use Cnow for an epoch-agnostic measure of atomic seconds (i.e., an CInstant). Note that both Ctime and Cnow are not functions, but terms of the pseudo-constant variety; as such they never take an argument. @@ -68,15 +68,14 @@ A CDateTime object describes the time as it would appear on someone's calendar and someone's clock. You can create a CDateTime object from an -CInstant or from any object that does the CNumeric role; in the latter -case, the argument is interpreted as POSIX time. +CInstant or from an CInt; in the latter case, the argument is +interpreted as POSIX time. my $now = DateTime.new(now); -my $now = DateTime.new(time); # same thing (usually) +my $now = DateTime.new(time); -Note that a CDateTime based on Cnow can return a CDateTime -that cannot be produced using Ctime, since Ctime doesn't know -about leap seconds. +These two statements are equivalent except that Ctime doesn't know about +leap seconds or fractions of seconds. Or you can use named arguments:
r31680 -[S32/Temporal] Added to Date: There are also Cweek, Cweek-year, Cweek-number, Cweekday-of-month, and Cday-of-year methods, which work just like their DateTime equivalents.
Author: Kodi Date: 2010-07-14 16:35:46 +0200 (Wed, 14 Jul 2010) New Revision: 31680 Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod Log: [S32/Temporal] Added to Date: There are also Cweek, Cweek-year, Cweek-number, Cweekday-of-month, and Cday-of-year methods, which work just like their DateTime equivalents. Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod === --- docs/Perl6/Spec/S32-setting-library/Temporal.pod2010-07-14 14:35:21 UTC (rev 31679) +++ docs/Perl6/Spec/S32-setting-library/Temporal.pod2010-07-14 14:35:46 UTC (rev 31680) @@ -16,7 +16,7 @@ Created: 19 Mar 2009 Last Modified: 14 Jul 2010 -Version: 11 +Version: 12 The document is a draft. @@ -244,6 +244,9 @@ $d.days-in-month# 31 $d.Str # '2010-12-24' +There are also Cweek, Cweek-year, Cweek-number, Cweekday-of-month, +and Cday-of-year methods, which work just like their DateTime equivalents. + =head2 Arithmetics $d.succ # Date.new('2010-12-25')
r31689 -[S32/Temporal] Permit days-in-month and is-leap-year on DateTimes, too.
Author: Kodi Date: 2010-07-14 23:18:42 +0200 (Wed, 14 Jul 2010) New Revision: 31689 Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod Log: [S32/Temporal] Permit days-in-month and is-leap-year on DateTimes, too. Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod === --- docs/Perl6/Spec/S32-setting-library/Temporal.pod2010-07-14 20:35:20 UTC (rev 31688) +++ docs/Perl6/Spec/S32-setting-library/Temporal.pod2010-07-14 21:18:42 UTC (rev 31689) @@ -16,7 +16,7 @@ Created: 19 Mar 2009 Last Modified: 14 Jul 2010 -Version: 12 +Version: 13 The document is a draft. @@ -157,9 +157,17 @@ month, the day itself included. For example, June 9, 2003 is the second Monday of the month, and so this method returns 2 for that day. +The Cdays-in-month method returns the number of days in the current +month of the current year. So in the case of January, Cdays-in-month +always returns 31, whereas in the case of February, Cdays-in-month +returns 28 or 29 depending on the year. + The Cday-of-year method returns the day of the year, a value between 1 and 366. +The method Cis-leap-year returns a CBool, which is true if and only +if the current year is a leap year in the Gregorian calendar. + The method Cwhole-second returns the second truncated to an integer. The CDate method returns a CDate object, and is the same as @@ -232,20 +240,23 @@ =head2 Accessors -The following accessors are pretty obvious, and are defined by example only. -See the test suite for more formal definitions. +CDate objects support all of the following accessors, which work just +like their CDateTime equivalents: -my $d = Date.new('2010-12-24'); -$d.year # 2010 -$d.month# 12 -$d.day # 24 -$d.day-of-week # 5 # Friday -$d.is-leap-year # Bool::False -$d.days-in-month# 31 -$d.Str # '2010-12-24' +year +month +day +day-of-week +week +week-year +week-number +day-of-week +weekday-of-month +days-in-month +day-of-year +is-leap-year -There are also Cweek, Cweek-year, Cweek-number, Cweekday-of-month, -and Cday-of-year methods, which work just like their DateTime equivalents. +The Str method returns a string of the form '-mm-dd'. =head2 Arithmetics
Re: r31651 -[S13] try to make multisig semantics slightly more generic so sigs can do better pattern matching
On Mon, Jul 12, 2010 at 7:59 PM, pugs-comm...@feather.perl6.nl wrote: Author: lwall Date: 2010-07-13 01:59:37 +0200 (Tue, 13 Jul 2010) New Revision: 31651 Modified: docs/Perl6/Spec/S13-overloading.pod Log: [S13] try to make multisig semantics slightly more generic so sigs can do better pattern matching ... +are not required to all bind the same set of formal variable names, +nor are all parameters of a given name required to bind with the +same type. Unbound parameters will be born with an undefined value +(even if they have a default). For any parameter that occurs in +multiple signatures with non-identical nominal types, the actual +lexical variable will declared will *be* declared? -- Aaron Sherman Email or GTalk: a...@ajs.com http://www.ajs.com/~ajs
r31690 -[S04] revise catcher semantics semantics to allow $!.handled = 1 to work as well as case match
Author: lwall Date: 2010-07-15 01:32:07 +0200 (Thu, 15 Jul 2010) New Revision: 31690 Modified: docs/Perl6/Spec/S04-control.pod Log: [S04] revise catcher semantics semantics to allow $!.handled = 1 to work as well as case match Modified: docs/Perl6/Spec/S04-control.pod === --- docs/Perl6/Spec/S04-control.pod 2010-07-14 21:18:42 UTC (rev 31689) +++ docs/Perl6/Spec/S04-control.pod 2010-07-14 23:32:07 UTC (rev 31690) @@ -13,8 +13,8 @@ Created: 19 Aug 2004 -Last Modified: 12 Jul 2010 -Version: 101 +Last Modified: 14 Jul 2010 +Version: 102 This document summarizes Apocalypse 4, which covers the block and statement syntax of Perl. @@ -993,18 +993,46 @@ default {...} } -you're really getting something more like: +you're really calling into a Icatch lambda that looks like: -CATCH { -when Mumble {...} -default {...} +- $! { +my $SUCCEEDED = 1; # assume we will handle it -leave(Failure); +given $! { +when Mumble {...} +default {...} +$SUCCEEDED = 0;# unassume we handled it +} -KEEP (die(Pending exceptions not handled in $!) unless all($!.pendingĀ».handled); $!.handled = 1); -UNDO die $!; +# the user may handle exception either by +# 1. pattern matching in the given +# 2. explicitly setting $!.handled = 1 +$!.handled = 1 if $SUCCEEDED; + +# conjecture: this might be enforced by the exception thrower instead +if $!.handled { +$!.wrap-die(Pending exceptions not handled) unless all($!.pendingĀ».handled); +} + +$!; } +The exception thrower looks up the call stack for a catch lambda +that returns the exception object as handled, and then it is happy, +and unwinds the stack to that point. If the exception is returned +as not handled. the exception thrower keeps looking for a higher +dynamic scope for a spot to unwind to. Note that any Cdie in the +catch lambda rethrows outside the lambda as a new exception, wrapping +up the old exception in its new pending list. In this case the lambda +never finishes executing. Resumable exceptions may or may not leave +normally depending on the implementation. If continuations are used, +the C$!.resume call will simply goto the continuation in question, +and the lambda's callframe is abandoned. Resumable exceptions may also +be implemented by simply marking the C$! exception as resumed, +in which case the original exception thrower simply returns to +the code that threw the resumable exception, rather than unwinding +before returning. + A CCATCH block sees the lexical scope in which it was defined, but its caller is the dynamic location that threw the exception. That is, the stack is not unwound until some exception handler chooses to @@ -1013,7 +1041,7 @@ CCATCH block to catch its own exception recursively forever. However, a CCATCH must not behave that way, so we say that a CCATCH block never attempts to handle any exception thrown within its own dynamic scope. -(Otherwise the Cdie in the previous paragraph would never work.) +(Otherwise any Cdie would cause an infinite loop.) =head1 Control Exceptions @@ -1132,7 +1160,11 @@ that the semantics would be preserved by merely printing out the error and going on. Since all exception handlers run in the dynamic scope of the throw, that reduces to simply returning from the Cwarn -function most of the time. +function most of the time. See previous section for discussion of +ways to return from catch lambdas. The control lambda is logically +separate from the catch lambda, though an implementation is allowed +to combine them if it is careful to retain separate semantics for +catch and control exceptions. =head1 The goto statement Xgoto
r31691 -[S04] more bombastic utterances about not dropping pending exceptions
Author: lwall Date: 2010-07-15 01:53:05 +0200 (Thu, 15 Jul 2010) New Revision: 31691 Modified: docs/Perl6/Spec/S04-control.pod Log: [S04] more bombastic utterances about not dropping pending exceptions Modified: docs/Perl6/Spec/S04-control.pod === --- docs/Perl6/Spec/S04-control.pod 2010-07-14 23:32:07 UTC (rev 31690) +++ docs/Perl6/Spec/S04-control.pod 2010-07-14 23:53:05 UTC (rev 31691) @@ -1043,6 +1043,16 @@ never attempts to handle any exception thrown within its own dynamic scope. (Otherwise any Cdie would cause an infinite loop.) +Any attempt to throw a fatal exception past an already active exception +handler must guarantee to steal the existing fatal exception (plus +any pending exceptions it contains) and add all those to the new +exception's pending list. (This does not apply to control exceptions +described in the next section.) When the new exception is handled, +it must also deal with the list of pending exceptions, or the Cwrap-die +mentioned above will throw a Pending exceptions not handled at that point. +Even this does not discard the pending exceptions, so in the final outermost +message, all non-handled exceptions are guaranteed to be listed. + =head1 Control Exceptions All abnormal control flow is, in the general case, handled by the