PasteRack.org
Paste # 98600
2025-11-07 19:23:10

Fork as a new paste.

Paste viewed 35 times.


Embed:

  1. #lang racket
  2. (define (fxn lst new inx)
  3.   (if (= inx 0)
  4.     (list new)
  5.     (append (list (first lst)) (fxn (rest lst) new (- inx 1)))
  6.     )
  7.   )
  8.  
  9. (fxn (list 1 2 3 4) "a" 2)

=>

'(1 2 "a")