|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
let name = pipeline – one value, read from a stream and given a name.
More...
#include <cpp/a11/flow/syntax.h>
Public Member Functions | |
| const Word & | name () const |
| The first name, which is the whole value where there is only one. | |
Public Member Functions inherited from a11::flow::syntax::NodeOf< NodeKind::kLet > | |
| NodeOf () | |
Public Member Functions inherited from a11::flow::syntax::Node | |
| virtual | ~Node ()=default |
Public Attributes | |
| std::vector< Word > | names |
One name is the value; several take it apart – let name, age = user by field, let first, second = pair by position. | |
| PipelinePtr | pipeline |
Public Attributes inherited from a11::flow::syntax::Node | |
| NodeKind | kind = NodeKind::kError |
| Location | location |
Additional Inherited Members | |
Static Public Attributes inherited from a11::flow::syntax::NodeOf< NodeKind::kLet > | |
| static constexpr NodeKind | kNodeKind |
let name = pipeline – one value, read from a stream and given a name.
Why the language needs this. Everything else here is a stream, and a stream is the right default: a flow is dataflow, and most of what moves through it is many values. But some of what moves through it is one value – a status code, an image, a summary – and until now a flow could only reach one inside an expression, with (x | first 1) written out at every use. A name that is a value can be compared, added, indexed and branched on directly, which is what makes if code >= 200 and code < 300 say what it means.
Why it is a word and not an operator. name = ... already says "a step
of this flow"; the thing that differs here is the kind of thing the name is, and that is worth a word at the front of the line where a reader scanning the left margin sees it. It reads as one, too: let code = ....
|
inline |
The first name, which is the whole value where there is only one.
| std::vector<Word> a11::flow::syntax::Let::names |
One name is the value; several take it apart – let name, age = user by field, let first, second = pair by position.
Which of the two is meant is a question about the value rather than about the text, so it is answered where the value is: by name, and by position where there is no such field.
| PipelinePtr a11::flow::syntax::Let::pipeline |