Created
April 29, 2016 15:02
-
-
Save whacked/24dba56e0844a7f37a72fcb7a9409527 to your computer and use it in GitHub Desktop.
example sibilant macro to turn console.log calls into comments at compile time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(var DEBUG-LEVEL 10 | |
console-log-orig console.log) | |
(assign console.log | |
(#(...argv) | |
(when (< 0 DEBUG-LEVEL) | |
(console-log-orig.apply console argv)))) | |
;; comment this out to preserve console.log in js output | |
(macro console.log (...body) `(comment ...@body)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment