Has a slot


It seems that Corinna is getting ahead.

So today I read this:

Corinna update: after much discussion, the slot declaration keyword `has`has been renamed to `slot`.

I guess it’s good news that Corinna is going ahead, even though this has a bit of not invented here taste and the need to please someone else. This is totally my guess, don’t get me wrong, but it seems that I’m not alone:

nxadm on slot

I’m not advocating for a different name or for going back to has. I mean, practically speaking I prefer that this moves on with a peculiar name more than that it stagnates with a better one. Call me pragmatic.

I still think has was superior though. In the typical OO discussion where the merits of is-a are weighted against those of has-a, being able to write:

class Foo is Bar {
    has $baz;

is so self-documenting. It is literally using the same language that is meant to discuss the thing. Call me pragmatic, or thick maybe.

There were some good answers to my observation, although I don’t buy them. Despite having different underlying mechanisms with respect to the corresponding has in Moo/Moose (and for good reasons!), most of the times people don’t care/talk about this and just want to use meaningful terminology. Here we’re talking about stuff in objects holding state, and has makes a lot of sense also because it’s been used by those modules.

Different things should be named differently, but I would argue that those things look different only when we look at them very closely. Which is what the designer risks to do. Moreover, maybe has makes more sense in Corinna than it did in Moo/Moose, who knows? I don’t see it as calling dibs on something, to be honest.

Anyway, it’s been enough of a thought dumping.

The decision has been discussed and taken, and I hope it helps bringing us closer to the goal. Keep up with the good work, I think you people are doing great!

Comments? Octodon, , GitHub, Reddit, or drop me a line!