This pull request attempts to clean up the code as I follow along to understand it.
All tests passed, but I make it a pull request instead of push because @davdar might disagree with the changes.
Changes:
Use struct instead of (legacy) define-struct to get shorter constructor names (no make- prefix) and pattern matching
false -> #f
Shorten the code with pattern matching where possible
Simplify conditions (if (not p) e1 e2) -> (if p e1 e2), and (if (or (not p) (not q)) e1 e2) -> (if (and p q) e2 e1)
This pull request attempts to clean up the code as I follow along to understand it. All tests passed, but I make it a pull request instead of push because @davdar might disagree with the changes. Changes:
struct
instead of (legacy)define-struct
to get shorter constructor names (nomake-
prefix) and pattern matchingfalse
->#f
(if (not p) e1 e2)
->(if p e1 e2)
, and(if (or (not p) (not q)) e1 e2)
->(if (and p q) e2 e1)