From f2a92e8eacef94ca5340bae7e04c76775d92725d Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Fri, 7 Jun 2019 17:29:15 -0600 Subject: [PATCH 1/2] Update README.md --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index f5c9daa..447457c 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,36 @@ Notable Differences like `@r_str` which in Julia can be called via `r""`, it is currently necessary to call these via standard macro syntax: `(@r_str "string")` + +REPL Mode +--------- +In order to avoid having to type out `lisp"( ... )"` for each top level expression, +one can use [ReplMaker.jl](https://github.com/MasonProtter/ReplMaker.jl) to make a +REPL mode for LispSyntax.jl +```julia +julia> using LispSyntax, ReplMaker + +julia> initrepl(LispSyntax.lisp_eval_helper, + prompt_text="λ> ", + prompt_color=:red, + start_key=")", + mode_name="Lisp Mode") +REPL mode Lisp Mode initialized. Press ) to enter and backspace to exit. +``` +As instructed, if we now press `)` at an empty `julia>` prompt, we enter `Lisp Mode`. +```julia +λ> (defn fib [a] (if (< a 2) a (+ (fib (- a 1)) (fib (- a 2))))) +fib (generic function with 1 method) + +λ> (fib 10) +55 +``` +to go back to vanilla julia, simply press the backspace button or `Ctr-C` +``` +julia> fib +fib (generic function with 1 method) + +``` TODO ---- From 9d3f4169be8a9428b0d396df015f877f711cc89b Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Fri, 7 Jun 2019 17:30:30 -0600 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 447457c..c931267 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ fib (generic function with 1 method) 55 ``` to go back to vanilla julia, simply press the backspace button or `Ctr-C` -``` +```julia julia> fib fib (generic function with 1 method)