Skip to content

Instantly share code, notes, and snippets.

@thinca
Created December 17, 2017 18:29
Show Gist options
  • Save thinca/330b3ebc33bd0212a8d9f24de3c39260 to your computer and use it in GitHub Desktop.
Save thinca/330b3ebc33bd0212a8d9f24de3c39260 to your computer and use it in GitHub Desktop.
function! X() abort
let x = 10
let scope = l:
let F = { -> extend(scope, {'x': 200}) }
call F()
echo x
endfunction
call X()
@thinca
Copy link
Author

thinca commented Dec 17, 2017

lambda 式から、外側の関数のローカル変数を書き換える黒魔術

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment