HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by FeepingCreature | Hacker News Reader
Parent
Full thread
FeepingCreature
·
So 'if', 'for', 'while' are not statements?
View on HN
lmm
·
Not on their own. A full if, for or while (with the conditions and body) is usally a statement, and might be an expression in some languages.
FeepingCreature
·
The body is also not terminated by a semicolon.
`while (true) { puts("Hello World\n"); };`
lmm
·
What you've written there does compile though, which was the original condition :).
FeepingCreature
·
I get the joke, but it's two statements, not one. (while and ;)
shikoba
·
In JavaScript no. But in some languages it can be.
teddyh
·
No. Those are syntactic elements.
Reply on news.ycombinator.com