Open vhsiao opened 11 years ago
It's important to note that this isn't just a convenience issue as far as making it easier for certain classes of bugs to slip through. It actually makes it so that perfectly valid Pyret programs can't even execute within Captain Teach.
Here's example code from this discussion on the mailing list.
fun even(n :: Number):
try:
safenum :: Number(fun (n): n.modulo(2) == 0 end) = n
true
except (e):
cases(error.Error) e:
| user-contract-failure(msg, location, trace) => false
end
end
where:
even(2) is true
even(3) is false
end
Type checking hasn't been implemented in the interactions window. For example:
A type error should have been raised.