diff --git a/may_2025_thoughts.md b/may_2025_thoughts.md index a15769c..4443075 100644 --- a/may_2025_thoughts.md +++ b/may_2025_thoughts.md @@ -240,11 +240,16 @@ println!("{a} // {b_high}/{b_low} // {c}"); ``` To reiterate the punch list that *I would have needed for Computer Class 1*: -* [ ] jump instructions need 16 bits of operand +* [x] jump instructions need 16 bits of operand + - Whew, that took longer than I expected * [ ] splatterns - [ ] validator should ensure splatterns are the longest patterns in a form -* [ ] add guards to loop forms -* [ ] check loop forms against function calls: do they still work the way we want them to? +* [ ] improve validator + - [ ] Tuples may not be longer than n members + - [ ] Loops may not have splatterns + - [ ] Identify others +* [x] add guards to loop forms +* [x] check loop forms against function calls: do they still work the way we want them to? * [ ] tail call elimination * [ ] stack traces in panics * [ ] actually good error messages diff --git a/src/main.rs b/src/main.rs index a3184b2..fb8ed5a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,10 +75,14 @@ pub fn run(src: &'static str) { pub fn main() { env::set_var("RUST_BACKTRACE", "1"); let src = " -loop (1) with { - (0) -> :done - (1) -> recur (0) +let foo = loop (1, 2, 3) with { + (0, 0, 1) -> :done + (1, 2, 3) -> recur (4, 5, 6) + (4, 5, 6) -> recur (:foo, :bar, :baz) + (:foo, :bar, :baz) -> recur (0, 0, 0) } + +(foo, 42) "; run(src); }