Currently if you use any of the methods of QueryResult it is expected to be used immediately. An example of how this behaviour could be a restriction is that you can't create a Snapshot following a query that has the :without() filter. And consequently impedes the implementation of View.
There are a few potential solutions:
Make the query lazily loaded, and have the user chain on .build() (or analogous) -This is not very ergonomic at all.
Let without modify the expand and next methods on QueryResult and return a new iterator - It is not clear how we would approach this and what issues it would create.
We add query modifiers and allow that to mark the set of components for which to include and exclude. For example for _ in world:query(With(...), Without(....)). - This is completely changing of the api surface and very unrealistic for us to implement.
Currently if you use any of the methods of
QueryResult
it is expected to be used immediately. An example of how this behaviour could be a restriction is that you can't create aSnapshot
following a query that has the:without()
filter. And consequently impedes the implementation ofView
.There are a few potential solutions:
.build()
(or analogous) -This is not very ergonomic at all.without
modify theexpand
andnext
methods on QueryResult and return a new iterator - It is not clear how we would approach this and what issues it would create.for _ in world:query(With(...), Without(....))
. - This is completely changing of the api surface and very unrealistic for us to implement.