[racket] Pattern matching define macro

From: Daniel Prager (daniel.a.prager at gmail.com)
Date: Sat Jul 12 18:19:27 EDT 2014

Hi Brian

r >= 0 && r <= 4 && c >= 0 && c <= r


implies

0 <= c <= r <= 4


Or  using prefix and the variable-arity of <=:

(define (is-pos r c)
  (<= 0 c r 4))


which I think works well for clarity, concision, and efficiency.

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140713/e32ac605/attachment.html>

Posted on the users mailing list.