I'm trying to create a function that returns a function that calls itself. I tried this:
(define (multo ex) (let ((f (lambda (n) (if
(= 0 n)
1
(* ex (f (- n 1))))))) f))
(println "~s" ((multo 3) 3))
But it doesn't work because the lambda can't refer to f inside the definition. How do I achieve this?
I'm trying to create a function that returns a function that calls itself. I tried this:
But it doesn't work because the lambda can't refer to
finside the definition. How do I achieve this?