Skip to content

Instantly share code, notes, and snippets.

View travis's full-sized avatar

Travis Vachon travis

View GitHub Profile
@travis
travis / macro.md
Created January 25, 2012 14:36 — forked from sritchie/macro.md

A little Clojure challenge inspired by Let over Lambda.

Write a macro (you can try a function, but it's impossible) that accepts four arguments:

  1. an expression that returns a number
  2. something to return if that number's negative
  3. something to return if that number's zero
  4. something to return if that number's positive

Here's the signature: (defmacro nif [expr neg zero pos] ...)