Common Lisp does too:
(deftype quantity () '(integer 0 240)) (defun foo (x) (declare (type quantity x)) (1+ x)) (foo 1) → 2 (foo -1) → ERROR (defun valid-username-p (string) (and (< 8 (length string) 24) (every (lambda (char) (find char "abcdefghijklmnopqrstuvwxyz0123456789-_=./" :test #'char=)) string))) (typep "foo" 'username) → NIL (typep "foobarbaz" 'username) → T (typep "foobar-baz" 'username) → T (typep "foobar-baz " 'username) → NIL
Common Lisp does too:
Common Lisp is pretty awesome.