The ability to print multiple fields can be done now using a method published by Mikal Hart here: http://www.arduino.cc/playground/Main/StreamingOutput
Its syntax is a C++ standard but I wonder if it looks a little scary to non-technical people?
I used to write C++ professionally (before Java and Erlang came along :)), and I was fine with the "<<" operator overloading on Streams. IMHO, we got a bit 'punchy' back in those days, and used overloaded operators for anything and everything. I felt it had got to a point where the editor needed to be smarter than me to figure out which code was actually going to be applied, so that it could show me the appropriate definition.
IMHO, one of the beautiful aspects of Arduino is the taste and restraint that the team has used to keep things clear and approachable.
I have no objection to folks using operator overloading. But I feel it is hard enough for new programmers to get to a point where they are happy to manipulate bits with "<<" and ">>", and that overloading to create different semantics may create confusion. I feel that is not what Arduino is about (I realise I am not an authority). I would beg that overloading "<<" for printing be eschewed in Arduino's IDE examples, as it seems a leap too far for the new programmer.
If folks want a more compact way to print, just overload a new member function so that it can be used like:
Serial.out("y=").out(y).out(" x=").out(y<<3).newline();
I accept this is not as pretty and compact as the "<<" overloaded operator, but it reduces confusion compared to:
Serial << "y=" << y << "x=" << (y << 3) << endl;
x = y << 3;
Just to emphasise the point, who can see the error in the operator overloading example?
Example:
Serial << "GPS unit #" << gpsno << " reports lat/long of " << lat << "/" << long;
Answer:
long is a type, not a variable, so this doesn't compile.
I found it easier to spot the error when I saw:
Serial.print(long);
which also doesn't compile. (AFAIK, the page history says it has been like this since 22nd January.)
(I apologise for not fixing it. I was tempted to fix it, but I wanted to leave it so folks looking at the entire example can see and appreciate how hard this stuff is. I'd only read this as a result of mem's post, and I 'read' it more than once, and missed it
)
I would observe that this has been referenced several times in this thread, and presumably read, and no one has raised this concern. I think it suggests that it is not easy to understand.
Just my $0.02 worth
GB