Commit 0d8c9fc4 authored by Eric Myhre's avatar Eric Myhre

Comment on "undefined" nodes.

Fairly sure this is going to come up in our handling of typed nodes
(and may also be relevant to some of the REVIEW-todo comments about
sparseness of arrays; haven't yet fully considered).
Signed-off-by: default avatarEric Myhre <hash@exultant.us>
parent 8c1a9602
......@@ -26,6 +26,14 @@ type Node interface {
// and if it's a primitive type the returned values are nil and zero.
Keys() ([]string, int)
// Undefined nodes are returned when traversing a struct field that is
// defined by a schema but unset in the data. (Undefined nodes are not
// possible otherwise; you'll only see them from `typed.Node`.)
//
// REVIEW: unsure if this should use ReprKind_Invalid or another enum.
// Since ReprKind_Invalid is returned for UnionStyle_Kinded, confusing.
//IsUndefined() bool
IsNull() bool
AsBool() (bool, error)
AsString() (string, error)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment