Many (but not all) programming languages syntactically distinguish "statements" ...
Simon Tatham @simontatham@hachyderm.io
Many (but not all) programming languages syntactically distinguish "statements" and "expressions". One intuitive idea you might have of the semantic difference is that a statement takes action (at least modifying a variable, maybe also doing I/O or the like) whereas an expression computes a value.
Of course, in most such languages, the semantics cross over. Some actions also naturally return a value (e.g. do some system call and tell me whether it was successful), and some computations can have side effects. So this is only a difference of emphasis, not a hard line.
Has there ever been a programming language in which the distinction was rigidly enforced, so that nothing you could write in an expression could have side effects? A language in which expressions _only_ compute values, and if you want to change the program's state, you _must_ use a statement?
(Not counting vacuous cases like pure functional languages.)