☰

# std/objectdollar

Theme:

- Manual
- Standard library
- Index
- Compiler docs
- Fusion docs
- devel, stable

Search:
Source Edit

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

# Imports

miscdollars

# Procs

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

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

  Example:

      type Foo = object
        a, b: int
      let x = Foo(a: 23, b: 45)
      assert $x == "(a: 23, b: 45)"

  Source Edit