Skip to content

Commit

Permalink
chapter assignement on ops tablet
Browse files Browse the repository at this point in the history
  • Loading branch information
lichtkind committed Aug 15, 2014
1 parent edc5a0c commit ae3d871
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 29 deletions.
3 changes: 1 addition & 2 deletions docs/appendix-a-index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,7 @@ example: `$a += 3;` equals `$a = $a + 3`
<a id="equal-colon-equal-op"/>
**=:=**
*«comparison op»* &mdash;
compares [binding](tablet-3-variables#binding),
if both vars are bound to same memory location
compares two variables, if their [bound](appendix-g-glossary#binding) to same memory location (in symbol table)


<a id="equal-equal"/><a id="equal-equal-op"/>
Expand Down
6 changes: 3 additions & 3 deletions docs/appendix-b-grouped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Constants
are builtins (not exactly variables and without a [sigil](#sigils))
that return always the same important value

Name Value Meaning
Name Value Meaning
---------------------------------- ---------------- -----------------------------------
[e](appendix-a-index#e-constant) 2.71828182878434 [euler number](appendix-g-glossary#e)
[i](appendix-a-index#i-constant) 0+1i [imaginary number](appendix-g-glossary#i)
Expand Down Expand Up @@ -512,7 +512,7 @@ Contextualizers
[prefix](appendix-a-index#prefix-category) operators or functions
that forcing a [context](appendix-g-glossary#context).

------------------------------------------ -------------------------------- ----------------------------------------------------------------------------------------------
------------------------------------------ ------------------------------- ----------------------------------------------------------------------------------------------
[`$()`](appendix-a-index#dollar-op) [item()](appendix-a-index#item) [scalar/item context](appendix-g-glossary#item-context)
[`?`](appendix-a-index#question-op) [so()](appendix-a-index#so) [boolean](appendix-g-glossary#bool-context)
[`!`](appendix-a-index#exclamation-op) [not()](appendix-a-index#not) negated bool context
Expand Down Expand Up @@ -984,7 +984,7 @@ Conditionals
[elsif](appendix-a-index#elsif) works like if, but only recognized if no preceding "if" or "elsif" clause was executed
[else](appendix-a-index#else) following block will be executed, when no preceding "if" or "elsif" clause was executed
[unless](appendix-a-index#unless) opposite of **if**, alias to **if not**, no "elsif" or "else" is allowed to follow
[?? !!](appendix-a-index#conditional-op) cond ?? term1 !! term2 id short form of if cond {term1} else {term2}
[?? !!](appendix-a-index#conditional-op) "cond ?? term1 !! term2" is short form "of if cond {term1} else {term2}"
[ff](appendix-a-index#ff) awk style flip flop, in P5 .. in scalar context
[fff](appendix-a-index#fff) sed style flip flop, in P5 ... in scalar context
[given](appendix-a-index#given) evals an expression into scalar context assignes it to **\$\_** for the following block
Expand Down
2 changes: 1 addition & 1 deletion docs/appendix-g-glossary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ but written only inside angle brackets (\< \>) that mark [*subrules*](#subrule),
to distinct that from the [pipe metacharacter](appendix-a-index#pipe-metachar).


<a id="evaluation"/>
<a id="eval"/><a id="evaluation"/>
**evaluation** &mdash;
transforming something, that it gets ready for practical usage -
sometimes means that just replacing in a piece of code all variables with there
Expand Down
29 changes: 13 additions & 16 deletions docs/tablet-4-operators.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,17 @@ and [**associativity**](appendix-g-glossary#associativity) (operand priority) .



Assignment
==========

=


[self assigning ops](#self-assigning)

[variable]()


Binding
-------

:=
::=
<a id="assignment"/><a id="binding"/>
Assignment and Binding
======================

Even if technically [**=**](appendix-a-index#equal-op), [**:=**](appendix-a-index#colon-equal-op),
[**::=**](appendix-a-index#colon-colon-equal-op) and [**=:=**](appendix-a-index#equal-colon-equal-op) are operators,
they are handled on the previous (variable) tablet in the chapters
[assignment](tablet-3-variables#assignment) and [binding](tablet-3-variables#binding).
That is because they force the [*evaluation*](appendix-g-glossary#eval) of the
[*expression*](appendix-g-glossary#expression) on their right side and do something
with the result on the variable on their left side.


Comparison
Expand All @@ -45,6 +39,9 @@ Comparison
Equality
--------

<=>
leg
cmp
eqv ===
!= !==
eq ==
Expand Down
14 changes: 7 additions & 7 deletions docs/tablet-5-io.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ say


Writes text to the standard output (`$*OUT`, called `STDOUT` in Perl 5).
This example just prints a [string literal](tablet-2-basic-syntax.html#quoting),
This example just prints a [string literal](tablet-2-basic-syntax#quoting),
but any type of value is allowed. **say** appends a line ending,
according to the operating system convention.
So every time you "say" something, later output will start on a fresh line.

You can also give `say` a list of values. Each item will be taken as
an expression to print. The results will be combined,
just like with [**~**](tablet-4-operators.html#string-context), and finally the
just like with [**~**](tablet-4-operators#string-context), and finally the
line ending will be added.

say 'Dear Earthlings, we come from ', $our_home_planet, ',
which is ', compute_distance($earth, $our_home_planet),
' parsecs away.';

That could also be written using [double-quoted strings](tablet-2-basic-syntax.html#double-quotes):
That could also be written using [double-quoted strings](tablet-2-basic-syntax#double-quotes):

say "Dear Earthlings, we come from $our_home_planet, which is { compute_distance($earth, $our_home_planet) } parsecs away.";

Expand All @@ -61,7 +61,7 @@ printf
------

It's a `print` that understands also the syntax of
[sprintf](tablet-2-basic-syntax.html#sprintf). It's a very lightweight
[sprintf](tablet-2-basic-syntax#sprintf). It's a very lightweight
framework for formated output. If you need more, use formats or even a
template engine.

Expand All @@ -73,7 +73,7 @@ template engine.
note
----

Works like [`say`](tablet-5-io.html#say), but writes to `$*ERR` (known as
Works like [`say`](#say), but writes to `$*ERR` (known as
`STDERR` in Perl 5). Content sent to `$*ERR` can be redirected
separately from normal program output, and is often used for progress
reports, extra debugging information, error messages, etc.
Expand All @@ -84,7 +84,7 @@ warn
----

Displays a warning along with the code location to `$.ERR`
(see also [`note`](tablet-5-io.html#note)). Under the hood, warn throws a "resumable
(see also [`note`](#note)). Under the hood, warn throws a "resumable
exception", and it can be caught and suppressed using a CONTROL block.
Normally, once it's handled, Perl will resume running the code just
after the warn call.
Expand Down Expand Up @@ -124,7 +124,7 @@ Files
file test
---------

[file test operators](appendix-b-grouped.html#filetest-ops)
[file test operators](appendix-b-grouped#filetest-ops)



Expand Down

0 comments on commit ae3d871

Please sign in to comment.