Closed luke-gru closed 11 years ago
This is in master (0.3.4) now.
It works like this:
riml_import Lib1, Lib2
then we can use classes g:Lib1 and g:Lib2, and we can even inherit from them.
Also, we can pass strings to riml_import, but these strings must have a * character somewhere in them. Ex:
riml_import
*
riml_import 'MyLib*'
Now, every global class that starts with MyLib is automatically imported upon use. We can now do:
l = new g:MyLib() or h = new g:MyLibHelpers()
l = new g:MyLib()
h = new g:MyLibHelpers()
There is also a commandline option --allow-undef-global-classes. All this does it adds the following:
--allow-undef-global-classes
riml_import '*'
Now, all global classes that aren't defined are imported upon use.
All this will appear in the README shortly.
I'm liking this. Would make the development of Portkey extensions a lot nicer. Extensions should be able to pull in utilities from Core that would otherwise require copy-paste driven development. Nice work!
This is in master (0.3.4) now.
It works like this:
then we can use classes g:Lib1 and g:Lib2, and we can even inherit from them.
Also, we can pass strings to
riml_import
, but these strings must have a*
character somewhere in them. Ex:Now, every global class that starts with MyLib is automatically imported upon use. We can now do:
l = new g:MyLib()
orh = new g:MyLibHelpers()
There is also a commandline option
--allow-undef-global-classes
. All this does it adds the following:riml_import '*'
Now, all global classes that aren't defined are imported upon use.
All this will appear in the README shortly.