It looks like you may want `define-inline' from `racket/performance-hint'.
Vincent
At Thu, 22 Aug 2013 11:11:51 -0400,
Sam Tobin-Hochstadt wrote:
Ah, indeed. I'm calling `random` in the closure now. Fixing that
removes the anomaly.
Sam
On Thu, Aug 22, 2013 at 11:05 AM, Matthew
This short program generates a lot of closures, and thus doesn't run very fast.
#lang racket/base
(require racket/flonum)
(define (Point x0 x1 y0 y1)
(list (λ () (let ([x (- x1 x0)] [y (- y1 y0)])
(flsqrt (+ (* x x) (* y y)))
(define iter 1e4)
(for ([i (in-range iter)])
At Thu, 22 Aug 2013 10:59:35 -0400, Sam Tobin-Hochstadt wrote:
This short program generates a lot of closures, and thus doesn't run very
fast.
#lang racket/base
(require racket/flonum)
(define (Point x0 x1 y0 y1)
(list (λ () (let ([x (- x1 x0)] [y (- y1 y0)])
3 matches
Mail list logo