user-pic

Toby Inkster

  • Posted Questioning the Role of API Design in Perl to Toby Inkster

    or Querying the Designated API of Perl Roles

  • Commented on lex parsimoniae
    Huh? $a_class->can('blessed') means nothing like what you seem to think it means. use v5.10; use strict; { package Foo; use Moose; } { package Bar; use Moo; } { package Baz; use Moose; use namespace::autoclean; } for my $class (qw(...
  • Commented on Dear Perl lazyweb: how to construct read-only data objects out of JSON?
    Here's a quick solution using Class::Tiny. It's not much more difficult with Moo. http://gist.github.com/10198397...
  • Posted Planet Moose - March 2014 to Toby Inkster

    Welcome to Planet Moose, a brief write up on what's been happening in the world of Moose in the past month, for the…

  • Commented on Python's decorators in Perl
    Attributes are isa-scoped. So you can define them in package X, and then use them not only in X, but also in any package that inherits from X. (The gotcha is to make sure you declare inheritance at compile-time rather...
  • Commented on RSS feed for blogs.perl.org
    There's an Atom one....
  • Commented on Life is good
    More seriously: orignal....
  • Commented on Life is good
    Is it supposed to be funny because it's an anagram of groinal?...
  • Commented on YAMADDP (Yet Another Moose ADD Post)
    It should be possible to usefully use a default with a SetOnce attribute, provided you make the attribute lazy. (However, this will make read accesses to the accessor count as "setting it" if they result in the default being returned....
  • Commented on Ok No is not Moose
    no is not a memory saving technique. The module is still loaded in memory after calling it. It's just a hook for modules to tidy up after themselves, or switch off their effects. For example: my $sum = do {...
  • Commented on Notice: forthcoming change to Type::Tiny overloading
    It's never worked especially cleanly because of issues with precedence. Consider: ArrayRef[Str] + Split which Perl parses as: ArrayRef( [Str] + Split ) To make it do what you mean, you need to add parentheses: (ArrayRef[Str]) + Split Graham Knop...
  • Posted Notice: forthcoming change to Type::Tiny overloading to Toby Inkster

    One of the features of Type::Tiny that differentiates it from Moose's built-in type constraint system is that it allows stand-alone coercions which can then be mixed with type constraints as required. So if you had a Split coercion which split a multi-line string…

  • Commented on map/grep is not a real iterator?
    The input list is as much the killer as the output list is. You can test that using: perl -e'map{print if $_ %1000==0; ()} 1..100_000_000' which of course will return the empty list. The problem is that for map Perl...
  • Commented on Moose, Mouse, Moo what next 'M'
    Also, the "attributes" discussed in perldoc attributes are an entirely different thing to the "attributes" defined by Moose/Mouse/Moo. Same word used for two unrelated purposes. The former "attributes" are similar to "decorators" in Python; the latter "attributes" are what might...
  • Commented on Moose, Mouse, Moo what next 'M'
    M is old news....
  • Commented on Perl Help :(
    This is a community blog, not a help forum. You'll get better answers asking in PerlMonks, StackOverflow, or IRC....
  • Commented on perldoc -l for modules without pod
    Have you tried perldoc -lm?...
  • Posted DOAPy Dist to Toby Inkster

    So what's DOPE? No, not DOPE, DOAP... what's DOAP?

    Here's what Wikipedia has to say...

    DOAP (Description of a Project) is an RDF Sche…

  • Commented on Precision Testing for Modern Perl
    It will eventually become aged. Then I (or someone) will have to write Test::Postmodern. Hopefully that won't be necessary for a few years....
  • Commented on A-tisket a-tasket a little perl hash basket
    Also, you might want to change the test to something like this: like($key_count, qr{ \A [0-9]+ / [0-9]+ \z }x, 'key count looks sane');...
  • Commented on A-tisket a-tasket a little perl hash basket
    The pod abstract is still wrong (though it claims to be fixed in the changelog). It needs to be: =head1 NAME Orignal - Very simple properties/attributes/fields for Perl So the section heading is "NAME" in upper-case....
  • Posted Precision Testing for Modern Perl to Toby Inkster

    I got to thinking... there are all these little frameworks on the CPAN like

  • Commented on I Hate Cheats
    MooseX::Privacy is slow; doesn't offer true private methods (in the sense used by Java, PHP, etc); and it's quite trivial to work around... package Something::Else; use Acme::Moose; my $obj = Acme::Moose->new; my $happiness = do { package Acme::Moose; $obj->happiness; };...
  • Commented on Falsehoods Programmers Believe About Names
    Yes, it's an article I've referred people to many times. One of the reasons people often think they need to have database fields like title, first_name and last_name is that they need to, say, address envelopes to "Ms Alice Jones",...
  • Commented on Not a Llama
    You forgot to s/Llama/Moose/ in a crucial place... Acme-Llama-0.01....
  • Commented on Subroutine signatures in Perl are long overdue
    I've actually been doing quite a bit of work to get Kavorka's method signature syntax to be compatible (a superset) of the Perl 5.20 sub signature syntax. I've also filed "wishlist" bugs against Method::Signatures and Function::Parameters to the same end....
  • Commented on perl Surprises me Yet Again
    A related construct can be used for sometimes pushing to one array and sometimes to another: push @{ cond ? \@a : \@b }, $xxx;...
  • Posted A Less Smart Smartmatch to Toby Inkster

    The smartmatch operator (~~) introduced in Perl 5.10 (and borrowed from Perl 6) has been the subject of much criticism. Its behaviour changes based on the types of its arguments (arrays vs hashes vs numbers vs strings vs ...).

  • Posted Planet Moose - February 2014 to Toby Inkster

    Welcome to Planet Moose, a brief write up on what's been happening in the world of Moose in the past month, for the…

  • Posted My Favourite Test::* Modules to Toby Inkster

    If you don't test your code, what makes you think it works?!

    Here are some of my favourite modules for testing Perl code.

Subscribe to feed Recent Actions from Toby Inkster

Subscribe to feed Responses to Comments from Toby Inkster

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 run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.