Page
Library
Module
Module type
Parameter
Class
Class type
Source
This library provides a simple interface for reading user input in OCaml programs. The goal of this project is to reduce the burden of reading user input for programming language REPLs.
The feature that makes this library particularly useful is its handling of brackets. Any brackets that are opened must be closed before input is accepted.
read ~brackets:['(',')'] ~prompt:"prompt>" ""
prompt> (lambda
(x)
(+ x 1))
prompt>
val read : ?trim_delim:bool ->
?brackets:(char * char) list ->
?prompt:string ->
?strings:char list ->
delim:string ->
string
Parameter | Description |
---|---|
| Whether or not to remove the line delimiter from the return value. |
| Any characters that once opened must be closed before the line is accepted |
| Customizes the prompt displayed to the user. |
| If brackets are in strings, they won't have to be closed. |
| The string that, when found, halts scanning and returns the input. |
Contributions to ocamline
are greatly appreciated! ❤️
Please try to keep its implementation unassuming and configurable. 🙂