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

Re: [perl #119455] [EXPERIMENT] pluggable keyword API

Thread Previous | Thread Next
From:
Eric Brine
Date:
September 30, 2013 13:37
Subject:
Re: [perl #119455] [EXPERIMENT] pluggable keyword API
Message ID:
CALJW-qGj1anq5t2wYuWPe7RsfyMtx_Wbnq7b6VB41TY4L55gSQ@mail.gmail.com
On Mon, Sep 30, 2013 at 9:29 AM, Eric Brine <ikegami@adaelis.com> wrote:

> On Sun, Sep 29, 2013 at 4:15 PM, Lukas Mai <plokinom@gmail.com> wrote:
>
% perl -we 'use syntax "loop"; sub loop {} &loop()'
>>
> Undefined subroutine &Syntax::Feature::Loop::loop called at -e line 1.
>>
>> That simply shouldn't happen. I have a perfectly fine &main::loop right
>> there.
>>
>
> Yes, but you said to use the one from S::F::L. Defining a sub doesn't
> override keywords.
>
> >perl -E"sub for { } for('abc');"
> syntax error at -e line 1, near ");"
>
> Execution of -e aborted due to compilation errors.
>
> >perl -E"sub lc { 'b' } say lc 'a'"
> a
>

ah, nevermind, I get your point here.  I'll don't know if that's an issue
with Call::DevelParser/Checker or with Lexical::Sub. I'll find out. I would
expect something like:

$ perl -Mfeature=lexical_subs -M-warnings=experimental -wE'my sub lc { "b"
} sub lc { "c" } say &lc("a")'
Subroutine lc redefined at -e line 1.
c

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