Fork me on GitHub

is there something like subvec for hashmaps? as in, (subhash { :a 1 :b 2 :c 3 } :a :b) that would return { :a 1 :b 2 }


just had to write it down and five minutes more googling led me to the cheatsheet with select-keys. problem solved.


How to run two luminus projects at the same time? The first one is launched as lein run. The second one tried to do lein run -p 8000 but got an error `[luminus.repl-server] failed to start nREPL Address already in use (Bind failed)`

Vincent Cantin11:04:36

That's probably the nREPL server which complains that the port it wants to use for its server socket is already used by the nREPL of the other instance.


I managed to do this, but had to grep one of the luminus project and alter the port. Was hoping to have it done though an initialization option. That -p doesn't seem to work.


@vincent.cantin In linux, lsof -i doesn't seem to show the port used by the REPL. Do you know what command to show it?

Vincent Cantin12:04:40

Where did you see the documentation for lein run -p 8000 ?


@lum @vincent.cantin -p is for lein repl not lein run


(run takes -m for the main namespace)


@ghadi @vincent.cantin In the page 5 of the first chapter of the book "Web development in Clojure, 2nd ed" there's this text: Should we want to start the application on a different port then we could pass it the -p flag followed by the port number, as follows. lein run -p 8000


I saw no documentation for the -p for lein run. Maybe have to look in the sources


-p doesn't exist for lein run


it may be something handled by the main namespace itself


@vincent.cantin lsof, /proc/net/tcp or udp or ss with | grep 7000 don't show anything open in that port, not even in port 3000 where the dev http service is running for the guestbook example of the book. I'm missing something here...


Do ClojureScript regexs support Unicode character classes? I need to check if a string contains only non-alphabetic (where alphabetic can be from any language, including 'A', '진', 'ת', etc.)


@lum I think the clearest way to put it is that your -main function decides what $ lein run -p 8000 means - all the args are sent to your main, beyond that we can't generalize


@deg I’d bet that CLJS just uses the JS regexes.


Indeed they are: Regular expressions compile to native JavaScript regular expressions.


Meh, seems like there is a u modifier in ES6 but a lot of hacks if you can’t target supporting browsers:


@orestis Thanks! I'd found a bunch of similar questions, but not this one with its complete answers.