Giter VIP home page Giter VIP logo

lein-iclojure's Introduction

lein-iclojure

IClojure plugin for Leiningen.

Installation

Leiningen 1.x

lein plugin install lein-iclojure 1.2

Leiningen 2

Add [lein-iclojure "1.2"] to the :user profile in ~/.lein/profiles.clj. Here is an example

{:user {:plugins [ [lein-iclojure "1.2" ]}}

Usage

To launch an IClojure REPL within the context of a project you'll have to use trampoline.

lein trampoline irepl

To launch a standalone IClojure REPL you can simply run

lein irepl

Trampoline and project classpath

By default the current version of Leiningen runs code that needs a project classpath in a subprocess. The problem is this blocks access to user input, and is therefore not appropriate for IClojure.

We can try to cheat by running IClojure in a separate classloader, however this won't provide the necessary classpath isolation. For example, IClojure will use the version of Clojure that ships with Leiningen (1.2.1) instead of the version required by the project.

Therefore the only available option is to use trampoline. This is a facility provided by Leiningen to get around the limitations above. When running a task within trampoline, Leiningen will execute that task after Leiningen's JVM exit.

License

Copyright (C) 2013 Cosmin Stejerean

Distributed under the Eclipse Public License, the same as Clojure.

lein-iclojure's People

Contributors

cosmin avatar

Stargazers

 avatar Stefan Zimmermann avatar Felix Riedel avatar Cox Chen avatar Sean Neilan avatar number23 avatar  avatar

Watchers

 avatar Sean Neilan avatar James Cloos avatar

Forkers

coxchen

lein-iclojure's Issues

doesn't evaluate expressions after it sees a comment at the start of a line

If a line starts with a comment, irepl gets stuck on that input line. Probably not an issue for interactive evaluation but a bummer when copy/pasting code.

Transcript below:

$ lein irepl
log4j:WARN No appenders could be found for logger (com.offbytwo.class_finder.ClassFinder).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Clojure 1.4.0

IClojure 1.1.1 -- an enhanced Interactive Clojure
? -> Introduction and overview of IClojure's features
?symbol -> Print documentation for symbol
??symbol -> Show source of function or macro
%d symbol -> Describe Java class (show constructors, methods and fields)
%f class -> find all classes matching this name (supports globs)
%f class package -> like the above, but restrict search to the given package

user[1]: (+ 1 2)
user[1]= 3

user[2]: (+ 1 2) ;end of line comment OK
user[2]= 3

user[3]: ;; start of line comment not OK
...: (+ 1 2)
...:
...:
...:
...:
...:
...: ;;hitting ^C here
...:
Keyboard Interrupt

user[3]:

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.