Predicates in general would be really awesome. I think the testing infrastructure for Sperber's book (DMDA) has something like this.
Making it lightweight is what matters most, whether through a new match form or a more general predicate form. Shriram On Mon, Nov 19, 2012 at 8:25 PM, David Van Horn <dvanh...@ccs.neu.edu> wrote: > On 11/19/12 8:20 PM, Joe Gibbs Politz wrote: >> >> > Yeah, that is very nice! (It should begin with "check" not "test" >> tho, right?) >> >> Indeed; Jonah was writing w.r.t plai, which uses test. Should use >> check- in rackunit. >> >> I noticed that this also violates, from the rackunit docs: >> >> "Although checks are implemented as macros, which is necessary to grab >> source location, they are conceptually functions. This means, for >> instance, checks always evaluate their arguments." >> >> I suppose this should go in a separate section of "additional checks" or >> some such? > > > Maybe the right thing to do is make it lightweight to write predicates with > match so that you don't even need a separate testing form? > > Something like (? P) => (lambda (x) (match x [P true] [_ false])) > > David > > > > _________________________ > Racket Developers list: > http://lists.racket-lang.org/dev _________________________ Racket Developers list: http://lists.racket-lang.org/dev