lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Stephan Mantler wrote:

> Philip Plumlee wrote:
> > Luists:
> > 
> > Ogle this awesome snip of C++:
> > 
> >        #define TRACE_(x) cout << #x ": " << x << endl
> 
> can't help with the Lua translation, but i'd suggest using 
> (x) instead of the bare x, or you might run into operator 
> precedence problems:

TRACE_(apples << oranges);

That's a feature. (x) would yield an attempt to shift apples by orange
bits.

(Actually, the feature will cram the results together, so:

TRACE_(apples << ' ' << oranges);

)

One could tweak the width manipulators there...

-- 
  Phlip
  http://ssw0251/wiki.rb?RecentChanges
  home: mailto:phlip2005@gmail.com
  cell: 760 214 2958