I'm attempting to concatenate lists in scheme using fold-left and append (for usage in a bigger function). However, I keep getting outputs that look like this:
=> (0 quote (1) quote (2))
This is my code:
(fold-left (lambda(a b) (append a b)) '(0) '('(1) '(2)))
Why wouldn't this work exactly the same as:
(define x (append '(0) '(1)))
(define y (append x '(2)))
y
This code outputs a simple list:
(0 1 2)
Isn't fold-left doing the exact same as the second code block? What can I change to get a simple list output?