Skip Menu |

This queue is for tickets about the Perl6-Say CPAN distribution.

Report information
The Basics
Id: 20419
Status: resolved
Worked: 35 min
Priority: 0/
Queue: Perl6-Say

People
Owner: jkeenan [...] cpan.org
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

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



Subject: IO::Handle::say redefined warning for IO::Handle >= 1.23
IO::Handle 1.23 implements the "say" method. Perl6::Say should probably not override it for IO::Handle >= 1.23. Alternatively, if this implementation is better/truer to Perl6 semantics, it should just put the override in a block with "no warnings 'redefine'"
On Tue Jul 11 13:57:44 2006, DAGOLDEN wrote: Show quoted text
> IO::Handle 1.23 implements the "say" method. > > Perl6::Say should probably not override it for IO::Handle >= 1.23. > > Alternatively, if this implementation is better/truer to Perl6 > semantics, it should just put the override in a block with "no warnings > 'redefine'"
David: Damian had this in his most recent beta: *IO::Handle::say = \&say if ! defined &IO::Handle::say; Do you think that will suffice? jimk
Subject: Re: [rt.cpan.org #20419] IO::Handle::say redefined warning for IO::Handle >= 1.23
Date: Sun, 23 Jul 2006 08:50:35 -0400
To: bug-Perl6-Say [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
I think I sent you the exact same one-line patch last week, so yes, that should work. :-) Show quoted text
> -*IO::Handle::say = \&say; > +*IO::Handle::say = \&say if ! defined &IO::Handle::say;
Note that you must make sure that Perl6::Say continues to load IO::Handle, so that its say() will already be loaded if it exists. There's also no guarantee that the semantics of IO::Handle::say and Perl6::say will be exactly the same, so you might want to add a documentation note that to that effect. Perl6::Say seems to do a bunch of warning fiddling that IO::Handle doesn't. For example, this code has warnings forced on: Show quoted text
> #!perl -W > use Perl6::Say; > use IO::Handle; > use strict; > > my $handle = IO::Handle->new_from_fd(fileno(STDOUT),"w") > or die "Couldn't make a handle"; > > say "IO::Handle::say is ", \&IO::Handle::say; > say "Perl6::Say::say is ", \&Perl6::Say::say; > say; > say "Perl6::Say says hello"; > $handle->say("IO::Handle says hello"); > say; > say "Perl6::Say saying undef:"; > say undef; > say "IO::Handle::say saying undef:"; > $handle->say(undef);
And it prints: Show quoted text
> IO::Handle::say is CODE(0x9f9810) > Perl6::Say::say is CODE(0x9a40e4) > > Perl6::Say says hello > IO::Handle says hello > > Perl6::Say saying undef: > > IO::Handle::say saying undef: > Use of uninitialized value in print at C:/perl/perl/site/lib/IO/Handle.pm line 415. >
On Sun Jul 23 08:57:35 2006, DAGOLDEN wrote: Show quoted text
> I think I sent you the exact same one-line patch last week, so yes, > that > should work. :-) >
Damian had included it in his last beta. That's where I got it from. Show quoted text
> > -*IO::Handle::say = \&say; > > +*IO::Handle::say = \&say if ! defined &IO::Handle::say;
> > Note that you must make sure that Perl6::Say continues to load > IO::Handle, so that its say() will already be loaded if it exists. >
It will load IO::Handle. Show quoted text
> There's also no guarantee that the semantics of IO::Handle::say and > Perl6::say will be exactly the same, so you might want to add a > documentation note that to that effect. Perl6::Say seems to do a > bunch > of warning fiddling that IO::Handle doesn't. >
And, as is typical of my work, it will have even more error checking by the time I'm done! So I will revise the documentation accordingly. Thanks. jimk
Fixed in 0.06.