Is frtime supposed to handle programs like this?

63 views
Skip to first unread message

'John Clements' via dev-redirect

unread,
Jul 30, 2019, 2:43:50 PM7/30/19
to d...@racket-lang.org
I was messing around with Father Time today and wrote this program:

(require 2htdp/image)

(square
(- seconds 1564512004)
"solid"
"blue”)

I expected to see a growing blue square, but instead got:

.../lang/prim.rkt:24:44: square: expects a non negative real number as first argument, given (signal 145 '() #f #<procedure:...ime/lang-ext.rkt:646:20> 2 #<continuation-mark-set> #<parameterization> (list (signal 1564512149 '(#<weak-box>) #f #<procedure:...ime/lang-ext.rkt:467:23> 1 #<continuation-mark-set> #<parameterization> '()) 156451…

Somehow the “I’m a signal but I’m also a number” abstraction didn’t quite flow through the “square” primitive. Is this supposed to work?

John




Gregory Cooper

unread,
Jul 31, 2019, 11:11:32 PM7/31/19
to John Clements, d...@racket-lang.org
Hi John,

It's been several years since I've looked at this, but what happens if you change the require line to:

(require (lifted (only-in 2htdp/image square) square))

(and, I guess, update the constant that you're subtracting from `seconds`)?

--Greg


--
You received this message because you are subscribed to the Google Groups "Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/c12a06a8-7732-4d11-b4c7-a396967bd759%40mtasv.net.

'John Clements' via dev-redirect

unread,
Aug 1, 2019, 8:21:36 AM8/1/19
to Gregory Cooper, d...@racket-lang.org
Yes, this does exactly what I expected the original to do. Thanks!

John
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/CAFm%3DwCdaw9McRxRn7LFiGtZ7QzMaTwfAWwQ2WVsExGZVpoR14w%40mail.gmail.com.



'John Clements' via dev-redirect

unread,
Aug 1, 2019, 8:28:17 AM8/1/19
to John Clements, Gregory Cooper, d...@racket-lang.org
Also, in the “no good deed goes unpunished” vein, do you have any idea why the tetris demo doesn’t work on recent versions of DrRacket? More specifically, the arrow the arrow keys don’t seem to have any effect on the game, though hitting a non-arrow-key results in a beep as expected. This is on MacOS, and I see the problem both in the current version (release candidate) and 7.3 and 6.11, which are all the versions I tried. Might be something simple…

John
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/a9e6a181-c1d9-47d0-9a6b-2142c770b526%40mtasv.net.



Gregory Cooper

unread,
Aug 1, 2019, 11:41:10 PM8/1/19
to John Clements, d...@racket-lang.org
It works for me in 7.3 on a recent version of MacOS, as long as I click in the graphics window before pressing the keys.

Reply all
Reply to author
Forward
0 new messages