PasteRack.org
Paste # 81516
2019-08-22 12:42:31

Fork as a new paste.

Paste viewed 471 times.


Embed:

  1. #lang racket
  2.  
  3. (define (list-nth-mod xs n)
  4.     (car (list-tail xs (+ 1 (remainder n (length(xs)))))))
  5.  
  6.  
  7. (define xs (list 0 1 2 3 4 5))
  8. (define n 3)
  9. (println (list-nth-mod xs n))

=>

application: not a procedure;

 expected a procedure that can be applied to arguments

  given: '(0 1 2 3 4 5)

  arguments...: [none]