The only good justification I've heard for final is as a directive
for optimization. If you declare a variable to be of a final type, then
the compiler (JIT, or whatever) can resolve method dispatch at
compile-time. If it is not final, then the compiler can make no such
assumption because
At 09:30 AM 9/4/2001 -0700, Hong Zhang wrote:
The only good justification I've heard for final is as a directive
for optimization. If you declare a variable to be of a final type, then
the compiler (JIT, or whatever) can resolve method dispatch at
compile-time. If it is not final, then
At 05:23 PM 8/28/2001 -0700, David Whipp wrote:
They list two reasons to make your class final. One is security
(which might actually be valid, but I doubt it will hold up to
determined attack), the other though...
You may also wish to declare a class as final for object-oriented
Brent Dax wrote:
On the other hand, it could stop some of the really stupid uses for
inheritance I've seen. The dumbest one was in high school Advanced
Placement's C++ classes--the queue and stack classes inherited from the
array class!
Oh? How could final classes prevent such a travesty?
Michael G Schwern wrote:
If you *really* wanted to write an optimized redirector, you'd
have the redirector eliminate itself.
sub foo {
my $method = $_[0]-{_foo} || $_[0]-can(_foo);
{
no warnings 'redefine';
*foo = $method;
}
goto $method;
}
:)
On Tue, Aug 28, 2001 at 09:10:40AM -0400, Ken Fox wrote:
One of the cool things about Perl's OO system is that it lets
us invent new type systems. This IMHO is its greatest strength.
Perhaps this is also why some OO people hate Perl's OO?
Yes, this sort of thing FRIGHTENS THE HELL out of
On Tue, Aug 28, 2001 at 10:47:35AM -0700, Damien Neil wrote:
On Tue, Aug 28, 2001 at 09:13:25AM -0400, Michael G Schwern wrote:
As the pendulum swings in the other direction you get mind-bogglingly
silly things like finalize which I just learned of today.
What's so silly about finalize?
Sorry, I ment final. final classes and methods. The idea that you
can prevent someone from subclassing your class or overriding your
methods. I've seen things that hinder reuse, but this is the first
time I've seen one that violently blocks reuse!
final is only useful for
# -Original Message-
# From: Michael G Schwern [mailto:[EMAIL PROTECTED]]
# Sent: Tuesday, August 28, 2001 4:35 PM
# To: [EMAIL PROTECTED]
# Subject: Re: Expunge implicit @_ passing
#
#
# On Tue, Aug 28, 2001 at 10:47:35AM -0700, Damien Neil wrote:
# On Tue, Aug 28, 2001 at 09:13:25AM
Michael G Schwern wrote:
I can't think of any reason why this feature is useful anymore, and it
can be a really confusing behavior, so what say we kill it in Perl 6?
I've always thought is was pretty useful for implementing generic
redirectors. I wrote a frame system that allows instances to
Ken Fox [EMAIL PROTECTED] writes:
Michael G Schwern wrote:
I can't think of any reason why this feature is useful anymore, and it
can be a really confusing behavior, so what say we kill it in Perl 6?
I've always thought is was pretty useful for implementing generic
redirectors. I wrote
On Mon, Aug 27, 2001 at 10:58:00AM -0400, John Porter wrote:
You can, with C goto $foo; .
Problem is, it's *slower* (in p5 anyway) than the plain sub call.
By only 10%. Let's keep things in proportion here.
--
Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/
Perl6
On Mon, Aug 27, 2001 at 06:50:35PM -0400, Ken Fox wrote:
Michael G Schwern wrote:
Any time you want to implicitly pass @_, you can just as easily
*explicitly* pass it or use goto.
I never thought of using goto actually. goto $method; actually
looks clearer than the code I'm using.
On Mon, Aug 27, 2001 at 06:02:50PM -0500, Garrett Goebel wrote:
From: Ken Fox [mailto:[EMAIL PROTECTED]]
Michael G Schwern wrote:
Any time you want to implicitly pass @_, you can just as easily
*explicitly* pass it or use goto.
goto does screw up caller... so I wouldn't say *anytime*
When foo() is called as foo with no parens and no arguments, it
inherits @_ from it's caller.
I can't think of any reason why this feature is useful anymore, and it
can be a really confusing behavior, so what say we kill it in Perl 6?
It's alreday scheduled for termination.
In
15 matches
Mail list logo