Skip to content
This repository has been archived by the owner on Jan 23, 2018. It is now read-only.

Commit

Permalink
allow start-repl to accept optional arguments to pass to start-server
Browse files Browse the repository at this point in the history
  • Loading branch information
bmillare committed Feb 9, 2010
1 parent da6cb50 commit 326162c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/swank/swank.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@

(defn start-repl
"Start the server wrapped in a repl. Use this to embed swank in your code."
([port]
(let [stop (atom false)]
([port & opts]
(let [stop (atom false)
opts (merge {:port port :encoding "iso-latin-1-unix"}
(apply hash-map opts))]
(repl :read (fn [rprompt rexit]
(if @stop rexit
(do (swap! stop (fn [_] true))
`(do (ignore-protocol-version nil)
(start-server "/tmp/slime-port.txt"
:encoding "iso-latin-1-unix"
:port ~port)))))
~@(apply concat opts))))))
:need-prompt #(identity false))))
([] (start-repl 4005)))

Expand Down

0 comments on commit 326162c

Please sign in to comment.