Skip to content

Instantly share code, notes, and snippets.

@icholy
Created July 29, 2014 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icholy/e9069da1bb60c7e040d4 to your computer and use it in GitHub Desktop.
Save icholy/e9069da1bb60c7e040d4 to your computer and use it in GitHub Desktop.
(defmacro $ [&rest cmd]
(let [var? (fn [s] (s.startswith "$"))
rm-$ (fn [s] (slice s 1))
`@(map (fn [s] (if (var? s) (rm-$ s) `'~s))) cmd)
(let [test "hello"
data ($ cat foo | grep $test)]
(print data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment