in reply to Fun with Typed Objects 1
I disagree. There are many cases where a default constructor taking zero arguments would be pointless.
I think a better approach would be to allow on-the-fly topicalization of the class in the declaration so you could say something close to
my Dolphin $friend is topic = .new("Flipper");
Admittedly verbose, but there's no duplication.
I've no doubt the real Perl6 heads would come up with a different solution yet, but I believe something along these lines would work better than just plain autovivification.
Makeshifts last the longest.
|
|---|