1
votes

How do I remove the list itself in scheme? Are there any functions that does this?

 (1 2 3 4 5) -> 1 2 3 4 5

Car does almost what I want, but it only gives the first element.

2

2 Answers

3
votes

A literal interpretation of your question:

> (apply values '(1 2 3 4 5))
1
2
3
4
5

But maybe, you are looking for list-ref ?

> (list-ref '(a b c d) 2)
'c
0
votes

At the risk of getting all www.htdp.org on you, I have to ask: what value is it you want to produce?

Taking a step back: In Racket/Scheme/whatever, programs take in values and produce values. So, for your question, you want to take in a list, and return ... what? Specifically, what Scheme value do you want to return?