Null
Null is one shared object that means “there is nothing here” (NSNull in
shape). A collection stores Object*, and a null reference usually means
absent. Sometimes a slot needs an explicit nothing that is still an object: a
sparse row, a JSON null, a cleared entry that must keep its place.
From 0.72.
#import "Null.xc" // or the Foundation umbrellaOverview
Section titled “Overview”Array* row = new Array();row.add(Null.null()); // a gap that keeps its indexif (Null.isNothing(row.get((u32)0))) // a null reference or Null.null() …There is only ever one instance, so compare with isNull or by
reference. Its description is null.
JSON reads null as this object.
Topics
Section titled “Topics”· null · isNull · isNothing · description
static Null* null(void)The shared instance.
isNull
Section titled “isNull”static bool isNull(Object* o)Whether o is the shared instance. A null reference is not.
isNothing
Section titled “isNothing”static bool isNothing(Object* o)Whether o is a null reference or the shared instance.
description
Section titled “description”String* description(void)null.