On Thu, Feb 21, 2013 at 5:47 PM, Sam Tobin-Hochstadt <sa...@ccs.neu.edu> wrote: > On Thu, Feb 21, 2013 at 5:28 PM, Norman Gray <nor...@astro.gla.ac.uk> wrote: >> >> >> But I'm now quite securely stuck, I think. >> >> ---- >> >> In case anyone is curious (and in case the clear and obvious solution is >> indeed clear and obvious), what I'm trying to do is produce a typed version >> of the procedure below: > > I think the following example shows the way to implementing what > you're looking for. > > https://gist.github.com/samth/5009113
Thinking about it further, it's possible to enforce this invariant statically. Unfortunately TR isn't smart enough to let you express this in the nicest way possible, but if you look at the above gist now, it shows an example of the type system rejecting the errors that you're catching dynamically. Sam ____________________ Racket Users list: http://lists.racket-lang.org/users