diff --git a/src/preserves.nim b/src/preserves.nim index b9478de..cfcf016 100644 --- a/src/preserves.nim +++ b/src/preserves.nim @@ -411,6 +411,12 @@ func isRecord*(pr: Preserve; label: string): bool {.inline.} = pr.record.len > 0 and pr.label.isSymbol(label) +func isRecord*(pr: Preserve; label: string; arity: Natural): bool {.inline.} = + ## Check if ``pr`` is a Preserves record with the given label symbol and field arity. + pr.kind == pkRecord and + pr.record.len == succ(arity) and + pr.label.isSymbol(label) + proc isSequence*(pr: Preserve): bool {.inline.} = pr.kind == pkSequence ## Check if ``pr`` is a Preserves sequence.