develooper Front page | perl.modules | Postings from June 2018

Rationale for using Dot as a top level namespace

From:
Yang Bo
Date:
June 1, 2018 09:40
Subject:
Rationale for using Dot as a top level namespace
Message ID:
20180529154315.hCIKrd8r@smtp3o.mail.yandex.net
I just did some reading on PAUSE and found out that using top level
namespace is considered bad and impolite, I don't know whether that's
the reason that indexing failed for my module [1], but I think it indeed
qualifies as a top level package.

First, it's an object system, just like Moose, but it's really different,
the traditional Perl 5 OO mechanism is bypassed completely, and you
don't call a method using $obj->method, but $obj->{method}, and a class
is not a package but a subroutine, and it never creates an object but
only modifies it. So Dot as an object system behaves differently and it
would cause confusion if it doesn't have its own top level namespace,
if a class resides in the Dot namespace you would immediately know
how to construct an object from it and how to call the methods from
the object.

Also, Dot is designed to be a base class from which every Dot object
inherits, so it's indeed at the top level of the hierarchy and just
reflects how things actually are.

I hope this justifies using Dot as toplevel namespace.

Please tell me what else I need to do or did wrong, this is really
important for me. Thanks in advance.

Sincerely,
Yang Bo.

[1] https://metacpan.org/release/RSLOVERS/Dot-v1.0.0



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About