PasteRack.org
Paste # 53090
2025-11-07 19:19:02

Fork as a new paste.

Paste viewed 35 times.


Embed:

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

=>

“a”: undefined;

 cannot reference an identifier before its definition

  in module: 'm