Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
27ebe0ac
Commit
27ebe0ac
authored
3 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add missing doc for affectation operators
parent
19d451f2
No related branches found
No related tags found
1 merge request
!145
git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/userdoc.org
+314
-110
314 additions, 110 deletions
doc/userdoc.org
with
314 additions
and
110 deletions
doc/userdoc.org
+
314
−
110
View file @
27ebe0ac
...
@@ -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 character
s
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment