-
Notifications
You must be signed in to change notification settings - Fork 1
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
The spec needs to talk about abstract methods #32
Comments
check that local declns of abstract methods override traits |
We agreed to start talking about |
It's not. The main difference is that a local definition of a I was keen earlier to switch back to To simplify the syntax, I'd just make |
Oh yeah my other reason for preferring required is I think it works better with fully symmetric inheritance resolution --- no implicit overriding, you have to exclude something you want to override #137 |
It's not a simplification, but I agree that it would be an improvement — if a method with an The reason that I'm suggesting this is that the old syntax, where the body is I related question is: what error should be generated when a required method is not provided? An object composition error at object construction time, or a |
I think @apblack means:
where I think we're nominally at now is:
what I currently suggest is:
because the other two cases make the method syntax irregular |
these should also be consistent. I assume @apblack wants a construction time error; I would prefer a dynamic error, or just not specifying it - if only because I could kid myself that in some non-existent dynamic IDE you should be able to run the code, drop into the debugger, and then supply the necessary error then. The key issue here is: what invariants can the compiler (or checkers) assume about Grace programs. We all seem to agree that nothing should see a syntactically incorrect methods. I take this as a matter of tradition. |
What we are at now is
because that's the same syntax as a normal declaration. What I' m proposing is that the syntax should be different from a normal declaration, because the semantics is also different. |
Hmm the spec has one example
and one sentence that says the body is " (Of course, if we removed all braces execpt for blocks (everything else just layout) then the deign issue goes away.) |
You are right about that example; it's another one of the inconsistencies that we need to fix. The spec also says that The Spec also says that
That's what we are discussing changing here, right?
What I want is for the spec to explain the difference between saying nothing at all about foo and saying that |
well that's probably a good idea :-)
I don't know - someone needs to write down the whole semantics of inheritance --- including required, overrides, who knows what else --- in a comprehensible way. I've only got halfway there. Depends on details of the semantics. I could imagine a world where you weren't allowed to write It will I imagine do something about types, at least static types. |
Are
abstract
declarations required? Or are they optional? And what is the semantics ofabstract
?Personally, because I want to be able to use Grace for experimental as well as production coding, I would like abstract methods to remain optional. It would be fine for a dialect to prevent the instantiation of a class that contains an abstract method, but not for the base language.
This all needs to be specified.
The text was updated successfully, but these errors were encountered: