4 ms·
I'm not. Look at the ridiculous hoops a programmer must jump through… https://stackoverflow.com/a/63867074 https://stackoverflow.com/a/63867074 … for what is
by bmn__ 6y ago
I'm not. Look at the ridiculous hoops a programmer must jump through…
https://stackoverflow.com/a/63867074 https://stackoverflow.com/a/63867074
… for what is literally a one-liner elsewhere:
class User :ro {
has name => isa => Str;
has email => isa => Str->where('lc =~ /^[a-z.@]{1,32}$/');
}
User->new(name => 'Dave Morrison', email => 'Dave.Morrison@gmail.com');
User->new(name => 'Van Morrison', email => 'Van-Morrison@gmail.com');
User->new(name => 'Jim Morrison', email => 'Jim.Morrison.is.my.name.and.it.is.too.long@gmail.com');
- jhanschoo 6y agoYou're comparing a type inference task on a use case it was not meant for against a runtime validation task that you can do in JS as well. It's unfair.