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.pod Sat 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