This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-06
Channels
- # announcements (58)
- # babashka (43)
- # babashka-sci-dev (22)
- # beginners (8)
- # biff (8)
- # calva (62)
- # circleci (3)
- # clerk (6)
- # clj-kondo (27)
- # cljsrn (9)
- # clojure (61)
- # clojure-austin (4)
- # clojure-conj (3)
- # clojure-europe (11)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-norway (4)
- # clojure-spain (5)
- # clojure-uk (2)
- # clojurescript (51)
- # data-science (1)
- # datascript (4)
- # emacs (33)
- # events (14)
- # funcool (14)
- # gratitude (13)
- # introduce-yourself (1)
- # jobs (9)
- # lsp (58)
- # malli (23)
- # missionary (31)
- # nextjournal (9)
- # off-topic (35)
- # proletarian (2)
- # re-frame (5)
- # remote-jobs (7)
- # shadow-cljs (2)
- # spacemacs (7)
- # sql (26)
- # testing (12)
- # vim (1)
- # web-security (3)
- # xtdb (2)
Here is more detail on the error that one of my students is getting, in this case when trying to fire up the Getting Started REPL: > I am currently on Microsoft Windows 11. I tried Calva: Fire up the Getting Started REPL", but the terminal gave me the same following error message: > > java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""1.0.0""},cider/cider-nrepl {:mvn/version,""0.28.5""}}}" -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" > Error while parsing option "--config-data {:deps {nrepl/nrepl {:mvn/version,1.0.0},cider/cider-nrepl {:mvn/version,0.28.5}}}": java.lang.NumberFormatException: Invalid number: 1.0.0 > Jack-in process exited. Status: 1 Is this the Windows-specific issue that you mentioned earlier, @pez? I will suggest that they try installing the CLI tools, which I don't think they've yet done.
Yes, looks like the bug I mentioned earlier. This bug: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8266473 I somehow doubt that the CLI tools will handle it better. But I'm curious if it does. I have myself never succeeded in installing the CLI on Windows, so I haven't been able to check.
Interesting. I will let you know about the student's experience in trying CLI. Is the workaround mentioned there implemented?
Nope. Then it would work. 😃 The bug is fixed back to Java 11, I think, so re-installing Java should get rid of it.
If someone runs into troubles installing the Clojure CLI, here's what I do when I need clojure
on Windows:
• Download the windows-amd64
zip from https://github.com/borkdude/deps.clj/releases
• Unzip it -> gives me deps.exe
• Rename deps.exe
to clojure.exe
• Place clojure.exe
somewhere on the PATH (like C:\Windows\System32\clojure.exe
).
This will use deps.clj
instead of the official Clojure CLI, so in case the official CLI tool can dodge that Java bug, then this is not a solution.
This may be a known issue, not sure. But using #dbg
on a private method (defn-
doesn’t work. But setting the private meta data (`^:private`) works.
It seems to work for me. Can you provide an example for reproducing the issue? I can’t think of why it wouldn’t work for you if the private metadata is working.
let me try it again with latest version
Here is what I found. v2.0.331 it works. But the cool lines you draw above and below the function don’t appear. In v2.0.324 it doesn’t work. But the cool lines still appear. 🤷 I’m using v2.0.324 because the lsp works in this version.
Ahh I’m not sure why the lines wouldn’t show for you in 2.0.331, if they show for me. Feel free to create an issue for that and provide details such as how you’re starting your repl, if you’re using lein or deps.edn, the Calva version (2.0.331) and sample code for which the lines don’t appear when instrumented.
It would be really awesome to have the # %%
Python code cell notation in Calva (`; %%`): https://code.visualstudio.com/docs/python/jupyter-support-py
Hi! (We try to use threads here.) Can you describe this feature a bit? I'm not familiar with it. But sounds cool! 😃
Sure basically when you write Python in a .py
file you can place a comment above code like so
# %%
1 + 1
and then type shift+enter
anywhere in the area below the # %%
and it will send the code as a code cell to a live notebook.Try it out. Just create a Python file. Write # %%
type some code as I have in the screen shot and press shift+enter
.
What's the use case in Clojure code? When would you use this instead of alt+enter och ctrl+enter?
Also, since # %%
evaluates everything below there is no need to wrap things with let
and/or do
to evaluate multiple forms, etc.
Calva has a an API which lets you use its REPL. Maybe this should go in a separate extension using that API, or maybe it can be done with Joyride?
I didn't know about send to notebook until now. 😃 Maybe @U02EMBDU2JU knows what's possible around that.
Sure. I’m just now learning about the Notebook API in VS Code. A lot of this is new to me so I apologize if I don’t know everything yet. I’ve just barely ported over my standard Emacs evil bindings to work with neovim etc.
Not saying I know this shouldn't be added to Calva, but sounds like Joyride could be a good first step to prototype it at least.
Mostly I’ve used VS Code for Python and JavaScript. I’ve almost got most of my creature comforts for Clojure. 🙂
Mhh no never heard of send to notebook
FWIW it could also be handy for new people using the language who like to def
everything and aren’t used to working with a loaded weapon like the REPL. 😛
> To work with Jupyter notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you’ve installed the https://pypi.org/project/jupyter/. To select an environment, use the Python: Select Interpreter command from the Command Palette (⇧⌘P).
I’ve kinda gotten used to Python pip install
just about everything but I also use conda
to keep things sane.
@U9A1RLFNV, we discussed alternatives for the Output/REPL window some days ago. This Interactive jupyter thing looks pretty interesting.
Its definitely nice. It’s really convenient for all sorts of things. Just checked out Portal too.
I think something unstructural like # %%
isn't a good fit for Calva, but a Joyride script or an extension could do it for people who want it.
Re: Portal -- I have all my evaluations go into Portal for viewing (and my REPL output window is always hidden).
I use the Portal middleware so it captures regular evaluations, but I can also tap>
values and those go directly to Portal without middleware wrapping.
I like that it allows me to switch to data exploration mode if I need to, expanding parts of nested data, and visualizing them in different ways, but I also have hot keys that I can use from my editor to expand/contract parts of the Portal view without needing to switch over to Portal directly.
> I use the Portal middleware so it captures regular evaluations So I can just use Calva’s regular eval commands and results are sent to Portal, if I use the Portal middleware?
Well, what I mean is, I like tap>
for certain things (async). The use case of # %%
is very nice for several use cases and easy to clean up.
tap>
is one of the best additions to Clojure in years for me - I use it so much in development and in debugging, even with remote servers.