Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

5.12 proposals

Journal written by schwern (1528) and posted by brian_d_foy on 2008.01.11 18:29   Printer-friendly
Now that 5.10 is out, rjbs and I have fired off a bunch of proposals for 5.12 features to p5p. These are things which should be dead obvious, at least on the surface.

rjbs proposed...

Was I called as a method? A caller() extension so a routine can tell if it was called as a method or not.

Lexical named subroutines:

my sub foo {...}
to take over from

my $foo = sub { ... };
. Yes please, I'll take 10.

Anonymous packages: Yep, a namespace with no name.

I've proposed...

Named subroutine parameters:

sub foo ($this, $that) { ... }
Oh god please can we? The idea is to start simple and obvious and build out from there. Discussion is positive and lively. There's lots of small, but very important, details to work out.

method declaration:

method foo { return $self->{foo} }
No more my $self = shift;!
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.

5.12 proposals 11 Comments More | Login | Reply /

More | Login | Reply
Keybindings Beta
Loading ... Please wait.
  • It's maybe kinda obvious and you've probably already discussed this in depth, but wouldn't it be useful to try and pick some features like Perl 6 is doing?

    In particular, I'm thinking about named parameters: I think that if Perl 5 is going to have them, it
    • Re: (Score:1)

      Except that Perl 6's named parameters are implemented in terms of Capture objects, which are complicated, full of all manner of Perl 6ish syntax, and can be used all over the place for lots of other things.

      That's not to say that they're bad, or that they w
  • junctions would make given even more powerfull and if (3 $a 7) { looks also very nice.
  • Especially if we could cheaply prevent those methods being called as functions.
  • What I'd like to see is something like Python's generators. While one could argue we've got something similar by using closures, its not the same thing. Generators can return values with a yield statement, resume execution on the next line when they are ca
    Every token is like an unnecessary stain on whitespace and idleness.
  • yes! (Score:1)

    named subroutine parameters, please please please.
  • It would be SO cool if there was a way,
    use 'moderndot';
    or whatever that made $a.b mean $a->{b} and $a.b() mean $a->b() like every other language. Yes, I know this would not be backward compatible with string concat, but it's where Perl6 is going