r30456 - docs/Perl6/Spec

2010-04-23 Thread pugs-commits
Author: masak
Date: 2010-04-23 18:17:12 +0200 (Fri, 23 Apr 2010)
New Revision: 30456

Modified:
   docs/Perl6/Spec/S03-operators.pod
Log:
[S03] corrected typo

Modified: docs/Perl6/Spec/S03-operators.pod
===
--- docs/Perl6/Spec/S03-operators.pod   2010-04-23 11:07:13 UTC (rev 30455)
+++ docs/Perl6/Spec/S03-operators.pod   2010-04-23 16:17:12 UTC (rev 30456)
@@ -3986,7 +3986,7 @@
 R<=>
 
 The precedence of any reversed operator is the same as the base operator.
-The associative is I reversed, so
+The associativity is I reversed, so
 
 [R-] 1,2,3   # produces 2 from 3 - (2 - 1)
 



r30459 - docs/Perl6/Spec

2010-04-23 Thread pugs-commits
Author: masak
Date: 2010-04-24 02:25:30 +0200 (Sat, 24 Apr 2010)
New Revision: 30459

Modified:
   docs/Perl6/Spec/S12-objects.pod
Log:
[S12] straightened up the language

Modified: docs/Perl6/Spec/S12-objects.pod
===
--- docs/Perl6/Spec/S12-objects.pod 2010-04-23 23:17:38 UTC (rev 30458)
+++ docs/Perl6/Spec/S12-objects.pod 2010-04-24 00:25:30 UTC (rev 30459)
@@ -506,7 +506,7 @@
 @list.grep({ $_ % 2 }).map({ $_ - 1 }).say
 
 Since the colon does not require a space in this case, and it looks
-kinda funny to put it, it may be clearer to omit the space to make
+slightly odd there anyway, it may be clearer to omit the space to make
 the method calls on the right look more like they attach to the term
 on the left in one cascade of method calls:
 



Re: Proposal for a new Temporal time-measurement paradigm

2010-04-23 Thread Darren Duncan

Jon Lang wrote:

Why do I find myself thinking of roles and classes here?

IMHO, we should have a role that represents abstractly a moment in
time.  This role should, in and of itself, not be tied to any
particular calendar; its purpose is so that one can write functions
that make reference to instances in time without locking oneself into
a particular labeling scheme.  We should also have a series of classes
that compose that role, each class representing a different calendar
scheme.  For perl 6.0.0, only one such class need be defined: the one
representing the Gregorian calendar.  Later on, modules can be written
to provide additional classes representing other calendar schemes.

Fine in theory; in practice, the big question is: how much can we get
the role to do, within the "no calendar preference" constraint?  And a
corollary to this: can we get it to do enough to be worthwhile?


I think that the most thorough solution is to just take it for granted that 
there are multiple reference timelines/calendars and that in general it is 
impossible to reconcile them with each other.


And so, what we can do in general is simply have an Instant role and a Duration 
role, and pairs of types where each member composes one of those, and then all 
that needs to exist for temporal routines is an independent collection for each 
pair that is closed within that pair.


Each instant simply says, "I am this point on this particular 
timeline/calendar", and not try to imply that it is anything against any other 
calendar.


For example, each instant is only a datetime in the Gregorian or Julian or 
Muslim or Jewish or TAI-1958 or TAI-1970s or whatever.


This may result in a proliferation of calendars, but that can be blunted 
somewhat anywhere there are multiple measuring systems that are guaranteed to be 
commonly-defined.


Similarly, there would be a calendar for "I don't know what calendar", or 
varying degrees of such, which is often the case for dated historical records.


So all Perl 6 really needs to define is:

1.  There is an Instant role and a Duration role.

2.  A Duration is an amount of time that isn't fixed on a timeline; to get 
something fixed on a timeline, use a Range of Instant.


3.  The system routine now()/etc returns a value of some Instant-composing 
class.

4.  The Instant/Duration roles define functions like these:

abs Duration -> Duration
Duration + Duration -> Duration
Duration - Duration -> Duration
Duration abs_diff Duration -> Duration
Duration * Numeric -> Duration
Duration / Numeric -> Duration
Instant - Instant -> Duration
Instant abs_diff Instant -> Duration
Instant + Duration -> Instant
Instant - Duration -> Instant

5.  There are absolutely no attributes defined by the Instant or Duration roles; 
attributes are defined entirely by the specific implementing classes, or other 
roles that they compose which compose Instant or Duration etc.  There is no 
concept of years/days/etc in Instant or Duration.  We might be counting time on 
Mars for example, so no Terra-centricity.


So, basically like that.

It keeps the core very simple and we avoid most of the bikeshedding seen so far.

What calendars/timelines are supported can be implementation-defined and/or 
provided by modules.  Each Perl 6 implementation can be minimalist as far as 
composing classes go; just provide some programmatically readable way to 
discover what calendar the system uses so then modules can use that to decide 
how to make a particular calendar work on any system as possible.


This brings up a new discussion point though:  We should come out with a list of 
distinct timelines/calendars and canonical names for them with respect to Perl 
6.  So to at least help those who are trying to use the exact same calendar to 
recognize that they are doing so.


-- Darren Duncan