diff --git a/docs/bindings.md b/docs/bindings.md index 257e659e..b1600bf6 100644 --- a/docs/bindings.md +++ b/docs/bindings.md @@ -92,13 +92,6 @@ vm->bind(obj, "f() -> int", [](VM* vm, ArgsView args){ }, x); // capture x ``` -The 3rd way is to change the macro `PK_ENABLE_STD_FUNCTION` in `config.h`: -```cpp -#define PK_ENABLE_STD_FUNCTION 0 // => 1 -``` - -Then you can use standard capture list in lambda. - ## Bind a class or struct Assume you have a struct `Point` declared as follows. diff --git a/include/pocketpy/common/config.h b/include/pocketpy/common/config.h index 547c4a50..598c65a2 100644 --- a/include/pocketpy/common/config.h +++ b/include/pocketpy/common/config.h @@ -24,13 +24,6 @@ #define PK_GC_MIN_THRESHOLD 16384 #endif -// Whether to use `pkpy::function<>` to do bindings or not -// By default, functions to be binded must be a C function pointer without capture -// However, someone thinks it's not convenient. -// By setting this to 1, capturing lambdas can be binded, -// but it's slower and may cause "code bloat", it also needs more time to compile. -#define PK_ENABLE_STD_FUNCTION 0 - /*************** debug settings ***************/ // Do not edit the following settings unless you know what you are doing #define PK_DEBUG_CEVAL_STEP 0 diff --git a/include/pocketpy/objects/codeobject.hpp b/include/pocketpy/objects/codeobject.hpp index d9afc2c9..7bf95080 100644 --- a/include/pocketpy/objects/codeobject.hpp +++ b/include/pocketpy/objects/codeobject.hpp @@ -7,11 +7,7 @@ namespace pkpy { -#if PK_ENABLE_STD_FUNCTION -using NativeFuncC = function; -#else typedef PyVar (*NativeFuncC)(VM*, ArgsView); -#endif enum class BindType { DEFAULT,