Nullp
来自MudWiki
名称
nullp() - 检测给定变量是否是空(null)
语法
int nullp( mixed arg );
描述
如果变量 'arg' 是空值(null)返回 1。 'arg' 在以下几种情况为 null: 1. 变量没有初始化。 2. 变量是函数的形式参数,但在调用时没有传递实参。 3. 变量是映射变量中不存在的元素。(如: arg = map[not_there]) 4. 变量是 call_other() 外部函数呼叫对象中不存在的函数的返回值(如: arg = call_other(obj, "???")) 5. 变量指向(array/class/mapping)中被销毁的对象元素。 本质上 nullp() 是 undefinedp() 的别名。 fluffos v2019.20220507-11版本以后可以判断class中未赋值的变量。
参考
mapp(3), stringp(3), pointerp(3), objectp(3), intp(3), bufferp(3), floatp(3), functionp(3), undefinedp(3)
翻译
雪风(i@mud.ren)