Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
nikai
11y ago
0 comments
Save
Share
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) { (..) }
0 comments
3 comments · 3 top-level
top
newest
oldest
cygx
11y 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.
raverbashing
11y 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.
olavk
11y ago
That is cheating!
j
/
k
navigate · click thread line to collapse