Y
Hacker News
new
|
ask
|
show
|
jobs
by
nikai
4035 days ago
Not even in C. You can have an if condition that is actually a macro that expands with parentheses. For example the macros in ctype.h, so you can actually write
if islower(c) { (..) }
3 comments
cygx
4035 days ago
That's not portable, though: A comforming implementation may very well implement
islower
as a function call, and you should treat is as such.
link
raverbashing
4035 days ago
Yeah, but macros are not
really
part of the language, they're more a writing aid than anything really.
So, for the sake of good practices, write if with parenthesis.
link
olavk
4035 days ago
That is cheating!
link