Course of Raku / Advanced / Debugging

Debugging with dd

There are different ways to debug a program, from a simple printing instruction such as say to more elaborate tracing tools. In this section, we will look at the handy dd routine. It is built into the Rakudo compiler, although it is not a part of the Raku language standard itself.

The name dd stands for data dumper. Unlike say or put, which are meant for the normal output of the program, dd prints a developer-friendly representation of a value — the same code-like form produced by the .raku method from the previous section. It writes to the standard error stream, so its output does not mix with the data that your program prints for the user.

Topics in this section

Practice

Complete the quiz that covers the contents of this section.

Exercises

This section contains 3 exercises. Examine all the topics of this section before doing the coding practice.

  1. Dump the data structure
  2. Dump a typed variable
  3. Dump a hash

Course navigation

Choosing the right one   |   Dumping variables