Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not. Look at the ridiculous hoops a programmer must jump through…

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');


You'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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: