generates == for objects including case objects
Example:
import skinsuit/equals type Foo {.equals.} = object name: string case kind: bool of false: a: int of true: b: float assert Foo(name: "abc", kind: false, a: 1) == Foo(name: "abc", kind: false, a: 1) assert Foo(name: "abc", kind: false, a: 1) != Foo(name: "abc", kind: true, b: 1) assert Foo(name: "abc", kind: false, a: 1) != Foo(name: "def", kind: false, a: 1)
Macros
macro equalsForwardDecl(body)
-
generates forward declaration of equals, useful for mutually recursive types
used like equalsForwardDecl T or equalsForwardDecl *T (exported)
Source Edit