[svn:perl6-synopsis] r14593 - doc/trunk/design/syn
Author: larry Date: Sat Oct 11 11:39:24 2008 New Revision: 14593 Modified: doc/trunk/design/syn/S06.pod Log: clarify use of [...] and {...} in a signature Modified: doc/trunk/design/syn/S06.pod == --- doc/trunk/design/syn/S06.pod(original) +++ doc/trunk/design/syn/S06.podSat Oct 11 11:39:24 2008 @@ -13,9 +13,9 @@ Maintainer: Larry Wall [EMAIL PROTECTED] Date: 21 Mar 2003 - Last Modified: 17 Mar 2008 + Last Modified: 11 Oct 2008 Number: 6 - Version: 94 + Version: 95 This document summarizes Apocalypse 6, which covers subroutines and the @@ -1373,6 +1373,19 @@ ... } +Use of the curly form is not allowed where it might be confused with the +following block's opening curly: + +- {:$name, :$addr, *%guest_data}, $room_num { # WRONG + +However, as described in the next section, you can always use a +sub-signature instead: + +- (:$name, :$addr, *%guest_data), $room_num { # WRONG + +In fact, the [...] and {...} forms are really just extra documentation +about what you expect. + =head2 Unpacking tree node parameters You can unpack tree nodes in various dwimmy ways by enclosing the bindings
Re: [svn:perl6-synopsis] r14593 - doc/trunk/design/syn
[EMAIL PROTECTED] wrote: +- {:$name, :$addr, *%guest_data}, $room_num { # WRONG + +However, as described in the next section, you can always use a +sub-signature instead: + +- (:$name, :$addr, *%guest_data), $room_num { # WRONG + +In fact, the [...] and {...} forms are really just extra documentation +about what you expect. I guess it's not intentional to use the same example twice? Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/
[svn:perl6-synopsis] r14594 - doc/trunk/design/syn
Author: larry Date: Sat Oct 11 11:58:34 2008 New Revision: 14594 Modified: doc/trunk/design/syn/S06.pod Log: copy/paste error, moritz++ Modified: doc/trunk/design/syn/S06.pod == --- doc/trunk/design/syn/S06.pod(original) +++ doc/trunk/design/syn/S06.podSat Oct 11 11:58:34 2008 @@ -1381,7 +1381,7 @@ However, as described in the next section, you can always use a sub-signature instead: -- (:$name, :$addr, *%guest_data), $room_num { # WRONG +- (:$name, :$addr, *%guest_data), $room_num { # note ()'s In fact, the [...] and {...} forms are really just extra documentation about what you expect.