Created
May 15, 2021 03:08
-
-
Save dhilst/6c6249e56f8558f25d15da796033f685 to your computer and use it in GitHub Desktop.
OOP in VimL
This file contains 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
function MyClass() abort | |
let this = {} | |
function this.setA() dict | |
let self.a = 1100 | |
endfunc | |
function this.method() dict | |
return self.a | |
endfunc | |
return this | |
endfunc | |
let myObj = MyClass() | |
echo myObj.setA() | |
echo myObj.method() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment