All Projects → chrisnevers → ocamline

chrisnevers / ocamline

Licence: BSD-3-Clause license
👨🏻‍💻 Command line interface for user input

Programming Languages

ocaml
1615 projects

Projects that are alternatives of or similar to ocamline

all-seeing-bot
Repl.it discord moderation bot
Stars: ✭ 73 (+128.13%)
Mutual labels:  repl
NeoConsole
NeoConsole offers a command line (REPL) interface to a Pharo image, as well as other tools.
Stars: ✭ 22 (-31.25%)
Mutual labels:  repl
nim-noise
Nim implementation of linenoise command line editor
Stars: ✭ 45 (+40.63%)
Mutual labels:  repl
java-sheets
☕ Run Java Snippets in your Browser
Stars: ✭ 19 (-40.62%)
Mutual labels:  repl
integrant-repl
Reloaded workflow functions for Integrant
Stars: ✭ 115 (+259.38%)
Mutual labels:  repl
replbot
Slack/Discord bot for running interactive REPLs and shells from a chat.
Stars: ✭ 169 (+428.13%)
Mutual labels:  repl
cicada
Cicada Language
Stars: ✭ 9 (-71.87%)
Mutual labels:  repl
amqp-client
OCaml Amqp client library for Async and Lwt.
Stars: ✭ 58 (+81.25%)
Mutual labels:  ocaml-library
scope-capture-nrepl
nREPL middleware for scope-capture
Stars: ✭ 27 (-15.62%)
Mutual labels:  repl
nodeScratchpad
Evaluate Nodejs Code Snippets From Menubar! 💻
Stars: ✭ 102 (+218.75%)
Mutual labels:  repl
Nota
A calculator with a beautiful interface for the Terminal, Including unicode-based charting and rich mathematical notation rendering
Stars: ✭ 45 (+40.63%)
Mutual labels:  repl
ol
Otus Lisp (Ol in short) is a purely* functional dialect of Lisp.
Stars: ✭ 157 (+390.63%)
Mutual labels:  repl
lambda
lambda calculus interpreter
Stars: ✭ 23 (-28.12%)
Mutual labels:  repl
quac
Quoine Exchange API Console
Stars: ✭ 14 (-56.25%)
Mutual labels:  repl
huginn
Programming language with no quirks, so simple every child can master it.
Stars: ✭ 41 (+28.13%)
Mutual labels:  repl
tinker-zero
Bridge laravel/tinker for your laravel-zero applications
Stars: ✭ 39 (+21.88%)
Mutual labels:  repl
JShellStandalone
Provides a standalone version of the JShell REPL. Anything needed to run JShell independently is contained, so there is no need to install the full JDK. A minimal Java runtime is embedded and compressed using the jlink tool.
Stars: ✭ 36 (+12.5%)
Mutual labels:  repl
Replay.jl
Replay your REPL instructions
Stars: ✭ 24 (-25%)
Mutual labels:  repl
vue-code-view
A Vue 2 component like Vue SFC REPL `@vue/repl` : u can edit, run and preview the code effect display in real time on the web page.
Stars: ✭ 67 (+109.38%)
Mutual labels:  repl
ws-repl
MIGRATED TO https://vcs.rowanthorpe.com/rowan/ws-repl - THIS IS AN ARCHIVED VERSION... Arbitrary REPL in a web-page using websocketd
Stars: ✭ 38 (+18.75%)
Mutual labels:  repl

ocamline

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. This library uses ocaml-linenoise to provide rlwrap like functionality, including command history, arrow navigation, etc.

Example

Source Code:

read ~brackets:['(',')'] ~prompt:"lisp>" ()

Command Line:

lisp> (lambda
          (x)
          (+ x 1))
lisp>

API

val read :  ?trim_delim:bool ->
            ?brackets:(char * char) list ->
            ?prompt:string ->
            ?strings:char list ->
            ?history_loc:string ->
            ?hints_callback:(string -> (string * LNoise.hint_color * bool) option) ->
            ?completion_callback:(string -> LNoise.completions -> unit) ->
            ?delim:string ->
            unit ->
            string
Parameter Description Default Value
trim_delim Whether or not to remove the line delimiter from the return value. false
brackets Any characters that once opened must be closed before the line is accepted []
prompt Customizes the prompt displayed to the user. ">"
strings String delimiters. If brackets are in strings, they won't have to be closed. []
history_loc Where to store the history for the user commands ".ocamline_history.txt"
hints_callback Linenoise's hints callback. See here No op
completion_callback Linenoise's completion callback. See here No op
delim The string that, when found, halts scanning and returns the input. "" (* newlines *)

Contributions

Contributions to ocamline are greatly appreciated! ❤️

Please try to keep its implementation unassuming and configurable. 🙂

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].