Skip to content

Instantly share code, notes, and snippets.

@bounceme
Last active May 5, 2017 03:22
Show Gist options
  • Save bounceme/837c724b9dfc4828e81141cceeccaddb to your computer and use it in GitHub Desktop.
Save bounceme/837c724b9dfc4828e81141cceeccaddb to your computer and use it in GitHub Desktop.
function! g:Compose(...)
let l:args = a:000
return {...->eval(execute("let ret = a:000|let i = (len(".string(l:args).")-1)"
\ ."|while i>-1|let ret = [call(".string(l:args)."[i],ret)]"
\ ."|let i -= 1|endwhile|echon string(ret[0])"))}
endfunction
echom Compose('toupper','join','uniq','split','printf')('%s','aa bb aa aa b b b b')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment