Hi.

I know that Perl 6 has a lot of "live and let live" to it, but is it possible somehow to remove features as well?

The latest comment about language design by Parrot Raiser (great name!) had me reflect on why I don't use perl any longer, and here is one of the reasons:

class Person {
    has $.name;
    method hello {
        say "Hi, I'm $.name (Person)";
    }
}

class Employee is Person {
    method hello {
        say "Hello. My name is $.name (Employee)";
    }
}

class Surfer is Person {
    method hello {
        say "Whats up, dude? (Surfer)";
    }
}

class Professor is Surfer is Employee {
    method hello {
        say "Good day to you, my name is $.name (Professor)";
    }
}

my $p = Professor.new(name => "Alice");

$p.*hello;

Which outputs

Good day to you, my name is Alice (Professor)
Whats up, dude? (Surfer)
Hello. My name is Alice (Employee)
Hi, I'm Alice (Person)

This is working exactly as specified in the synopsis, but does Perl 6 NEED anything like this? Just because something is possible doesn't make it an automatic requirement!

I know that if I don't like the construct, then I shouldn't use it, but this operator (and .+) is nudging people who really doesn't understand OOP to use the inheritance hierarchy as a function chaining mechanism way beyond what it is intended for. Working with a language means working with code that *other people* has written in that language. I don't want to maintain anything using this operator (or its twin, .+), because I haven't seen just one reasonable use case for it.

--
Michael Zedeler
70 25 19 99
mich...@zedeler.dk

dk.linkedin.com/in/mzedeler | twitter.com/mzedeler | github.com/mzedeler

Reply via email to