Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Perl 6 vs Perl 5

Name: Anonymous 2012-01-08 0:35

Can we have a serious Perl 6 vs Perl 5 thread?

I've been trying to wrap my head around what roles are trying to emulate. Just an odd sort of OO way of programming?'

What else where significant changes?

Name: Anonymous 2012-01-09 12:50

>>43 In fact, you can't overload an operator that starts with '!', because ! is reserved for negating any operator.

multi sub prefix:<iseven>(Int $n) { return ?($n % 2 == 0) }; say iseven 4; say !iseven 4;

OUTPUT:
Bool::True
Bool::False

This prints the same result (note that perl6 is full unicode compliant, at least as compliant as IBM's libicu is):
multi sub prefix:<¬>(Int $n) { return ?($n % 2 == 0) }; say (¬ 4); say (!¬ 4);

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List