Slashdot Mirror


User: b2gills

b2gills's activity in the archive.

Stories
0
Comments
14
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 14

  1. Re:BS on The Slashdot Interview With Larry Wall · · Score: 1

    Perl 6 has a similar feature: gather / take.
    ( with Python's yield being roughly the same as take )
    The reason for for the gather is that it requires you to be explicit about where the generator is, unlike Python which is implicit.

    my @even = gather loop { take $ += 2 };
    say @even[^10]; # (2 4 6 8 10 12 14 16 18 20)


    Which in this case would be better written as

    my @even = 2,4,6 ... *;

    Here is another example.

    # note that this isn't a generator on it's own like it would be in Python
    sub roll-die () { take ("\c[DIE FACE-1]".."\c[DIE FACE-6]").roll }

    sub weird-list (){
    gather {
    take 1;
    take my $a = 3;
    take ++$a for ^10;
    roll-die();
    }
    }

  2. Re:Ternary Fail: "??", "!!" on The Slashdot Interview With Larry Wall · · Score: 2

    Considering the Regex code that I see in Perl 6 is easier for me to read than the Perl 5 equivalent. I have more than a decade's worth of experience with the latter, but only a couple years worth in the former. I would definitely say it is worth it.

    I would like to see a conventional regex for JSON that is easier to read and understand than JSON::Tiny::Grammar.

    Everything that was broken deserved to be broken, and was replaced by a much more generally useful feature.

    ( That said there is an adverb that you can add to regexes so that you get the Perl 5 semantics )

  3. Re:Moose and Perl5 on Interviews: Ask Perl Creator Larry Wall a Question · · Score: 1

    There is a project similar to Moose that has been worked on that is planned to go into Perl 5.

    Also Larry hasn't been active with Perl 5 for 15 years, so not actually a good question for him

  4. Re:Parrot VM on Interviews: Ask Perl Creator Larry Wall a Question · · Score: 1

    Rakudo and Parrot started to go in different directions well before they officially parted ways.

    Perl 6 wouldn't be where it is today without Parrot, it also wouldn't be here if Rakudo still supported it.

  5. Re:Perl 6 for Perl 5 developers on Interviews: Ask Perl Creator Larry Wall a Question · · Score: 1

    I wouldn't make any major applications in it just yet, but there are people who have said that they have used it in production in smaller roles.
    Really it is a fairly big departure from pretty much all other languages including Perl 5, so I would recommend just tinkering with it for a while.
    There is an Inline::Perl5 for Perl 6 and an Inline::Perl6 for Perl 5, so you could write small tools in Perl 6 that integrate with your existing Perl 5 codebase.

  6. Re:what do you think about the perl guy? on Interviews: Ask Perl Creator Larry Wall a Question · · Score: 1

    They aren't bugs in the language they are design decisions made in very early versions of the language, back when it was basically just a combination of sed awk sh and C.
    None of those languages has lists of lists, not like modern languages anyway.
    It wasn't until Perl 5 that arrays of arrays without using symbolic references was possible, and that came out before the first version of Java in 1994 (It had features even back then that Java didn't, like closures and lambdas).
    I find it amazing just how capable it can be and still maintain over 90% compatibility all the way back to Perl 1 from 1987.
    I mean there is probably a bigger difference between Perl 5 of 10 years ago, and that of today, than between Python 2&3, but upgrading Perl isn't that big of a deal.

    As to calling subroutines or methods inside of a key value argument list, I thought everybody knew that you have to either put scalar in front of it, or do something else to make sure it doesn't clobber the rest of your arguments, like put it in an anonymous array ref.

    Also any argument about Perl 5 coming from someone who thinks that @list is a list should be taken with a grain of salt.
    I mean I think that was literally the only time I have ever seen a Perl 5 array named @list. ( other than right here of course )

  7. Re:what do you think about the perl guy? on Interviews: Ask Perl Creator Larry Wall a Question · · Score: 1

    And yet it had absolutely nothing to do with Perl 6, none of the things he pointed out work that way in the new sister language.

  8. Re:what do you think about the perl guy? on Interviews: Ask Perl Creator Larry Wall a Question · · Score: 1

    I saw the first one, it was hilarious how many mistakes he made.
    He thinks that @list is a list, what a newb.
    There was one slide that had like 5 errors on it, if I liked cringe humor I would have been laughing my ass off.

  9. Re:Just one question on Interviews: Ask Perl Creator Larry Wall a Question · · Score: 1

    The problem was that the edges of what was possible to do were starting to show, and some of the design decisions were difficult for new Perl programmers to learn.
    None of that could be changed without major backward compatibility breakage.

    We're talking changes bigger than that of Python 2amp;3.

    The main thing I like about Perl 6 is that it has many features from many languages, but manages to combine them in a way that they all seem like they have always belonged together.
    How many other languages have a class based regular expression system that doesn't seem tacked on?
    I once came across a Python project that attempted to replicate it, but not only was it tacked on, it wasn't even class based as far as I could tell.
    ( there didn't appear to be a way to subclass a grammar, and the tokens/rules didn't appear to be methods )

  10. has Perl 6 flopped? on Interviews: Ask Perl Creator Larry Wall a Question · · Score: 1

    How could it have flopped in just 6 months? Especially as I regularly see new people on irc.freenode.net#perl6. (we also had to split up the channel because it was getting difficult to discuss the actual implementation because of all the activity)

    I will grant you that the Perl 6 project is a lot older than that. I'm actually glad it wasn't a rush job, just image how bad of a language it would have been as a result <cough>php</cough>.

    You're probably one of those people who are deluded into thinking that Perl25 is on its deathbed. In fact there has been more activity on the Perl5 core in the past 5 years than there was on the previous 10 years. ( Actually a similar thing could be said about Perl6 as well )

  11. Re:After 15 years of failure, not work. on Perl 6 Released (wordpress.com) · · Score: 1

    Actually Camelia ( the butterfly logo ) is a test to see if we want you in the community.
    You have failed the test.

  12. Re:Perl6 greatest failure on Perl 6 Released (wordpress.com) · · Score: 1

    Why would you think that is a reference? We're talking about Perl 6 not C. That is a term definition, which is a bit like a constant alias, or static single assignment.
    One of the things I really like about Perl is that when you are reading the code you can instantly recognize the variables.
    Also you can add new operators by simply adding a subroutine. ( In fact all of the operators except the hyper and meta operators are implemented that way in Rakudo )

    sub postfix:<!> ( UInt $n ) is tighter(&[,]) { [*] 2..$n }
    say 5! ; # 120
    say (0..10)>>! ; # (1 1 2 6 24 120 720 5040 40320 362880 3628800)

    say infix:<+> 4, 5; # 9

    my &square = &infix:<**>.assuming(*,2);
    say square 5; # 25


    By allowing you to create new operators it is hoped that you won't do something stupid like use << for IO or + for string concatenation.

  13. Re: PHP vs Perl on Perl 6 Released (wordpress.com) · · Score: 1

    The most recent version of Perl5 has experimental support for subroutine signatures. ( I doubt it will change incompatibly before it is no longer experimental. )

  14. Re:PHP vs Perl on Perl 6 Released (wordpress.com) · · Score: 1

    I'm sure that one of these is less than 5 years old: Lacuna Expanse, Duck Duck Go, Geekuni, Questhub, The Game Crafter, Treasurer's Briefcase