cosmin / iclojure Goto Github PK
View Code? Open in Web Editor NEWA better Interactive REPL for Clojure
Home Page: http://www.iclojure.com
License: Eclipse Public License 1.0
A better Interactive REPL for Clojure
Home Page: http://www.iclojure.com
License: Eclipse Public License 1.0
Multi-line editing would be significantly more productive for working with Clojure at the REPL. Getting this to work with the current state of jline2 might prove challenging however
http://www.iclojure.com/ requires me to enable all 3 domains before the page shows up.
I expect the page to work without JavaScript or at least show message about JS requirement.
Hey Cosmin,
Just wanted to give a heads-up that the jline artifact is now under the "jline" groupId.
I'd put a github issue in about a release, and that's one of the things that came out of it. No full release yet as far as I know.
λ java -jar iclojure-1.0-SNAPSHOT.jar
Clojure 1.4.0-alpha4
IClojure 1.0 -- 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)
user[1]: (def d (Integer. 1))
user[1]= #'user/d
user[2]: %d
Exception in thread "main" java.lang.RuntimeException: EOF while reading
at clojure.lang.Util.runtimeException(Util.java:170)
at clojure.lang.LispReader.read(LispReader.java:165)
at clojure.lang.RT.readString(RT.java:1691)
at com.offbytwo.iclojure.Main.read(Main.java:109)
at com.offbytwo.iclojure.Main.loop(Main.java:177)
at com.offbytwo.iclojure.Main.main(Main.java:227)
IClojure is mostly written in Java now... is it possible to do much of the work in Clojure itself so making port on clojurescript can be less painful as possible?
Hi There,
I just discover your project,
I think you might be interested by
http://nbviewer.ipython.org/4279371/node-kernel.ipynb
and
It would be really great, you would inherit all the frontend (notebook included) for free,
and would love to have native support for other languages in IPython.
Thanks !
user[3]: ;; start of line comment not OK
...: (+ 1 2)
...:
...:
Currently the non-first form seems to be just ignored by IClojure:
user[4]: 4 whatever
user[4]= 4
It can be useful to simplify function calls by allowing to omit parentheses (on top level) in such cases, so, for example, Math/sin 4
will be interpreted as (Math/sin 4)
. Tab completion can optionally auto-insert parentheses as well, like + 4 <tab>
-> (+ 4 <cursor>)
.
Some other for-convenience rules can apply, like "qwe" .sta<tab>
-> (. "qwe" startsWith<cursor>)
or (.startsWith<cursor> "qwe")
.
The content of that website seems to be not related to this project.
IClojure should support nrepl. This will eliminate the need for trampoline inside lein-iclojure
Upgrade to 0.2.2 of clojure-complete
[user@host]$ iclojure
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-SNAPSHOT -- 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]: (map vec :a)
Exception in thread "main" java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword
at clojure.lang.RT.seqFrom(RT.java:494)
at clojure.lang.RT.seq(RT.java:475)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$map$fn__465.invoke(core.clj:2426)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:473)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$print_sequential.invoke(core_print.clj:46)
at clojure.core$eval1962$fn__1963.invoke(core_print.clj:140)
at clojure.lang.MultiFn.invoke(MultiFn.java:167)
at clojure.core$pr_on.invoke(core.clj:3266)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.RT.print(RT.java:1717)
at clojure.lang.RT.printString(RT.java:1696)
at com.offbytwo.iclojure.repl.IClojureRepl.print(IClojureRepl.java:134)
at com.offbytwo.iclojure.repl.IClojureRepl.loop(IClojureRepl.java:154)
at com.offbytwo.iclojure.Main.main(Main.java:63)
[user@host]$ # we're back at the shell, since Iclojure exited unexpectedly.
the repl does:
user=> (map vec :a)
IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Keyword clojure.lang.RT.seqFrom (RT.java:494)
user=> ;; we're still inside the REPL..
$ java -jar ~/bin/iclojure-latest.jar
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-SNAPSHOT -- an enhanced Interactive Clojure
.....
user[1]: (. qqqqq ;;TAB completion attempt here
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: qqqqq in this context, compiling:(NO_SOURCE_PATH:0)
When issued '?', this is shown:
user[2]: ?
doc => show documentatio...
source => ...
...
(input i) => return the input from line i
(output i) => return the output from line i
Here is not stated how 'doc' or 'source' should be used (as they are clojure functions) and when I installed IClojure for the first time, I thought they are commands, and should be used like:
user[2]: source "map"
or
user[3]: dir user
Documentation for given commands should be the same as for 'input/output' or (which is much better) it could be implemented as commands (like %d).
Also, when IClojure is started, one options are printed (?symbol, %d) but when ? is issued, they are not visible.
Thanks.
I've found ClojureDocs to be an invaluable reference for its user-contributed examples. Too bad you need to visit it in a browser. But now there's a great little cd-client to access it from the REPL. It would seem like a nice fit for IClojure to support its cdoc
-like lookup. So two things that IClojure could add:
cdoc
(like ?foo
and ??foo
)Neither is critical, but would be nice-to-haves.
IClojure will by default output prompt in blue (including current namespace) and stacktrace bar in red. These colors looks bad in terminal with black background (I often use this setup) and the prompt is practically not visible.
Using Home & End keys just result in "H" and "F" chars getting printed, expected ?
For longer ipython-sessions, I regularly use the %edit functionality, which opens an editor (defined in $EDITOR) and upon closing the editor, returns the contents in a string to the interactive shell.
With python, the functionality is really nice when needing to insert custom classes in your ipython session, those indentations are much more easily managed in a sane editor than in the shell. The same is the case for me when trying to keep track of the parentheses.
See http://ipython.org/ipython-doc/rel-0.12/interactive/tips.html#lightweight-version-control for reference.
I was wondering if you'd be willing to cut a new release now that you're using JLine 2.9. I'm working on a Java/Clojure project in a group, and I often update my local pom file to point to IClojure 1.2.0-SNAPSHOT so that I can take advantage of JLine, but I can't check that in without something to refer to -- we don't have a team maven repo yet.
I have found that autocomplete is not working in such case
(def x (interl<TAB>
nothing happens, while REPL-y appends to interleave
Switch to sjacket for checking the currently entered input instead of having to rely on the reader.
Hi, can't find your jline2 fork in maven central or clojars?
cheers
Colin
Downloading: net/sf/jline/jline/2.6-SNAPSHOT/jline-2.6-20120211.211349-7.jar from repository sonatype-nexus-snapshots at https://oss.sonatype.org/content/repositories/snapshots
Unable to locate resource in repository
An error has occurred while processing the Maven artifact tasks.
Diagnosis:
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=net.sf.jline -DartifactId=jline -Dversion=2.6-20120211.211349-7 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=net.sf.jline -DartifactId=jline -Dversion=2.6-20120211.211349-7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.apache.maven:super-pom:pom:2.0
2) com.offbytwo.iclojure:iclojure:jar:1.0.2-SNAPSHOT
3) net.sf.jline:jline:jar:2.6-SNAPSHOT
1 required artifact is missing.
for artifact:
org.apache.maven:super-pom:pom:2.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
clojars (http://clojars.org/repo/)
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=net.sf.jline -DartifactId=jline -Dversion=2.6-20120211.211349-7 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=net.sf.jline -DartifactId=jline -Dversion=2.6-20120211.211349-7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.apache.maven:super-pom:pom:2.0
2) com.offbytwo.iclojure:iclojure:jar:1.0.2-SNAPSHOT
3) net.sf.jline:jline:jar:2.6-SNAPSHOT
1 required artifact is missing.
for artifact:
org.apache.maven:super-pom:pom:2.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
clojars (http://clojars.org/repo/)
(NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:551)
at clojure.lang.Var.invoke(Var.java:390)
at clojure.lang.AFn.applyToHelper(AFn.java:193)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=net.sf.jline -DartifactId=jline -Dversion=2.6-20120211.211349-7 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=net.sf.jline -DartifactId=jline -Dversion=2.6-20120211.211349-7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.apache.maven:super-pom:pom:2.0
2) com.offbytwo.iclojure:iclojure:jar:1.0.2-SNAPSHOT
3) net.sf.jline:jline:jar:2.6-SNAPSHOT
1 required artifact is missing.
for artifact:
org.apache.maven:super-pom:pom:2.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
clojars (http://clojars.org/repo/)
at org.apache.maven.artifact.ant.DependenciesTask.doExecuteResolution(DependenciesTask.java:268)
at org.apache.maven.artifact.ant.DependenciesTask.doExecute(DependenciesTask.java:168)
at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:751)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:90)
at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:265)
at leiningen.deps$do_deps.invoke(deps.clj:133)
at leiningen.deps$deps.doInvoke(deps.clj:198)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at leiningen.install$install.invoke(install.clj:75)
at leiningen.plugin$install.invoke(plugin.clj:52)
at leiningen.plugin$plugin.invoke(plugin.clj:83)
at clojure.lang.Var.invoke(Var.java:373)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:540)
at leiningen.core$apply_task.invoke(core.clj:265)
at leiningen.core$_main.doInvoke(core.clj:331)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:334)
at user$eval42.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 11 more
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=net.sf.jline -DartifactId=jline -Dversion=2.6-20120211.211349-7 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=net.sf.jline -DartifactId=jline -Dversion=2.6-20120211.211349-7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.apache.maven:super-pom:pom:2.0
2) com.offbytwo.iclojure:iclojure:jar:1.0.2-SNAPSHOT
3) net.sf.jline:jline:jar:2.6-SNAPSHOT
1 required artifact is missing.
for artifact:
org.apache.maven:super-pom:pom:2.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
clojars (http://clojars.org/repo/)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:360)
at org.apache.maven.artifact.ant.DependenciesTask.doExecuteResolution(DependenciesTask.java:263)
... 36 more
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.