There is a problem with the parentheses in the num-els2
procedure, nothing serious. Basically, you are not correctly calling the mynum
helper procedure, and the procedure is always returning 0
, because that's the last expression in the body. Here, this should fix it:
(define num-els2
(lambda(xs)
(mynum xs 0))) ; notice the opening bracket in this line