Permalink
Browse files

Leiningen build scheme, updated README.

  • Loading branch information...
1 parent c411157 commit fe381f9792eea41537d3c9b1886947a18dbc9970 @mmcgrana committed Dec 24, 2009
Showing with 62 additions and 78 deletions.
  1. +56 −0 README.md
  2. +0 −62 README.textile
  3. +0 −16 build.xml
  4. +6 −0 project.clj
View
@@ -0,0 +1,56 @@
+`clj-stacktrace` is a library for creating more readable stacktraces in Clojure programs.
+
+For example, to print a nice stack trace in a REPL:
+
+ => (use 'clj-stacktrace.repl)
+ => ("foo")
+ java.lang.ClassCastException: java.lang.String
+ user=> (pst) ;instead of (.printStackTrace *e)
+ java.lang.ClassCastException: java.lang.String
+ Compiler.java:4163 clojure.lang.Compiler.eval
+ core.clj:1497 clojure.core/eval
+ main.clj:148 clojure.main/repl[fn]
+ main.clj:145 clojure.main/repl
+ RestFn.java:876 clojure.lang.RestFn.invoke
+ repl_ln.clj:233 clojure.contrib.repl-ln/repl
+ RestFn.java:402 clojure.lang.RestFn.invoke
+ user.clj:71 user/eval
+ Compiler.java:4152 clojure.lang.Compiler.eval
+ Compiler.java:4480 clojure.lang.Compiler.load
+ RT.java:327 clojure.lang.RT.loadResourceScript
+ RT.java:312 clojure.lang.RT.loadResourceScript
+ RT.java:308 clojure.lang.RT.maybeLoadResourceScript
+ RT.java:446 clojure.lang.RT.doInit
+ RT.java:286 clojure.lang.RT.<clinit>
+ Namespace.java:31 clojure.lang.Namespace.<init>
+ Namespace.java:116 clojure.lang.Namespace.findOrCreate
+ main.java:21 clojure.main.<clinit>
+ (Unknown Source) java.lang.Class.forName0
+ Class.java:164 java.lang.Class.forName
+ ConsoleRunner.java:69 jline.ConsoleRunner.main
+ Caused by: java.lang.String
+ repl-1:1 user/eval
+ Compiler.java:4152 clojure.lang.Compiler.eval
+
+In stack traces printed by `pst`:
+
+* Java methods are described with the usual `name.space.ClassName.methodName` convention and Clojure functions with their own `name.space/function-name` convention.
+* Anonymous clojure functions are denoted by adding an `[fn]` to their enclosing, named function.
+* "Caused by" cascades are shown as in regular java stack traces.
+* Elements are vertically aligned for better readability.
+* Printing is directed to `*out*`.
+
+If you want to direct the printing to somewhere other than `*out*`, either use `pst-on` to specify the output location or `pst-str` to capture the printing as a string.
+
+The library also offers an API for programatically 'parsing' exceptions. This API is used internal for `pst` and can be used to e.g. improve development tools. Try for example:
+
+ => (use '(clj-stacktrace core))
+ => (try
+ ("nofn")
+ (catch Exception e
+ (parse-exception e)))
+
+License
+-------
+
+Copyright 2009 Mark McGranaghan and released under an MIT license.
View
@@ -1,62 +0,0 @@
-h2. clj-stacktrace
-
-clj-stacktrace is a library for creating more readable stacktraces in Clojure programs.
-
-To install, build using <code>ant</code> and include the resulting <code>clj-stacktrace.jar</code> in your classpath.
-
-One use for clj-stacktrace is it to print stack traces from the REPL:
-
-<pre><code>
-=> (use 'clj-stacktrace.repl)
-=> ("foo")
-java.lang.ClassCastException: java.lang.String
-user=> (pst) ;instead of (.printStackTrace *e)
-java.lang.ClassCastException: java.lang.String
- Compiler.java:4163 clojure.lang.Compiler.eval
- core.clj:1497 clojure.core/eval
- main.clj:148 clojure.main/repl[fn]
- main.clj:145 clojure.main/repl
- RestFn.java:876 clojure.lang.RestFn.invoke
- repl_ln.clj:233 clojure.contrib.repl-ln/repl
- RestFn.java:402 clojure.lang.RestFn.invoke
- user.clj:71 user/eval
- Compiler.java:4152 clojure.lang.Compiler.eval
- Compiler.java:4480 clojure.lang.Compiler.load
- RT.java:327 clojure.lang.RT.loadResourceScript
- RT.java:312 clojure.lang.RT.loadResourceScript
- RT.java:308 clojure.lang.RT.maybeLoadResourceScript
- RT.java:446 clojure.lang.RT.doInit
- RT.java:286 clojure.lang.RT.<clinit>
- Namespace.java:31 clojure.lang.Namespace.<init>
- Namespace.java:116 clojure.lang.Namespace.findOrCreate
- main.java:21 clojure.main.<clinit>
- (Unknown Source) java.lang.Class.forName0
- Class.java:164 java.lang.Class.forName
- ConsoleRunner.java:69 jline.ConsoleRunner.main
-Caused by: java.lang.String
- repl-1:1 user/eval
- Compiler.java:4152 clojure.lang.Compiler.eval
-</code></pre>
-
-In stack traces printed by <code>pst</code>:
-* Java methods are described with the usual <code>name.space.ClassName.methodName</code> convention and Clojure functions with their own <code>name.space/function-name</code> convention.
-* Anonymous clojure functions are denoted by adding an <code>[fn]</code> to their enclosing, named function.
-* "Caused by" cascades are shown as in regular java stack traces.
-* Elements are vertically aligned for better readability.
-* Printing is directed to <code>*out*</code>.
-
-If you want to direct the printing to somewhere other than <code>*out*</code>, either use <code>pst-on</code> to specify the output location or <code>pst-str</code> to capture the printing as a string.
-
-The library also offers an API for programatically 'parsing' exceptions. This API is used internal for <code>pst</code> and can be used to e.g. improve development tools. Try for example:
-
-<pre><code>
-=> (use '(clj-stacktrace core))
-=> (try
- ("nofn")
- (catch Exception e
- (parse-exception e)))
-</code></pre>
-
----
-
-Copyright 2009 Mark McGranaghan and released under an MIT license.
View
@@ -1,16 +0,0 @@
-<project name="clj-stacktrace" default="jar">
- <description> Pack all sources into a JAR. </description>
-
- <property name="jarfile" location="clj-stacktrace.jar"/>
-
- <target name="clean" description="Remove generated files and directories.">
- <delete file="${jarfile}"/>
- </target>
-
- <target name="jar" description="Create jar file.">
- <jar jarfile="${jarfile}">
- <path location="LICENSE"/>
- <fileset dir="./src" includes="clj_stacktrace/**/*.clj"/>
- </jar>
- </target>
-</project>
View
@@ -0,0 +1,6 @@
+(defproject clj-stacktrace "0.1.0-SNAPSHOT"
+ :description "More readable stacktraces in Clojure programs."
+ :url "http://github.com/mmcgrana/clj-stacktrace"
+ :dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"]
+ [org.clojure/clojure-contrib "1.0-SNAPSHOT"]]
+ :dev-dependencies [[lein-clojars "0.5.0-SNAPSHOT"]])

0 comments on commit fe381f9

Please sign in to comment.