Skip to content

Commit 064b2e0

Browse files
committed
Remove "unofficial" types from printArray()
As a protest for the bureaucratic intransigence refusal to include the missing `short[]` in **printArray()**, I've made this opposite proposal! https://github.com/processing/processing/pull/2896/files Motive given was: "'shorts' are not supported in Processing and are omitted on purpose." But so are both `long` & `double`; and they were contemplated into **printArray()** nonetheless! Another case is `boolean[]`. It's more like hit 'n' miss. There are some array util methods which got it, but most don't. Very inconsistent to say the least. So `boolean` is out for conciseness' sake! A pity this project are kept at 7 locks. Alas... 😞 My only fear is that this pull request may end up being accepted! Oh the irony... 😩
1 parent 120b87c commit 064b2e0

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

core/src/processing/core/PApplet.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4694,21 +4694,28 @@ static public void printArray(Object what) {
46944694
}
46954695
}
46964696
break;
4697-
4697+
/* Why would n1 would need a boolean[] after all?
46984698
case 'Z': // boolean
46994699
boolean zz[] = (boolean[]) what;
47004700
for (int i = 0; i < zz.length; i++) {
47014701
System.out.println("[" + i + "] " + zz[i]);
47024702
}
47034703
break;
4704-
4704+
*/
47054705
case 'B': // byte
47064706
byte bb[] = (byte[]) what;
47074707
for (int i = 0; i < bb.length; i++) {
47084708
System.out.println("[" + i + "] " + bb[i]);
47094709
}
47104710
break;
4711-
4711+
/* I was refused even though I'm the only 1 missing!
4712+
case 'S': // short
4713+
byte ss[] = (short[]) what;
4714+
for (int i = 0; i < ss.length; i++) {
4715+
System.out.println("[" + i + "] " + ss[i]);
4716+
}
4717+
break;
4718+
*/
47124719
case 'C': // char
47134720
char cc[] = (char[]) what;
47144721
for (int i = 0; i < cc.length; i++) {
@@ -4722,28 +4729,28 @@ static public void printArray(Object what) {
47224729
System.out.println("[" + i + "] " + ii[i]);
47234730
}
47244731
break;
4725-
4732+
/* I'm as non-official as any other primitive!
47264733
case 'J': // int
47274734
long jj[] = (long[]) what;
47284735
for (int i = 0; i < jj.length; i++) {
47294736
System.out.println("[" + i + "] " + jj[i]);
47304737
}
47314738
break;
4732-
4739+
*/
47334740
case 'F': // float
47344741
float ff[] = (float[]) what;
47354742
for (int i = 0; i < ff.length; i++) {
47364743
System.out.println("[" + i + "] " + ff[i]);
47374744
}
47384745
break;
4739-
4746+
/* Use float[] instead, dumb!!!
47404747
case 'D': // double
47414748
double dd[] = (double[]) what;
47424749
for (int i = 0; i < dd.length; i++) {
47434750
System.out.println("[" + i + "] " + dd[i]);
47444751
}
47454752
break;
4746-
4753+
*/
47474754
default:
47484755
System.out.println(what);
47494756
}

0 commit comments

Comments
 (0)