Source Edit

This module implements a generic $ operator to convert objects to strings.

Imports

miscdollars

Procs

  1. proc `$`[T: object](x: T): string

Generic $ operator for objects with similar output to $ for named tuples.

Example:

  1. type Foo = object
  2. a, b: int
  3. let x = Foo(a: 23, b: 45)
  4. assert $x == "(a: 23, b: 45)"

Source Edit