Actually, I've been thinking about it, since someone recently made a compelling case for efficiently discarding unnecessary protocol stuff from a certain wifi-to-serial adaptor.
I created a patch, but haven't had time to throughly test it yet.
The name will be Serial.clear(), because Arduino generally follows Processing's naming conventions.
It so hurts me to keep seeing new terms being used to define "new" functionality
when it suddenly becomes obvious again that some of that old functionality really was needed.
In this case, technically, I guess the IOSTREAM library guys and processing have created the problems here.
My preference would be that if
names are to be changed/updated how about we use the names and meanings
that were always historically used in serial devices?
flush() means discard,
drain() means wait for things to empty.
It had been that way for decades - long before the stream i/o guys
incorrectly picked the term "flush" to mean to drain out queued data.
and long before APIs like Win32 which now use the term "purge" to flush out buffers.
(Although I think "purge" is more intuitive than "flush" as to what it really does)
It used to be so simple and consistent.
For those too young to remember: here is some information on the topic:
http://www.serialio.com/support/jspUsing.htmBut I guess I can only dream.....
---- bill