Ok, right now I decided to use Moo, so I will write below only about Moo.
Yes, I know about it's dynamic nature and so on (about typing system). So let me express how do I feel about isa and coerce.
Coercion is something about type-casting in languages with static typing, while isa-checking is about type-checking. Since Moo doesn't have native (relatively to the framework itself) type system, we provide our own type-checking system (based on subroutines). If I'd use Moose, I could use its own type system.
The isa sub should throw an exception on invalid values
And what is about exceptions? Sorry for silly question, but did you mean dying from sub?
And one more question. When are this subs called? As far as I can understand, isa and coerce are called when we try to set the new value. But are this subs called somewhere else?
In reply to Re^2: Moo's coerce and isa difference
by krautcat
in thread Moo's coerce and isa difference
by krautcat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |