Navigation
index
next
|
previous
|
Intro to CS 2022
»
Lecture Notes, Week 05
¶
Strings
Resources
Strings, revisited
Exercise 01
Food for thought about Exercise 01.1
Mini-interlude about the food for thought about Exercise 01.1
Mini-interlude about the Emacs content of the food for thought about Exercise 01.1
Mini-interlude about Exercise 01.2
Mapping a character-to-character function pointwise over a string
Random interlude
Exercise 02
Small (but helpful) interlude about Exercise 02
Exercise 03
General interlude
Exercise 04
General interlude (continued)
Food for thought
General interlude (ended)
Aftermath
Conversion between integers and strings
Formatting strings
Formatted output
Resources
Version
Unparsing values and formatting strings
Resources
Unparsing values
Unparsing Booleans
Interlude about Booleans
Unparsing characters
Interlude about characters
Unparsing strings, or from the frying pan into the fire
Interlude about strings
Interlude about strings within strings
Executive summary
Unparsing integers
Interlude about integers
Unparsing pairs of Booleans and strings
The situation so far
Exercise 05
Unparsing polymorphic pairs
Unparsing polymorphic triples
Interlude
Exercise 06
The end game: printing unparsed values
Resources
Version
Where do we go from here?
Food for thought
More food for thought
Version
Tracing function calls and returns
Resources
The point
Versions where the calls are traced
Versions where the calls and the returns are traced
Traced versions with an indentation that reflects the nesting of the calls
Resources
Version
The factorial function
Resources
The mandatory unit-test function
Mathematical specification of factorial numbers
How to compute a factorial number, with a little help from our friends
La même chose, with a little help from OCaml
Resources
Version
Induction and recursion over natural numbers
Resources
From inductive data to structurally recursive functions
Local declaration of a recursive function
Exercise 07
Global declaration of a recursive function
Syntactic sugar for declaring recursive functions
A first example: doubling up a natural number
Food for thought
Simplifying the definition of the doubling function
Exercise 08
Solution for Exercise 08
Interlude
Exercise 09
Solution for Exercise 09
Aftermath
Exercise 10
The even predicate
The odd predicate
Exercise 11
After hours
Vigfus’s dream
Resources
Version
Polynomials revisited
Exercise 12
Polynomials revisited, continued
Exercise 13
Polynomials revisited, continued^2
Exercise 14
Polynomials revisited, continued^3
Exercise 15
Polynomials revisited, ended
Postlude
Exercise 17
Post-postlude
Resources
Version
Exercises for Week 05
Exercise 00
Mandatory exercises
Recommended exercise
Exercise 16
Resources
Version
Previous topic
Exercises for Week 04
Next topic
Strings
Quick search
Enter search terms or a module, class or function name.
Navigation
index
next
|
previous
|
Intro to CS 2022
»