Skip to content
/ gonrepl Public
forked from chazu/gonrepl

An nrepl client written in go

Notifications You must be signed in to change notification settings

mkmik/gonrepl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An nREPL client that reads Clojure code from standard input and writes the result to standard output.

Installation

Dependency

You need to install https://github.com/nrepl/nrepl

Binary release

Fetch a binary from https://github.com/mkmik/gonrepl/releases/latest

Source install

go install github.com/mkmik/gonrepl@latest

Usage

Leiningen has built-in support for nREPL since version 2. You can start a nREPL session with:

$ lein new app acmedemo
$ cd acmedemo
$ lein repl
nREPL server started on port 54344 on host 127.0.0.1 - nrepl://127.0.0.1:54344
REPL-y 0.5.1, nREPL 0.8.3
Clojure 1.10.3
OpenJDK 64-Bit Server VM 18.0.1+0
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

acmedemo.core=>

gonrepl talks to nREPL at the localhost:$LEIN_REPL_PORT address by default. Pass the -a flag to override the default address.

In another terminal you do:

$ export LEIN_REPL_PORT=54344
$ echo '(+ 1 2)' | gonrepl
3
$ echo '(println "foo")' | gonrepl
foo
nil

Related projects

  • acmeclj uses gonrepl to execute clojure expressions from the editor.

About

An nrepl client written in go

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%