Re: Problem with use Moose -strict

2010-03-03 Thread Nick Perez
On Wed, 3 Mar 2010 13:20:06 -0600 (CST)
Dave Rolsky auta...@urth.org wrote:

 So with that in mind, maybe the flag needs to be more specific, like 
 -strict-constructor.
 
 We could also offer a catchall -all-strict-i-mean-it flag (with a
 better name) that would be explicitly documented as something that
 could add more strictness later.

Personally, I like the -flag = [qw/some options here/] syntax. That
would let us specify everything we want. That way -strict could be a
gateway to all sorts of pedantry. 


-- 

Nicholas Perez
XMPP/Email: n...@nickandperla.net
http://search.cpan.org/~nperez/
http://github.com/nperez


Re: Problem with use Moose -strict

2010-03-03 Thread Goro Fuji
On 4 March 2010 04:20, Dave Rolsky auta...@urth.org wrote:
 I like the interface, and I think it's preferable to a separate
 Moose::Strict module.

 However, the problem with naming the flag strict is the same problem Perl
 has with the strict pragma. Strict is a very general name, which we'd be
 using simply for strict constructors right now. That means if we want to add
 _more_ types of strictness later, we're stuck with either changing the
 meaning of -strict, or adding another flag like -this-other-strict, both
 of which suck.

 So with that in mind, maybe the flag needs to be more specific, like
 -strict-constructor.

 We could also offer a catchall -all-strict-i-mean-it flag (with a better
 name) that would be explicitly documented as something that could add more
 strictness later.

I think -strict = [args] seems better.

And I'm thinking about two other strict options:

* strict hierarchy, requiring all the parents are immutable
  because mutable parents are considered a source of problems
* strict attribute, requiring required or default/builder or isa
= 'Maybe[...]
  , in order to ensure type consistency.

-- 
Goro Fuji (藤 吾郎)