On 16 September 2017 at 23:29, Elizabeth Mattijsen <l...@dijkmat.nl> wrote:

>
> > On 16 Sep 2017, at 13:32, Norman Gaywood <ngayw...@une.edu.au> wrote:
> > sub MAIN( :$debug = False, :$verbose is rw = False  ) {
> > ...
> > $ ./tt.p6 --debug
> > ===SORRY!=== Error while compiling /home/ngaywood/./tt.p6
> > Cannot use 'is rw' on optional parameter '$verbose'.
> > at /home/ngaywood/./tt.p6:4
>
>
> You probably want “is copy” here?  I mean, you want to be able to change
> it *within* MAIN, no?
>

Ah yes! That makes sense, thanks!

Still, I wonder if the compiler should have error'ed before I actually
tried to assign to the variable at run-time.

The compiler should know that I can't do:

sub MAIN( :$debug = False, :$verbose = False  ) {
>     $verbose = True if $debug;
>

before it is actually run.

-- 
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia

ngayw...@une.edu.au  http://turing.une.edu.au/~ngaywood
Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062

Please avoid sending me Word or Power Point attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Reply via email to