Skip Menu |
 

This queue is for tickets about the Kavorka CPAN distribution.

Report information
The Basics
Id: 102318
Status: open
Priority: 0/
Queue: Kavorka

People
Owner: Nobody in particular
Requestors: dr [...] jones.dk
Cc: ether [...] cpan.org
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: requires deprecated Parse::Keyword
Date: Tue, 24 Feb 2015 13:47:31 +0100
To: bug-kavorka [...] rt.cpan.org
From: Jonas Smedegaard <dr [...] jones.dk>
Download (untitled) / with headers
text/plain 602b
Kavorka depends on Parse::Keyword, which in its documentation is strongly discouraged and described as fundamentally broken. I am looking into packaging Moops for Debian, but that warning makes me hesitate packaging Parse::Keyword. Does that warning somehow not relate to its use with Kavorka, or should I postpone Debian packaging of Kavorka (and Moops) until Kavorka has been refactored to avoid Parse::Keyword? - Jonas -- * Jonas Smedegaard - idealist & Internet-arkitekt * Tlf.: +45 40843136 Website: http://dr.jones.dk/ [x] quote me freely [ ] ask before reusing [ ] keep private
Download (untitled) / with headers
text/plain 354b
On 2015-02-24T12:47:47Z, dr@jones.dk wrote: Show quoted text
> Kavorka depends on Parse::Keyword, which in its documentation is > strongly discouraged and described as fundamentally broken.
The thing which makes it fundamentally broken was actually something I discovered and reported. Sadly it was so long ago that I forget what it was. But I know I worked around it.
Subject: Re: [rt.cpan.org #102318] requires deprecated Parse::Keyword
Date: Tue, 31 Jan 2017 16:06:56 +0100
To: bug-Kavorka [...] rt.cpan.org
From: Jonas Smedegaard <dr [...] jones.dk>
Download (untitled) / with headers
text/plain 1.4k
Quoting Toby Inkster via RT (2017-01-31 15:52:55) Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=102318 > > > On 2015-02-24T12:47:47Z, dr@jones.dk wrote:
> > Kavorka depends on Parse::Keyword, which in its documentation is > > strongly discouraged and described as fundamentally broken.
> > The thing which makes it fundamentally broken was actually something I discovered and reported. Sadly it was so long ago that I forget what it was. > > But I know I worked around it.
Not sure we are talking about same thing: I mean that Parse::Keyword is flagged DEPRECATED in synopsis and first part of description is this: Show quoted text
> DO NOT USE! > > This module has fundamental errors in the way it handles closures, > which are not fixable. Runtime keywords will never be able to work > properly with the current design of this module. There are certain > cases where this module is still safe to use (keywords that only have > effect at compile time, or keywords that never call any of the parse_* > functions), but that is limiting enough to make this module mostly > worthless, and I likely won't be continuing to maintain it. Be warned!
According to MetaCPAN.org, Parse::Keyword has only 4 reverse depndencies - three of them by you: Kavorka, Moops and Switcheroo. - Jonas -- * Jonas Smedegaard - idealist & Internet-arkitekt * Tlf.: +45 40843136 Website: http://dr.jones.dk/ [x] quote me freely [ ] ask before reusing [ ] keep private
Download signature.asc
application/pgp-signature 833b

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 414b
Yes, I'm aware it's flagged as deprecated, but until somebody releases a module providing similar hooks into the Perl parser, Kavorka's dependency on it can't really be eliminated. pk.pl (attached) illustrates the issue with Parse::Keyword. It should output 1, 2, 3 three times, but the third time is mysteriously blank. However, pk2.pl shows that the problem can be worked around, and this is what Kavorka does.
Subject: pk.pl
Download pk.pl
text/x-perl 517b
use v5.14; BEGIN { package MyExample; $INC{'MyExample.pm'} = __FILE__; use base 'Exporter'; use Parse::Keyword { example => \&_parse_example }; our @EXPORT = 'example'; sub example { shift->(); } sub _parse_example { lex_read_space; my $code = parse_block; lex_read_space; return sub { $code }; } } use MyExample 'example'; say example { 1 }; say example { 2 }; say example { 3 }; for our $package (1..3) { say example { $package }; } for my $lexical (1..3) { say example { $lexical }; }
Subject: pk2.pl
Download pk2.pl
text/x-perl 921b
use v5.14; BEGIN { package MyExample; $INC{'MyExample.pm'} = __FILE__; use base 'Exporter'; use Parse::Keyword { example => \&_parse_example }; use PadWalker (); our @EXPORT = 'example'; sub example { shift->(); } sub _parse_example { lex_read_space; my $code = parse_block; lex_read_space; return sub { my $closedover = PadWalker::closed_over($code); return $code unless keys %$closedover; sub { my $callervars = PadWalker::peek_my(2); $closedover->{$_} = $callervars->{$_} for keys %$closedover; PadWalker::set_closed_over($code, $closedover); goto $code; }; }; } } use MyExample 'example'; say example { 1 }; say example { 2 }; say example { 3 }; for our $package (1..3) { say example { $package }; } for my $lexical (1..3) { say example { $lexical }; }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.