specter

Latest version: 1.1.3
puzzler 2019-08-13T22:50:35.017900Z

Is there a variant of select that returns a lazy sequence instead of a vector? I've tried things like (sequence (traverse ...)) but that doesn't work.

nathanmarz 2019-08-13T23:04:14.018500Z

@puzzler no

nathanmarz 2019-08-13T23:04:46.018800Z

but select-first and select-any early terminate if that's what you're looking for

puzzler 2019-08-13T23:24:25.020100Z

No, I need a lazy sequence because I'm producing a potentially large return value for a library API, and I don't know how people will consume it. But thanks for the info. I didn't realize select-first had early termination, since doc says it is no more efficient that select.

puzzler 2019-08-13T23:30:49.021100Z

For use case where you are substituting an existing get-in call where you want a nil return value, would you use select-first, select-one, or would you use select-any and then call its return value with a function to convert NONE to nil?

puzzler 2019-08-13T23:46:40.021600Z

Or maybe just use select-any and stick (nil->val nil) at the end of the navigator?

puzzler 2019-08-13T23:51:37.022Z

Ah, select-any returns nil in that particular case anyway. Never mind.