> On Apr 6, 2016, at 7:35 AM, Matthew Flatt <[email protected]> wrote: > > I haven't been able to replicate the problem, so far, even though my > machine and installation is similar to yours. > > Do you have a Racket installation on a different machine that you can > check? Whatever the problem is, my guess is that it's specific to OS X > (but that's just a guess). > > Does it matter whether you run the program in DrRacket or just through > `racket`?
I’m able to successfully replicate the problem on my machine at work. However, the problem does seem to be specific to DrRacket. Furthermore, I find that *restarting* DrRacket appears to solve the problem. If this workaround continues to work, then I suppose I won’t fret, though it’s a bit worrisome. I’ll file a bug report if I find that this becomes reproducible. Apologies for not trying to restart DrRacket earlier; I suppose this can be seen as a tribute to my belief in its stability? Thanks again for your time. John > > At Wed, 06 Apr 2016 00:17:51 -0400, "'John Clements' via Racket Users" wrote: >> I just wrote a simple 2htdp/universe program that animates a moving green >> rectangle. I was expecting to scale up to larger #s of rectangles, but I >> discover that moving the mouse affects the animation quite seriously. >> Specifically, moving the mouse in a small smooth circle causes the green >> rectangle to reduce its frame rate to about 7 frames per second. No GC >> activity is observed in the log box when gc@debug is added. >> >> I’m going to include the program below: I haven’t tried to minimize it, but >> it’s still quite small. (76 lines of HtDP style.) I’m guessing this problem >> is >> not specific to this program. >> >> FWIW, this is a 13” macbook pro, 16MB, running 10.11.4. >> >> Is this a known issue? >> >> John >> >> >> >> #lang racket >> >> (require 2htdp/universe >> 2htdp/image >> rackunit) >> >> (define r (rectangle 40 40 'solid 'green)) >> >> ;; represents a position on the screen >> (struct posn (x y) #:transparent) >> >> ;; a shape-transition contains an image, a starting >> ;; position, and an ending position. It represents >> ;; a shape that moves from the start-pos to the end-pos >> ;; through the transition >> (struct shapetrans (image start-pos end-pos) #:transparent) >> >> ;; in seconds: >> (define TRANSITION-TIME 1) >> >> ;; in frames per second >> (define FRAME-RATE 40) >> >> (define SCENEWIDTH 400) >> (define SCENEHEIGHT 300) >> >> (define transition-frames (* TRANSITION-TIME FRAME-RATE)) >> >> ;; given fraction of transition and shapetrans, compute >> ;; shape position >> (define (trans-posn frac st) >> (define 1-frac (- 1 frac)) >> (match st >> [(shapetrans _ (posn sx sy) (posn ex ey)) >> (posn (+ (* 1-frac sx) (* frac ex)) >> (+ (* 1-frac sy) (* frac ey)))])) >> >> (check-equal? (trans-posn 0 (shapetrans r (posn 10 30) (posn -50 100))) >> (posn 10 30)) >> (check-equal? (trans-posn 1/2 (shapetrans r (posn 10 30) (posn -50 100))) >> (posn -20 65)) >> (check-equal? (trans-posn 1 (shapetrans r (posn 10 30) (posn -50 100))) >> (posn -50 100)) >> >> ;; given fraction of transition, shapetrans, and scene, overlay >> ;; shapetrans-image at the correct location >> (define (add-image frac st scene) >> (match (trans-posn frac st) >> [(posn x y) >> (place-image (shapetrans-image st) x y scene)])) >> >> >> ;; a world is a shapetrans and a frame number >> (struct world (st frame)) >> >> ;; draw a world >> (define (draw-world w) >> (match-define (world st frame) w) >> (add-image (/ (modulo frame transition-frames) transition-frames) >> st >> (empty-scene SCENEWIDTH SCENEHEIGHT))) >> >> (check-equal? (draw-world (world (shapetrans r (posn 10 30) (posn 20 100)) >> (* 5/2 transition-frames))) >> (place-image r 15 65 (empty-scene SCENEWIDTH SCENEHEIGHT))) >> >> ;; advance the frame by 1 >> (define (tick-fun w) >> (match-define (world st frame) w) >> (world st (add1 frame))) >> >> (big-bang (world (shapetrans r (posn 10 30) (posn 20 100)) 0) >> [to-draw draw-world] >> [on-tick tick-fun (/ 1 FRAME-RATE)]) >> >> >> >> -- >> 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 [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> >> ------------------------------------------------------------------------------ >> [application/pgp-signature "signature.asc"] [~/Desktop & open] [~/Temp & >> open] -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

