Most Perl 6 will look like Perl 5
Dirk Koopman
djk at tobit.co.uk
Fri Jan 25 09:50:39 GMT 2008
Mark Overmeer wrote:
> * Ovid (publiustemp-londonpm at yahoo.com) [080124 23:09]:
>> 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) {
>>
>> Becomes this:
>>
>> my $is_ok = 1;
>> for 0..6 -> $t {
>> if abs(@new[$t] - @new[$t+1]) > 3 {
>>
>> 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)
>
> IMO, both your examples are readible to any programmer, not only
> Perl programmers. But reading is not writing.
>
> While giving Perl trainings, I always see people struggle with the
> parenthesis and the sigils: to get them exactly correct. Well, the
> reasoning behind those has changed a lot. Although it is only one
> character difference in the program, you will make mistakes for quite
> some time.
I shall enjoy the argument that ensues when someone notices that in
perl6 '$t' seems to have become implicitly automatic whilst '$is_ok'
still has to be explicitly declared as such. At least perl5 is regular
in that respect. I imagine that the change of meaning of '->' will not
help conversion either.
But I shall reserve judgement (if not my concern) until perl 6.0
actually appears in a year or three or ...
More information about the london.pm
mailing list