Fork me on GitHub
#beginners
<
2018-04-30
>
valerauko06:04:47

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 }

valerauko06:04:22

just had to write it down and five minutes more googling led me to the cheatsheet with select-keys. problem solved. https://clojure.org/api/cheatsheet

lum10:04:35

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 java.net.BindException: 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.

lum11:04:53

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.

lum11:04:57

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

ghadi14:04:15

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

ghadi14:04:32

(run takes -m for the main namespace)

lum14:04:29

@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

lum14:04:26

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

ghadi14:04:04

-p doesn't exist for lein run

ghadi14:04:21

it may be something handled by the main namespace itself

lum14:04:41

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

deg15:04:01

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

noisesmith15:04:59

@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

orestis15:04:42

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

orestis15:04:48

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

orestis15:04:38

Meh, seems like there is a u modifier in ES6 but a lot of hacks if you can’t target supporting browsers: https://stackoverflow.com/questions/280712/javascript-unicode-regexes

deg15:04:55

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