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

Probable bug in stream #2625

Closed
vicuna opened this issue Nov 28, 2000 · 2 comments
Closed

Probable bug in stream #2625

vicuna opened this issue Nov 28, 2000 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 28, 2000

Original bug ID: 235
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Vladimir Támara
Version: 3.00
OS: GNU/LINUX
Submission from: gateway1-nehmer.informatik.uni-kl.de (131.246.19.252)

If I define a function to convert a stream of chars to a string like:

let rec string_of_stream str=
match str with parser
| [<'c>] -> (String.make 1 c)^(string_of_stream str)
| [<>] -> ""
;;

The following behavior is correct:

string_of_stream (Stream.of_string "Hi");;

  • : string = "Hi"

But I think the following is not:

string_of_stream [<Stream.of_string "Hi">];;
Uncaught exception: Failure "illegal stream concatenation".

(I saw with Stream.dump that Stream.of_string generates a Sgen while [<...>]
generates an Slazy, probably Slazy doesn't mix well with Sgen (?)).

@vicuna
Copy link
Author

vicuna commented Nov 28, 2000

Comment author: administrator

Hi,

On Tue, Nov 28, 2000 at 10:50:17AM +0100, vtamara@gnu.org wrote:

string_of_stream [<Stream.of_string "Hi">];;
Uncaught exception: Failure "illegal stream concatenation".

Implementation feature. It's specified in a comment in stream.mli.

--
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/

@vicuna
Copy link
Author

vicuna commented Nov 28, 2000

Comment author: administrator

Works as documented.

@vicuna vicuna closed this as completed Nov 28, 2000
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant