V2EX  ›  英汉词典

Nonnull

释义 Definition

nonnull(常见于编程语境)指“非空”:某个值(尤其是指针/引用/变量)**保证不是 null**。常用于类型系统、静态分析、函数契约(contract)、数据库约束或注解(annotation)中。不同语言/框架里也可能写作 non-null / nonnull / not-null

发音 Pronunciation (IPA)

/ˌnɒnˈnʌl/

例句 Examples

The name field must be nonnull.
name 字段必须为非空。

To prevent crashes, the function checks that the pointer is nonnull before dereferencing it, and the compiler may use that fact to optimize the code.
为避免崩溃,函数在解引用前检查指针非空;编译器也可能利用“非空”这一事实来优化代码。

词源 Etymology

由前缀 **non-**(“不、非”)+ null(“空值、零值”)构成,字面意思就是“不是空(null)”。在软件工程中,它常被用来表达“该值不允许为空”的约束。

相关词 Related Words

文学与著作中的用例 Literary Works

  • Kotlin in Action(Kotlin 的“非空类型”与“可空类型”是核心概念,常以 non-null/nonnull 的方式表述)
  • Effective Java(围绕空值处理、参数校验与契约设计,常出现 @NonNull / non-null 的相关讨论)
  • Android Programming: The Big Nerd Ranch Guide(Android/Java 生态中常用 @NonNull、nonnull 来标注参数与返回值约束)
  • GCC / Clang Documentation(编译器文档中有与 nonnull 相关的属性/注解,用于表达“参数不得为 NULL”的约束)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   911 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 18:18 · PVG 02:18 · LAX 10:18 · JFK 13:18
♥ Do have faith in what you're doing.