Skip to content

Instantly share code, notes, and snippets.

@marionette-of-u
Last active December 15, 2015 00:49
Show Gist options
  • Select an option

  • Save marionette-of-u/5175996 to your computer and use it in GitHub Desktop.

Select an option

Save marionette-of-u/5175996 to your computer and use it in GitHub Desktop.
" autoload, https://github.com/mattn/lambda-vim
exe lambda#setup()
let s:test = {}
let s:fa = lambda#gen(s:, 'a:1 + a:2')
let s:fb = lambda#gen(s:, 'a:1 * 2 + a:2 * 2')
function! s:test.g(f)
return a:f(3, 4)
endfunction
" 7
echo s:test.g(s:fa)
" 14
echo s:test.g(s:fb)
function! s:F_impl(x, y)
return a:x * a:y
endfunction
" 12
echo s:test.g(function('s:F_impl'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment