Open silky opened 1 month ago
all
is a function that returns a query, not a query, so to find everything, you need to say find (all)
Semantically, a function is only called implicitly if the symbol appears as the first argument in a (potentially nested) sequence of tokens, so in find all
the function bound to the find
symbol is called, and passed the function bound to the all
symbol as an argument. In find (all)
, the function bound to the all
symbol is first called with no arguments, and the result (a query that matches anything indexed) is passed to find
Ah great; thanks for the clarification!
Can confirm that find (all)
does exactly what I expected :)
The shell interface doesn't seem perfectly specified, and this results in significant confusion about how to run expressions.
For example, the following Python returns all things in the world:
But it doesn't seem possible to run this query in the UI:
Gives:
But the documentation for for
find
indicates that it does take aQuery
; which is whatall
is.There are probably many more examples of this problem; so this issue is related to #283 in terms of documenting precisely how to use this feature.
The main outcome to seek here is clear indications of what is possible. Maybe we only want to support tag-based querying ( cc @gacafe ) , in which case queries like the above should be rejected, and not just result in a type error.