Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

masak (6289)

masak
  (email not shown publicly)
http://masak.org/carl

Been programming Perl since 2001. Found Perl 6 somewhere around 2004, and fell in love. Now developing November (a Perl 6 wiki), Druid (a Perl 6 board game), pls (a Perl 6 project installer), GGE (a regex engine), and Yapsi (a Perl 6 implementation). Heavy user of and irregular committer to Rakudo.

Journal of masak (6289)

Friday April 09, 2010
02:49 AM

It's about time

[ #40305 ]

jnthn++ touched upon the subject. I thought I'd do the same. We're rewriting the Temporal spec from scratch. It's not the first time this happens, but for some reasons, this attempt feels better than the previous ones.

Ever since the Web.pm work had its course plotted in more detail — not to mention since the work on GGE — I feel I belong to the "shameless copycat" school of design. More specifically, in many domains not directly related to the Perl 6 core model, our best chance of success is likely not to be oh-so-clever, but to start with something that works well in some other language (big-sister Perl 5, Ruby, Haskell, JavaScript, what-have-you), adapt it to Perl 6 idioms, and ship it. In the case of Temporal, the clear winner was CPAN's DateTime, a subset of which is now in Synopsis 32.

Imitation may be the sincerest form of flattery, but basing your design on something that already works also seems a fairly safe way to make sure that the design you end up with isn't and abstraction-laden heap of wishful thinking.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I personally vote for dashes-in-method-names++ ... easy to read and type.
    • The waves went high about this on p6l, but eventually dashes emerged as the clear winner. Temporal.pod now has it that way.

  • Please make it look like the PS model eg

    PS C:\> [datetime] | gm -Static

       TypeName: System.DateTime

    Name            MemberType Definition
    ----            ---------- ----------
    Compare         Method     static System.Int32 Compare(DateTime t1, DateTime t2)
    DaysInMonth     Method     static System.Int32 DaysInMonth(Int32 year, Int32 month)
    Equals       
    • I think we're already on the road to meeting your requests.

      DateTime.today()

      (DateTime.now - DateTime.new('2010-03-20T00:00:00')).days

      (With moritz++'s proposed Date class, the second example might be even more straightforward. It feels a bit silly to specify 00:00:00 just to be able to use the ISO8601 constructor.)

      Please create & publish an Amazon wish list so those wannabe P6 Medicis out there can thank you.

      As it happens, I have one already [amazon.com], but more for keeping track of things myself than for people to thank me.

    • Please create & publish an Amazon wish list so those wannabe P6 Medicis out there can thank you.

      The book [amazon.com] you bought for me arrived today. I just want you to know that not only was the book a pleasant surprise, but the act itself made me giddy with gratitude. Thank you so much! Hoping to find occasion to pay it forward [wikipedia.org] real soon.