Welcome to the CHICKEN Scheme pasting service

another prime stream added by C-Keen on Wed Jun 8 17:22:33 2011

(define my-prime-stream
  (let ((prime?
	 (lambda(n)
	   (define-stream (iter s)
	     (let-stream ((np (stream-car s)))
			 (cond
			  ((> np (sqrt n)) (quote true))
			  ((= 0 (modulo n np)) #f)
			  (else (iter (stream-cdr s))))))
	   (iter my-prime-stream))))
  (stream-cons 2 (stream-filter prime? natural-numbers-stream))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the one-argument procedure to check if a list is empty?
Visually impaired? Let me spell it for you (wav file) download WAV