Append new item to end of list in scheme

Viewed 1137

I need to append a new item to the end of a list. Here is what I tried:

(define my-list (list '1 2 3 4))
(let ((new-list (append my-list (list 5)))))
new-list

I expect to see:

(1 2 3 4 5)

But I receive:

let: bad syntax (missing binding pair5s or body) in (let ((new-list (append my-list (list 5)))))

2 Answers
Related