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

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

Thread Previous | Thread Next
From:
Lukas Mai
Date:
September 29, 2013 20:15
Subject:
Re: [perl #119455] [EXPERIMENT] pluggable keyword API
Message ID:
52488A72.7020700@gmail.com
On 29.09.2013 17:46, Eric Brine wrote:
> On Wed, Aug 28, 2013 at 3:52 PM, Lukas Mai <plokinom@gmail.com
> <mailto:plokinom@gmail.com>> wrote:
> 
>     I've been thinking about creating a branch to convert
>     Function::Parameters to D:CP. I've hit two problems so far:
> 
>     1) There's no documentation that tells you how you actually integrate it
>     in a distribution. There's only this in the synopsis:
> 
>     [...]
>     2) Function::Parameters is a lexical pragma. Does D:CP provide lexical
>     exports? I don't see how to get the effect of lexically scoped keywords
>     with plain subs.
> 
> 
> For both, take a look at Syntax::Feature::Loop. Feel free to ask me if
> you have any questions.

I've given up on D:CP for now. It simply doesn't provide the right
look-and-feel for keywords.

I've found a few weird things in Syntax::Feature::Loop, though:

% perl -we 'use syntax "loop"; loop()'
syntax error at -e line 1, near "loop("
syntax error at -e line 1, near "()
"
Execution of -e aborted due to compilation errors.

That's not very helpful. (Also, why 2 syntax errors?)

% perl -we 'use syntax "loop"; &loop()'
Undefined subroutine &Syntax::Feature::Loop::loop called at -e line 1.

Why is it trying to call Syntax::Feature::Loop::loop instead of
main::loop when that sub doesn't even exist?

% 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.

-- 
Lukas Mai <plokinom@gmail.com>

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