diff --git a/src/preserves.nim b/src/preserves.nim index c3de9b5..a788589 100644 --- a/src/preserves.nim +++ b/src/preserves.nim @@ -27,14 +27,16 @@ const compoundKinds* = {pkRecord, pkSequence, pkSet, pkDictionary} type Symbol* = distinct string -proc `$`*(s: Symbol): string {.borrow.} proc `<`*(x, y: Symbol): bool {.borrow.} proc `==`*(x, y: Symbol): bool {.borrow.} proc hash*(s: Symbol): Hash {.borrow.} proc len*(s: Symbol): int {.borrow.} +proc `$`*(s: Symbol): string = + if s.len == 0: "||" else: string(s) + type - Preserve*[E = void] = object + Preserve*[E] = object embedded*: bool ## Flag to mark embedded Preserves case kind*: PreserveKind