-
Notifications
You must be signed in to change notification settings - Fork 55
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
Should object method param names be equal in declaration and definition? #124
Comments
There is no logical need for them to be the same, but it would probably reduce confusion to require this. @sanjiva what do you think? |
We should require them to be the same - otherwise its lots of unnecessary confusion. |
Ack. Will keep the same name for both. |
@sanjiva Also need to decide whether annotations are required to be the same for both. |
No I think annotations have to be different I think .. and we union the annotations. (That raises an interesting question whether annotation order matters .. new issue?) |
I don't think they should be union-ed. A user who wants to make use of the object type should only have to read the object type declaration, and should not need to look at the outside method implementations. If you don't want to repeat, then I think the annotations relating to the function type should be on the declaration only. Annotations on extern could of course on the definition. |
Hmm that means there's a semantic difference between
and
I'm not sure that's good. Also, didn't understand |
AFAIU, What @jclark meant to say is the following. object A {
@x:y { }
function foo ();
}
@java {class:"", method:"" }
function A.foo () = external This can confuse a mort. Figuring out what annotations go on the declaration and what annotations go on the definition is not straightforward IMO. |
Should we also define which documentation string takes the precedence? It is logical to say that documentation should be specified on the method declaration. |
The @java annotation should be on the external |
This also relates to parameter names being optional, which was issue #148. |
All of this my poor Mort-mind-blowing aspects can be avoided if we lose outside methods and just say methods have to defined, not just declared, in the object itself. I guess that ship has sailed already :). In that case I think we should just require everything that is being repeated (function name (duh), param names, modifiers) to be the same and for other metadata (docs, annotations) to be in declaration in the object. If anything is specific to the implementation (e.g. annotation related to '= external') then that can be on the definition, not decl. |
Conclusion after discussion today was that we should consider removing the outside method definition feature. See issue #179. |
Since we decided to remove the outside method definition feature, this issue no longer arises. |
If we consider an object, should the parameter names of a method declaration be equal to their corresponding counterparts in the method definitions?
The spec doesn't specify whether the param names are significant in this case.
Somewhat related to #125 as well
The text was updated successfully, but these errors were encountered: