diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 652c7e862..3bd550fa4 100755 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -4380,6 +4380,23 @@ public class PApplet extends Applet System.out.flush(); } + + static public void print(Object... variables) { + StringBuilder sb = new StringBuilder(); + for (Object o : variables) { + if (sb.length() != 0) { + sb.append(" "); + } + if (o == null) { + sb.append("null"); + } else { + sb.append(o.toString()); + } + } + System.out.print(sb.toString()); + } + + static public void print(Object what) { if (what == null) { // special case since this does fuggly things on > 1.1 @@ -4389,8 +4406,8 @@ public class PApplet extends Applet } } - // -/** + + /** * ( begin auto-generated from println.xml ) * * Writes to the text area of the Processing environment's console. This is @@ -4458,6 +4475,13 @@ public class PApplet extends Applet System.out.flush(); } + + static public void println(Object... variables) { + print(variables); + println(); + } + + static public void println(Object what) { if (what == null) { // special case since this does fuggly things on > 1.1 diff --git a/core/todo.txt b/core/todo.txt index 1aa0972b8..8fde85231 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -15,6 +15,8 @@ X https://github.com/processing/processing/pull/2070 X Java2D images crash after being resized X https://github.com/processing/processing/issues/2113 X constrain lerpColor() between 0 and 1 +X allow println() and print() to take varargs +X https://github.com/processing/processing/issues/2056 _ JSONObject/Array.format(-1) not working on embedded JSONObjects _ should be a quick fix, notes are in the report