Commit Graph

27 Commits (ee8f71101b80496b2ec2c996d29ac33bbaf7cf00)

Author SHA1 Message Date
Damien Doligez ee8f71101b clean up whitespace and cut long lines 2016-02-17 13:36:27 +01:00
Gabriel Scherer b82ef62532 Remove out of date comment of Stream
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16472 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:34 +00:00
Gabriel Scherer 1640764c12 Rename type data' to cell in Stream
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16471 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:33 +00:00
Gabriel Scherer d4ff2bccc1 Remove last Obj.magic in Stream
(Pierre Chambart)

Turn Stream.data into a GADT to ensure that streams built with the
Sbuffio constructor are char streams.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16470 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:32 +00:00
Gabriel Scherer 2ac862f27d Make Stream a less unsafe
(Pierre Chambart)

Stream used to modify blocks allocated as immutable. This Get rid of
most Obj module invocations in this module.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16469 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:30 +00:00
Alain Frisch aeead32662 #6500: add String.init, Bytes.init, Labels couterparts, Stream.of_byte. (Cherry-picked from 15029 on 4.02.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15030 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-28 13:29:50 +00:00
Damien Doligez 5b8df637d2 merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Gabriel Scherer cdd43f2800 PR#5644: a dumbed-down fix to fix the observable effect (Stream.of_string) with no change to the underlying code (to avoid regressions)
As I learned the hard way, it is essentially impossible to get
a satisfying behavior in presence of a mix of updates, concatenations
and counts. The best thing to do is thus to not change anything
(a good way to preserve compatibility), and only fix the
Stream.of_string function to assume nothing of the count passed to the
[from] function.

I also modified the mli documentation of [Stream.from] to warn other
users of this potential pitfall.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13915 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-21 20:03:52 +00:00
Gabriel Scherer 4574c718f8 Revert the changes of revision 12682 (PR#5644 Stream.count broken when used with Sapp or Slazy nodes) because of regressions identified by hongboz
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13914 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-21 20:02:29 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 997a678d5e clean up TABs and whitespace
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12799 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-30 18:04:46 +00:00
Gabriel Scherer bc139ae14e PR#5644: Stream.count broken when used with Sapp or Slazy nodes
There is a bug in the way concatenating operations work when combined
with `Sgen`-defined stream (Stream.from, Stream.of_string): the
concatenation functions reset the `count` field to 0, which disturbs
the Sgen producer.

While the fix in the Scons case is easy (instead of 0, set
the count to `original_count - 1`), fixing the Sapp case is more
delicate (we can't predict the size of the prepended stream). Our
technique is to change the stored left-hand-side to not the stream
data only, but the whole stream, count included.
Once we detect the prepended stream was completely consumed, we can
then restore the count to its previous value, so that Sgen's function
can be provided correct count information. This required a change in
the internal `get_data` implementation.

Slazy-constructed streams have the exact same issue: we don't know
their count before forcin them. Again, `get_data` is changed to
dynamically update the count at forcing time.



git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12682 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-10 09:58:38 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Michel Mauny d0d6af3c16 Remove restrictions to stream concatenation, and use Lazy.t for the argument
of the Slazy data constructor.
Affected files: stdlib/{stream.ml,.depend,Makefile}


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8893 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-06-18 15:35:02 +00:00
Xavier Leroy 7501784c80 MAJ en-tetes pour mentionner la 'special exception' sur la LGPL
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4144 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-12-07 13:41:02 +00:00
Xavier Leroy cc0f32b054 Changement de la licence
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-17 18:59:06 +00:00
Xavier Leroy 5038f3cdb6 Ajout de Pervasives.ignore. List.remove -> List.remove_ass*
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2304 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-02-24 15:21:50 +00:00
Daniel de Rauglaudre f8c39b7d67 Message d'erreur manquant (était indiqué par erreur comme "erreur interne").
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2139 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1998-11-02 23:27:22 +00:00
Damien Doligez c194d39545 Paresseux.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1716 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1997-10-14 13:17:48 +00:00
Daniel de Rauglaudre 45ffca1009 Nouvelle version des Streams
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1612 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1997-06-16 15:33:44 +00:00
Xavier Leroy dfb5710a14 Utilisation de Sys.os_type. Nettoyages exceptions (failwith -> invalid_arg)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1170 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1996-11-07 11:00:19 +00:00
Xavier Leroy 2301d778e7 Renommage en Objective Caml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@782 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1996-04-30 14:53:58 +00:00
Daniel de Rauglaudre e5884f1b62 Les fonctions de streams rapides, "from", "of_channel", etc. ne peuvent plus
se me'langer avec les streams normaux.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@518 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-12-07 19:44:19 +00:00
Daniel de Rauglaudre d80ae19644 Mutables in buffio (do not compromise streams polymorphism).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@447 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-11-15 13:50:40 +00:00
Daniel de Rauglaudre f67cf2d0cd Modify interface & comments.
Implement with Obj.set_field instead of mutable to accept polymorphic empty
streams (worked before because of a bug in type checking).


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@439 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-11-13 13:29:51 +00:00
Daniel de Rauglaudre b6e330b089 Add "iter". Change comments.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@437 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-11-10 15:15:12 +00:00
Daniel de Rauglaudre c23136aa3e Library module for streams and parsers. Very first version.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@423 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-11-09 11:04:31 +00:00