PPCs icon indicating copy to clipboard operation
PPCs copied to clipboard

[PPC0022] - Initial entry point as functions vs. constructor-methods

Open leonerd opened this issue 1 year ago • 1 comments

The original design had functions such as

my $metapkg = meta::get_package("some::name::here");

A suggestion from the mailing list was that these could instead be written as constructor-style methods on named packages within meta:

my $metapkg = meta::package->get("some::name::here");

Having implemented both now it feels actually a little nicer to use the latter style. Plus it conveniently gives a place to explain and document what actual class these meta-objects appear to be in.

If we think this style is better we should update the doc to match.

leonerd avatar Jan 04 '24 20:01 leonerd

Yeah, I always disliked get_OBJECT, set_OBJECT language, the shorter the better (with grouping).

rwp0 avatar Jan 04 '24 23:01 rwp0