clojure.repl

86 views
Skip to first unread message

Mark Engelberg

unread,
Nov 17, 2012, 12:22:18 AM11/17/12
to clojured...@googlegroups.com
I noticed that in the latest plugin, the REPL no longer seems to automatically include the clojure.repl namespace.  Is this change intentional?

Chas Emerick

unread,
Nov 18, 2012, 4:15:58 PM11/18/12
to clojured...@googlegroups.com

The new behaviour is now in line with the standard Clojure REPL.  That said, there is something to be said for one's REPL referring certain vars into *ns* on every in-ns (I particularly miss having pp available everywhere, for example, and I'm sure others would like to be able to always have non Clojure core fns directly available as well).  The easiest way to do this would be to provide some configuration option for prepending a set of forms to each eval; whether that should live in CCW or nREPL is unclear at the moment.

- Chas

On Nov 17, 2012, at 12:22 AM, Mark Engelberg wrote:

I noticed that in the latest plugin, the REPL no longer seems to automatically include the clojure.repl namespace.  Is this change intentional?

--
You received this message because you are subscribed to the Google Groups "counterclockwise-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/clojuredev-users/-/d8u3xefiQqsJ.
To post to this group, send email to clojured...@googlegroups.com.
To unsubscribe from this group, send email to clojuredev-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/clojuredev-users?hl=en.

Mark Engelberg

unread,
Nov 18, 2012, 8:52:00 PM11/18/12
to clojured...@googlegroups.com
On Sun, Nov 18, 2012 at 1:15 PM, Chas Emerick <ch...@cemerick.com> wrote:

The new behaviour is now in line with the standard Clojure REPL.  

OK.
 
That said, there is something to be said for one's REPL referring certain vars into *ns* on every in-ns (I particularly miss having pp available everywhere,

Isn't that what the :injections key in project.clj is supposed to do?

Chas Emerick

unread,
Nov 20, 2012, 5:08:41 PM11/20/12
to clojured...@googlegroups.com
On Nov 18, 2012, at 8:52 PM, Mark Engelberg wrote:

That said, there is something to be said for one's REPL referring certain vars into *ns* on every in-ns (I particularly miss having pp available everywhere,

Isn't that what the :injections key in project.clj is supposed to do? 

No; forms added there are evaluated when the REPL starts, but at no other time.

- Chas

Laurent PETIT

unread,
Nov 20, 2012, 5:13:34 PM11/20/12
to clojured...@googlegroups.com
Hi,

2012/11/18 Chas Emerick <ch...@cemerick.com>


The new behaviour is now in line with the standard Clojure REPL.  That said, there is something to be said for one's REPL referring certain vars into *ns* on every in-ns (I particularly miss having pp available everywhere, for example, and I'm sure others would like to be able to always have non Clojure core fns directly available as well).  The easiest way to do this would be to provide some configuration option for prepending a set of forms to each eval; whether that should live in CCW or nREPL is unclear at the moment.

Should it live in CCW would probably make it tedious to split out the result from nrepl's server (we don't want to echo the result of the prepended commands in the log area, etc.) ? 
Also, having it in nREPL (and thus in nREPL's config) would allow more sharing between users for the 'dev' leiningen profile ?

My opinion is not formed yet, just sharing current thoughts ...

Mark Engelberg

unread,
Apr 23, 2013, 10:12:45 PM4/23/13
to clojured...@googlegroups.com
A while back, we discussed :injections.  At the time, I was mourning the change away from having clojure.repl always present in the REPL.  It gets tedious to always have to type (use 'clojure.repl) before using doc or pst.  Putting :injections in the project.clj was the closest thing, but only worked to include the clojure.repl vars in the first namespace you start up.

I notice that in the most recent version, :injections doesn't seem to work at all.  I find this curious since the new version seems to generally have better support for leiningen project settings.

What is the current state of things regarding injections, and is there an alternative way to get clojure.repl vars available in the REPL?

Thanks,

Mark

Laurent PETIT

unread,
Apr 25, 2013, 5:31:14 AM4/25/13
to clojuredev-users
Hello Mark,

2013/4/24 Mark Engelberg <mark.en...@gmail.com>:
> A while back, we discussed :injections. At the time, I was mourning the
> change away from having clojure.repl always present in the REPL. It gets
> tedious to always have to type (use 'clojure.repl) before using doc or pst.
> Putting :injections in the project.clj was the closest thing, but only
> worked to include the clojure.repl vars in the first namespace you start up.

Yes, AFAICT that's still a restriction in Leiningen 2: the REPL server
does not honor :injections (yet?)


> I notice that in the most recent version, :injections doesn't seem to work
> at all. I find this curious since the new version seems to generally have
> better support for leiningen project settings.
>
> What is the current state of things regarding injections, and is there an
> alternative way to get clojure.repl vars available in the REPL?

I'd say I would not expect :injections to work with the stable 0.12.3
version, since it does not honor at all what is in project.clj (but
the :dependencies stuff).

I can see it working with the 0.13 beta version, as expected (with the
restriction that it's indeed only working for the first namespace used
when leiningen starts up).

>
> Thanks,
>
> Mark
>
>
> On Tuesday, November 20, 2012 2:08:43 PM UTC-8, Chas Emerick wrote:
>>
>> On Nov 18, 2012, at 8:52 PM, Mark Engelberg wrote:
>>
>>> That said, there is something to be said for one's REPL referring certain
>>> vars into *ns* on every in-ns (I particularly miss having pp available
>>> everywhere,
>>
>>
>> Isn't that what the :injections key in project.clj is supposed to do?
>>
>>
>> No; forms added there are evaluated when the REPL starts, but at no other
>> time.
>>
>> - Chas
>
> --
> You received this message because you are subscribed to the Google Groups
> "counterclockwise-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojuredev-use...@googlegroups.com.
>
> To post to this group, send email to clojured...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojuredev-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages