Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001284OCaml~DO NOT USE (was: OCaml general)public2002-07-31 07:222012-06-09 13:07
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.11.0 
Summary0001284: Fix offered for "illegal stream concatenation" in Stream
DescriptionThe documentation in Stream.mli says:

   Warning: these functions create streams with fast access; it is illegal
   to mix them with streams built with [[< >]]; would raise [Failure]
   when accessing such mixed streams.

As an example of this, the following code fails:

   open Stream;;
   npeek 20 (iapp (of_string "as") (icons 'z' (of_list ['d'; 'f'])));;

(This is an artificial example. The actual example that motivated me
has since been replaced by a workaround, so I don't have it
conveniently available.)

The resolution of bug 235 at;user=guest;selectid=235 [^]

reaffirms that this behavior is considered acceptable, but it doesn't make
sense to regard throwing an exception as better than computing a useful result.
I found it frustrating that the compiler wouldn't help me predict when a stream
operation would fail with the "illegal stream concatenation" error, so I
rewrote so all streams are valid inputs to all stream operations that
take streams as arguments.

I plugged it into the ocaml source from anonymous CVS and the compiler
was able to bootstrap fine. It also passes a fairly thorough unit
test that's in the comments at the end, and it has reasonable
performance according to the benchmark at the end of the test cases.

Is there any interest in incorporating this changed code into OCAML?

The revised .ml file is at [^]

and the .mli file (which is identical to the old version, except for a few
comments) is at [^]

As indicated by the header at the beginning of, I'm happy to
assign copyright on the rewritten file to INRIA if it gets incorporated into

Tim Freeman
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78

TagsNo tags attached.
Attached Files

- Relationships
parent of 0001289closed Speed improvement Stream replacement 
related to 0005644closedgasche Stream.count broken when used with Sapp or Slazy nodes 

-  Notes
doligez (administrator)
2012-01-25 15:50

This restriction was removed in 3.11.0 and the example now works (tested in 3.12.1). I am updating the documentation (stream.mli) by removing the paragraph in question.

Problem fixed in 3.11.0 (commit 8893), documentation fixed in trunk (3.13.0) (commit 12077).

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue
2012-01-25 15:50 doligez Note Added: 0006797
2012-01-25 15:50 doligez Status acknowledged => closed
2012-01-25 15:50 doligez Resolution open => fixed
2012-01-25 15:50 doligez Fixed in Version => 3.11.0
2012-01-25 15:50 doligez Description Updated View Revisions
2012-01-25 15:55 doligez Relationship added parent of 0001289
2012-06-09 13:07 gasche Relationship added related to 0005644
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker