in reply to Re: Re: Re: Re: Re^4: Perl6 syntax being too much complex? How we will teach and read that?!
in thread Perl6 syntax being too much complex? How we will teach and read that?!

Well, everything's an object underneath if you scratch it,...

That begs one more question, but I'll understand if it's too early for a difinitive answer:

Is my $sub = { .... }; a private subroutine declaration? (And are while/map/reduce etc. methods of a code object?)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
  • Comment on Re: Re: Re: Re: Re: Re^4: Perl6 syntax being too much complex? How we will teach and read that?!
  • Select or Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re^4: Perl6 syntax being too much complex? How we will teach and read that?!
by TimToady (Parson) on Mar 25, 2004 at 19:13 UTC
    That's two questions... :-)

    I would not call that a private subroutine declaration, but an anonymous subroutine stored in a private variable. You can already do the same thing in Perl 5, except you have to say "sub" explicitly. But if you want a private sub, either of

    my &foo = {...}; my sub foo {...}
    will work.

    As for your second question, in general we'll try not to hang specialized methods off of generic classes unless they really belong. Most of these things are multi-dispatched global subs instead. (And while is probably hard-wired in the interests of giving the optimizer as much information as possible, so that it can cheat on control exceptions like "next".)