Fork me on GitHub
#beginners
<
2021-04-20
>
ho0man08:04:40

Hi everyone, does derefing a promise inside a go block a bad practice and result in its thread to b be blocked? I am not directly doing that but writing a function which may be called inside a go block

thumbnail10:04:52

You can just deref in an async/thread and <! from the channel tho

noisesmith19:04:30

you can also call realized? to check if a promise is ready

noisesmith19:04:40

or use a promise-chan

1
piyer16:04:11

Is there a way to get the logging in the cider repl?

piyer16:04:33

[org.apache.logging.log4j/log4j-api "2.14.1"]                 [org.apache.logging.log4j/log4j-core "2.14.1"]                 [org.apache.logging.log4j/log4j-jcl "2.14.1"]                 [org.apache.logging.log4j/log4j-jul "2.14.1"]                 [org.apache.logging.log4j/log4j-slf4j18-impl "2.14.1"]

piyer16:04:23

I see the logging in nrepl-server buffer but not on the repl

piyer16:04:36

:jvm-opts ["-Dclojure.compiler.direct-linking=true"                                  "-Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory"]

jumar16:04:55

If you log to stdout it should be visible in the REPL

piyer18:04:56

@U06BE1L6T Thanks.

status = warn
monitorInterval = 5

appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %date %level %logger %message%n%throwable

rootLogger.level = info
rootLogger.appenderRef.stdout.ref = STDOUT

piyer18:04:00

that is what I have.

Karo18:04:59

Hi team, need your help. If there are several maps in lazy seq for example 4 maps how can I get the map for the given index (for example third map)? when I print my data this is the shape: ( { :first "map1" } { :second "map2" } { :third "map3" } { :fourth "map4"} ) is it possible to transfer this into vector? [ { :first "map1" } { :second "map2" } { :third "map3" } { :fourth "map4"} ]. thanks

valtteri18:04:44

nth function can be used to get the… nth element

(nth '(:a :b :c) 1)
:b

thanks2 1
valtteri18:04:33

You can transform list to vector in several ways. One way is to use (into [] '(1 2 3))

Karo18:04:46

nth or vec are what I need. thanks