PasteRack.org
Paste # 26805
2025-02-19 10:35:54

Fork as a new paste.

Paste viewed 66 times.


Embed:

Tr

  1. #lang racket
  2. (define (min)
  3. (current-posix-seconds))
  4. (define (gcd n a)
  5. (cond ((> (* a a) n) n)
  6.            ((= (remainder n a) 0) a)
  7.            (else (gcd n (+ a 1)))))
  8. (define (prmctr n c e)
  9. (if (> c 0)
  10.         (cond ((= (gcd n 2) n)
  11.                                         (display n)
  12.                                         (newline)
  13.                                         (prmctr (+ n 2) (- c 1) e))
  14.                     (else (prmctr (+ n 1) c e)))
  15.         (display (- (min) e))))
  16. (define (prt n c)
  17. (prmctr n c (min)))
  18.  
  19. (prt 56 6)

=>

current-posix-seconds: undefined;

 cannot reference an identifier before its definition

  in module: 'm