Build the Sugar
Each function you’ll write constructs an array, the same arrays you’ve been writing by hand. The evaluator doesn’t change. It still receives arrays like [1, "+", 2] and ["lambda", "n", body]. The difference is how you build them.
Instead of:
["n", "*", 2]
You write:
mul("n", 2)
Instead of:
["double", "=", ["lambda", "n", ["n", "*", 2]]]
You write:
define("double", fn("n", mul("n", 2)))
Same array. Same evaluator. Easier to read.
Write twelve helper functions. Each one takes its arguments and returns the corresponding array. They all follow the same one-line pattern. There’s nothing clever happening, just packaging.
One naming quirk: the conditional helper is called iff, not if. That’s because if is a reserved keyword in JavaScript, so you can’t use it as a function name. The name iff comes from logic, where it’s short for “if and only if.” It’s not quite the same meaning here, but it’s a common convention when you need a function that does what if does.