so I'm trying to experiment with some code and change between the two scheme expression methods of let and lambda.
The code I have is as follows:
(let splice ((l '()) (m (car s)) (r (cdr s)))
(append
(map (lambda (x) (cons m x)) (perm (append l r)))
(if (null? r) '()
(splice (cons m l) (car r) (cdr r)))))
I'm trying to change the outermost let definitions to lambda format, but it's a bit confusing due to the nested nature of the code. What I have attempted to do so far is:
(lambda (splice (l m r))
(append
(map (lambda (x) (cons m x)) (perm (append l r)))
(if (null? r) '()
(cut (cons m l) (car r) (cdr r)))))
(('()) (car upList) (cdr upList))
This is clearly wrong, but I don't know how to proceed further...