On Jun 2, 2008, at 12:24 AM, Shlomi Fish wrote:


On Sun, Jun 1, 2008 at 5:19 PM, Stevan Little
<[EMAIL PROTECTED]> wrote:


And naturally, Moose is
also making many run-time checks that are not present in my old
Class-Accessor and are not really necessary for me. As much as I
appreciate type-checking for instance members, I'm disciplined enough
for it not to matter much.

So just remove the types, it is that simple since they are entirely
optional. In fact, the accessor generated by Moose for this:

has foo => (is => 'rw');

if *faster* the the typical Class::Accessor version since it never creates a lexical $self, and just uses $_[0] instead. Moose does as much as it can to only make you pay for the features you use, but it cannot remove the cost of
features you use, but just don't really want ;)


Yes, but to me it seems that it beats the point of using Moose. If I'm
using Moose, I'd rather have type-checking, so people will know what
every class member is.

Is it possible to tell Moose to skip type-checking for particular classes? That way, one could insert the types solely for declarative purposes, or could turn on type-checking only in the development version of an application, or turn off checking for performance critical classes.

The FAQ mentions this will likely be "in the next release", not sure when that was written. :)

Jon

Reply via email to