themetaschemer/malt

Error in definition of k-relu in kindle version of the little learner

Closed this issue · 1 comments

The book has it as:
(define k-relu •  
(λ (k)
(λ (t)
(λ (θ)
(cond
   ((zero? k) t)
   (else (((k-relu (sub1 k))
       ((relu t) θ) <-- Should be extra ')' here
       θ2↓)))))))) <-- Remove ')' here

I believe without the extra ')' the call to (k-relu (sub1 k)) is getting 2 args, not 1.
The code in K-dense.rkt looks right to me.

Thank you for catching that. It is indeed an error in the text. We will add it to the errata. Yes, the code in the file is correct.