<div dir="ltr"><div style>One way is to just write:</div><div style><br></div><div style>(define (my-big-bang ht) (big-bang [on-tick (hash-ref ht &#39;on-tick)] ...etcetcetc...))</div><div style><br></div><div style>and you&#39;d be duplicating the default values but maybe that&#39;s enough to get going for now?</div>
<div style><br></div><div style>Robby</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 21, 2013 at 10:04 AM, Joe Gibbs Politz <span dir="ltr">&lt;<a href="mailto:joe@cs.brown.edu" target="_blank">joe@cs.brown.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;d like to write a library function that takes a hash table of<br>
handlers and starts a running world in big-bang style, for example:<br>
<br>
(my-big-bang<br>
 0<br>
 (make-immutable-hash<br>
  `((on-tick . ,add1)<br>
    (stop-when . ,(lambda (x) (&gt; x 100))))))<br>
<br>
Is there an interface that I could use to write this?  I suppose I<br>
could try to generate a syntax object containing an appropriate<br>
big-bang and eval it, but that seems like a big hammer to wield here.<br>
I&#39;ve poked around a little bit in 2htdp/ but haven&#39;t found anything<br>
provided that seems to fit the bill.<br>
<br>
Motivation: I want to support big-bang in a language that doesn&#39;t<br>
support macros (yet), and I don&#39;t want to add special-case syntax for<br>
big-bang.  I&#39;d like the usage in that language (Pyret, which has<br>
Python-like syntax) to look like:<br>
<br>
big-bang(init, {<br>
  event_name: event_handler,<br>
  ...<br>
})<br>
<br>
Which calls something like `my-big-bang` under the hood.<br>
<br>
Thanks!<br>
Joe<br>
____________________<br>
  Racket Users list:<br>
  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br></div>