From 3186eee04e43d5c0c52b32cf23bcc2c6ea8b04d5 Mon Sep 17 00:00:00 2001 From: Joey Date: Wed, 16 Sep 2020 10:10:32 -0600 Subject: [PATCH] Update readme with objprint --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index a16b0a1..2f8909b 100644 --- a/README.md +++ b/README.md @@ -53,3 +53,22 @@ Extensions so far include: echo i, " ", tup ``` +## Objprint + +These printing procs are useful for printing objects and their types. + +```nim +import objprint + +type Unit = ref object + name: string + +echo Unit(name: "Ref") +echo Unit(name: "Non-ref")[] +echo (str: "value") + +# Prints: +#. ref Unit(name: "Ref") +#. Unit(name: "Non-ref") +#. tuple[str: string](str: "value") +```