Skip to content

Instantly share code, notes, and snippets.

@danking
Created December 21, 2013 23:54
Show Gist options
  • Save danking/8076803 to your computer and use it in GitHub Desktop.
Save danking/8076803 to your computer and use it in GitHub Desktop.
#lang racket
(require rackunit
(rename-in racket [#%app old-app]))
(define-syntax #%app
(syntax-rules (?)
([#%app condition ? then else]
(if condition then else))
([#%app x ...]
(old-app x ...))))
(check-equal? (true ? 1 0) 1)
(check-equal? (false ? 1 0) 0)
(check-equal? (sqr 4) 16)
(check-equal? ((lambda (x y) (+ x (* y y))) 5 10) 105)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment