Hi! I'm just working on a small problem in Scheme. I am passing to the function a list, such as '(1 2 3), and I need the function to return seperate lists, such as '(1)'(1 2)'(1 2 3). I have already experiemented with many different appends and cons, and I am looking for further advice.
Here is what I have so far...
(define (sublists lst)
(if (null? lst)
'()
(cons (car lst)(sublists (cdr lst)))
)
)
(sublists '(1 2 3))
This just returns my original list, and not what I need. Thanks.