[oak perl] v6

Belden Lyman blyman at iii.com
Fri Jan 14 14:19:04 PST 2005


On Fri, 2005-01-14 at 11:35, Steve Fink wrote:

> Perl6 only aims to achieve partial compatibility with Perl5 through 
> compatibility layers, but is itself a very different language. For the 
> most part, you can do things using almost exactly the same syntax and 
> techniques as you would use in Perl5. But there are many newer ways of 
> doing things (hopefully simpler in many cases, but certainly more 
> powerful). Some of these ways are expected to eventually supplant the 
> Perl5-style approaches.As an example; we've seen this Perl5 recently:

    my @names = ('Bob', 'Bruce', >'Bonehead', 'Bob');
    my @ages = (12, 20, 13, 20);

    for my $i (0..$#names) {
      print "$names[$i] is $args[$i] milliseconds old.\n";
    }

Perl6 will introduce a "zip" operator, which will allow us to
write:

    my @names = ('Bob', 'Bruce', >'Bonehead', 'Bob');
    my @ages = (12, 20, 13, 20);

    for zip(@names, @ages) -> $name, $age {
      print "$name is $age milliseconds old.\n";
    }

...or something fairly close to that.

Belden



More information about the Oakland mailing list