Курс языка программирования Raku / Основы / Основы функций / Функция MAIN / Чтение аргументов командной строки

Тест: Значения по умолчанию

Consider the following program.

sub MAIN($a = 'abc', $b = 'def') {
    say $a;
    say $b;
}

1

What does it print if it is run as shown below?

$ raku t.raku
abc defEnter the output values: ␣␣␣ and ␣␣␣

2

Now, the same program is run as:

$ raku t.raku xyz
xyz defEnter the output values: ␣␣␣ and ␣␣␣

3

Finally, this command:

$ raku t.raku xyz 123
xyz 123Enter the output values: ␣␣␣ and ␣␣␣

Навигация по курсу

Тест: Чтение аргументов командной строки   |   Несколько функций MAIN