Skip to content

Commit

Permalink
Add a sidebar mentioning ~=
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpilot committed Jul 28, 2010
1 parent 7c5b65e commit 3f1a6ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/operators.pod
Expand Up @@ -58,6 +58,18 @@ The C<=> operator is the I<assignment operator> -- it takes the
values from the right-hand side, and stores them in the variable on the
left-hand side, here C<@scores>.

=begin sidebar

Like other languages that have adopted a similar syntax to C, Perl 6
allows for a shorthand way to write certain assignments. Any
assignment of the form C<$var = $var R<op> EXPR> can be expressed as
C<$var R<op>= EXPR>. So, for instance, C<~> (tilde) is the string
concatenation operator; to append some text to the end of a string,
you could say C<$string ~= "text"> which is equivalent to C<$string =
$string ~ "text">.

=end sidebar

X<pair>
X<< operator;=> >>
X< operator; fat arrow>
Expand Down
1 change: 0 additions & 1 deletion src/subs-n-sigs.pod
Expand Up @@ -92,7 +92,6 @@ pad or other exotic input device). How can you maintain a variable list of
custom behaviors, allow user input, and restrict that input to a safe set of
behaviors?

TODO this example uses the ~= operator before it's been introduced.
TODO this example doesn't seem like a good one for first-class subs.

=begin programlisting
Expand Down

0 comments on commit 3f1a6ec

Please sign in to comment.