Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: raise keyword support proposal. (REP-6) #83

Closed
9 of 10 tasks
Almas-Ali opened this issue Apr 19, 2024 · 5 comments
Closed
9 of 10 tasks

[Feature]: raise keyword support proposal. (REP-6) #83

Almas-Ali opened this issue Apr 19, 2024 · 5 comments
Labels
core System level core enhancement New feature or request proposal Radon Enhancement Proposal (REP)

Comments

@Almas-Ali
Copy link
Member

Almas-Ali commented Apr 19, 2024

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:

  • Add raise keyword support.
  • Add raisable errors.

Examples:

  • ValueError
  • TypeError
  • KeyError
  • IndexError
  • MemoryError
  • IOError
  • NotImplementedError etc more...
  • For making this multiple errors, we need to make a BaseError class that will be inherited by child classes to make new errors. Also custom (user defined) errors will be supported.

This issue will be edited for any future changes.

@Almas-Ali Almas-Ali added enhancement New feature or request core System level core labels Apr 19, 2024
@Almas-Ali Almas-Ali changed the title [Feature]: raise keyword like Python. [Feature]: raise keyword support like Python. Apr 19, 2024
@Almas-Ali Almas-Ali changed the title [Feature]: raise keyword support like Python. [Feature]: raise keyword support proposal. (REP-6) Apr 20, 2024
@Almas-Ali
Copy link
Member Author

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

@Almas-Ali Almas-Ali added the proposal Radon Enhancement Proposal (REP) label Apr 20, 2024
@Almas-Ali
Copy link
Member Author

Added raise keyword support. #135

@Almas-Ali Almas-Ali pinned this issue May 25, 2024
@Almas-Ali
Copy link
Member Author

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

@Almas-Ali
Copy link
Member Author

Also user defined radiation errors are possible.

fun MyError(message=null) -> message

raise MyError
raise MyError("This is my error")

@Almas-Ali
Copy link
Member Author

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

@Almas-Ali Almas-Ali unpinned this issue May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core System level core enhancement New feature or request proposal Radon Enhancement Proposal (REP)
Projects
None yet
Development

No branches or pull requests

1 participant