I wrote this code to create a list from en number of arguments given
(define (create-list . e)
e)
But I need it to remove any duplicated numbers from the list within this block itself.
I have tried and searched for hours and can’t find a solution without placing dozens of lines of code on other blocks.
For example let’s say my input is
(create-list . 2 2 3 5 5 )
I need the list created to be ‘(2 3 5) and not ‘(2 2 3 5 5 )…
The order of the numbers doesn’t matter.
Basically, you need to do something like:
I can think of a really simple but probably inefficient way to do this:
If you can’t use existing functions like
filter, you can make one yourself: