pocketpy/docs/1_5_0.md
2024-05-04 22:35:54 +08:00

1.0 KiB

icon title order
log Upgrade to v1.5.0 25

We are applying a major API refactoring in this release. The main goal is to make the API more consistent and easier to use. We are also adding new features and improvements. This release is not backward compatible with the previous versions. Please read the following guide to upgrade your project.

New style bindings

We introduced the new style bindings vm->bind in v1.1.3 and deprecated the old style bindings vm->bind_func<> and vm->bind_method<>.

In this release, we added an ARGC-based binding vm->bind_func (without template parameter) to replace the old style bindings. If you are still using vm->bind_func<> and vm->bind_method<>, please update your code to use vm->bind_func instead.

// old style (removed)
vm->bind_func<N>(obj, "add", f_add);
vm->bind_method<M>(obj, "get", f_get);

// new ARGC-based binding
vm->bind_func(obj, "add", N, f_add);
vm->bind_func(obj, "get", M+1, f_get);