Expressions and StatementsΒΆ
- Expression
An expression is a
Value<T>
orReference<T>
instance (whereT
is notvoid
) obtained as a result from a series of operations. It is analogous to a rvalue of typeT
(forValue<T>
) or typeT&
(forReference<T>
) obtained as a result of some work in C++. Since it is the result of some work, PochiVM disallows implicitly ignoring it. It must be either fed into further operations as input, or explicitly ignored by using theIgnoreRet
API (TODO).- Statement
A statement is a
Value<void>
instance obtained as a result from a series of operations. Its C++ analogy is an arbitrary piece of code which yields no return value (e.g. a function call returningvoid
, or a language construct like if-statement, for-loop).
Every generated function in PochiVM is constituted by a function signature, and a sequence of statements in its function body, similar to C++.