-
Notifications
You must be signed in to change notification settings - Fork 239
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
Fix color in appearing in fully qualified names. #246
Conversation
It's not the cleanest solution but I don't see too many alternatives. Modify grammar to explicitly allow the color literal to appear in fully qualified name.
Other primitive types aren't allowed to be part of import statements anyways. A similar problem is with Edit: Does the grammar even need to know about |
Yeah, I don't think this is actually something we want to enable/provide a hack to make it work… Using a reserved word is a no-no in any language, and carving out separate behavior is a maintenance nightmare. It's a bummer, but I think the alternative is worse. |
Respect your decision either way Ben. My only thought is that it does make us unable to use some Jars since color isn’t reserved in Java. However, I think the concern around grammar integrity is also valid.
All that in mind, I checked and one alternative we do have for folks is that they can still use .java files to import things with color in their qualified names which they can then reference in the .PDE files.
…Sent from my iPhone
On Aug 11, 2021, at 1:05 PM, Ben Fry ***@***.***> wrote:
Yeah, I don't think this is actually something we want to enable/provide a hack to make it work… Using a reserved word is a no-no in any language, and carving out separate behavior is a maintenance nightmare. It's a bummer, but I think the alternative is worse.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I think unless it's possible to have There are also a lot of alternatives:
The bottom line is that |
This also means the color part of java.awt will not be directly accessible, correct?
https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/color/package-summary.html If That said, there are maybe 500 packages I could check in the index -- and that doesn't speak to the larger java ecosystem. |
p.s. I should have also mentioned -- micycle's example in the issue (micycle.pgs.color.*) from the PGS library was not found my scan because that library was published in May, and I hadn't scraped it yet. |
Just point of info, no int isn't allowed in Java package names. https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html |
There is no other package in Java 11 with a The only other major library I found out there is in Apache Commons -- org.apache.commons.imaging.color. Guava's packages do not have a |
Yeah I think I see your point @jeremydouglass…. Especially for awt.color. I know it’s weird to carve out an exception for color but it is the only primitive with this issue and the grammar change doesn’t concern me too much. It shouldn’t get caught up in the preprocessing rewrites because of the context and there’s tests for preproc in particular that could help catch a regression. I do see how this could be confusing for a new developer so I’d still be comfortable with the carve out. |
That sounds good to me. As it stands the consequences are:
Those aren't great, but |
FWIW I just got informed about this issue by a toxiclibs user, i.e. that As you know, I don't actively maintain the library anymore, but if the final answer really is as @benfry stated above, then I will try to cut a new release with breaking changes (i.e. the package name changed) and dozens of examples sketches updated... IMVHO this issue shouldn't even be specifically about |
@postspectacular Java is one such language with |
@dzaima It shows then, I haven't used Java for ~10 years... Could have sworn there wasn't such a restriction for package names (and those are the only ones which matter here), but I stand corrected. The Anyhow, the only other thing somewhat bugging me a little here is that after 2 decades (congrats, btw!) of established behavior in P5, this use of |
Given the impact as outlined here #246 (comment) that changes the priorities quite a bit. If @sampottinger has a fix that's working without too much impact, it sounds like we should make use of that. Sam, can you verify that you're comfortable with the reliability of the fix? |
Giving this a shot for 4.0 beta 2 for sake of compatibility. Fingers crossed… |
This pull request has been automatically locked. Pull requests that have been closed are automatically locked 30 days after the last comment. |
Addressing #240, allow color to appear in fully qualified names like as part of import statements. It's not the cleanest solution (other primitive types could not appear here) but I don't see too many alternatives.