-
Notifications
You must be signed in to change notification settings - Fork 34
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
Does the run() function need to be shared? #907
Comments
Yeah yeah, I know. I've been trying to convince @chochos that the |
Fiiiiiine I'll get on it. Just please open an issue in ceylon-js |
I don’t know, the JS behavior makes more sense to me. I know @gavinking is probably concerned about cluttering even the smallest sample code with “unnecessary” |
Guys, it’s ridiculous how long this “high priority” and really simple issue has remained open, just because I refused to open an issue in ceylon-js… I’ll repeat my vote for the JS behavior, because:
Discussion? 1) Yes, |
One one hand, Java requires the |
personally I prefer it to be shared , and while doing some demonstrations of ceylon always been asked to run on JS I had to leave everything to modifying to use shared ... anyway, shared or unshared we need to be consistent in both platforms .. the behavior that we have today is frustrating to explain this lack of consistency |
Well the thing is, suppose I have a method |
Perhaps we could add an exception for “local modules” (from repo |
Well, my strongest argument here is that if you have a private method then it is often dependent of the environment context or the own instance state, this way its usefull just in rare cases, normally when you want to run the method its probably because its also shared. |
We could give the IDE the ability to run non-shared functions. It is an IDE after all, and can do all sorts of |
...Special things Stupid phone |
Well then this would become only an issue for the |
Well that doesn't seem right, if the IDE can do it why can't we on the command line? So then we would be back at square one. I don't care too much one way or the other, both backends should just behave the same, period. The problem with the JS backend is, IIRC, that it cannot execute private methods. So the JS compiler would have to make all parameterless toplevel funtions public to make things work. That might be an acceptable tradeoff though. |
Because the IDE wouldn’t run arbitrary modules? |
If the IDE works like that I don't see why the command line can't do the same. I definitely don't like the idea that you'd be able to do more in the IDE than on the command line. "Oh I need to test this private function, better fire up the IDE". Let's not go there. |
Even a simple rule stating the mere existence of |
Resolved affirmatively. |
The |
Is that a ceylon-runtime issue because the |
Well I think at least having it confirmed is something. Both tools have already worked different from the beginning, letting this slip to 1.1.5 won't be a disaster. I opened an issue for it on ceylon-runtime. |
Try the following code
It compiles fine for both the Java and Javascript backends. However, when running it in Javascript, you get the following error
while it runs perfectly fine in Java.
I don’t care what behavior is the correct one here, but the inconsistency is pretty confusing when you’re e. g. trying to test that your changes in both backends produce the same result :) (especially if you just skim through the message and only read the “does not exist” part)
The text was updated successfully, but these errors were encountered: