Closure for native functions (not tested)