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

Stream.junk has no effect on a Stream.of_channel until we use Stream.next #7769

Closed
vicuna opened this Issue Apr 10, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Apr 10, 2018

Original bug ID: 7769
Reporter: Michael_Perin
Assigned to: @nojb
Status: resolved (set by @nojb on 2018-04-11T12:27:13Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: Intel Core i7
OS: Mac OS
OS Version: 10.13.3
Version: 4.02.3
Category: standard library
Monitored by: @nojb

Bug description

On a stream made from a file, using Stream.of_channel, the function Stream.junk : 'a Stream.t -> unit
which should "Remove the first element of the stream, possibly unfreezing it before."
has no effect until we use Stream.next.

It behaves normally on a stream made from a string.

Here is a piece of code that demonstrates this strange behaviour.

Steps to reproduce

#create a file
echo "abcdefghijklmnopqrstuvwxyz" > alphabet.txt

execute the uploaded file

ocaml demo.ml

File attachments

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Apr 10, 2018

Comment author: @nojb

Reproduced on trunk.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Apr 10, 2018

Comment author: @nojb

Potential fix in #1714

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Apr 11, 2018

Comment author: @nojb

PR merged, will be in 4.07.

@vicuna vicuna closed this Apr 11, 2018

@vicuna vicuna added the stdlib label Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.