Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seq function returns #45

Closed
puredanger opened this issue Oct 24, 2018 · 2 comments
Closed

Seq function returns #45

puredanger opened this issue Oct 24, 2018 · 2 comments

Comments

@puredanger
Copy link

In general, it is most flexible for sequence functions to be spec'ed as taking seqable? and returning seqable? (not seq?). The reasons for this are quite subtle, but there is a performance advantage to be had in cases where a sequence function can return something that avoids forcing the seq. We ran into this when the reducing/seqable work was done on range/cycle/iterate/repeat in 1.7. So, I'd just urge seqable? as the most generic alternative in most of those.

borkdude added a commit that referenced this issue Oct 24, 2018
borkdude added a commit that referenced this issue Oct 24, 2018
borkdude added a commit that referenced this issue Jan 11, 2019
@borkdude borkdude mentioned this issue Jan 11, 2019
borkdude added a commit that referenced this issue Jan 11, 2019
* Revert fcadece, see #45

* Update wording about sequence functions
@borkdude
Copy link
Owner

borkdude commented Jan 11, 2019

@puredanger Out of curiosity and documentation purposes I’d like to know some examples of this:

where a sequence function can return something that avoids forcing the seq

How can this be used if you cannot rely on a sequence function returning a sequence? You'd still have to call seq on it to be able to use it as a sequence?

@puredanger
Copy link
Author

All sequence functions call seq on their inputs so "using" it already does this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants