Expr.adoc: replaced dev-expr with ecli
This commit is contained in:
+19
-16
@@ -1,6 +1,7 @@
|
|||||||
= Expr
|
= Expr
|
||||||
Expressions calculator
|
Expressions calculator
|
||||||
:authors: Celestino Amoroso
|
:authors: Celestino Amoroso
|
||||||
|
:email: celestino.amoroso@gmail.com
|
||||||
:docinfo: shared
|
:docinfo: shared
|
||||||
:encoding: utf-8
|
:encoding: utf-8
|
||||||
:toc: right
|
:toc: right
|
||||||
@@ -16,10 +17,11 @@ Expressions calculator
|
|||||||
:sectlinks:
|
:sectlinks:
|
||||||
:sectanchors:
|
:sectanchors:
|
||||||
:source-highlighter: rouge
|
:source-highlighter: rouge
|
||||||
// :rouge-style: ThankfulEyes
|
// :rouge-style: gruvbox
|
||||||
:rouge-style: gruvbox
|
:rouge-style: manni
|
||||||
// :rouge-style: colorful
|
:stylesdir: /home/share/s3-howto/styles
|
||||||
//:rouge-style: monokay
|
:stylesheet: adoc-colony.css
|
||||||
|
|
||||||
// Workaround to manage double-column in back-tick quotes
|
// Workaround to manage double-column in back-tick quotes
|
||||||
:2c: ::
|
:2c: ::
|
||||||
// Workaround to manage double-plus in back-tick quotes
|
// Workaround to manage double-plus in back-tick quotes
|
||||||
@@ -74,7 +76,7 @@ Imported functions are registered in the _global context_. When an expression fi
|
|||||||
===== Inspecting contexts
|
===== Inspecting contexts
|
||||||
_Expr_ provides the operator [blue]_$$_ that returns the current context. This can be used to inspect the content of the context, for example to check the value of a variable or to see which functions are currently linked to the context. This operator is primarily intended for debugging purposes.
|
_Expr_ provides the operator [blue]_$$_ that returns the current context. This can be used to inspect the content of the context, for example to check the value of a variable or to see which functions are currently linked to the context. This operator is primarily intended for debugging purposes.
|
||||||
|
|
||||||
An interactive tool could like `dev-expr` (see <<_dev-expr_test_tool>>) can be used to inspect contexts interactively.
|
An interactive tool could like `ecli` (see <<_ecli_test_tool>>) can be used to inspect contexts interactively.
|
||||||
|
|
||||||
|
|
||||||
.Example: inspecting contexts
|
.Example: inspecting contexts
|
||||||
@@ -123,24 +125,25 @@ In order to inspect the global context issue the [blue]`$$ global` operation.
|
|||||||
[green]`]`
|
[green]`]`
|
||||||
////
|
////
|
||||||
|
|
||||||
=== `dev-expr` test tool
|
[[sec_ecli]]
|
||||||
Before we begin to describe the syntax of _Expr_, it is worth introducing _dev-expr_ because it will be used to show many examples of expressions.
|
=== `ecli` Expression Calculator Interactive Tool
|
||||||
|
Before we begin to describe the syntax of _Expr_, it is worth introducing _ecli_, former _dev-expr_, because it will be used to show many examples of expressions.
|
||||||
|
|
||||||
`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, in additon to the automatic verification test suite based on the Go test framework, `dev-expr` provided an important aid for quickly testing of new features during their development.
|
`ecli` is a simple program that can be used to evaluate expressions interactively. As its name suggests, it was created for testing purpose. In fact, in additon to the automatic verification test suite based on the Go test framework, `ecli` provided an important aid for quickly testing of new features during their development.
|
||||||
|
|
||||||
`dev-expr` can work as a _REPL_, _**R**ead-**E**xecute-**P**rint-**L**oop_, or it can process expression acquired from files or standard input.
|
`ecli` can 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 can be downloaded from https://git.portale-stac.it/go-pkg/-/packages/generic/ecli/[ecli].
|
||||||
|
|
||||||
Here are some examples of execution.
|
Here are some examples of execution.
|
||||||
|
|
||||||
.Run `dev-expr` in REPL mode and ask for help
|
.Run `ecli` in REPL mode and ask for help
|
||||||
[source,shell]
|
[source,shell]
|
||||||
----
|
----
|
||||||
# Type 'exit' or Ctrl+D to quit the program.
|
# Type 'exit' or Ctrl+D to quit the program.
|
||||||
|
|
||||||
[user]$ ./dev-expr
|
[user]$ ./ecli
|
||||||
dev-expr -- Expressions calculator v1.12.0(build 1),2024/09/14 (celestino.amoroso@portale-stac.it)
|
ecli -- Expressions calculator v1.12.0(build 1),2024/09/14 (celestino.amoroso@portale-stac.it)
|
||||||
Based on the Expr package v0.26.0
|
Based on the Expr package v0.26.0
|
||||||
Type help to get the list of available commands
|
Type help to get the list of available commands
|
||||||
See also https://git.portale-stac.it/go-pkg/expr/src/branch/main/README.adoc
|
See also https://git.portale-stac.it/go-pkg/expr/src/branch/main/README.adoc
|
||||||
@@ -176,8 +179,8 @@ dev-expr -- Expressions calculator v1.12.0(build 1),2024/09/14 (celestino.amoros
|
|||||||
.REPL examples
|
.REPL examples
|
||||||
[source,shell]
|
[source,shell]
|
||||||
----
|
----
|
||||||
[user]$ ./dev-expr
|
[user]$ ./ecli
|
||||||
dev-expr -- Expressions calculator v1.10.0(build 14),2024/06/17 (celestino.amoroso@portale-stac.it)
|
ecli -- Expressions calculator v1.10.0(build 14),2024/06/17 (celestino.amoroso@portale-stac.it)
|
||||||
Based on the Expr package v0.19.0
|
Based on the Expr package v0.19.0
|
||||||
Type help to get the list of available commands
|
Type help to get the list of available commands
|
||||||
See also https://git.portale-stac.it/go-pkg/expr/src/branch/main/README.adoc
|
See also https://git.portale-stac.it/go-pkg/expr/src/branch/main/README.adoc
|
||||||
@@ -476,7 +479,7 @@ Currently, boolean operations are evaluated using _short cut evaluation_. This m
|
|||||||
<1> This multi-expression returns _1_ because in the first expression the left value of [blue]`or` is _true_ and, as a conseguence, its right value is not computed. Therefore the _a_ variable only receives the integer _1_.
|
<1> This multi-expression returns _1_ because in the first expression the left value of [blue]`or` is _true_ and, as a conseguence, its right value is not computed. Therefore the _a_ variable only receives the integer _1_.
|
||||||
|
|
||||||
|
|
||||||
TIP: `dev-expr` provides the _ctrl()_ function that allows to change this behaviour.
|
TIP: `ecli` provides the _ctrl()_ function that allows to change this behaviour.
|
||||||
====
|
====
|
||||||
|
|
||||||
=== Lists
|
=== Lists
|
||||||
|
|||||||
Reference in New Issue
Block a user