(define (layer li)
(cond ((null? l) li)
((null? (cdr li)) (list (car li)))
(else ((cons (list (car li)) (layer (cdr (li))))))))
This is my code above.
I'm trying to run (layer '(1 2 3))
but I keep getting this error message below. Can anyone tell me what I'm doing wrong? Thanks!
. . application: not a procedure; expected a procedure that can be applied to arguments given: '(1 2 3) arguments...: [none]