flâneur — a map of the web's best reading

CSC 151 - Mental models of computation

eikmeier.sites.grinnell.edu · 1,479 words · saved by 1 readers

As we’ve seen, expressions lie at the core of Scheme. Expressions are syntactic constructs that evaluate to values. We are intimately familiar with expressions already: they form the basis of computation in arithmetic! For example, here is an arithmetic expression: 3 × ( 8 + 4 ÷ 2 ) 3 × ( 8 + 4 ÷ 2 ) This expression evaluates to a final value, 30 30 . We say that 30 30 is a value: it is an expression that no longer takes any steps of evaluation. The analogous Scheme code is also an expression: This extends to Scheme code that doesn’t involve numbers at all! Here the expression produces a string as output—the upper-case version of the string resulting from gluing "hello world" and "!!!" together. The process of determining the value that an expression produces is called evaluation. The evaluation of expressions is the primary way that we perform computation in Scheme! But how do expressions evaluate? We determine how expressions evaluate by applying two basic sets rules: For arithmet

CSC 151 - Mental models of computation Mental models of computation Due Friday, 5 September 2025 --> Summary We introduce a mental model of computation for Scheme programs that allows us to read code and predict its behavior without having to run the program. Expressions As we’ve seen, expressions lie at the core of Scheme. Expressions are syntactic constructs that evaluate to values. We are intimately familiar with expressions already: they form the basis of computation in arithmetic! For example, here is an arithmetic expression: \[ 3 × (8 + 4 ÷ 2) \] This expression evaluates to a final val

Explore this link on the map →

related reading