PasteRack.org
Paste # 91599
2025-09-18 00:03:30

Fork as a new paste.

Paste viewed 44 times.


Embed:

  1. #lang racket
  2.  
  3. (require racket/fixnum)
  4.  
  5. (define (sum n acc)
  6.   (if (zero? n)
  7.       acc
  8.       (sum (fx- n 1)
  9.            (if (fxeven? n)
  10.                (fx+ acc n)
  11.                (fx- acc n)))))
  12.  
  13. (time (sum 10000000 0))

=>

fxeven?: undefined;

 cannot reference an identifier before its definition

  in module: 'm