Ovid (publius_ovidius) wrote,
Ovid
publius_ovidius

  • Mood:
  • Music:

Pleasant pre-Christmas Evenings

So I started writing a post about my "fantasy" Christmas list. One idea was the idea of buying a bottle of cheap whiskey and a pack of fags for the elderly mother of my long long adopted brother and sister. However, my present list got offensive enough that it offended even me! So I'll just say that after wrapping a few presents for family members, I am having a thoroughly pleasant evening drinking rum and Coke and working on Perl 6. All I can say is that Perl 6 rocks!

  # P12 (**) Decode a run-length encoded list.
  #
  #     Given a run-length code list generated as specified in problem P11.
  #     Construct its uncompressed version.
 
  sub decode(*@list) returns Array {
      gather {
          for @list -> $elem {
              take $elem.isa(Array) ?? $elem[1] xx $elem[0] !! item $elem;
          }
      }
  }
  decode( [4, "a"], "b", [2, "c"], [2, "a"], "d", [4, "e"] ).perl.say;

And if you don't think I'm totally cool, just check out my "current music".

In other news, why the hell do I feel so guilty for not doing more to promote Perl 6?

Tags: family, perl, personal, programming
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 12 comments