Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
48 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,10 @@ | ||
#!/bin/bash | ||
|
||
USER_CLJ_DIR=/Users/mmcgrana/Clojure | ||
SHARED_JARS_DIR=$USER_CLJ_DIR/jars | ||
|
||
# Local src, test, and classes | ||
CP=src/:test/:classes/ | ||
|
||
# Local jars | ||
if [ -d jars ]; then | ||
for file in jars/*.jar; do | ||
CP=$CP:$file | ||
done | ||
fi | ||
|
||
# Global jars. | ||
for file in $SHARED_JARS_DIR/*.jar; do | ||
CP=$CP:$file | ||
done | ||
|
||
if [ -z "$1" ]; then | ||
echo "USAGE: cljp <script_file.clj>" | ||
rlwrap java -Xmx2g -cp `cljcp` clojure.contrib.repl_ln | ||
else | ||
java -cp $CP clojure.main $@ | ||
fi | ||
java -server -Xmx2g -cp `cljcp` clojure.main $USER_CLJ_DIR/run.clj $@ | ||
# java -server -Xmx2g -cp `cljcp` clojure.main $@ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
USER_CLJ_DIR=/Users/mmcgrana/Clojure | ||
|
||
# Local src, test, and classes | ||
CP=./:src/:src/clj/:src/main/clojure/ | ||
CP=$CP:test/:src/test/clojure/ | ||
CP=$CP:classes/ | ||
|
||
# Either local or glocal jars, but not both | ||
if [ -d lib ]; then | ||
for file in lib/*.jar; do | ||
CP=$CP:$file | ||
done | ||
else | ||
for file in $USER_CLJ_DIR/jars/*.jar; do | ||
CP=$CP:$file | ||
done | ||
fi | ||
|
||
# For user.clj | ||
CP=$CP:$USER_CLJ_DIR | ||
|
||
echo $CP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,10 @@ | ||
#!/bin/bash | ||
|
||
USER_CLJ_DIR=/Users/mmcgrana/Clojure | ||
SHARED_JARS_DIR=$USER_CLJ_DIR/jars | ||
YOURKIT_DYLB="/Applications/YourKit.app/bin/mac/libyjpagent.jnilib" | ||
|
||
# Local src, test, and classes | ||
CP=src/:test/:classes/ | ||
|
||
# Local jars | ||
if [ -d jars ]; then | ||
for file in jars/*.jar; do | ||
CP=$CP:$file | ||
done | ||
fi | ||
|
||
# Global jars. | ||
for file in $SHARED_JARS_DIR/*.jar; do | ||
CP=$CP:$file | ||
done | ||
|
||
if [ -z "$1" ]; then | ||
echo "USAGE: cljp <script_file.clj>" | ||
echo "Usage: cljp <script_file.clj>" | ||
else | ||
java -cp $CP -agentpath:$YOURKIT_DYLB clojure.main $@ | ||
fi | ||
java -server -agentpath:$YOURKIT_DYLB -Xmx2g -cp `cljcp` clojure.main $USER_CLJ_DIR/run.clj $@ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(use 'clj-stacktrace.repl) | ||
(import 'clojure.lang.Compiler) | ||
|
||
(let [script-path (first *command-line-args*) | ||
script-args (rest *command-line-args*)] | ||
(binding [*command-line-args* script-args] | ||
(try | ||
(Compiler/loadFile script-path) | ||
(catch Exception e | ||
(pst-on *err* true e) | ||
(System/exit 1))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,8 @@ | ||
;; Announce | ||
(println "REPL Extensions") | ||
|
||
;; Always-used libs | ||
(use | ||
'(clojure.contrib repl-utils repl-ln duck-streams) | ||
'clj-backtrace.repl) | ||
|
||
;; Macroexpansion utils | ||
(defn- mapr | ||
"recursively maps a function to a sequence and | ||
subsequences within the map results." | ||
[f & sequence] | ||
(defn maprec [form] | ||
(if (seq? form) | ||
(map maprec (f form)) | ||
form)) | ||
(first (maprec sequence))) | ||
|
||
(defn macroexpand-r | ||
"Expands all macros in a form and its subforms." | ||
[forms] | ||
(mapr macroexpand forms)) | ||
|
||
(defn macroexpand-only | ||
"Expands all macros in a form and its subforms that match a given symbol." | ||
[macro forms] | ||
(mapr | ||
(fn [f] (if (= macro (first f)) (macroexpand f) f)) | ||
forms)) | ||
'(clojure.contrib repl-utils) | ||
'(clj-stacktrace repl)) | ||
|
||
;; General REPL functions | ||
(defn quit | ||
"Quit the clojure process with a 0 status code." | ||
[] | ||
(System/exit 0)) | ||
|
||
(defn r | ||
"Enter the line-numbering repl" | ||
[] | ||
(repl)) | ||
|