Am 17.11.2010 10:31, schrieb Kris Shannon:
A recent rakudo commit [1] is a quick fix for #78896 [2] to allow
exponentiation of Duration's.

And it did so with a real world use case in mind.

I'm uneasy with allowing this and I think the spec probably meant not
to but is badly worded [3]:

  Durations allow additive operations with other durations, and allow
  any numeric operation with a number as the other argument:

      $duration * $duration    # WRONG, durations aren't geometric
      $duration * 2            # ok, a duration twice as long
      2 * $duration            # same

What are your thoughts?

I've summarized my thoughts here, before I read your email: http://perlgeek.de/blog-en/perl-6/real-world-strikes-back.html

Another example: current Duration % Duration is forbidden. But I have a very good use case:

suppose I want to organize a 60 minutes session, and it's filled with presentations, each 8 minutes long. How long do I have for the introduction, if I fit in as many presentations as possible?

The operation $session_duration % $presentation_duration answers me that. Why am I not allowed to carry out that operation? Because some designer thought I'd be better off not doing that operation. Wow, awesome reason</sarcasm>.

[1] 
https://github.com/rakudo/rakudo/commit/d9e22463479927fa8f1f594753979022de35970d
[2] http://rt.perl.org/rt3/Ticket/Display.html?id=78896
[3] 
https://github.com/perl6/specs/commit/32abb95b9776e1cb7672c8a6a77612c86b37aea2#L0R1333

Reply via email to