Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id: 83188
Status: resolved
Priority: 0/
Queue: Moo

People
Owner: Nobody in particular
Requestors: MAUKE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.000008
Fixed in: (no value)



Subject: __PACKAGE__->meta->make_immutable not documented
The documentation says: | Finally, Moose requires you to call | | __PACKAGE__->meta->make_immutable; | | at the end of your class to get an inlined (i.e. not horribly slow) | constructor. Moo does it automatically the first time ->new is called | on your class. It should also mention that explicitly calling '__PACKAGE__->meta->make_immutable;' is still valid under Moo (and does nothing). This is important to know if you want to write code that works under both Moo and Moose.
On Thu Feb 07 01:46:12 2013, MAUKE wrote: Show quoted text
> It should also mention that explicitly calling > '__PACKAGE__->meta->make_immutable;' is still valid under Moo (and does > nothing). This is important to know if you want to write code that works > under both Moo and Moose.
What kind of code are you writing where you would want to do this? I can see documenting that it isn't harmful to do, but I'm not coming up with a situation where you would actually want to.
Subject: Re: [rt.cpan.org #83188] __PACKAGE__->meta->make_immutable not documented
Date: Tue, 19 Mar 2013 00:23:17 +0100
To: bug-Moo [...] rt.cpan.org
From: Lukas Mai <l.mai [...] web.de>
On 19.02.2013 09:41, Graham Knop via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83188 > > > On Thu Feb 07 01:46:12 2013, MAUKE wrote:
>> It should also mention that explicitly calling >> '__PACKAGE__->meta->make_immutable;' is still valid under Moo (and does >> nothing). This is important to know if you want to write code that works >> under both Moo and Moose.
> > What kind of code are you writing where you would want to do this? I > can see documenting that it isn't harmful to do, but I'm not coming up > with a situation where you would actually want to. >
See e.g. https://metacpan.org/source/MAUKE/Function-Parameters-1.0102/lib/Function/Parameters/Info.pm - I have to play ugly games with $meta_make_immutable because technically __PACKAGE__->meta->make_immutable isn't part of the Moo API. -- Lukas Mai <l.mai@web.de>
RT-Send-CC: l.mai [...] web.de
The next release will document that make_immutable is a no-op.