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

Expand .zip() specialization to .map() and .cloned() #37230

Merged
merged 1 commit into from
Oct 19, 2016

Commits on Oct 17, 2016

  1. Expand .zip() specialization to .map() and .cloned()

    Implement .zip() specialization for Map and Cloned.
    
    The crucial thing for transparent specialization is that we want to
    preserve the potential side effects.
    
    The simplest example is that in this code snippet:
    
    `(0..6).map(f).zip((0..4).map(g)).count()`
    
    `f` will be called five times, and `g` four times. The last time for `f`
    is when the other iterator is at its end, so this element is unused.
    This side effect can be preserved without disturbing code generation for
    simple uses of `.map()`.
    
    The `Zip::next_back()` case is even more complicated, unfortunately.
    bluss committed Oct 17, 2016
    Configuration menu
    Copy the full SHA
    ed50159 View commit details
    Browse the repository at this point in the history