4 ms·
Instead of declaring a local function, you can use let (http://docs.plt-scheme.org/reference/let.html http://docs.plt-scheme.org/reference/let.html) e.g.: >
by antiismist 18y ago
Instead of declaring a local function, you can use let (http://docs.plt-scheme.org/reference/let.html http://docs.plt-scheme.org/reference/let.html)
e.g.:
> (let fac ([n 10])
(if (zero? n)
1
(* n (fac (sub1 n)))))
3628800
- danprager 18y agoYes, "named let" is lovely, but perhaps less obvious for the non-cognoscenti. It also doesn't translate into Python, etc.