Questions tagged [statements]
For questions relating to statements, a small unit of code that expresses a certain action, in programming languages.
5 questions
0 votes
2 answers
1k views
“return(x);” vs. “return x;”
In most C-like languages, a call such as printf("%d", x) is followed by two parentheses; and I see that a statement such as ...
9 votes
6 answers
4k views
Would it be safe to introduce the "freeze" statement?
Would it be safe to introduce the freeze statement for freezing a mutable object into an immutable object? Such statement would mix well into dynamically-typed ...
6 votes
5 answers
592 views
What languages have semantics with more than one "way" to execute each statement?
This is a difficult question to get across because I don't think there is an established term for what I'm asking about. In the title I've called it "ways" of executing statements, but I ...
9 votes
3 answers
463 views
What are the advantages/disadvantages of distinguishing statements and expressions?
Some languages distinguish expressions from statements so that something like int x = 2; foo((x += 2)); is invalid. Other languages don't, so that a similar ...
4 votes
6 answers
482 views
How would I describe an expression separately from a statement?
I have thought about how I could specify an expression separate from a statement. A fragment of code that resolves to a value. But void expressions are still ...