PasteRack.org
Paste # 67705
2019-04-11 10:52:57

Fork as a new paste.

Paste viewed 297 times.


Embed:

  1. #lang racket
  2. ;;repeat : symbol natural -> los
  3. ;;produce a list with symbols
  4. (define (repeat symbol natural)
  5.   (cond
  6.    [(= natural 0) empty]
  7.    [else (cons symbol ( repeat symbol (sub1 natural)))]))
  8. (repeat 'bets 3)

=>

'(bets bets bets)