radon-project / radon

The Radon Programming Language
https://radon-project.github.io
GNU General Public License v3.0
23 stars 2 forks source link

[Feature]: `assert` statement #75

Closed angelcaru closed 3 months ago

angelcaru commented 3 months ago

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.

Almas-Ali commented 3 months ago

I was thinking to add this late, but never mind. PR is welcome.