CSC 151 - Mental models of computation
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
- CSC 151 - Computation via Expressionseikmeier.sites.grinnell.edu
- CSC 151 - Procedures and mental models of computationeikmeier.sites.grinnell.edu
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu
- CSC 151 - Conditional evaluation in Schemeeikmeier.sites.grinnell.edu
- Lambda calculus - Wikipediaen.wikipedia.org
- CSC 151 - Anonymous procedureseikmeier.sites.grinnell.edu
- CSC 151 - An abbreviated introduction to Scampereikmeier.sites.grinnell.edu
- CSC 151 - Expressions and typeseikmeier.sites.grinnell.edu
- Expression Evaluation and Fundamental Physics-Stephen Wolfram Writingswritings.stephenwolfram.com
- CSC 151 - Naming values with local bindingseikmeier.sites.grinnell.edu
- Documentationdocs.swift.org
- 4 A First Taste of Desugaringcs.brown.edu