Rust - Lexicon, Control Structures, Functions




CS152

Chris Pollett

Oct 4, 2021

Outline

Introduction

Lexicon

Comments in Rust

Variables - Immutability and Mutability

Types in Rust

Primitive Types

Constants and Statics in Rust

Quiz

Which of the following statements is true?

  1. Runtime heaps are typically used to manage local variables for function calls.
  2. C is a dynamically scoped language.
  3. C supports nested blocks.

Expressions

Control Structures - if

Control Structures - match

Control Structures - loop, while

Control Structures - for

Functions