Hi All,

On creation, I would like to salt some of the
values inside an object  when the variable
inside is an array:


First a concept test:
$ p6 'class AA { has Str @.I is rw; }; my $CC= AA.new; $CC.I[1] = "def"; say $CC.I[1];'

def


Now for the pre-salt test
$ p6 'class AA { has Str @.I is rw; }; my $CC = AA.new( I[1] => "abc" ); say $CC.I[1];'

===SORRY!=== Error while compiling -e
Undeclared name:
    I used at line 1


What am I doing wrong?

Many thanks,
-T

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If I had a dime every time I didn't know
what was going on, I'd be like, "Why is
everyone giving me all these dimes?"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to