Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Free variables in the query should be an ordered set, not just a set #116

Open
lvh opened this issue Mar 28, 2016 · 0 comments
Open

Free variables in the query should be an ordered set, not just a set #116

lvh opened this issue Mar 28, 2016 · 0 comments

Comments

@lvh
Copy link
Contributor

lvh commented Mar 28, 2016

Free variables in the query as returned by find-free-vars is currently a regular set. It should be a set (because if a free variable occurs n > 1 times in an expression it is still a single free variable), but it should be an ordered set because we're splicing it into fresh so you need to know the order in order to know what your results mean.

Since we don't touch the set once we created it, this may not be a problem since (seq free-vars) will always return a consistent value. However, having an ordered set would be nice because that makes that requirement explicit. Secondly, that would mean that (ideally) variables are returned in the order they appear in the query, which is nice.

Unfortunately it appears ordered types are only available externally (e.g. flatland/ordered) and not in the stdlib. This is problematic because it appears that library is not available for ClojureScript. Perhaps an acceptable return value for find-free-vars would even be an arbitrary seq; just with duplicate values removed; in which case we can just use distinct.

@lvh lvh added this to the Advanced querying milestone Mar 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant