Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.94 KB

expressions.md

File metadata and controls

39 lines (26 loc) · 1.94 KB

Expressions

The Concept

An expression is a combination of one or more constants, variables, operators, and functions that the programming language interprets (according to its particular rules of precedence and of association) and computes to produce ("to return", in a stateful environment) another value. This process, as for mathematical expressions, is called evaluation.

In simple settings, the resulting value is usually one of various primitive types, such as numerical, string, logical, complex data type or many others.

For example, 2+3 is an arithmetic and programming expression which evaluates to 5. A variable is an expression because it denotes a value in memory, so y+6 is an expression. An example of a relational expression is 4≠4, which evaluates to false.

What to cover

  • What is an expression? Explain what an expression is and how it is different from a statement.

Exercises

Lasagna cooking

This exercise deals with cooking a lasagna dish in the oven. The reference implementation (Common Lisp) teaches:

  • What an expression is.

Implementations

Track Exercise Changes
Common Lisp basics