A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::flow::syntax::Let Struct Reference

let name = pipeline – one value, read from a stream and given a name. More...

#include <cpp/a11/flow/syntax.h>

Inheritance diagram for a11::flow::syntax::Let:
[legend]

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
 

Detailed Description

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 = ....

Member Function Documentation

◆ name()

const Word & a11::flow::syntax::Let::name ( ) const
inline

The first name, which is the whole value where there is only one.

Member Data Documentation

◆ names

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.

◆ pipeline

PipelinePtr a11::flow::syntax::Let::pipeline

The documentation for this struct was generated from the following file: