This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-04
Channels
- # announcements (7)
- # babashka (32)
- # beginners (106)
- # bristol-clojurians (10)
- # cider (6)
- # clj-kondo (5)
- # cljdoc (10)
- # clojure (110)
- # clojure-australia (10)
- # clojure-dev (6)
- # clojure-europe (12)
- # clojure-nl (2)
- # clojure-norway (16)
- # clojure-spec (9)
- # clojure-uk (59)
- # clojurescript (105)
- # community-development (2)
- # conjure (46)
- # cursive (12)
- # data-science (1)
- # datalog (26)
- # datomic (37)
- # docker (4)
- # emacs (10)
- # events (1)
- # fulcro (8)
- # graalvm (2)
- # jobs (1)
- # jobs-discuss (1)
- # malli (24)
- # meander (13)
- # off-topic (52)
- # pathom (4)
- # polylith (17)
- # proletarian (4)
- # react (1)
- # rewrite-clj (4)
- # shadow-cljs (56)
- # sql (21)
- # xtdb (14)
It may be a bit much, but I think setting the option conjure#eval#result_register
to *
will always copy the result to your clipboard.
Say I've got a project structured like this:
example
|-- a.fnl
`-- nested
|-- b.fnl
`-- more-nested
`-- c.fnl
When using Conjure for Aniseed projects, Conjure seems to always be aware of the context in which it should be running.
I guess that's because of this: (module example.a {autoload {nvim aniseed.nvim}})
(or (module example.nested.b {autoload {nvim aniseed.nvim}})
for the nested one)
Question: Is there a way to get that same "intelligence" when setting conjure#filetype#fennel
to "conjure.client.fennel.stdio"
?
So for a non-Aniseed project?
If I would then do this:
$ cd example/nested
$ nvim b.fnl
Conjure will not be aware of the fact that it's part of the example
project, right?Yeah there's no way to do this since fennel / lua has no concept of module aware evals unlike Clojure and it's ns system ๐ that's why I added the module system (which some people reaaaaly dislike), so we could get that context.
You have to treat it as one big global REPL right now sadly, not sure how I can get around that right now
Alright! I like the idea of the module system, it's just that it's an extra abstraction on top of Fennel (new to me) on top of Lua (also new to me) + Neovim (also new to me)
Possibly when I work on my new project that will wrap the fennel REPL in an nREPL client that may be able to add context aware evals in a clever way ๐ but you'll have to stay tuned for that. It'll be a companion project with a stand alone binary you wrap your REPLs with (like rlwrap) which adds rich REPL support to many different non-Clojure REPLs that Conjure can hook into easily.
How about Janet? That language has relative imports. Can Conjure understand it should then reason about things from the file where the cursor is at?
So if I'd be in example/nested/b.janet
and that would contain (import ../some-other-file)
there, can Conjure understand it'll have to grab example/some-other-file.janet
?
We use netrepl to connect to Janet I think, but I'm preeeety sure it's still just one big global space.
Yeah, janet uses dofile for <prefix>ef https://github.com/Olical/conjure/blob/998603d240b13e32e3c9571bcb805357ea323fa9/fnl/conjure/client/janet/netrepl.fnl#L106-L110 so that should work with relative imports
My ideal scenario will be my REPL relay tool thing adding support for "namespace" like things to as many langs and REPLs as I can, even if that means starting sub-repls within the plain stdio REPL, kinda like how unrepl etc work. So when it start up it will inject a sub-repl that can support contexts.
But I need to sit down for a couple of weeks and build some magical thing to make this happen, can someone invent a time machine for me, please?
I had to run eval-file instead of buffer!
Yeah! Buffer sends the contents directly to the REPL which means paths are interpreted from CWD
Again, can't hack that afaik, we'll see what mad science comes out of replica, but not yet.
And I can probably create something that does this every time I jump to another file
I think that solves it for me!
Yep! Something I don't do by default because if your file says "run me to delete filesystem", you probably don't want to run it when you open it. You're more than welcome to autocmd though!
> can someone invent a time machine for me, please? Well it's about time I donated to you, so you can regard it as funding for either Conjure or a time machine. Your choice!
But that'll be massively appreciated, even if it's a coffee a month worth, or less! Every little helps on my road to being full time on my OSS passion projects within 10-30 years ๐
Hmm true that. Maybe I'll do something like keeping a file with "trusted" files. Or I'll just be lazy. I prefer to call it "brave", though
(and have a prompt in the autocmd)
What's your preferred way of receiving donations? I'll rather do a one-time but slightly bigger donation for now than something where I have to create an account and all that.
Wait, I'll ask that in the main thread to get more people thinking about donating ๐
Maybe I could solve that with a example/.lnvim.fnl
file that sets the conjure#filetype#fennel
value and starts the REPL with something like fennel ./a.fnl
?
Not sure if that would work, and if I'd unknowingly still be using some Aniseed things under the hood.
(What I want to prevent is situations where things work fine in Conjure because of Aniseed, without me knowing they'd break in normal Fennel.)
Yeah! You could use some clever autocmds + ConjureClientState (search :h conjure
for this) where you have a different REPL per buffer! But then you can't communicate between them ๐
(ClojureScript/shadow) One thing Iโve been running into again is that somehow async evaluations lose *out*
and so any println
in the .then
part of a promise arenโt printed to the REPL buffer. Iโve found some workarounds with tap>
and atoms and whatnot but I wanted to ask if this is to be expected or if itโs a bug or just not possible to really get right? ๐
I think that's a cljs bug of sorts? Like the prns come out in a different context so nREPL doesn't capture them and send them out, they bypass nREPL
Same problem when you reconnect to a CLJS nREPL for the 2nd time, nREPL has a kind of bug in it (or the CLJS layer does anyway) so that the stdout is still going to the first nREPL session which you may not have access to anymore.
I don't remember the exact details, but cljs+nrepl+stdout has always had issues for me ๐ at the nREPL level itself, not sooo much in Conjure. I really need to add tap> support to Conjure though! That'll help a lot!
There's an issue for that, but I'm struggling for time / energy to get my day job and life under control right now, so I'm not in the right place to put in extra time on Conjure right now ๐ Looking to move to a 4 day work week and maaaaybe get Clojurists Together funding if I'm lucky, so that would help!
Ah interesting, that makes sense. Do what you need to do ๐ I hope Clojurerists Together funding comes through, Iโve been rooting for you every time grants were allocated ๐
Do you happen to know if thereโs an issue somewhere that tracks this?
For tap> support? That's here https://github.com/Olical/conjure/issues/220