From cf73b5c98da29cd803db9940250fbff4045be1f1 Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Fri, 10 May 2024 06:39:48 +0200 Subject: [PATCH] Doc: add link to dev-expr download page --- doc/Expr.adoc | 17 ++++++------ doc/Expr.html | 75 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 61 insertions(+), 31 deletions(-) diff --git a/doc/Expr.adoc b/doc/Expr.adoc index 25c9fae..aaebff4 100644 --- a/doc/Expr.adoc +++ b/doc/Expr.adoc @@ -22,17 +22,23 @@ Expressions calculator toc::[] -#TODO: Work in progress (last update on 2024/05/09, 07:17 am)# +#TODO: Work in progress (last update on 2024/05/10, 06:52 a.m.)# == Expr _Expr_ is a GO package capable of analysing, interpreting and calculating expressions. +=== Concepts and terminology +#TODO# + +image::expression-diagram.png[] + === `dev-expr` test tool `dev-expr` is a simple program that can be used to evaluate expressions interactively. As its name suggests, it was created for testing purpose. In fact, beyond in additon to the automatic test suite based on the Go test framework, `dev-expr` provides an important aid for quickly testing of new features during their development. -It cat work as a REPL, *R*ead-*E*xecute-*P*rint-*L*oop, or it can process expression acquired from files or standard input. +It cat work as a _REPL_, _**R**ead-**E**xecute-**P**rint-**L**oop_, or it can process expression acquired from files or standard input. + +The program can be downloaded from https://git.portale-stac.it/go-pkg/-/packages/generic/dev-expr/[dev-expr]. -The program in located in the _tools_ directory. Here are some examples of execution. .Run `dev-expr` in REPL mode and ask for help @@ -103,11 +109,6 @@ Here are some examples of execution. <4> But operator, see <<_but_operator>>. <5> Multi-expression: the same result of the previous single expression but this it is obtained with two separated calculations. -=== Concepts and terminology -#TODO# - -image::expression-diagram.png[] - == Data types _Expr_ supports numerical, string, relational, boolean expressions, and mixed-type lists. diff --git a/doc/Expr.html b/doc/Expr.html index d0f9ed4..a2541e1 100644 --- a/doc/Expr.html +++ b/doc/Expr.html @@ -535,8 +535,8 @@ pre.rouge .ss {
  • 3. Dictionaries
  • @@ -579,7 +579,7 @@ pre.rouge .ss {
    -

    TODO: Work in progress (last update on 2024/05/09, 07:17 am)

    +

    TODO: Work in progress (last update on 2024/05/10, 06:52 a.m.)

    @@ -590,16 +590,29 @@ pre.rouge .ss {

    Expr is a GO package capable of analysing, interpreting and calculating expressions.

    -

    1.1. dev-expr test tool

    +

    1.1. Concepts and terminology

    +
    +

    TODO

    +
    +
    +
    +expression diagram +
    +
    +
    +
    +

    1.2. dev-expr test tool

    dev-expr is a simple program that can be used to evaluate expressions interactively. As its name suggests, it was created for testing purpose. In fact, beyond in additon to the automatic test suite based on the Go test framework, dev-expr provides an important aid for quickly testing of new features during their development.

    -

    It cat work as a REPL, *R*ead-*E*xecute-*P*rint-*L*oop, or it can process expression acquired from files or standard input.

    +

    It cat work as a REPL, Read-Execute-Print-Loop, or it can process expression acquired from files or standard input.

    -

    The program in located in the tools directory. -Here are some examples of execution.

    +

    The program can be downloaded from dev-expr.

    +
    +
    +

    Here are some examples of execution.

    Run dev-expr in REPL mode and ask for help
    @@ -697,17 +710,6 @@ Here are some examples of execution.

    -
    -

    1.2. Concepts and terminology

    -
    -

    TODO

    -
    -
    -
    -expression diagram -
    -
    -
    @@ -791,14 +793,14 @@ Here are some examples of execution.

    2.2. Fractions

    -

    Expr also suports fractions. Fraction literals are made with tow integers separated by a vertical bar |.

    +

    Expr also supports fractions. Fraction literals are made with two integers separated by a vertical bar |.

    Examples

    >>> 1 | 2
    1|2
    >>> 4|6
    -2|3 Fractions are always reduced to theri lowest terms
    +2|3 Fractions are always reduced to their lowest terms
    >>> 1|2 + 2|3
    7|6
    >>> 1|2 * 2|3
    @@ -1003,7 +1005,7 @@ Here are some examples of execution.

    -

    2.5. List

    +

    2.5. Lists

    Expr supports list of mixed-type values, also specified by normal expressions.

    @@ -1048,6 +1050,33 @@ Here are some examples of execution.

    +
    +

    The items of array can be accessed using the dot . operator.

    +
    +
    +
    Item access syntax
    +
    +
    <item> ::= <list-expr>"."<index-expr>
    +
    +
    +
    +
    Items of list
    +
    +
    `>>>` [blue]`[1,2,3].1`
    +[green]`2`
    +`>>>` [blue]`list=[1,2,3]; list.1`
    +[green]`2`
    +`>>>` [blue]`["one","two","three"].1`
    +[green]`two`
    +`>>>` [blue]`list=["one","two","three"]; list.(2-1)`
    +[green]`two`
    +`>>>` [blue]`list.(-1)`
    +[green]`three`
    +`>>>` [blue]`list.(-1)`
    +[green]`three`
    +`>>>` [blue]`list.(10)`
    +
    +
    @@ -1461,7 +1490,7 @@ The value on the left side of = must be an identifier.