diff options
Diffstat (limited to 'src/zisp/value.zig')
| -rw-r--r-- | src/zisp/value.zig | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/zisp/value.zig b/src/zisp/value.zig index f075b35..aff05fe 100644 --- a/src/zisp/value.zig +++ b/src/zisp/value.zig @@ -101,8 +101,8 @@ pub const HeapType = enum(u8) { pub fn of(ptr: anytype) HeapType { return switch (@TypeOf(ptr)) { - PairPtr => .pair, - ArrayHeader => .array, + pair.PairPtr => .pair, + array.ArrayPtr => .array, else => @panic("Unknown heap pointer."), }; } @@ -316,12 +316,17 @@ pub const Value = packed union { /// Check for small rat (rational number). pub fn isSrat(v: Value) bool { - return v.srat._hi == hi15_srat; + return v.srat._hi == hi16_srat; } - /// Placeholder: Check for (undefined). - pub fn isNdef(v: Value) bool { - return v.ndef._hi == hi15_ndef; + /// Placeholder: Check for (undefined 1). + pub fn isNdf1(v: Value) bool { + return v.ndf1._hi == hi16_ndf1; + } + + /// Placeholder: Check for (undefined 2). + pub fn isNdf2(v: Value) bool { + return v.ndf2._hi == hi16_ndf2; } /// Check for rune. |
