nustack
ReferenceNuforms

primitives.sentinel_

Sentinel interfaces - SentinelForm, EmptyForm, InvalidForm.

Module nu.forms.primitives.sentinel_.

Sentinel interfaces - SentinelForm, EmptyForm, InvalidForm.

Wraps EMPTY and INVALID so they can appear as typed Form nodes in a Nu tree, mainly so is_empty() / is_invalid() have something typed to call on.

NameSortCallMeaning
EmptyFormscalar_queryEmptyForm()Wraps EMPTY, the address-resolved-to-nothing sentinel.
InvalidFormscalar_queryInvalidForm()Wraps INVALID, the operation-not-applicable sentinel.
SentinelFormscalar_querySentinelForm()Base for the sentinel interfaces, EmptyForm and InvalidForm.

EmptyForm

Wraps EMPTY, the address-resolved-to-nothing sentinel.

EmptyForm()

Path nu.forms.EmptyForm. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Example

nu.run(nu.EmptyForm())[0]
<EMPTY>

Inherited methods

From nu.lang.forms.Form:

CallBuildsMeaning
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.is_invalid()BoolTrue if this Form yields the INVALID sentinel.
.is_sentinel()BoolTrue if this Form yields either sentinel (EMPTY or INVALID).
.not_empty()BoolTrue if this Form does not yield EMPTY.
.not_invalid()BoolTrue if this Form does not yield INVALID.

InvalidForm

Wraps INVALID, the operation-not-applicable sentinel.

InvalidForm()

Path nu.forms.InvalidForm. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Notes

  • INVALID arises when an operation is applied to an EMPTY operand, and Query chains collapse to INVALID as soon as any operand is a sentinel. This Form does not produce that propagation itself, it just gives INVALID a typed node.

Example

nu.run(nu.InvalidForm())[0]
<INVALID>

Inherited methods

From nu.lang.forms.Form:

CallBuildsMeaning
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.is_invalid()BoolTrue if this Form yields the INVALID sentinel.
.is_sentinel()BoolTrue if this Form yields either sentinel (EMPTY or INVALID).
.not_empty()BoolTrue if this Form does not yield EMPTY.
.not_invalid()BoolTrue if this Form does not yield INVALID.

SentinelForm

Base for the sentinel interfaces, EmptyForm and InvalidForm.

SentinelForm()

Path nu.forms.SentinelForm. Kind ScalarQuery, sort scalar_query, cardinality scalar.

Inherited methods

From nu.lang.forms.Form:

CallBuildsMeaning
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.is_invalid()BoolTrue if this Form yields the INVALID sentinel.
.is_sentinel()BoolTrue if this Form yields either sentinel (EMPTY or INVALID).
.not_empty()BoolTrue if this Form does not yield EMPTY.
.not_invalid()BoolTrue if this Form does not yield INVALID.

Undocumented: example.

On this page