Last active
December 15, 2015 00:49
-
-
Save marionette-of-u/5175996 to your computer and use it in GitHub Desktop.
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
| " 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