tiny.preserves.ValueKind
Defined in value.
A value's kind: its group and, for an atom, a compound or a pattern, which one.
API (5)
Actions
Public operations.
eql: Returns whether two kinds are in the same group and, within it, the same kind.
Fields and members
Public fields and members.
Source
Source: lib/preserves/src/value.zig:74
zig
/// A value's kind: its group and, for an atom, a compound or a pattern, which one. Code that/// switches on a value's kind reads this from `kind`. `kind` returns it for any value.pub const ValueKind = union(ValueKindTag) { /// Which of the six atom kinds the value is. atomic: AtomClass, /// Which of the four compound kinds the value is. compound: CompoundClass, /// Marks an embedded value, which has no subkind. embedded, /// Which of the four kinds of pattern the value is. pattern: PatternFormClass, /// Returns whether two kinds are in the same group and, within it, the same kind. `Value.eql` /// calls it to check two values' kinds before their contents. pub fn eql(a: ValueKind, b: ValueKind) bool { return switch (a) { .atomic => |ac| switch (b) { .atomic => |bc| ac == bc, else => false, }, .compound => |ac| switch (b) { .compound => |bc| ac == bc, else => false, }, .embedded => switch (b) { .embedded => true, else => false, }, .pattern => |ac| switch (b) { .pattern => |bc| ac == bc, else => false, }, }; }};Source: lib/preserves/src/root.zig:138
zig
pub const ValueKind = value.ValueKind;Audit
| Definitions | 2 |
|---|---|
| Public names | 4 |
| Members | 4 |
| Version | 26.7.0 |
| Revision | daab053ee433 |