Fork me on GitHub

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.

๐Ÿ™ 2

I use that โ˜บ๏ธ


Say I've got a project structured like this:

|-- 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


Maybe I'll think of something some day!


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.


It'll be called replica so look out for it ๐Ÿ˜›


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?


Janet has the same problem I think? That the Janet REPL is one big global state?


We use netrepl to connect to Janet I think, but I'm preeeety sure it's still just one big global space.


I think the relative imports should work though?


but again, global shared REPL space, so names will collide


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


Not dir of source


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!


If you can donate a TARDIS I'll have everything done yesterday.


Judging by the fact that it wasn't, I think I won't ๐Ÿ˜›

๐Ÿ˜„ 3

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)


Hey, if you don't write dangerous top level forms, you do you!

โœ… 3

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 ๐Ÿ˜„

thanks3 3

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?