develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #117947] all XS functions are implicitly :lvalue

From:
Father Chrysostomos via RT
Date:
May 28, 2013 01:03
Subject:
[perl #117947] all XS functions are implicitly :lvalue
Message ID:
rt-3.6.HEAD-10787-1369703006-532.117947-15-0@perl.org
On Mon May 13 12:18:21 2013, plokinom@gmail.com wrote:
> On 13.05.2013 14:12, Leon Timmermans wrote:
> > On Mon, May 13, 2013 at 1:28 PM, Rafael Garcia-Suarez
> <rgs@consttype.org> wrote:
> >> maxstr is not a method; if you use List::Util::maxstr() instead, it
> >> complains as it should:
> >>
> >> ~§ perl -wle 'use List::Util qw(maxstr); List::Util::maxstr($_ =
> "hi")
> >> = 42; print'
> >> Can't modify non-lvalue subroutine call in scalar assignment at -e
> >> line 1, near "42;"
> >> Execution of -e aborted due to compilation errors.
> >>
> >> That said, we actually seem to have a problem with XS functions
> called
> >> as methods.
> >
> > Yeah, the keywords there seems to be "compilation errors". For
> methods
> > we have to detect this at runtime…
> 
> Yes, this is about calls that can't be resolved (and rejected) at
> compile time. It affects all method calls but also this:
> 
> % perl -wle 'use List::Util qw(maxstr); (\&maxstr)->($_ = "hi") = 42;
> print'
> 42
> 
> i.e. calls through a reference.

I’ve just fixed this in 4587c5322c964b.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=117947



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