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]: `raise` keyword support proposal. (REP-6) #83

Closed Almas-Ali closed 1 month ago

Almas-Ali commented 3 months ago

Is your feature request related to a problem? Please describe. It will make Radon more powerful.

Describe the solution you'd like A sample example.

try {
    1/0
}
catch as err {
    raise some error
}

Work List:

Examples:

This issue will be edited for any future changes.

Almas-Ali commented 3 months ago

Converting this to a proposal. Radon Enhancement Proposal (REP-6)

Almas-Ali commented 1 month ago

Added raise keyword support. #135

Almas-Ali commented 1 month ago

Added raisable builtin in stdlib/radiation #140 This supports a list of error types.

Almas-Ali commented 1 month ago

Also user defined radiation errors are possible.

fun MyError(message=null) -> message

raise MyError
raise MyError("This is my error")
Almas-Ali commented 1 month ago

This ends up this REP for now. We don’t have OOP fully supported yet. We will move to OOP model in the future.