Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 28351
Status: resolved
Priority: 0/
Queue: Moose

People
Owner: stevan.little [...] gmail.com
Requestors: SHLOMIF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Moose.pm's documentation for 'isa' => needs to refer to Moose/Util/TypeConstraints.pm
Hi all! Today when working with Moose on a new module, I needed to define a new type. However, the documentation for Moose.pm says this on 'isa': <<<<<<<<<< isa => $type_name The isa option uses Moose's type constraint facilities to set up runtime type checking for this attribute. Moose will perform the checks during class construction, and within any accessors. The $type_name argument must be a string. The string may be either a class name or a type defined using Moose's type definition features. Show quoted text
>>>>>>>>>>
Nowhere does it say how to define a new type. So I went on IRC and asked, and phaylon answered that I should refer to Moose::Util::TypeConstraints (thanks!). However, it's still a problem with the documentation. The attached patch against the svn trunk fixes this problem. Please apply it. For more information on why this is needed, see the "Fix everything two ways" item here: http://www.joelonsoftware.com/articles/customerservice.html Regards, Shlomi Fish
Subject: Moose-link-to-util-type.diff
Index: lib/Moose.pm =================================================================== --- lib/Moose.pm (revision 2511) +++ lib/Moose.pm (working copy) @@ -394,7 +394,8 @@ type checking for this attribute. Moose will perform the checks during class construction, and within any accessors. The C<$type_name> argument must be a string. The string may be either a class name or a type defined using -Moose's type definition features. +Moose's type definition features. (Refer to L<Moose::Util::TypeConstraints> +for information on how to define a new type). =item I<coerce =E<gt> (1|0)>
From: SHLOMIF [...] cpan.org
This patch was applied to the SVN. So this report should be closed either now or when a new Moose program, with the modifications is released. Regards, Shlomi Fish On Tue Jul 17 11:55:58 2007, SHLOMIF wrote: Show quoted text
> Hi all! > > Today when working with Moose on a new module, I needed to define a > new type. However, the documentation for Moose.pm says this
on 'isa': Show quoted text
> > <<<<<<<<<< > isa => $type_name > The isa option uses Moose's type constraint facilities to set up > runtime type checking for this attribute. Moose will perform the > checks during class construction, and within any accessors. The > $type_name argument must be a string. The string may be either a
class Show quoted text
> name or a type defined using Moose's type definition features.
> >>>>>>>>>>
> > Nowhere does it say how to define a new type. > > So I went on IRC and asked, and phaylon answered that I should refer > to Moose::Util::TypeConstraints (thanks!). However, it's still a > problem with the documentation. The attached patch against the svn > trunk fixes this problem. Please apply it. > > For more information on why this is needed, see the "Fix everything > two ways" item here: > > http://www.joelonsoftware.com/articles/customerservice.html > > Regards, > > Shlomi Fish
This is fixed in 0.25