Skip to content

Commit bdbe964

Browse files
committed
Add postfix:<i> to S03
It wasn't mentioned at all before, and since it's at the methodcall level in rakudo, which may not be expected at first, I figured it was worth mentioning. It also makes postfix:<i> the only operator at that level to not start with a dot, which seems like another noteworthy detail.
1 parent e80063c commit bdbe964

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

S03-operators.pod

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ each level. (Column 'A' is for "associativity", see following table.)
2525
A Level Examples
2626
= ===== ========
2727
O Terms 42 3.14 "eek" qq["foo"] $x :!verbose @$array
28-
L Method postfix .meth .+ .? .* .() .[] .{} .<> .«» .:: .= .^ .:
28+
L Method postfix .meth .+ .? .* .() .[] .{} .<> .«» .:: .= .^ .: i
2929
N Autoincrement ++ --
3030
R Exponentiation **
3131
L Symbolic unary ! + - ~ ? | || +^ ~^ ?^ ^
@@ -315,10 +315,10 @@ comma on the right--see List prefix precedence below.
315315

316316
=head2 Method postfix precedence
317317

318-
All method postfixes start with a dot, though the dot is optional
319-
for subscripts. Since these are the tightest standard operator,
320-
you can often think of a series of method calls as a single term that
321-
merely expresses a complicated name.
318+
All method postfixes (except for C<i>) start with a dot, though the dot is
319+
optional for subscripts. Since these are the tightest standard operator, you can
320+
often think of a series of method calls as a single term that merely expresses a
321+
complicated name.
322322

323323
See L<S12> for more discussion of single dispatch method calls.
324324

@@ -395,6 +395,17 @@ Dotted postfix form of any other prefix operator
395395

396396
=item *
397397

398+
Imaginary number postfix
399+
400+
42i
401+
$foo\i
402+
403+
The only operator on this level that does not start with a dot. Turns a number
404+
into a purely-imaginary number (a C<Complex> with a zero real part). Must be
405+
backslashed if after a name, including C<Inf> and C<NaN>.
406+
407+
=item *
408+
398409
There is specifically no C<< infix:<.> >> operator, so
399410

400411
$foo . $bar

0 commit comments

Comments
 (0)