Using inline stream source template expressions
The previous code example can be re-written in a more concise format by writing the stream source template expressions inline, as illustrated below.
01. TemperatureAndPressure tp;
02. stream<float> meanTs :=
03. from t in all Temperature(sensorId="T001") retain 3 select mean(t.temperature);
04. stream<float> meanPs :=
05. from p in all Pressure(sensorId="P001") retain 3 select mean(p.pressure);
06. from t in meanTs retain 1 from p in meanPs retain 1
07. select TemperatureAndPressure("S001",t,p) : tp {
08. print tp.toString();
09. }