- From: Dimitre Novatchev <dnovatchev@gmail.com>
- Date: Tue, 9 Dec 2025 11:59:43 -0800
- To: Christian Grün <cg@basex.org>
- Cc: Michael Kay <mike@saxonica.com>, "Liam R. E. Quin" <liam@fromoldbooks.org>, "public-xslt-40@w3.org" <public-xslt-40@w3.org>
- Message-ID: <CAK4KnZenLrmq+tH6dJPsL=G7QMTtVe=xmx5vWbAazxQqku=KCQ@mail.gmail.com>
> > I currently have a gut feeling that many of the use cases could be satisfied by a simple function such as > > > > generate-sequence($initial-state, $step) > > > > returning a sequence of states, where $step is a function that computes the next state from the current state. > > This reminds me a lot of the proposal made by Reece two years ago [1]. Several interesting questions had been asked in this thread, for example if "count(generate-> sequence(...))" would work, or, more generally, if the function would introduce a new value type that has no fixed size. > > [1] https://github.com/qt4cg/qtspecs/issues/708 A few quick observations: 1. The cited issue (#708) proposes that each value returned is an `item()`. And this excludes a value being a sequence. By definition, any value in a generator's yield can be a sequence. Thus no limitations and no sacrifices. 2. This seems problematic: Passing around and mixing/processing different instances of different intermediate results of several generate-sequence() instructions. With Generators this is done naturally. And "all these functions" are the "mixers" that produce any imagined, and even unanticipated processing and result. On Tue, Dec 9, 2025 at 10:36 AM Christian Grün <cg@basex.org> wrote: > > I currently have a gut feeling that many of the use cases could be > satisfied by a simple function such as > > > > generate-sequence($initial-state, $step) > > > > returning a sequence of states, where $step is a function that computes > the next state from the current state. > > This reminds me a lot of the proposal made by Reece two years ago [1]. > Several interesting questions had been asked in this thread, for example if > "count(generate-sequence(...))" would work, or, more generally, if the > function would introduce a new value type that has no fixed size. > > [1] https://github.com/qt4cg/qtspecs/issues/708 > >
Received on Tuesday, 9 December 2025 19:59:57 UTC