3232 put "Hello, world!"
3333
3434There is also the L<say|/routine/say> keyword, which behaves similarly, but will
35- call the L<gist|/routine/gist> method of its argument.
35+ call the L<. gist|/routine/gist> method of its argument instead of the C<.Str|/routine/Str> method .
3636
3737Raku
3838
@@ -64,8 +64,9 @@ matching curly braces are closed.
6464
6565In Raku, a semicolon signifies the end of a statement.
6666The semicolon may be omitted if it is the last statement
67- of a block. The semicolon may also be omitted if there
68- is a closing curly brace followed by a newline.
67+ of a block (i.e. of a list of statements enclosed in curly braces).
68+ The semicolon may also be omitted after a closing curly brace
69+ followed by a newline.
6970
7071Python
7172
8182 3 + 4;
8283 say 1 +
8384 2;
85+ if True { say 42 }
8486
8587=head2 Blocks
8688
@@ -123,7 +125,7 @@ initialized or declared and initialized at once.
123125 $foo = 12; # initialize
124126 my $bar = 19; # both at once
125127
126- Also, as you may have noticed, variables in Raku usually start with sigils --
128+ Also, as you may have noticed, variables in Raku usually start with sigils –
127129symbols indicating the type of their container. Variables starting with a C<$>
128130hold scalars. Variables starting with an C<@> hold arrays, and variables
129131starting with a C<%> hold a hash (dict). Sigilless variables, declared with a
@@ -398,20 +400,23 @@ I<Raku>
398400 say "Symbol '$symbol' stands for $element";
399401 }
400402
401- =head2 Lambdas, functions and subroutines>
403+ =head2 Functions, subroutines and lambdas
402404
403405Declaring a function (subroutine) with C<def> in Python is accomplished
404406with C<sub> in Raku.
405407
406408=begin code :lang<python>
407409def add(a, b):
408410 return a + b
411+ =end code
409412
413+ =begin code
410414sub add(\a, \b) {
411415 return a + b
412416}
413417=end code
414418
419+
415420The C<return> is optional; the value of the last expression is used as
416421the return value:
417422
@@ -431,8 +436,8 @@ sub add($a, $b) {
431436Python 2 functions can be called with positional arguments
432437or keyword arguments. These are determined by the caller.
433438In Python 3, some arguments may be "keyword only".
434- In Raku, positional and named arguments are determined
435- by the signature of the routine.
439+ In Raku, each argument is either positional or named,
440+ as determined by the signature of the routine.
436441
437442Python
438443
0 commit comments