@rauh, the new Map object has a .size
property:
> var m = new Map(); m.set("a", "b"); m.size
1
although that again is not mandated to be O(1) in the spec
Oh, and there's even WeakMap
!
polyfilled in GCL https://github.com/google/closure-compiler/blob/c3f5e9a5713cdd9af9283e75c309e5d831f1b45e/src/com/google/javascript/jscomp/js/es6/weakmap.js#L23
Hi there. I'm just wondering if anyone has experience of using Lumo from Vim. Been going around in circles, and considering switching editor, which I really don't want to do, but... Anyway, any advice really appreciated.
@pjullah It may be possible to first connect Vim to a Clojure REPL, and then from there connect that REPL to Lumo using Socket REPL and Tubular https://github.com/mfikes/tubular
(Lumo supports Socket REPL via its -n
/ --socket-repl
command line args.)
you can also watch for changes using watchexec
and just netcat
everything into the socket repl
it's a bit crude but works-ish
There is also Unrepl, right?
Unrepl doesn't work with clojurescript hosts... yet
@cgrand did some work but it's not complete
Thanks @mfikes & @pesterhazy
All I'm trying to do is write a few utility scripts in cljs. Currently editing, file then dropping to cli to run it. Anything that allows me to eval in the editor would be great.
@mfikes just so I understand. 1. start Lumo repl server, 2. start boot repl 3. vim-fireplace -> boot repl 4. run tubular/repl -> Lumo
Yeah, if you know how to fire up and interoperate with a Clojure REPL from vim, then Tubular can definitely then be used for that.
then everything I evaluate should get evaluated by Lumo socket repl?
Yes, for step 1, I would start Lumo passing -n
for a port, and -c
to the folder containing your script source
Then, once you have connected Tubular to Lumo, you can (require ...)
on your script source namespace, (in-ns ...)
to that namespace if you like, or make a change to the file, save it (require .... :reload)
. In other words, just like conventional Clojure dev.
If vim sends a form to your REPL, it should be evaluated in Lumo
Nice. Thanks so much.
Will give it a try.
Tubular is definitely not magic. See https://github.com/mfikes/tubular/blob/master/src/tubular/core.clj
Just be sure to start the Clojure as a plain REPL, without nREPL involved.
ah
That might be a bit of a sticking point. The plugin that I'm using - which is de-facto way of doing things, vim-fireplace - uses nrepl.
de-facto from a vim perspective.
Yeah, that is probably a show-stopper
Thank you though.