develooper Front page | perl.perl6.users | Postings from November 2020

Re: The ,= operator

Thread Previous | Thread Next
Joseph Brenner
November 29, 2020 17:16
Re: The ,= operator
Message ID:
William Michels <> wrote:
>> > "Perhaps more importantly, what improvement do you propose?"
> Apologies for top-posting, but what immediately comes to my mind upon
> encountering the creation of a self-referential (circular/infinite)
> object is proverbially 'going-down-a-level' and trying again. So I
> tried 1. 'decontainerizing' the object on the LHS, and then 2. using
> the ",=" postfix to add an additional element (or many). Nothing
> worked.

I think the trouble with ideas like that is once you accept that

  @a ,= 'd';

Is necessarily a short-form of:

  @a = @a, 'd';

You can see the thing you need to decontainerize is that @a on
the RHS:

  @a = | @a, 'd';

But you can't get at it in the short form.

(So you wouldn't normally try to use the short form with arrays.)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About