:around for clojure.main/repl

17 views
Skip to first unread message

Kevin Downey

unread,
Mar 29, 2011, 4:18:56 PM3/29/11
to Clojure Dev
Current Status: clojure.main/repl always establishes a binding for
various vars like *1 *2 *3

Problem: if you have a domain specific repl that reuses
clojure.main/repl, designed to be launched from within a clojure repl,
sharing *1 *2 *3 with the outer clojure repl is a pain

Proposal: add an :around keyword argument to clojure.main/repl, the
value would by a function responsible for setting up any bindings to
exist around the repl

Details:
a domain specific repl is would be something like replacing eval in
the current repl with something that does an sql query instead of
evaluating clojure code.
implementation of :around would be a single arg function (fn [repl]
(binding [*1 ...] (repl))) similar to a fixture from clojure.test or a
hook from robert.hooke.

--
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

Kevin Downey

unread,
Apr 19, 2011, 2:04:26 PM4/19/11
to Clojure Dev
does lack of response mean there is no interest in this? or does it
mean Clojure/core is busy? is discussing on the mailing list still the
correct thing to do before just opening an issue in jira and attaching
a patch?

Stuart Sierra

unread,
Apr 19, 2011, 6:49:55 PM4/19/11
to cloju...@googlegroups.com
I expect the lack of response  indicates that no one else has encountered this particular problem.

Given the lack of response, I'd recommend just replacing clojure.main/repl with your own implementation.

-Stuart Sierra
clojure.com
Reply all
Reply to author
Forward
0 new messages