Very new to Scheme, so I'm sorry for a basic question. Whenever I print out something as a test, my result always contains the word "list" in the list that is printed.
My code:
(define get-lower-half
(lambda (lst n)
(if (< n (quotient (length lst) 2))
(cons (list-ref lst n) (get-lower-half lst (+ n 1)))
'())))
(get-lower-half '(1 2 3 4 5) 0)
My result is then:
(list 1 2)
instead of just
(1 2)
The examples of using cons I find online don't have this problem, what the heck am I doing wrong here? I'm using DrRacket as my IDE with Intermediate Student with Lambda as the language.