let Ref = function({val -> execute("echo val")})
call Ref("hoge") " => hoge
vim9script
var Ref = function((val) => execute("echo val"))
Ref("hoge") # => E121: Undefined variable: val
この挙動
def s:hoge(val: string)
echo val
enddef
def s:hugo()
var Ref = function("s:hoge")
Ref("HOGE")
enddef
function s:foo()
let Ref = function("s:hoge")
call Ref("HUGO")
endfunction
call s:hugo() " -> E1267: Function name must start with a capital: s:hoge
call s:foo() " HUGO
この挙動