Why must functions used with stream call/async take no arguments?
← Streams and Pipelines · Ref: Q844
Functions used with call/async must take ZERO arguments. The stream calls them without parameters.
See Q813 for call/async rules. See Q843 for return requirement.
Example
defines module qa.streams.call.no.arguments defines function getTimestamp() <- rtn <- "2026-03-26" getHostname() <- rtn <- "ek9-server" defines class StreamSink received <- String() operator | -> item as String if item? received: String(item) override operator ? as pure <- rtn as Boolean: received? defines function StreamNoArgsDemo() collector <- StreamSink() cat [getTimestamp] | call > collector require collector?
Common mistakes
E06310 — Functions used with stream call must take no arguments. See ek9 -h E06310 for details.
Incorrect:
getTimestamp()
-> inputArg as String
<- rtn <- "2026-03-26"
Correct:
getTimestamp()
<- rtn <- "2026-03-26"
Other ways to ask this
- What triggers E06310 REQUIRE_NO_ARGUMENTS?
- Why can't I stream functions with parameters through call?
- What is the correct function shape for stream call?
Coming from another language?
Java: Supplier has get() with no arguments. Python: zero-arg callables. EK9: call/async require zero-argument supplier functions.
Keywords: E06310, arguments, pipeline, zero-arg, stream, call, supplier, function