Most Perl 6 will look like Perl 5
Ovid
publiustemp-londonpm at yahoo.com
Thu Jan 24 23:09:08 GMT 2008
--- Dirk Koopman <djk at tobit.co.uk> wrote:
> There are different ways of saying the same thing, some new short
> cuts
> (that are welcome) and some frankly esoteric things that make sense
> to
> the likes of Ovid and Mr Conway, but will probably take the language
> out
> of reach to mere mortals like myself.
Actually, have you read the article "And now for something completely
similar" by Damian? I can't find a copy online right now, but for most
folks, Perl 6 really isn't changing that much. For example, this:
my $is_ok = 1;
for my $t (0 .. 6) {
if ( abs($new[$t]-$new[$t+1]) > 3) {
$is_ok = 0;
last;
}
}
if ($is_ok) {
push @moves, [$i,$j];
}
Becomes this:
my $is_ok = 1;
for 0..6 -> $t {
if abs(@new[$t] - @new[$t+1]) > 3 {
$is_ok = 0;
last;
}
}
if $is_ok {
push @moves, [$i, $j];
}
In short, with very few changes, Perl 6 will be completely
comprehensible to Perl 5 programmers. (You can even add in the extra
parentheses, if you like)
However, some things in Perl 5 which are virtually impossible to do
will now be possible.
Cheers,
Ovid
--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Perl and CGI - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog - http://use.perl.org/~Ovid/journal/
More information about the london.pm
mailing list