Course of Raku / Advanced / Containers / Introspecting containers / Exercises

Describe a variable

Problem

You are given a typed variable:

my Str $lang = 'Raku';

Print three facts about it, each on its own line:

  1. the type of its value;
  2. the type of its container;
  3. its name, including the sigil.

Example

The program prints:

Str
Scalar
$lang

Solution

See the solution

Course navigation

WHO and HOW   |   Solution: Describe a variable