Skip to content

Instantly share code, notes, and snippets.

@microamp
Last active July 16, 2020 07:24
Show Gist options
  • Save microamp/a454d3a2d906cdd73bc9e1a5726ed353 to your computer and use it in GitHub Desktop.
Save microamp/a454d3a2d906cdd73bc9e1a5726ed353 to your computer and use it in GitHub Desktop.
The simplest possible macro
(define-syntax unless
(syntax-rules ()
[(unless e1 e2 e3)
(if (not e1) e2 e3)]
[(unless e1 e2)
(if (not e1) e2 #f)]))
(unless #t (/ 1 0) (+ 1 2 3 4)) ;; 10
(unless #t (/ 1 0)) ;; #f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment