Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Temporal] made Dateish into a role
If nothing else, we get rid of one level of inheritance this way. jnthn
and I discussed it a bit, and it feels wrong-ish in Perl 6 to use a
base class as a collector of convenience methods.
  • Loading branch information
Carl Masak committed Oct 7, 2010
1 parent 377615e commit 9702438
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/Temporal.pm
@@ -1,6 +1,6 @@
use v6;

class Dateish {
role Dateish {
has Int $.year;
has Int $.month = 1;
has Int $.day = 1;
Expand Down Expand Up @@ -140,7 +140,7 @@ sub default-formatter(::DateTime $dt, Bool :$subseconds) {
!! 'Z';
}

class DateTime is Dateish {
class DateTime does Dateish {
has Int $.hour = 0;
has Int $.minute = 0;
has $.second = 0.0;
Expand Down Expand Up @@ -344,7 +344,7 @@ class DateTime is Dateish {

}

class Date is Dateish {
class Date does Dateish {
has Int $.daycount;

method !set-daycount($dc) { $!daycount = $dc }
Expand Down

0 comments on commit 9702438

Please sign in to comment.