📘 Infix operators in Perl 6

Infix operators are placed in a programme between two operands. The majority of the infix operators are binary, and there is a single ternary operator, which expects three operands.

The simplest example of the binary operator is an addition operator +. On the right and left sides it expects two values, for example, two variables: $a + $b. It is important to understand that the same symbol or the same sequence of characters may be either an infix or a prefix operator depending on the context. In the example with a plus, the unary counterpart is a unary plus operator, which coerces the operand to a number: +$str.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s