noprompt / meander

Tools for transparent data transformation
MIT License
921 stars 55 forks source link

`search` returns `nil` rather than `()` for no match #160

Closed dgr closed 3 years ago

dgr commented 3 years ago

In Epsilon, if you invoke search and no results are returned, it returns nil. Given that search generally returns a value that conforms to sequential? in all other cases (either a clojure.lang.PersistentList or a clojure.lang.LazySeq, depending on the exact macro expansion) and nil does not conform to sequential?, this suggests that () would be preferable. In particular, nil is not the same as the empty list in Clojure ( (= nil '()) is false).

noprompt commented 3 years ago

I apologize for the lack of response here. This was discussed in the Slack channel and I should have transferred the releveant bits here.

Unfortunately, for epsilon, there is little I can do to resolve this issue as changing the return type in this situation would technically be a breaking change. This is lame, I know, and I wish I had noticed this earlier. 😞