• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaFolds / Transducers.jl / 315
93%

Build:
DEFAULT BRANCH: master
Ran 23 Jun 2019 10:38PM UTC
Jobs 2
Files 10
Run time 29s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
315

push

travis-ci-com

tkf
<a href="https://github.com/tkf/Transducers.jl/commit/<a class=hub.com/JuliaFolds/Transducers.jl/commit/74f8961fea97b746cb097b27aa5a5761e9bf4dae">74f8961fe<a href="https://github.com/JuliaFolds/Transducers.jl/commit/74f8961fea97b746cb097b27aa5a5761e9bf4dae">&quot;&gt;Do not call `complete` when reduced

Previously (&amp;lt;= v0.2.1), Transducers.jl was using

    val isa Reduced &amp;amp;&amp;amp; return reduced(complete(rf, unreduced(val)))

everywhere.  Or more precisely an equivalent macro:

    @​return_if_reduced complete(rf, val)

This actually was a bad idea because `complete` can call `next` hence
the reducing function at the &amp;quot;bottom.&amp;quot;  This violates the purpose of
`Reduced`; the reducing function must not be called after returning a
`Reduced`.  So, the correct way to do this is simply

    val isa Reduced &amp;amp;&amp;amp; return val

(I was initially doing this but it was changed to the v0.2.1 form
apparently to &quot;Improve PartitionBy&quot; </a><a class="double-link" href="https://github.com/tkf/Transducers.jl/commit/<a class="double-link" href="https://github.com/JuliaFolds/Transducers.jl/commit/12dd581158c449f23ca8b4d5d41409a83c96cf42">12dd58115</a>">12dd58115</a><a href="https://github.com/tkf/Transducers.jl/commit/74f8961fea97b746cb097b27aa5a5761e9bf4dae">.)

Fixing this requires some related changes:

* Previously, the private state of the transducers are `unwrap`&#39;ed
  during the `complete` phase.  However, now that `complete` will not
  be called always _by the transducible processes_ (e.g., `foldl`),
  the `unwrap`ping has to be done during the `next` call chain where
  the `Reduced` is created.

  This is treated by changing `wrap(rf, state, iresult::Reduced)`.

* Now that the transducible processes are not responsible for calling
  `complete`, aborting transducers must initiate `complete` for inner
  reducing functions (e.g., in `Take(4) |&gt; TakeLast(2)`, transducer
  `Take(4)` must call `complete` for `TakeLast(2)` to flush the buffer
  and invoke the downstream reducing functions).

  This change is introduced to `Take`, `TakeWhile`, and `Inject`.

620 of 816 relevant lines covered (75.98%)

203366.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 315.1 23 Jun 2019 10:38PM UTC 0
75.98
Travis Job 315.1
2 315.2 23 Jun 2019 10:38PM UTC 0
87.6
Travis Job 315.2
Source Files on build 315
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #315
  • 74f8961f on github
  • Prev Build on master (#309)
  • Next Build on master (#320)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc