develooper Front page | perl.moose | Postings from June 2011

Re: Moose Type Constraints violations to warnings?

Thread Previous | Thread Next
Dave Rolsky
June 13, 2011 08:36
Re: Moose Type Constraints violations to warnings?
Message ID:
On Mon, 13 Jun 2011, Ovid wrote:

> I don't want to turn off the type checks. I would just like some of them to be warnings if we're in production.
> I agree completely with the *concept* of the strict type constraints, but 
>   "In theory, theory and practice are the same.
>   In practice, we're trying to comb spaghetti."
>   Abraham Lincoln, 1912 speech to the Republican Women's De-emancipation Convention
> If a hotel's "short description" must be no longer than 200 characters, 
> they would much prefer to have the first 200 characters of their hotel's 
> 250-character description displayed rather than nothing.

You can use coercions to do this, can't you? You could even warn inside 
the coercion.


Your guide to all that's veg      House Absolute(ly Pointless)
Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About