Course of Raku / Advanced / Debugging / Debugging with dd / Exercises / Dump a typed variable

Solution: Dump a typed variable

Here is a possible solution to the task.

Code

my Int $n = 42;
dd $n;

🦋 You can find the source code in the file dump-typed.raku.

Output

Int $n = 42

Comments

  1. Because the variable has a declared type, dd prints that type before the name: Int $n = 42.

  2. An untyped variable would be dumped as just $n = 42, without the type.

Course navigation

Dump a typed variable   |   Dump a hash