diff -r d4c2968a391f -r d7ae02390fac relpipe-data/examples-guile-filtering.xml --- a/relpipe-data/examples-guile-filtering.xml Sat Sep 12 13:20:21 2020 +0200 +++ b/relpipe-data/examples-guile-filtering.xml Fri Sep 25 14:38:24 2020 +0200 @@ -2,7 +2,7 @@ xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana" xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"> - Complex filtering with Guile + Complex filtering with Scheme filtering records with AND, OR and functions 01400 @@ -12,12 +12,12 @@ For simple filtering, we can use relpipe-tr-grep. But what if we need to write some complex query that contains AND and OR operators? What if we need e.g. compare numbers – not only match texts against regular expressions? - There is a tool capable to do this and much more: relpipe-tr-guile! + There is a tool capable to do this and much more: relpipe-tr-scheme!

Guile is the GNU implementation of Scheme language (something like Lisp and also full of parenthesis). - The relpipe-tr-guile uses GNU Guile as a library, puts data in the Guile context and evaluates Guile expressions and then reads data from the Guile context back and generates relational output from them. + The relpipe-tr-scheme reference implementation uses GNU Guile as a library, puts data in the Scheme context and evaluates Scheme expressions and then reads data from the Scheme context back and generates relational output from them. Good news are that it is not necessary to know Lisp/Scheme to use this tool. For the first steps, it can be used just as a query language – like SQL, just a bit Polish.

@@ -29,7 +29,7 @@

Well, well… here we are:

@@ -54,7 +54,7 @@ ╰───────────────────────────────────────────────────────────────────────┴───────────────┴────────────────┴────────────────┴────────────────╯ Record count: 13]]> -

The --relation 'files.*' is a regular expression that says which relations should be processed in Guile – others are passed through unchanged.

+

The --relation 'files.*' is a regular expression that says which relations should be processed in Scheme – others are passed through unchanged.

The --where '(= $size 666)' is our condition. @@ -65,11 +65,11 @@

- Relational attributes are mapped to Guile variables with same name, just prefixed with $. + Relational attributes are mapped to Scheme variables with same name, just prefixed with $. (we considered symbol, but $ seems to be still more common on keyboards in 2019) - While relational attribute name is an arbitrary string, Guile variable names have some limitations, thus not all attributes can be mapped – those with spaces and some special characters are currently unsupported (this will be fixed in later versions by some kind of encoding/escaping). + While relational attribute name is an arbitrary string, Scheme variable names have some limitations, thus not all attributes can be mapped – those with spaces and some special characters are currently unsupported (this will be fixed in later versions by some kind of encoding/escaping).

@@ -88,7 +88,7 @@

The Btrfs filesystems in our fstab:

@@ -106,7 +106,7 @@

So we can find filesystems mounted somewhere under /mnt:

@@ -130,7 +130,7 @@

Like in SQL, we can join multiple conditions together with logical operators AND and OR. - In Guile/Scheme these operators are also functions – they are written in the same (fashion). + In Scheme these operators are also functions – they are written in the same (fashion).

@@ -139,7 +139,7 @@

Files with sizes 666 bytes or 1984 bytes:

@@ -172,7 +172,7 @@