title: Avoid using set! into functional programming style algorithm
body: <p>I'm not sure if I can ask this question here. If this is not the right place, please tell me and I will delete it.</p>
  
  <p>I'm learning Racket and someone has told me something about avoiding using <code>set!</code> in functional programming style. But I'm confused, I don't understand the meaning of "functional programming style". Just to learn, I want to ask this question.</p>
  
  <p>I have the following code:</p>
  
  <pre><code> (define lst1 '())
  
   (do ([i n (- i 1)])
     ((zero? i))
     ; Get an item.
     (set! item (random-chooser original-list))
     ; Insert it into an auxiliary list, lst1
     (set! lst1 (cons item lst1))
     ; Remove the item from the original list
     (set! original-list (remove item original-list)))
  
   (append (list lst1) (list original-list))))))
  </code></pre>
  
  <p>This code is working perfectly. I have to choose <code>n</code> items from <code>original-list</code> list randomly, without repetition. And then create a list with two sub-lists with the <code>n</code> items chosen in <code>lst1</code> and as the second sub-list, the remaining items on <code>original-list</code>.</p>
  
  <p>Is there a better way to do this without using <code>set!</code>?</p>