I am struggling the difference between let, letrec, let* ... since scheme is not my primary programming language, my memory is not existing for long time.. I have this function.. now I am very confusing with letrec here.. this is again recursion.that I can understand...but can't make connection enough in this code.. (maybe still confuse about recursion) can someone explain why here need letrec
(define myFunc
(lambda (start end res func)
(letrec ((func:rec_func
(lambda (x i y)
(if (>= i start)
(func:rec_func (cons i x) (- i res) (cons (func i) y)) ;; line6
(cons x (cons y '())))))) ;; line7
(func:rec_func '() end '()))))
(edited) what I understand it's tail recursion
-> [Q1] Does it tail recursion?
-> [Q2] then, should use always letrec for tail recursion?
this function returns the lists of x, y with boundaries of start, end so it checks index i is inside boundaries , if yes, then do line 6
-> [Q3]then, what does line6 ? I can't get the line6