I want to declare an empty list inside a scheme function. To make this happen, i use let. I know the structure of let
(let (name1 value1) (name2 value2)...)
But when i apply this into my function
(let (new-list '()))
i get an error which says ” let: expected a binding with a variable and an expression, but found something else”
How can i fix it, any idea?
Let expects a list of bindings and an s-expression.
(let ((name1 value1) (name2 value2) ...) expression-to-evaluate-with-the-bindings)You need another layer of parentheses.
RTFM at R6RS for the gory details.