On Thu, Jan 21, 2016 at 12:00 PM, Aaron Baugher <aa...@baugher.biz> wrote:
> Tom Browder <tom.brow...@gmail.com> writes:
...
>> For the example Perl 5 input I like the Blue_Tiger translation, except
>> I haven't so far found an description of the '<->' operator.  Why
>> would Blue_Tiger prefer it to the '->' operator which I've seen in all
>> the examples I can remember seeing?
>
> In Perl 5, the loop variable ($c) is an alias into the array, and changing 
> its value changes the the value in the array.  In Perl 6, the array being 
> worked on is read-only by default, so in the Perl::ToPerl6 example, trying to 
> change the value of $c inside the loop would throw an error.  Using the <-> 
> operator (also pointing back from the loop variable to the array) tells it to 
> use the Perl 5 behavior, where the array can be changed by changing the loop 
> variable.

Thanks, Aaron, good explanation.  But can you find a description of
'<->' in the Perl 6 docs?

I did a search here

  
https://raw.githubusercontent.com/perl6/mu/master/docs/Perl6/Cheatsheet/cheatsheet.txt

here

  https://doc.perl6.org/language/operators

and here:

  https://doc.perl6.org/language.html

and couldn't find it.

Cheers!

-Tom

Reply via email to