user-pic

moritz

  • Website: perlgeek.de/
  • About: I use Perl, and develop Perl 6
  • Commented on Are Restricted/Locked Hashes A Failed Experiment?
    We use them a bit at work. They helped me catch some typos while refactoring very messy code. That said, I'd be fine with a replacement module that works similarly to Python's NamedTuple (that is, you specify the keys at...
  • Commented on Using Role as Partial Classes
    To me, those roles sounds like a degenerate case of the normal "roles for code reuse" approach. Degenerate, because they are only composed into one class. But who knows, maybe in future there's something other than a character that does...
  • Commented on A small puzzle for you
    Here's my solution: https://gist.github.com/moritz/4421c5e9ab0e5d994bac...
  • Commented on Creating an MMORPG in Perl
    Question: do you want to hear more about my attempts to create an MMORPG in Perl, even if posts are not Perl-related? Doesn't quite fit the "RPG" part, but it fits the "MMO" part: http://www.lacunaexpanse.com/ the backend is mostly...
  • Commented on YAPC::Europe 2013 in Kiev, week minus 42. Food
    Please serve lunch right at the venue; it means attendants have to worry much less about where to get lunch, and it makes it much easier to converse with other people during lunch. I for one attend YAPC mostly for...
  • Commented on No Accepted Perl 6 Talks at YAPC::EU 2012?
    Thanks for looking into it. While you are at it, could you please send emails to those who have rejected talks too? It feels very weird to notify only speakers who have accepted talks....
  • Posted No Accepted Perl 6 Talks at YAPC::EU 2012? to moritz

    The YAPC::EU blog says "Our final voting round ends on Friday." So, Friday has gone by, does that mean that all talks that have not been accepted now have been rejected?

    And if so, are we really not going to have a single talk on Perl 6? I k…

  • Commented on Yet Another Friday the 13th
    Here's a Perl 6 one-liner: http://irclog.perlgeek.de/perl6/2012-07-18#i_5825055 say (2012..2017 X 1..12).map(-> $y, $m { Date.new($y, $m, 13) }).grep(*.day-of-week == 5)...
  • Commented on Perl first world problems #1
    About perlbrew being slow, if you have multiple cores you could try MAKEFLAGS=-j4 perlbrew ... to compile with 4 jobs in parallel....
  • Commented on Core Modules add/remove quick reference
    FWIW the data is all in Module::CoreList, getting it out isn't very hard....
  • Commented on How (not) To Load a Module or Bad Interfaces Make Good People Do Bad Things
    You are totally right, using a module is too much "black box" in Perl 5. And while require_module is certainly a start in the right direction, it might make more sense to start exposing the more low-level operations to the...
  • Commented on What are your environment settings for Unicode?
    FWIW I wrote http://perlgeek.de/en/article/set-up-a-clean-utf8-environment a while ago, but it probably needs to consider many more aspects and systems....
  • Commented on Perl Helps Save Endangered Languages
    I just downloaded the Perl client, and --list only shows to languages (Italian and Dutch). Is that normal? If not, where can I submit a bug report?...
  • Commented on Let's add Git userdiff defaults for Perl and Perl 6
    For Perl 6, instead of just 'sub', it's probably good to use multi|sub|submethod|method|macro Not sure if it's also a good idea to include BEGIN|END|INIT|CHECK etc., probably not....
  • Commented on Perl6 modules in Rakudo baby-steps, part 1
    For the record, you can also use the PERL6LIB environment variable on the outside of the program, just like PERL5LIB in p5....
  • Commented on Is 230 % 5 == 4? Sometimes it is.
    Output in Perl 6: 0. The reason is that 1.25 is represented as a rational number with integer numerator and denominator, so the identity 200 * 1.15 == 230 actually holds. Put another way: 15:47 <@pmichaud> I'd simply say that...
  • Commented on Grepping exact values
    In Perl 6 this form works already, because each list item is simply smart-matched against the first argument (aka matcher). If the matcher is a block/closure, the smart-matching executes the block, handing the list item as a parameter. If it's...
  • Posted Contribute to Perl 6, without huge startup costs to moritz

    Do you find Perl 6 interesting, but maybe not very accessible? Would you like to contribute half an hour of your time, if it doesn't involve learning a few new languages and weird parrot assembler langauges?

    Then participate in the ="http://perlgeek.de/blog-en/perl-6/contribute-now-…

  • Commented on Improve My Perl 6!
    You can force coercion to a hash with return %( gather for %preds.kv ...) But I'm not sure if you like that bettter. Also a perfect Perl 6 implementation wouldn't need %!freqs{$item1}{$item2} //= 0; and similar lines. I'm pretty sure...
Subscribe to feed Recent Actions from moritz

  • Jon Jensen commented on Are Restricted/Locked Hashes A Failed Experiment?

    I've used restricted hashes in a few ecommerce situations where they were indispensable, exactly as important and useful as `use strict` for making sure lexical accesses aren't typos.

    I don't have any opinion about whether restricted hashes should be part of all hash types -- I think I'd be fine using a special hashlike object since I haven't used them a lot. But in the cases I've needed them, they were really, really helpful.

  • Andreas Koenig commented on Are Restricted/Locked Hashes A Failed Experiment?

    kid51: short example

    % perl -le '
    use Getopt::Long;
    use Hash::Util qw(lock_keys);
    lock_keys %Opt, qw(mrg);
    GetOptions(\%Opt, "mrg=i") or die;
    if ($Opt{mgr}){
    print "INT=$Opt{mrg}";
    }
    '
    Attempt to access disallowed key 'mgr' in a restricted hash at -e line 6.

    An example that combines with Pod::Usage:
    http://repo.or.cz/cpan-testers-parsereport.git/blob/HEAD:/bin/ctgetreports

  • Mikko Koivunalho commented on Are Restricted/Locked Hashes A Failed Experiment?

    For me lock_keys is a typo checker, also but not limited for production code, also but not limited for blessed hashed.

  • Toby Inkster commented on Are Restricted/Locked Hashes A Failed Experiment?

    Locked hashes are great, but if the implementation is slowing down all hashes, then I agree they should no longer be built in, and should be moved to a module

    That said, I think it's an important enough feature that this module should be bundled with Perl, so that people relying on fields.pm (which was first released with Perl 5.5) and Hash::Util (Perl 5.8) won't need to install anything extra.

  • Alceu Rodrigues de Freitas Junior commented on Are Restricted/Locked Hashes A Failed Experiment?

    I have used Hash::Utils more than once, specially in OOP projects that I was using "default" OOP model of Perl (not Moose or anything like that).
    On the other hand, I usually don't start using it from scratch, usually when things starts to getting more complex and bugs starts to appear it is a sign that I should consider using it.
    It is good to be have options... sometimes you need flexibility (like expanding a…

Subscribe to feed Responses to Comments from moritz

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.