Coder Social home page Coder Social logo

clj-wrepl-example's Introduction

DEPRECATED: This project was used only to combine all the deps; clj-wrepl now can load its own deps

Example setup for clj-wrepl

Note: Right now the deps are on no public repo. So you need to install them locally.

This project combines clj-wrepl and some "plugins" into a configurable standalone REPL.

Build

Build an uberjar

lein uberjar

Run

% alias clj="java -jar target/uberjar/clj-0.1.0-SNAPSHOT-standalone.jar"
% clj --help
WREPL

wrepl [options...]

  -c, --config config.edn  Read the integrant system config from this file and merge it with the default
      --no-user-config     Don't load the default user config from $HOME/.wrepl.edn
  -i, --init script.clj    Run the given file before the first prompt
  -e, --eval string        Evaluate the expression (after --init if both given)
  -h, --help

A default config can be provided via ~/.wrepl.edn. Which should contain things, you always want to use. E.g. configure a printer and a color scheme:

{:wrepl/print #ig/ref :wrepl.puget/print
 :wrepl.puget/print {:seq-limit 20 
                     :color-scheme {:delimiter [:red]
                                    :string nil
                                    :character nil
                                    :keyword [:yellow]
                                    :symbol [:magenta]
                                    :function-symbol [:bold :magenta]
                                    :class-delimiter [:magenta]
                                    :class-name [:bold :magenta]}}}

For more specific REPLs provide additional setup. E.g. create a config file specter.edn with additional overrides:

{[:wrepl/append-init :wrepl/init] [#ig/ref :wrepl.specter/pomegranate
                                   #ig/ref :wrepl.specter/use-specter]
 [:wrepl.specter/pomegranate :wrepl.pomegranate/init] {:coordinates [[com.rpl/specter "1.0.3"]]}
 [:wrepl.specter/use-specter :wrepl.init/eval] {:expr "(use 'com.rpl.specter)"}}

And run it via the clj alias:

% clj -c specter.edn 
; (use (quote com.rpl.specter))
nil
user=> (transform [MAP-VALS even?] inc {:a 1 :b 2})
{:a 1, :b 3}
user=> 

clj-wrepl-example's People

Contributors

christoph-frick avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.