Cursus Raku / Elementa / Plura de generibus / Positionalia data genera / @*ARGS array

Quiz — @*ARGS array

You are running the following program a few times. For each run, find the correct answers.

The program is saved in the file t.raku and has the following code:

say @*ARGS.elems;
say @*ARGS[0];

1

The program is run as:

$ raku t.raku hello world

What are the values printed by each of the lines of code?

2say @*ARGS.elems; prints  (: 1, 2 :)
hellosay @*ARGS[0]; prints  (: hello, world, hello world :)

2

The program is run as:

$ raku t.raku "hello world"

What are the values printed?

1say @*ARGS.elems; prints  (: 1, 2 :)Chorda virgulis clausa unum argumentum est.
hello worldsay @*ARGS[0]; prints  (: hello, "hello", world, "world", hello world, "hello world" :)

3

The program is run as:

$ raku t.raku "hello" "world"

What does it print?

2say @*ARGS.elems; prints  (: 1, 2 :)
hellosay @*ARGS[0]; prints  (: hello, "hello", world, "world", hello world, "hello world" :)The quotes from the shell are not included in the value of the argument.

@*ARGS array   |   Interpolando array