I would like to use several racket 2htdp functions / macros so that I can translate them into another language for my children.
Things that are functions, I can simply define . I have problems with the big-bang structure; If I try to make an on-tick alias, for example, every time I get big-bang: [new-name] clauses are not allowed within big-bang .
I tried various options for define-syntax , but I could not get it to work so far (this suggests that I am a complete newbie-newbie).
Something like this works (well, ladja not defined):
But this does not cause (causes an error):
#lang racket (require 2htdp/universe 2htdp/image) (define new-name on-tick) (big-bang 0 (new-name (lambda (x) (+ x 1))) (to-draw (lambda (x) (place-image ladja 150 x (prazni-prostor 300 300)))) (stop-when (lambda (x) (= x 300))))
I see that big-bang is a macro , so this explains the problem: I assume that I would need to get my macro to be ranked first, somehow?
source share