books on perl

M

Martijn Lievaart

Martijn> Better written as:

Martijn> $self->kick();

Martijn> although if kick() does not exist, the former fails at compile
time while Martijn> the latter fails at run time.

And if kick doesn't know what to do with an object of the type that
$self is, it'll have to check that itself unless it's a method call. :)

OK, so which one is preferable:

shoot($self, $foot);

or

$self->$shoot($foot);

:)

Or should we introduce some form of double dispatch here, so

shoot($self, $foot);

depends both on the type of $self as the type of $foot?.

M4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top