Author: autrijus Date: Sat Apr 1 10:32:53 2006 New Revision: 8520 Modified: doc/trunk/design/syn/S02.pod
Log: * S02: destill the compoments of an Arguments object, and specify the $() @() %() &() casting forms for them. Modified: doc/trunk/design/syn/S02.pod ============================================================================== --- doc/trunk/design/syn/S02.pod (original) +++ doc/trunk/design/syn/S02.pod Sat Apr 1 10:32:53 2006 @@ -14,7 +14,7 @@ Date: 10 Aug 2004 Last Modified: 1 Apr 2006 Number: 2 - Version: 18 + Version: 19 This document summarizes Apocalypse 2, which covers small-scale lexical items and typological issues. (These Synopses also contain @@ -393,6 +393,17 @@ bound to. Some bindings are sensitive to multiple dimensions while others are not. +You may cast C<Arguments> to other types with a prefix sigil operator: + + $args = \3; # same as "$args = \(3)" + $$args; # same as "$args as Scalar" or "Scalar($args)" + @$args; # same as '$args as Array" or "Array($args)" + %$args; # same as '$args as Hash" or "Hash($args)" + &$args; # same as '$args as Code" or "Hash($args)" + +Casted as an array, you can access to all positionals. Casted as a hash, all +nameds. As a scalar, the invocant. As a code, the slurpy nameless block. + =item * A signature object (C<Signature>) may be created with coloned parens: @@ -430,7 +441,7 @@ &foo:(Int,Num) It still just returns a function reference. A call may also be partially -applied by using a tuple literal as a postfix operator: +applied by using an argument list literal as a postfix operator: &foo\(1,2,3,:mice<blind>)