develooper Front page | perl.perl5.porters | Postings from June 2019

Re: Making join() respect string-concat operator

Thread Previous | Thread Next
From:
wolfsage
Date:
June 10, 2019 14:22
Subject:
Re: Making join() respect string-concat operator
Message ID:
CAJ0K8bjQbYoazjJTBE5Sw+Y4u-DF15_pUrQ+rfe+f33N_x6FEw@mail.gmail.com
On Wed, Jun 5, 2019 at 5:30 AM Dave Mitchell <davem@iabyn.com> wrote:
> At the moment its reasonably clear that where you explicitly use the '.'
> operator (and double-quoted strings, which are syntactic sugar for
> concatenation) you should expect concat overloading to be honoured.
[...]
>
> We should keep a clear distinction between:
>
>     concat operator '.' appears in the source code
>
> and
>
>     perl concatenates two strings for some reason.

To me "" seems like the latter, not the former.

This is probably documented somewhere but I find it surprising that
"$foo" calls concat overloading on $foo before string overloading.

Anyway... my concern with changing this is the performance
implications Dave mentioned, and also what problems this change in
behaviour might introduce to existing code. We can test CPAN for that
but not DARKPAN.

-- Matthew Horsfall (alh)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About