Slashdot Mirror


Exegesis 3 Released (Perl 6 Examples)

chromatic writes "On the heels of Larry's most recent revelation, the mad scientist of Perl (Damian Conway) has followed up with Exegesis 3. His article gives working Perl 6 code examples of Larry's design decisions." Lots of good stuff in here.

6 of 85 comments (clear)

  1. Still prefer scalars, I do. by imrdkl · · Score: 2, Interesting
    The flattening star *@array seems to give basically the same behavior as an real array parameter dereference in perl5, gobbling every other parameter to the end. OTOH, making an array parameter require a actual array is an improvement, I guess, because at least there is now a way to pass scalar after array without having it be gobbled up by the array.

    For me tho, I guess I'll stick with array reference arguments, anyways. Probably still cheaper and faster. I wonder also if what Damian says is true:

    In other words, a @ parameter in Perl 6 is like a \@ context specifier in Perl 5. .

    I suspect that passing an actual array is still "by value". Seems like alot of work to avoid confusion that is not really very confusing.

  2. i hold my breath and... by d_i_r_t_y · · Score: 2, Interesting
    ...await what LW and the gang make of what i really care about -- built-in language support for OOP. i can live with spelling '->' as '.' and using an underscore for concatenation, but what i really want to know is -- will perl6 allow me to write 50K lines of OO perl that doesn't depend on my client coders being able to read my source to be sure they don't trample over my member objects? all i'm really dying for with perl is some clean feel-good OO syntax and real encapsulation:

    public class MyPerlClass
    {
    my public $member_obj1 = new CGI ();
    my private %hash = ( 'some' => 'values' );
    my private int foo = 1;

    public sub new ( const int $int )
    {
    this.foo += $int;
    return this;
    }

    public sub get_foo ()
    {
    return this.foo;
    }

    public sub set_foo ( const int $new_foo )
    {
    this.foo = $new_foo;
    }

    private sub _recalculate_stuff ()
    {
    # some important stuff here...
    }
    }


    perl-lover and then some, but give me syntax sugary OO dear larry!!!
    d_i_r_t_y

  3. wow, perl meets apl by scrytch · · Score: 4, Interesting

    I do love the hell out of perl, but I sure hope I can "use English 'operators';" for things like the hyper-operators. 'course, maybe 'use English' is deprecated ... can't wait for 'use Chinese', imagine what perl would look like then...

    I would much rather see "@diffs = @set1 ^- @set2" expressed as a list comprehension, say @diffs = (each $x - $y suchthat $x in @set1, $y in @set2); (assuming I have said "english operators" on, otherwise I would imagine at least the 'suchthat' operator would be some punctuation char). It's a bit contrived for something as simple as subtracting every member of a couple lists, but list comprehension is beautiful stuff when combined with lazy evaluation in languages like Haskell.

    Oh, and Perl6 is going to have an 'in' operator, right?

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  4. Re:Some thoughts by archen · · Score: 2, Interesting

    Yeah, I'm pretty leary of any operator that can't be made by a key on my keyboard (or at least with a shift+key).

    Well I'm also sort of leary about any Perl article that goes into talking about "Schwartzian Transformers". Say what?!

    I think Perl 6 is starting to make me paranoid.

  5. Re:Some thoughts by smcdow · · Score: 2, Interesting

    Well I'm also sort of leary about any Perl article that goes into talking about "Schwartzian Transformers". Say what?!

    Aw, c'mon. Schwartzian Transforms have been around for as long as Perl 5 has been.

    my @output =
    map { $_->[0] }
    sort { $a->[1] cmp $b->[1] }
    map { [$_, expensive_func($_)] }
    @input;

    A sort between two maps. Doesn't get much simpler than that.

    --
    In the course of every project, it will become necessary to shoot the scientists and begin production.
  6. Unfortunately you will probably get your wish by Ars-Fartsica · · Score: 3, Interesting

    I believe there is extensive remodelling called for by the current Perl6 gameplan, although I think this will further distance Perl 6 from Perl 5 programmers, and most likely some of them will simply move on to other languages which don't seem like such moving targets (although with Python claiming a signficant rewrite in the future, there may not be much of a safe harbor outside of yuck Java).