>
> - why you use [i (in-range 10)] in all for loop? what's the difference
> with [i 10]. they both produce stream, right?


Yes, but `in-range` runs faster because of "types". Here's a little example:

#lang racket/base
(define N (expt 10 7))

(time (for ([n (in-range N)])  (void)))
;; cpu time: 36 real time: 36 gc time: 0

(time (for ([n N])  (void)))
;; cpu time: 635 real time: 635 gc time: 0

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to