133 | | * '''Sequence''': Queries can be sequenced to continue a query from where another has left off. This example first adds the module from file 'mymodule.erl'. The add call returns the entities loaded. A semantic query aggregate of a list works by executing the first query (or in this case, specifying a starting entity), and then running the next query in the chain (in this case getting the name of files included by the add call). |
| 132 | * '''Sequence''': Queries can be sequenced to continue a query from where another has left off. The execution works on arbitrarily long starting and continuation sequences (i.e., not just a single element). The following examples are correct, and can be used from {{{ris}}}: |
| 133 | |
| 134 | {{{ |
| 135 | #!erlang |
| 136 | |
| 137 | % Language elements can be written via atoms or via strings. The dot is optional. |
| 138 | ris:q([mods, funs]). |
| 139 | ris:q([mods, .funs]). |
| 140 | ris:q(["mods", "funs"]). |
| 141 | |
| 142 | % Filters can be sequenced. |
| 143 | ris:q(['mods', '[name==a]']). |
| 144 | |
| 145 | % Statistics can be sequenced. |
| 146 | ris:q(['mods', '.fun', '.arity', ':sum']). |
| 147 | ris:q(["mods", "funs", "arity", ":avg"]). |
| 148 | }}} |
| 149 | |
| 150 | Sequences can be constructed not only between queries parts, but between a basic {{{ris}}} command and query parts, too. |
| 151 | This example first adds the module from file 'mymodule.erl'. The add call returns the entities loaded. |
| 152 | A semantic query aggregate of a list works by executing the first query (or in this case, specifying a starting entity), |
| 153 | and then running the next query in the chain (in this case getting the name of files included by the add call). |