Releases: zdzhaoyong/Svar
Releases · zdzhaoyong/Svar
v0.3.2 improve svarpy, fix memory leak
Comparing to v0.3.1, this version:
- add jsontype() for property and arguments
- fixed python import of class constructors
- fixed memory leak of svarpy caused by string from python
- improved svarpy on efficiency
v0.3.1 first version supports kwargs, fast json parsing and dumps
This version solves:
- keyword argument parsing and extra helping things
- fast type switch and fast json parse and dump (about 5 times faster than the v2)
Now Svar supports kwargs like this:
int add_int(int a,int b){return a+b;}
TEST(Function,Overload){
Svar kw_f(add_int,"a"_a,"b"_a=0,"add two int");
EXPECT_EQ(kw_f(1,2),3); // call with arguments
EXPECT_EQ(kw_f(3),3); // b default is 0
EXPECT_EQ(kw_f("b"_a=1,"a"_a=2),3); // kwargs
kw_f.overload([](int a,int b,int c){
return a+b+c;
}); // overload is supported
EXPECT_EQ(kw_f(1,2,3),6);
}
v0.2.2 supporting import and labmda
Comparing to version 0.2.1, now v0.2.2 supporting
- direct import modules with svar.import()
- labmda functions are directly supported.
Comparing to version 3, this version
- does not support kwargs, accerated json parsing
- support the old version svar modules
Old version:
#include <Svar/Registry.h>
auto m=sv::Registry::load('sample_module');
sv::Svar labmda = sv::Svar::lambda([](int a){return a;});
Now:
#include <Svar/Svar.h>
auto m=svar.import('sample_module');
sv::Svar labmda=[](int a){return a;};
Now you can install svar for python using:
pip3 install svar==0.2.2
First stable version with Node.js supported
We are happy to announce that now Svar is more stable it has been used in commercial softwares!
Changes:
- Fix python bindings, memory leak testing
- Implemented Node.js bindings
- Fix bugs during commercial usage
First version implemented simple python module access
v0.1.0 modified travis.yml