Describe the solution you'd like
An assert statement like Python's would be great, and not too hard to implement.
Describe alternatives you've considered
Currently, you can do something like: 1 / (condition) and "message", which will divide by zero (and thus, error) if the condition is false. The trailing and is used to display a message. This solution is ugly and not very readable, which is why asserts would be great.
Describe the solution you'd like An
assert
statement like Python's would be great, and not too hard to implement.Describe alternatives you've considered Currently, you can do something like:
1 / (condition) and "message"
, which will divide by zero (and thus, error) if the condition is false. The trailingand
is used to display a message. This solution is ugly and not very readable, which is whyassert
s would be great.