[racket] Programmatically start a big-bang?
I'd like to write a library function that takes a hash table of
handlers and starts a running world in big-bang style, for example:
(my-big-bang
0
(make-immutable-hash
`((on-tick . ,add1)
(stop-when . ,(lambda (x) (> x 100))))))
Is there an interface that I could use to write this? I suppose I
could try to generate a syntax object containing an appropriate
big-bang and eval it, but that seems like a big hammer to wield here.
I've poked around a little bit in 2htdp/ but haven't found anything
provided that seems to fit the bill.
Motivation: I want to support big-bang in a language that doesn't
support macros (yet), and I don't want to add special-case syntax for
big-bang. I'd like the usage in that language (Pyret, which has
Python-like syntax) to look like:
big-bang(init, {
event_name: event_handler,
...
})
Which calls something like `my-big-bang` under the hood.
Thanks!
Joe