Add pipe-buffered function

Implements `pipe-buffered`, a new primitive that allows accumulating
values from multiple input streams into internal series buffers before
executing a user-provided lambda. This is useful for implementing
lookback logic and ensuring that the lambda only executes when
sufficient data is available in all input streams.

The function takes a `lookback` integer, input streams, and a lambda.
The lambda receives `Series` objects for each input, allowing indexed
access to past values. The `pipe-buffered` function manages the
buffering and fill-gate logic.
This commit is contained in:
2026-03-30 10:54:32 +02:00
parent 141ae36ede
commit 6d24c5b64c
2 changed files with 256 additions and 4 deletions
+3 -2
View File
@@ -200,9 +200,10 @@ fn test_pipe_buffered_lambda_params_are_series() {
)";
let dump = env.dump_ast(source).expect("dump_ast failed");
// Lambda param should be Series<Record>, not just Record or Any
// Lambda param should be Series<Record>, not just Record or Any.
// The AST dump uses Debug format: "Series(Record(...))"
assert!(
dump.contains("series<"),
dump.contains("Series(Record("),
"Lambda param should be typed as Series, not raw value.\nDump:\n{dump}"
);
}