Created
July 12, 2011 15:58
-
-
Save rocketnia/1078269 to your computer and use it in GitHub Desktop.
This file contains 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
; colon-pipes.arc | |
; | |
; Copyright 2011 Ross Angle. However, you can use this for whatever | |
; you want. Don't bother giving me credit. | |
; | |
; | |
; This was made based on an idea expressed at | |
; <http://arclanguage.org/item?id=13450> and again at | |
; <http://arclanguage.org/item?id=14870>. Instead of writing this: | |
; | |
; (accum acc | |
; (each x args | |
; (acc (* 2 x)))) | |
; | |
; You can write this: | |
; | |
; (// accum acc : | |
; each x args : | |
; acc : * 2 x) | |
(mac // body | |
(aif (pos ': body) | |
(let (before (nil . after)) (split body it) | |
`(,@before (// ,@after))) | |
body)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment