Apr.01:
Using Random Number Generators, passing in a seed:
rng-example.rs
Apr.03: Testing random-functions with a StepRng;
generalizing our function to take any object with trait Rng:
rng-example.rs.
Apr.08:
Review rand-walk.rs;
Implementing a trait.
Apr.10:
The common enums Option (variants Some(val) and None),
and code{Result} (variants Ok(val) and Err(msg)).
Start: Reading from std::io::stdin
Apr.15:
Finish: Reading from std::io::stdin (viz.flush).
Mention 3 handy methods for extracting a the value from a ResultorOption:
they each differ in what to do in the case there isn't a value present:
unwrap_or: returns your default, never panicking;
expect: provides a custom panic you specify;
unwrap generic panic if value not there.
Passing anonymous functions (closures in Rust), writing parameter list with e.g.|x|:
[code: before, after]
Apr.24:
Consider the last 6 slides of notes on
polymorphism and dyn:
We compare with polymorphism.rs,
and discuss how the dyn keyword adds a level of indirection to a virtual-function-table (v_table),
as seen in this photocredit: nlahn.
Apr.29:
Discuss hw03-soln's
interesting tidbits.
Review ownership and memory-issues
(buffer overflow, memory-leaks, dangling pointers, double-frees).
Skim smart-pointers.pdf
(mentioning Rc, weak-references, and circular data structures).
May.01:
Review questions, and reflecting on Java vs. Rust vs. C: trade-offs between ease, safety, performance.