in reply to The Evolution of Language (redux)
Perl 6, works nicely under Pugs :)
{ 2 * $^x } # or -> $x { 2 * $x } # or sub ($x) { 2 * $x } # or sub { 2 * $_[0] }
The $^x is called a placeholder variable, -> $var { ... } is a pointy sub.
They all can be invoked using:
$sub(3); # or $sub.(3); # All except the last one can also be called using: $sub(x => 3); # or $sub.(x => 3);
TIMTOWTDI! :)
|
|---|