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

Adapt all exceptions/errors to use factory methods for signaling #226

Open
smarr opened this issue Feb 18, 2018 · 0 comments
Open

Adapt all exceptions/errors to use factory methods for signaling #226

smarr opened this issue Feb 18, 2018 · 0 comments
Labels
bug Fixes an issue, incorrect implementation good first issue Are you trying to have a good at SOMns? Start here! help wanted Would be great if you could help out here. language-design Not everything is in the spec, sometimes, we need to decide what's best.
Milestone

Comments

@smarr
Copy link
Owner

smarr commented Feb 18, 2018

Currently, most exceptions are defined in a way that calls the signal method as part of the constructor.
This is problematic, because it makes subclassing correctly impossible.

For example: https://github.com/smarr/SOMns/blob/dev/core-lib/Kernel.ns#L902-L905

  public class IndexOutOfBounds signalWith: obj index: idx = Exception (
    | public target = obj.
      public index  = idx. |
    self signal
  )()

Any subclass would not have its fields properly initialized, which we need to fix by using factory/class-side methods for signalWith:*, and change the primary factory methods (constructors) to merely take the arguments and store them.

@smarr smarr added bug Fixes an issue, incorrect implementation help wanted Would be great if you could help out here. language-design Not everything is in the spec, sometimes, we need to decide what's best. good first issue Are you trying to have a good at SOMns? Start here! labels Feb 18, 2018
@smarr smarr added this to the later milestone Feb 18, 2018
@smarr smarr added this to Open Issues in Completeness via automation Feb 18, 2018
smarr added a commit that referenced this issue Feb 23, 2018
This is related to issue #226
#226

Signed-off-by: Stefan Marr <git@stefan-marr.de>
smarr added a commit that referenced this issue Mar 7, 2018
This is related to issue #226
#226

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes an issue, incorrect implementation good first issue Are you trying to have a good at SOMns? Start here! help wanted Would be great if you could help out here. language-design Not everything is in the spec, sometimes, we need to decide what's best.
Projects
No open projects
Completeness
  
Open Issues
Development

No branches or pull requests

1 participant