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

Bind a scalar

Problem

Start with a scalar $source holding 1. From it, make two more names: $bound, bound to $source with :=, and $copy, assigned from $source with an ordinary =. Now change $source to 9, and print both $bound and $copy so the difference between binding and copying is visible.

Example

The program prints:

9
1

Solution

See the solution

Course navigation

Solution: Flatten the parts   |   Solution: Bind a scalar