跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
天灾之下:危险连接官网(建设中)
天灾之下:危险连接QQ群
天灾之下:危险连接 Bilibili
冰糖服务器
冰糖服务器QQ群
天灾之下:危险连接资料站
搜索
搜索
中文(中国大陆)
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁模块:Func”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
[[雷光]]
外观
移至侧栏
隐藏
←
模块:Func
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
-------------------------------------------------------------------------------- -- This module provies helper functions for manipulating Lua functions. -- -- @module func -- @alias p -- @author ExE Boss -------------------------------------------------------------------------------- require("strict"); local checkTypeMulti = require("libraryUtil").checkTypeMulti; local p = {}; -------------------------------------------------------------------------------- -- Creates a bound function that calls `func` with the varargs passed to `bind` -- preceding the varargs passed to the newly created bound function. -- -- @param {function} func -- @param {any} ... -- @return {function} -- @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind -------------------------------------------------------------------------------- function p.bind(func, ...) checkTypeMulti("bind", 1, func, { "table", "function" }); local length = select("#", ...); local args = {...}; return function(...) local callArgs = { unpack(args, 1, length) }; local innerLength = select("#", ...); for i = 1, innerLength do callArgs[length + i] = select(i, ...); end return func(unpack(callArgs, 1, innerLength + length)); end end return p;
该页面嵌入的页面:
模块:Func/doc
(
查看源代码
)
返回
模块:Func
。
搜索
搜索
查看“︁模块:Func”︁的源代码
添加语言
添加话题