"include" re-usable static Zed (for const definitions, user ops, etc.)
A community zync user inquired:
Is there some sort of
#includestatement in Zed? where we could store all our constant declarations?
The closest thing to this that exists today is the -I parameter for the Zed CLI commands, which allows for inclusion of Zed that's stored in a referenced file. However, this would not help users that are trying to execute all their Zed from within Zui, nor would it help users hitting the API (which is the case for this community user).
To make the included Zed fragments available in all contexts it seems like they could be stored in a well-known pool in a Zed lake, similar to what's already being done with Remote Queries. Includes from Git might also be desirable.
A community zync user inquired about this again. To capture how they described the requirement in their own words:
Would it be feasible to persist user-defined ops in the lake, the server, or anywhere else, like a GitHub repository or a file system, for inclusion and reuse in further queries? Let’s suppose Zed provides a new
includeoperator with an argument that describes the persistence support in which a series of ops would be stored.The way I see it, as we develop new ops for current queries, those would automatically become available to all new queries, possibly through the use of an include operator, or simply by default in the context of a lake or a server.