On Wed, 18 Feb 2009, Dave Rolsky wrote:

On Wed, 18 Feb 2009, Timothy S. Nelson wrote:

Agreed, and that's kinda what I'm doing. But I still think there's room for improvement. I'll try and design an API that does what DateTime does, but:
1.      Uses more variables, of which I expect the getters and setters to be
        overridden.

What does that mean?

s/variables/attributes/ in what I said. Basically, I'm proposing something like:

role    Instant { # Someone suggested Instant instead of DateTime
        has $hour;
        has $epoch;
...
}

        Then we could do this:

$tobj = new Instant(...);
$tobj.epoch = 123456789;
$thishour = $tobj.hour;

...and when we read the hour, it will automatically convert from the epoch.

2.      Documents in terms of operator overloading

I'm assuming that Perl 6 will make overloading saner. In Perl 5, it's a nasty hack.

        That's the plan.

5. As a consequence of all of the above, has a lot fewer functions (while still providing all the same functionality).

Also good.

I've actually started on some DateTime stuff for Perl 6, sort of.

        Great!  That's a relief to me :).

One thing I'd like to do is have Date, Time, and DateTime classes. There's a lot of people who _only_ need dates, and having to deal with time (and therefore time zones and other madness) is a useless conceptual burden.

I've specced that, but was about to kill it until you recommended it :).

I was also hoping to separate out leap second handling so that it was a layer on top of a simple TAI-based underpinning.

        I'll leave leap seconds to you :).

But really, I'd hate to see any of this be core. Date and time modules will need to be released regularly to keep up with things like locale updates, time zone changes, leap second announcements, etc.

Yeah, I can see the problems. My plan is to make some simple roles that could be composed into the real DateTime objects later on.

It wasn't clear to me whether you were proposing putting this yet-to-be-named thing core, of course.

After discussion on IRC, I'd say a simple one in core, just enough to do what the other core modules need, and leave the heavy lifting to CPAN.

        :)


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

Reply via email to