user-pic

Aristotle

  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    Meanwhile the way I actually need it to work right now is not even an option. :-) […] I see how to work around it, thanks to your continued efforts to enlighten me. You’re aware that sentence 2 there directly...
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    Another try: Then (?: and (?= would mean the exact same thing. Wait ... what? I don't follow that at all. A(?:B) means an "A" followed by a "B." A(?=B) means an "A" followed by a "B," except don't include...
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    Why, "AC" of course. If tell you to match "ABC" but leave the "B" out, what else could you possibly get? And what would @- and @+ contain?...
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    That surprise is ignorance leaving your mind. :-) Please do yourself a favour and read Mastering Regular Expressions. You seem to have a mistaken mental model of how regexps work; that book will beat you into shape....
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    A(?=B) means an "A" followed by a "B," except don't include the "B" in the match string. I'm not sure how the consecutive-ness of anything would impact that. Then if you could write 'ABC' =~ /(A(?=B)C)/ and have it match...
  • Commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    if two consecutive zero-length tokens need to match, they must both match at the same point? Yes. Consecutive tokens should match consecutively, it seems to me, regardless of their length. That wouldn’t make any sense. Then (?: and (?= would...
  • Commented on A Naïve SQL Shell
    If you can install modules, DBI::Shell and you’re done....
  • Commented on Python is The New "Write-Only, Linenoise" Language
    my @list1 = 'a' .. 'h'; my @list2 = <x y>; my $n = 3; # (where did this go in your translation?) say flat roundrobin @list1.rotor($n - 1, :partial), @list2;...
  • Commented on Python is The New "Write-Only, Linenoise" Language
    ['a', 'b', 'x', 'c', 'd', 'y', 'e', 'f', 'g', 'h'] […] # OUTPUT«a x b y c d e f g h» Uhm, you did notice that “a b x c d y” is not the same thing as...
  • Commented on Python is The New "Write-Only, Linenoise" Language
    say join '', (u.comb Z l.comb) You can also do either of these: say [~] (u.comb Z~ l.comb); say [~] flat (u.comb Z l.comb);...
  • Posted Perl&#160;6 to Aristotle

    Wow, you people.

  • Posted Making local::lib real easy to use to Aristotle

    In bash, at least.

    Just paste this (on your command line or into .bashrc or wherever else you want):

    perl-lib() { eval "`perl -M'local::lib @ARGV' - "$@" 0<&-`" ; }
    

    Then you can just say things li…

  • Commented on Test::More: Clearing up some confusion
    Test::More is not changing in any significant way. I am aware that you say this in response to people freaking out about you supposedly changing the stuff in Test::More. And if you do have no changes planned in Test::More (and...
  • Commented on In “Cede Your Soul”, an episode of a tv show called “Blindspot”...
    But can you orbiculate your ideas if you ovoid that aspect?...
  • Commented on Tiny Games with Perl 6
    Or a |() to slip it....
  • Commented on P6SGI: More of a Journey than a Destination
    Whether middleware implements some fancy protocol on top of HTTP or the application does it is not that important. From the perspective of the server, that’s true. From the perspective of the (codebase of the) application, it’s the other...
  • Commented on P6SGI: More of a Journey than a Destination
    Something that occurs to me here: For background, I am the author of Plack::Middleware::MockProxyFrontend. That module uses psgix.io to unwrap the SSL layer from CONNECT requests and then process the inner connection again. (See also) So while the low abstraction...
  • Commented on P6SGI: More of a Journey than a Destination
    The psgix.io refactor can almost certainly be backported, albeit with a clumsier API. A bigger issue is that then you’ll have to get the servers to support it....
  • Commented on How each drove me crazy
    Actually this is a case where each could be fine, because the loop body is not making any calls to other code that could be messing with the hash’s iterator. He just has to reset the iterator every time he...
  • Commented on How each drove me crazy
    Why not values? You’re not using the keys for anything....
  • Commented on A Date with CPAN, Part 1: State of the Union
    Other options: Class::Date, Panda::Date, Date::Handler. API-wise they all have a large overlap with Time::Piece (which was once Time::Object, which is still on CPAN), and Panda::Date is apparently intended as a sort of XS rewrite of Class::Date to make it very...
  • Commented on Fluent interfaces in Perl 6
    Also you are directly setting attributes, rather than using a public API - isn't that usually something bad in OO code? Attributes in the interface don’t have to translate to fields in the class and assignments to such attributes...
  • Commented on P6SGI: 4 Myths Dispelled
    The last one is baffling to me. Isn’t Perl 6 itself “just rehashing” 30-year-old technology?...
  • Commented on Dispatch Tables
    Just put a prefix on the names of functions. sub cmd_greet { print "Hello!\n" } sub cmd_inquire { print "How are you?\n" } sub cmd_bye { print "Farewell!\n" } sub secure_enough_call { my ($cmd) = @_; my $sub = __PACKAGE__->can("cmd_$cmd")...
  • Commented on Converting glob patterns to regular expressions
    But I like the spread-out version better. :-) I find it much easier to understand what’s going on there. And I typically find it easier to reason about stars and pluses than counted repetitions, even if it means I have...
  • Commented on Refactoring Very Old Perl 5 in Perl 6
    Turns out I did not. The above comment is wrong. However, what has happened is that .index now returns an Index value, which is just like an Int except it is only false when it is undefined. So you can...
  • Commented on Refactoring Very Old Perl 5 in Perl 6
    If I caught the most recent developments right, .index($substr).defined is now called .contains($substr). With that, the entire loop body becomes just .say if .contains($string) && .words[1] != $*PID...
  • Posted Developing virtualhost-aware PSGI applications: Plack::Middleware::MockProxyFrontend to Aristotle

    Let’s say you work on a team that runs a web content management system for various different customers. It is hosted at ourcms.com, but each customer’s public content is published on a different domain, which is determined by a setting in the interface, which…

  • Commented on MakeMaker among the stars
    And this is a preemptive comment about the spelling difference....
  • Posted MakeMaker among the stars to Aristotle

    It is part of our solar system now.

    Now that’s legacy.

    Maybe the fault is, indeed, not in our stars.

Subscribe to feed Recent Actions from Aristotle

  • Buddy Burden commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    Consecutive tokens should match consecutively, it seems to me, regardless of their length.

    That wouldn’t make any sense.

    It doesn't make any sense that consecutive atoms should match consecutively? :-D I dunno man ... that's what makes sense to me ...

    Then (?: and (?= would mean the exact same thing.

    Wait ... what? I don't follow that at all. A(?:B) means an "A" followed by a "B." A(?=B) means an "A" followed by a "B," except don't include the "B" in the match s…

  • Buddy Burden commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    If they are zero-length, then "at the same point" is the same as "consecutive".

    But that's only true from the perspective of the match string. That is, when we say a look-ahead subpattern is "zero-length," what we really mean is it corresponds to zero characters in the match string. But (assuming it is non-optional) it does not correspond to zero characters in the source string. So when I say:

    /A(?=B)/

    that can only match two characters in the source string. Or, to look at it another way, a single-character string could…

  • Buddy Burden commented on A Date with CPAN, Part 6: Time Won't Give Me Time

    Oh, hey! I didn't respond to the second half of your comment. :-) Sorry about that.

    not to mention the repitition of "B," which in reality is a more complicated subpattern

    No problem.

    /(?:X|Y)$|B(?= C$|$)/

    Or if the $ was actually a more complicated subpattern too, you could DRY this out further:

    /(?:X|Y)$|B(?=(?: C)?$)/

    Admittedly, that is clever. I had not considered sticking the $ into the look-ahead. So that is certainly a possible solution that I may well look at changing ov…

  • Buddy Burden commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    Then if you could write 'ABC' =~ /(A(?=B)C)/ and have it match because consecutive, which portion of the string would $1 be supposed to contain?

    Why, "AC" of course. If tell you to match "ABC" but leave the "B" out, what else could you possibly get?

    I'm assuming that doesn't make any sense to you, but it seems perfectly obvious to me. :-)

  • Buddy Burden commented on A Date with CPAN, Part 6: Time Won't Give Me Time
    That surprise is ignorance leaving your mind. :-)

    Hmmm ... I would say instead that it's the sound of my brain bouncing off a wall because the feature that sounded like it did exactly what I wanted did nothing of the sort. ;->

    You seem to have a mistaken mental model of how regexps work; that book will beat you into shape.

    Well, I certainly have a mistaken mental model of how look-ahead works. But of course that's only one small piece of regular expressions. One which just hasn't come up all that often in the course …

Subscribe to feed Responses to Comments from Aristotle

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.