Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005678OCaml~DO NOT USE (was: OCaml general)public2012-07-11 07:242015-12-11 19:07
Assigned Todim 
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version 
Summary0005678: Unable to provide long (1024/4096+ character) inputs to the OCaml toplevel
DescriptionWhen using the OCaml toplevel, it will not accept more than 1024/4096 characters of input at a time. A line of input containing 1023/4095 characters can be followed by a return; a line of input containing 1024/4096 characters just beeps when any additional keys (letters, return, etc.) are pressed. Importantly, this *only* happens if OCaml is running interactively. Piping input in or reading input from a file does not cause any problems.

I've tested this on Mac OS X 10.6.7 and 10.7.4, with 3.12.1 from Homebrew (and 4.00.0+beta2 on the 10.6.7 system), I get this with 1024 characters every time. I believe the limit is 4096 characters on Linux systems, but I have not been able to check this directly (I have confirmed it second-hand).
Steps To ReproduceGenerate a 1023/4095 character string, e.g. by running `perl -e 'print ((" " x 1020) . "1;;")'` or `perl -e 'print ((" " x 4092) . "1;;")'`; copy and paste this into the top level; and try to continue typing.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
dim (developer)
2012-07-11 09:22

This is not a limitation of OCaml but a limitation of the terminal. The standard toplevel does not implement line edition, so the buffered input of the terminal is used, and this one has a limited capacity. You can observe the same behavior with the command "cat" for example.

In order to write long lines in the toplevel you have to launch it with a program like ledit or rlwrap, or you can also use utop.

- Issue History
Date Modified Username Field Change
2012-07-11 07:24 antalsz New Issue
2012-07-11 09:22 dim Note Added: 0007702
2012-07-11 09:24 dim Assigned To => dim
2012-07-11 09:24 dim Status new => assigned
2012-07-11 11:53 doligez Status assigned => resolved
2012-07-11 11:53 doligez Resolution open => no change required
2015-12-11 19:07 xleroy Status resolved => closed
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