Hacker News new | comments | show | ask | jobs | submit login

Sounds like what Perl 6 does :) You can add optional type signatures, and you get compile-time checks disallowing impossible usages of these:

  > sub takes-string(Str $foo) { }
  sub takes-string (Str $foo) { #`(Sub|94327719210888) ... }
  > takes-string(5); say "Hi!"
  ===SORRY!=== Error while compiling:
  Calling takes-string(Int) will never work with declared signature (Str $foo)
  ------> <BOL>ā¸¸takes-string(5); say "Hi!"



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

Search: