develooper Front page | perl.perl5.porters | Postings from August 2001

Re: How to redefine sub that has prototypes without warning at runtim e?

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
August 18, 2001 12:24
Subject:
Re: How to redefine sub that has prototypes without warning at runtim e?
Message ID:
20010818152431.B1477@blackrider
On Sat, Aug 18, 2001 at 09:35:44AM -0500, Nathan Neulinger wrote:
> > Also, would it make more sense to say C<*foo = sub { undef }> rather
> > than C<undef &foo>?
> 
> If you did that though, wouldn't &foo still be defined? If so, the code
> that maps from
> 
> #undef foo
> ...
> #ifndef foo
> #define foo bar
> #endif
> ...
> 
> wouldn't work right.

I don't know if "#ifndef foo" checks C<defined &foo> or C<defined
foo()>.  If it's the former, then stick to C<undef &foo>.


> I wonder if it would be sufficient to put a "no warnings 'redefine'" at
> the top of the generated files?

Probably, though it would be better to put it in each individual
declaration in case there are any *real* redefining mistakes.


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <perl-qa@perl.org>	     Kwalitee Is Job One
Maybe they hooked you up with one of those ass-making magazines.
	-- brian d. foy as misheard by Michael G Schwern

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