On Wed, Jan 26, 2011 at 09:52:39PM +0100, Jean-Marc Lasgouttes wrote: > Le 26 janv. 2011 à 20:55, Enrico Forestieri a écrit : > >> I would have preferred a more explicit syntax like > >> os << breakl << "\\begin" > >> and have all explicit \n be output. > > > > Hmm... iomanip's work at a lower level and that is a simple wrapper > > around an output stream. You are however right that it may be better > > to have some explicit way to break a line. > > We only have some os << setEncoding() stuff, it is easy to implement. > This is just syntactical sugar, AFAICS, no need to go at iomanip > level.
Yep, but an explicit method also helps in the line counting task, otherwise YA method has to be called to get that info. Currently it is done such as "lines = os.canBreakLine() ? 3 : 2;" just before outputting the thing, and it could be "lines = os.breakLine();" and then "lines += number_of_newlines_in_sight;", as already done. -- Enrico