cosmin/IClojure
{ "createdAt": "2012-01-16T10:34:43Z", "defaultBranch": "master", "description": "A better Interactive REPL for Clojure", "fullName": "cosmin/IClojure", "homepage": "http://www.iclojure.com", "language": "Java", "name": "IClojure", "pushedAt": "2020-02-11T04:31:36Z", "stargazersCount": 115, "topics": [], "updatedAt": "2023-02-09T05:55:52Z", "url": "https://github.com/cosmin/IClojure"}IClojure
Section titled “IClojure”An Interactive Clojure repl, inspired by IPython.
Getting started
Section titled “Getting started”Standalone
Section titled “Standalone”The simplest way to start with IClojure is to download the latest standalone IClojure jar
curl -O -L http://clk.tc/iclojure-latest.jarjava -jar iclojure-latest.jarAlternatively, you can download the following script, mark it executable and put it somewhere in path
curl -O https://raw.github.com/cosmin/IClojure/master/bin/iclojurechmod +x iclojuresudo mv iclojure /usr/local/binThen you can simply launch iclojure at any time.
Leiningen
Section titled “Leiningen”If you are already using Leiningen the simplest way to get started with IClojure is to use the lein-iclojure plugin.
Leiningen 1.x
Section titled “Leiningen 1.x”lein plugin install lein-iclojure 1.2Leiningen 2
Section titled “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"] ]}}If you are already using the latest clojure-maven-plugin snapshot you can simply add IClojure to your dependencies
<dependency> <groupId>com.offbytwo.iclojure</groupId> <artifactId>iclojure</artifactId> <version>1.2.0</version></dependency>and then IClojure will replace the usual repl
mvn clojure:replDevelopment
Section titled “Development”IClojure ships with the latest alpha of Clojure 1.4, although it supports Clojure >= 1.2
git checkout https://github.com/cosmin/IClojurecd IClojurebin/run.shPackage
Section titled “Package”You can package IClojure for distribution, including sources and a standalone jar with
mvn clean packageThe iclojure-*-standalone.jar is a self-contained Jar that includes all the necessary dependencies.
Features
Section titled “Features”- Tab completion
- Shorthand for source and doc
- Shorthand for introspecting Java objects and classes via reflection
- Proper Control-C handling, although not very portable
- persist history across sessions to ~/.iclojure_history
- input and output caching of last 1000 elements
Tab completion
Section titled “Tab completion”- variable
- method invocations
- “(.method” completion for all java methods for any of the classes in the current namespace
- ”(. object method” completion for all the methods of the object (or a form that evaluates to an object)
- namespaces
- java classes
- import statements for both symbols and import lists
Input / output caching
Section titled “Input / output caching”In addition to the Clojure convention of caching the last 3 output in *1, *2 and *3 IClojure also caches the last 1000 input and output
(input 102) ; => returns the input from line 102(output 102) ; => returns the output from line 102Other shorthands
Section titled “Other shorthands” ?symbol => (doc symbol) ??symbol => (source symbol) %d symbol => show constructors, methods and fields of the given object or Class %f class => find all classes matching this name (supports globs) %f class package => like the above, but restrict search to the given packageRoadmap
Section titled “Roadmap”- tab completion for require and use forms
- abort long runing tasks with Ctrl+C
- launch editor from within IClojure
License
Section titled “License”Copyright (C) 2013 Cosmin Stejerean
Distributed under the Eclipse Public License, the same as Clojure.
