I'm practicing recursion in Scheme. My code below is used to return a value of continued fraction:
(define (fun n v)
(define (fun-wl b v) (
(if (null? b)v ;return a value
(fun-wl (cdr b) (/ 1 (+ (car b) v)))))) ;first arg.list, second(1/(car b+v))
(define (iter a b)
(if (null? a)(fun-wl b v)
(iter (cdr a) (cons (car a) b)))) ;reverse list
(iter n null)
)
This is my input for scheme:
(fun '(1 2 3 4) 6)
I got this error from my code:
application: not a procedure;
expected a procedure that can be applied to arguments
given: 72/103
arguments...: [none]
site:stackoverflow.com "application: not a procedure"
? This is a duplicate many times over.