Fork me on GitHub
#lumo
<
2017-11-24
>
pesterhazy07:11:57

@rauh, the new Map object has a .size property:

> var m = new Map(); m.set("a", "b"); m.size
1

pesterhazy08:11:27

although that again is not mandated to be O(1) in the spec

pesterhazy08:11:40

Oh, and there's even WeakMap!

pjullah10:11:49

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.

mfikes16:11:48

@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

mfikes16:11:51

(Lumo supports Socket REPL via its -n / --socket-repl command line args.)

pesterhazy16:11:04

you can also watch for changes using watchexec and just netcat everything into the socket repl

pesterhazy16:11:10

it's a bit crude but works-ish

mfikes16:11:25

There is also Unrepl, right?

pesterhazy16:11:36

Unrepl doesn't work with clojurescript hosts... yet

pesterhazy16:11:55

@cgrand did some work but it's not complete

pjullah16:11:19

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.

pjullah16:11:41

@mfikes just so I understand. 1. start Lumo repl server, 2. start boot repl 3. vim-fireplace -> boot repl 4. run tubular/repl -> Lumo

mfikes16:11:41

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.

pjullah16:11:14

then everything I evaluate should get evaluated by Lumo socket repl?

mfikes16:11:32

Yes, for step 1, I would start Lumo passing -n for a port, and -c to the folder containing your script source

mfikes16:11:46

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.

mfikes16:11:14

If vim sends a form to your REPL, it should be evaluated in Lumo

pjullah16:11:29

Nice. Thanks so much.

pjullah16:11:00

Will give it a try.

mfikes16:11:15

Just be sure to start the Clojure as a plain REPL, without nREPL involved.

pjullah16:11:10

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.

pjullah16:11:27

de-facto from a vim perspective.

mfikes16:11:36

Yeah, that is probably a show-stopper

pjullah16:11:16

Thank you though.