Expression-oriented programming language
- 1 min read
- 2 chapters
Related on Lably
Through Expression (computer science), Preprocessor and Statement (computer science)
Lisp and ALGOL 68 are expression-oriented languages. Pascal is not an expression-oriented language.
All functional programming languages are expression-oriented.
Criticism and prevention
Critics, including language designers, blame expression-orientation for an entire class of programming mistakes wherein a programmer accidentally codes an assignment expression, which replaces a variable with an expression rather than testing it for equality with that expression.
Some languages such as Ada and Java prevent this type of mistake by restricting control expressions to those that evaluate strictly to the boolean data type.
Some languages such as Python implement assignment as a statement rather than an expression, thus prohibiting assignment from nesting inside any other statement or expression. (Until version 3.8 added 'assignment expressions', with a different syntax.)
In some expression-oriented languages, expressions that merely cause side effects return void types.
Sign in to keep reading
One more chapter is free with a Lably account.

