in reply to Re: Language features affect style
in thread Language features affect style
Indeed, which is why we've gotten rid of most of Perl 5's (not so) beloved boilerplate in Perl 6. Here's the same code (more or less) in Perl 6:
This may or may not tweak the refactoring knob back toward methods; Perl 6 is still not Java, after all.class Foo { has $!salary; method !private_method ($factor = 2) { $!salary *= $factor } method salary { self!private_method(10); $!salary } } my Foo $foo .= new(:salary(100)); say "salary is ", $foo.salary;
In Section
Meditations