# Motoko QoL trick

**URL:** <https://forum.dfinity.org/t/motoko-qol-trick/16655>\
**Category:** Language Support\
**Tags:** Motoko\
**Created:** [November 17, 2022, 5:30pm UTC](https://forum.dfinity.org/t/motoko-qol-trick/16655 "2022-11-17T17:30:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggreif](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ggreif/32/301_2.png) [@ggreif](https://forum.dfinity.org/u/ggreif)\
**Post date:** [November 17, 2022, 5:30pm UTC](https://forum.dfinity.org/t/motoko-qol-trick/16655/1 "2022-11-17T17:30:27Z")

</div>

We still don’t have string interpolation, but you can have something similar by `debug_show`-ing ad-hoc records and resorting to field punning:

```auto
let some_binding = ...;
let other = ...;
debug {
   Debug.print(debug_show {some_binding; other})
}

```

will nicely output `{ other = ...; some_binding = ... }` to the console.

Enjoy!

PS: I found this in the `moc` test suite, btw. Not sure who came up with it first.

---

<div class="post-metadata">

**Author:** ![nomeata](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nomeata/32/733_2.png) [@nomeata](https://forum.dfinity.org/u/nomeata)\
**Post date:** [November 17, 2022, 8:14pm UTC](https://forum.dfinity.org/t/motoko-qol-trick/16655/2 "2022-11-17T20:14:58Z")

</div>

> [@ggreif](#):
>
> PS: I found this in the `moc` test suite, btw. Not sure who came up with it first.

Claudio, it seems, according to `git log -G`:

> <https://github.com/dfinity/motoko/commit/c82e45cf35f0efc6a79d1a8cfe033df5ff0f7431>
>
> See design/StableMemory.md for design.
