Java 8 lambda feature (and possibly more) not accessible despite being advertised it would.
I have seen #3411, but the response is from 2015 and supposedly Processing now does support Java 8:
Processing 3 uses Java 8. We only support the version of Java 8 that's included with the download. Because Oracle sometimes removes older updates, Processing will usually ship with the most recent update of Java 8 that was available at release time.
On top of that, it can be seen in the Environment section that Processing, indeed, does ship with Java 8.
A Java 8 example featuring lambda compiles.
IDE throws: Lambda expressions are allowed only at source level 1.8 or above.
interface NumericTest {
boolean computeTest(int n);
}
void setup() {
NumericTest isEven = (n) -> (n % 2) == 0;
}
Java version: 1.8.0_181
Processing version: 3.3.7-1
Clearly, there is a discrepancy between the implementation and the documentation. Which one is wrong?
Upon deeper inspection it seems Processing is using its own Java implementation (#3054).
I would suggest then to reflect it in docs, adding the list of differences between the Processing version and the official specs there (since #3055 is still open and no one seems to be working on it)?
@joelmoniz even identified some features to list there already in #3054:
1. Multi-catch support 2. Support for the diamond operator 3. Underscores in numeric literals (such as `int x = 30_000`) 4. [Strings in switch](https://github.com/processing/processing/issues/3049) 5. Binary literals 6. Support for lambda calculus
Maybe this just requires a minor wiki edition, because just two paragraphs before your quote, there is a response to this relevant and frequently asked question:
We don't yet support any of the Java 7 and Java 8 language features. Please help us fix this. Advanced users (loosely defined as “people who know that these features exist”) can always make use of Java 7 and 8 features from another IDE.
While the call "Please help us fix this" is still open, maybe we could avoid more misunderstandings by slightly rewriting the referred paragraph in the wiki, to make it more clear that Processing _uses_ Java 8, but Processing _doesn't fully support_ the Java 8 specific features, like lambda expressions.
Since english is my second language, I don't dare to take the risk of editing the wiki and become "the man who broke the Processing documentation with his creative english" ;)
So the proposal is to edit the supported platforms page on the wiki adding the text marked with _italics_:
Java 8
Processing 3 uses Java 8 _(but please note that currently we doesn't fully support the Java 8 specific features, like lambda expressions)_. We only support the version of Java 8 that's included with ...
I hadn't noticed the above paragraphs before, my eyes went straight to the "Java 8" section.
I feel like your modification suggestion does make things much clearer, but I am not an English native either, so I'll leave it to someone more experienced too.
Thank you for your help :smiley:
I've made the edit to the wiki. Marking this as a duplicate.
but again, does not support all Java 8 language features
The current wording suggests that Processing supports some Java 8 features, whilst two paragraphs above it says:
We don't yet support any of the Java 7 and Java 8 language features.
Most helpful comment
Maybe this just requires a minor wiki edition, because just two paragraphs before your quote, there is a response to this relevant and frequently asked question:
While the call "Please help us fix this" is still open, maybe we could avoid more misunderstandings by slightly rewriting the referred paragraph in the wiki, to make it more clear that Processing _uses_ Java 8, but Processing _doesn't fully support_ the Java 8 specific features, like lambda expressions.
Since english is my second language, I don't dare to take the risk of editing the wiki and become "the man who broke the Processing documentation with his creative english" ;)
So the proposal is to edit the supported platforms page on the wiki adding the text marked with _italics_: