Naming a module that deals with the meta-object protocol

SSB3cm90ZSBhIHNtYWxsIHN1bSB0eXBlIG1vZHVsZSB0aGF0IHN1YmNsYXNzZXMgDQpQZXJsNjo6
TWV0YW1vZGVsOjpTdWJzZXRIT1cuIEkgd2FzIHRoaW5raW5nIG9mIG5hbWluZyBpdCBlaXRoZXIg
DQpUeXBlOjpTdW0gb3IgTWV0YW1vZGVsOjpTdW1IT1csIGJ1dCBUeXBlOjpTdW0gZG9lc24ndCBm
b2xsb3cgdGhlIHN0eWxlIA0KUmFrdWRvIHVzZXMgZm9yIG5hbWluZyBNT1AgY2xhc3NlcywgYW5k
IE1ldGFtb2RlbDo6U3VtSE9XIG1heSBub3QgYmUgYSANCmdvb2QgbmFtZSBiZWNhdXNlIGl0J2Qg
bGVhayB0aGUgbW9kdWxlIGludG8gQ09SRS4gV2hhdCBzaG91bGQgSSBjYWxsIGl0Pw0KDQo=
0
kaiepi
4/8/2019 5:38:10 PM
perl.perl6.users 1192 articles. 0 followers. Follow

2 Replies
54 Views

Similar Articles

[PageSpeed] 50

Not sure what you mean by 'leaking into CORE', but I wouldn't use =
Metamodel:: namespace too. My suggestion would be to use Type::SumHOW or =
Type::Metamodel::SumHOW. The latter is better from namespace structuring =
point of view unless long names disgust you.

Best regards,
Vadim Belman

> On Apr 8, 2019, at 1:38 PM, Ben Davies <kaiepi@outlook.com> wrote:
>=20
> I wrote a small sum type module that subclasses=20
> Perl6::Metamodel::SubsetHOW. I was thinking of naming it either=20
> Type::Sum or Metamodel::SumHOW, but Type::Sum doesn't follow the style=20=

> Rakudo uses for naming MOP classes, and Metamodel::SumHOW may not be a=20=

> good name because it'd leak the module into CORE. What should I call =
it?
>=20
0
vrurg
4/8/2019 5:59:10 PM
Aiui the most salient feature of your new type is being syntax sugar
for conveniently creating and naming a sum type that includes `Failure`,
i.e. instead of:

    my $foo where Int | Failure;
    $foo = 42;
    $foo = Failure;
    $foo = 'nope'; # Type check failed in assignment to $foo; expected
<anon> but got Str ("s")

One can write and get something like:

    my FailureOr[Int] $foo;
    $foo = 42;
    $foo = Failure;
    $foo = 'nope'; # Type check failed in assignment to $foo; expected
Failure or Int but got Str ("s")

If I'm right then imo it's not at all important that it uses the MOP.
If it isn't a general sum type then perhaps just FailureOr or Tyoe::FailureOr.
If it's a general sum type then perhaps Type::Sum.




On Mon, Apr 8, 2019 at 6:38 PM Ben Davies <kaiepi@outlook.com> wrote:
>
> I wrote a small sum type module that subclasses
> Perl6::Metamodel::SubsetHOW. I was thinking of naming it either
> Type::Sum or Metamodel::SumHOW, but Type::Sum doesn't follow the style
> Rakudo uses for naming MOP classes, and Metamodel::SumHOW may not be a
> good name because it'd leak the module into CORE. What should I call it?
>
0
ralphdjmellor
4/9/2019 10:31:31 PM
Reply: