Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[S06] allow = on 'rw' subject to restrictions
It's okay to have a default on a parameter marked 'rw' provided
the default is nameable at compile time and is bindable as an lvalue.
  • Loading branch information
TimToady committed Nov 17, 2010
1 parent 3104c5b commit 7846594
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions S06-routines.pod
Expand Up @@ -16,8 +16,8 @@ Synopsis 6: Subroutines

Created: 21 Mar 2003

Last Modified: 16 Nov 2010
Version: 146
Last Modified: 17 Nov 2010
Version: 147

This document summarizes Apocalypse 6, which covers subroutines and the
new type system.
Expand Down Expand Up @@ -2202,8 +2202,11 @@ to a readonly parameter never triggers autovivification.
Specifies that the parameter can be modified (assigned to, incremented,
etc). Requires that the corresponding argument is an lvalue or can be
converted to one. Since this option forces an argument to be required,
it cannot co-exist with any marks that indicate an optional parameter,
such as C<?> or a default value.
it cannot co-exist with the C<?> mark to make an argument optional.
(It may, however, be used with C<=> indicating a default, but only
if the default expression represents something that is nameable at
compile time and that can bind as an lvalue, such as
C<< CALLER::<$/> >> or C<< OUTER::<$_> >>.)

When applied to a variadic parameter, the C<rw> trait applies to each
element of the list:
Expand Down

0 comments on commit 7846594

Please sign in to comment.