lockvar on a function arg

5 views
Skip to first unread message

Ernie Rael

unread,
Sep 26, 2023, 2:50:53 PM9/26/23
to vim...@googlegroups.com

Here's a legacy script that has a function that locks it's argument which is a dictionary in this example. Since this is probably the most complex legacy script I've written, I want to make sure it's expected/good behavior. (the proceeding after an error is spooky, but convenient...)

Asking because vim9script doesn't handle it.

-ernie

func Lock(x)
    lockvar a:x
endfunc

let val = {'a': 99}

call Lock(val)

call extend(val, {'b': 100})
echo val
let val = {'c': 101}
echo val


Reply all
Reply to author
Forward
0 new messages