Skip to content

Commit

Permalink
Update PL/Perl6 page to describe using pointy blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Aug 3, 2010
1 parent c199d95 commit 706b7dc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions html/plperl6.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ <h1>Rakudo Perl 6</h1>
<p>
The first line is SQL, and everything between the $$ symbols is Perl 6! This stored procedure takes a single integer N and returns the sum of the first N Fibonacci numbers.
</p>
<p>
You will notice that the above stored procedure uses <b>@_</b>, and you may ask : Doesn't Perl 6 have named function arguments? Why are we still using <b>@_</b> ?
The answer is that, by default, you get access to <b>@_</b> inside a stored procedure, but if you want named function arguments, then you use a "pointy block", like so:
<pre>
CREATE OR REPLACE FUNCTION pointy_fibonacci(integer) RETURNS int LANGUAGE plperl6 AS $$
-> $limit {
[+] (1, 1, *+* ... $limit)
}(|@_);
$$;
</pre>
The arrow begins the "pointy block", followed by the named parameters.

</div>
</div>
Expand Down

0 comments on commit 706b7dc

Please sign in to comment.