Skip to content
Snippets Groups Projects
Commit 27ebe0ac authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add missing doc for affectation operators

parent 19d451f2
No related branches found
No related tags found
1 merge request!145git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
...@@ -712,7 +712,7 @@ The interpreter gives type to some special expressions. ...@@ -712,7 +712,7 @@ The interpreter gives type to some special expressions.
| ~\r~ | carriage return | | ~\r~ | carriage return |
| ~\t~ | horizontal tab | | ~\t~ | horizontal tab |
| ~\v~ | vertical tab | | ~\v~ | vertical tab |
These special character are not interpreted by ~pugs~ itself but These special characters are not interpreted by ~pugs~ itself but
interpreted by the system when an output is created. They are just interpreted by the system when an output is created. They are just
allowed in the definition of a ~string~. allowed in the definition of a ~string~.
...@@ -830,35 +830,35 @@ lists are sorted by type of left hand side variable. ...@@ -830,35 +830,35 @@ lists are sorted by type of left hand side variable.
- ~B~: boolean left hand side variable. One is only allowed to affect boolean - ~B~: boolean left hand side variable. One is only allowed to affect boolean
values. values.
| allowed expression type | | ~=~ allowed expression type |
|-------------------------| |---------------------------|
| ~B~ | | ~B~ |
- ~N~: natural integer ($\mathbb{N}$ or $\mathbb{Z}_{\ge0}$) left hand side variable. - ~N~: natural integer ($\mathbb{N}$ or $\mathbb{Z}_{\ge0}$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|-------------------------| |---------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ (for convenience) | | ~Z~ (for convenience) |
- ~Z~: integer ($\mathbb{Z}$) left hand side variable. - ~Z~: integer ($\mathbb{Z}$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|-------------------------| |---------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ | | ~Z~ |
- ~R~: real ($\mathbb{R}$) left hand side variable. - ~R~: real ($\mathbb{R}$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|-------------------------| |---------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ | | ~Z~ |
| ~R~ | | ~R~ |
- ~R^1~: vector of dimension 1 ($\mathbb{R}^1$) left hand side variable. - ~R^1~: vector of dimension 1 ($\mathbb{R}^1$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|-------------------------| |---------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ | | ~Z~ |
...@@ -866,7 +866,7 @@ lists are sorted by type of left hand side variable. ...@@ -866,7 +866,7 @@ lists are sorted by type of left hand side variable.
| ~R^1~ | | ~R^1~ |
- ~R^2~: vector of dimension 2 ($\mathbb{R}^2$) left hand side variable. - ~R^2~: vector of dimension 2 ($\mathbb{R}^2$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|---------------------------------------------| |---------------------------------------------|
| ~R^2~ | | ~R^2~ |
| ~0~ (special value) | | ~0~ (special value) |
...@@ -891,7 +891,7 @@ lists are sorted by type of left hand side variable. ...@@ -891,7 +891,7 @@ lists are sorted by type of left hand side variable.
#+results: R2-invalid-integer-affectation #+results: R2-invalid-integer-affectation
- ~R^3~: vector of dimension 3 ($\mathbb{R}^3$) left hand side variable. - ~R^3~: vector of dimension 3 ($\mathbb{R}^3$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|---------------------------------------------| |---------------------------------------------|
| ~R^3~ | | ~R^3~ |
| ~0~ (special value) | | ~0~ (special value) |
...@@ -907,17 +907,17 @@ lists are sorted by type of left hand side variable. ...@@ -907,17 +907,17 @@ lists are sorted by type of left hand side variable.
the output is the output is
#+RESULTS: affectation-to-R3-from-list #+RESULTS: affectation-to-R3-from-list
- ~R^1x1~: matrix of dimensions $1\times1$ ($\mathbb{R}^1\times1$) left hand side variable. - ~R^1x1~: matrix of dimensions $1\times1$ ($\mathbb{R}^{1\times1}$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|-------------------------| |---------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ | | ~Z~ |
| ~R~ | | ~R~ |
| ~R^1x1~ | | ~R^1x1~ |
- ~R^2x2~: matrix of dimension $2\times2$ ($\mathbb{R}^2x2$) left hand side variable. - ~R^2x2~: matrix of dimension $2\times2$ ($\mathbb{R}^{2\times2}$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|---------------------------------------------| |---------------------------------------------|
| ~R^2x2~ | | ~R^2x2~ |
| ~0~ (special value) | | ~0~ (special value) |
...@@ -934,8 +934,8 @@ lists are sorted by type of left hand side variable. ...@@ -934,8 +934,8 @@ lists are sorted by type of left hand side variable.
which produces which produces
#+RESULTS: affectation-to-R2x2-from-list #+RESULTS: affectation-to-R2x2-from-list
- ~R^3x3~: matrix of dimension $3\times3$ ($\mathbb{R}^3x3$) left hand side variable. - ~R^3x3~: matrix of dimension $3\times3$ ($\mathbb{R}^{3\times3}$) left hand side variable.
| allowed expression type | | ~=~ allowed expression type |
|---------------------------------------------| |---------------------------------------------|
| ~R^3x3~ | | ~R^3x3~ |
| ~0~ (special value) | | ~0~ (special value) |
...@@ -955,8 +955,8 @@ lists are sorted by type of left hand side variable. ...@@ -955,8 +955,8 @@ lists are sorted by type of left hand side variable.
- ~string~ left hand side variable. Expressions of any basic types can - ~string~ left hand side variable. Expressions of any basic types can
be used as the right hand side. be used as the right hand side.
| allowed expression type | | ~=~ allowed expression type |
|-------------------------| |---------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ | | ~Z~ |
...@@ -975,61 +975,61 @@ lists are sorted by type of left hand side variable. ...@@ -975,61 +975,61 @@ lists are sorted by type of left hand side variable.
variables. variables.
- ~N~: natural integer ($\mathbb{N}$ or $\mathbb{Z}_{\ge0}$) left hand side variable. - ~N~: natural integer ($\mathbb{N}$ or $\mathbb{Z}_{\ge0}$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|-------------------------| |----------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ (for convenience) | | ~Z~ (for convenience) |
- ~Z~: integer ($\mathbb{Z}$) left hand side variable. - ~Z~: integer ($\mathbb{Z}$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|-------------------------| |----------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ | | ~Z~ |
- ~R~: real ($\mathbb{R}$) left hand side variable. - ~R~: real ($\mathbb{R}$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|-------------------------| |----------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ | | ~Z~ |
| ~R~ | | ~R~ |
- ~R^1~: vector of dimension 1 ($\mathbb{R}^1$) left hand side variable. - ~R^1~: vector of dimension 1 ($\mathbb{R}^1$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|-------------------------| |----------------------------|
| ~R^1~ | | ~R^1~ |
- ~R^2~: vector of dimension 2 ($\mathbb{R}^2$) left hand side variable. - ~R^2~: vector of dimension 2 ($\mathbb{R}^2$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|---------------------------------------------| |----------------------------|
| ~R^2~ | | ~R^2~ |
- ~R^3~: vector of dimension 3 ($\mathbb{R}^3$) left hand side variable. - ~R^3~: vector of dimension 3 ($\mathbb{R}^3$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|---------------------------------------------| |----------------------------|
| ~R^3~ | | ~R^3~ |
- ~R^1x1~: matrix of dimensions $1\times1$ ($\mathbb{R}^1\times1$) left hand side variable. - ~R^1x1~: matrix of dimensions $1\times1$ ($\mathbb{R}^{1\times1}$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|-------------------------| |----------------------------|
| ~R^1x1~ | | ~R^1x1~ |
- ~R^2x2~: matrix of dimension $2\times2$ ($\mathbb{R}^2x2$) left hand side variable. - ~R^2x2~: matrix of dimension $2\times2$ ($\mathbb{R}^{2\times2}$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|---------------------------------------------| |----------------------------|
| ~R^2x2~ | | ~R^2x2~ |
- ~R^3x3~: matrix of dimension $3\times3$ ($\mathbb{R}^3x3$) left hand side variable. - ~R^3x3~: matrix of dimension $3\times3$ ($\mathbb{R}^{3\times3}$) left hand side variable.
| allowed expression type | | ~+=~ allowed expression type |
|---------------------------------------------| |----------------------------|
| ~R^3x3~ | | ~R^3x3~ |
- ~string~ left hand side variable. Expressions of any basic types can - ~string~ left hand side variable. Expressions of any basic types can
be used as the right hand side. be used as the right hand side.
| allowed expression type | | ~+=~ allowed expression type |
|-------------------------| |----------------------------|
| ~B~ | | ~B~ |
| ~N~ | | ~N~ |
| ~Z~ | | ~Z~ |
...@@ -1042,18 +1042,222 @@ lists are sorted by type of left hand side variable. ...@@ -1042,18 +1042,222 @@ lists are sorted by type of left hand side variable.
| ~R^3x3~ | | ~R^3x3~ |
| ~string~ | | ~string~ |
***** TODO List of defined operator ~-=~ for basic types. ***** List of defined operator ~-=~ for basic types.
- ~B~: the ~-=~ operator is not defined for left hand side boolean variables. - ~B~: the ~-=~ operator is not defined for left hand side boolean variables.
***** TODO List of defined operator ~*=~ for basic types. - ~N~: natural integer ($\mathbb{N}$ or $\mathbb{Z}_{\ge0}$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ (for convenience) |
- ~Z~: integer ($\mathbb{Z}$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
- ~R~: real ($\mathbb{R}$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^1~: vector of dimension 1 ($\mathbb{R}^1$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~R^1~ |
- ~R^2~: vector of dimension 2 ($\mathbb{R}^2$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~R^2~ |
- ~R^3~: vector of dimension 3 ($\mathbb{R}^3$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~R^3~ |
- ~R^1x1~: matrix of dimensions $1\times1$ ($\mathbb{R}^{1\times1}$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~R^1x1~ |
- ~R^2x2~: matrix of dimension $2\times2$ ($\mathbb{R}^{2\times2}$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~R^2x2~ |
- ~R^3x3~: matrix of dimension $3\times3$ ($\mathbb{R}^{3\times3}$) left hand side variable.
| ~-=~ allowed expression type |
|----------------------------|
| ~R^3x3~ |
- ~string~: the ~-=~ operator is not defined for left hand side string variables.
***** List of defined operator ~*=~ for basic types.
- ~B~: the ~*=~ operator is not defined for left hand side boolean variables. - ~B~: the ~*=~ operator is not defined for left hand side boolean variables.
***** TODO List of defined operator ~/=~ for basic types. - ~N~: natural integer ($\mathbb{N}$ or $\mathbb{Z}_{\ge0}$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ (for convenience) |
- ~Z~: integer ($\mathbb{Z}$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
- ~R~: real ($\mathbb{R}$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^1~: vector of dimension 1 ($\mathbb{R}^1$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^2~: vector of dimension 2 ($\mathbb{R}^2$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^3~: vector of dimension 3 ($\mathbb{R}^3$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^1x1~: matrix of dimensions $1\times1$ ($\mathbb{R}^{1\times1}$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^2x2~: matrix of dimension $2\times2$ ($\mathbb{R}^{2\times2}$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^3x3~: matrix of dimension $3\times3$ ($\mathbb{R}^{3\times3}$) left hand side variable.
| ~*=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
#+BEGIN_note
Observe that for these small matrix types ($\mathbb{R}^{d\times d}$) the
construction ~A *= B;~ is not allowed. The main reason for that is that
for $d>1$ this operation has no interests since it requires a
temporary. One will see bellow that one can write ~A = A*B;~ if needed.
#+END_note
- ~string~: the ~*=~ operator is not defined for left hand side string variables.
***** List of defined operator ~/=~ for basic types.
- ~B~: the ~/=~ operator is not defined for left hand side boolean variables. - ~B~: the ~/=~ operator is not defined for left hand side boolean variables.
- ~N~: natural integer ($\mathbb{N}$ or $\mathbb{Z}_{\ge0}$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ (for convenience) |
- ~Z~: integer ($\mathbb{Z}$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
- ~R~: real ($\mathbb{R}$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^1~: vector of dimension 1 ($\mathbb{R}^1$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^2~: vector of dimension 2 ($\mathbb{R}^2$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^3~: vector of dimension 3 ($\mathbb{R}^3$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^1x1~: matrix of dimensions $1\times1$ ($\mathbb{R}^{1\times1}$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^2x2~: matrix of dimension $2\times2$ ($\mathbb{R}^{2\times2}$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
- ~R^3x3~: matrix of dimension $3\times3$ ($\mathbb{R}^{3\times3}$) left hand side variable.
| ~/=~ allowed expression type |
|----------------------------|
| ~B~ |
| ~N~ |
| ~Z~ |
| ~R~ |
**** Unary operators **** Unary operators
The ~pugs~ language allows the following tokens as unary operators The ~pugs~ language allows the following tokens as unary operators
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment