beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
Prabu Rajan 2021-04-20T06:47:27.262600Z

Thanks! I read your blog, very useful. I shall explore more. It would be great if you can send some code examples for 1. Using s/conform and s/explain-data to return user friendly error messages 2. Some tutorial on generative test generation using test.check library

2021-04-20T08:42:40.265900Z

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

2021-04-29T15:03:30.250900Z

Thanks @noisesmith

2021-04-20T10:41:18.266400Z

Yes

2021-04-20T10:41:52.267300Z

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

2021-04-20T11:10:29.267800Z

Thanks @jeroen.dejong

👍 1
piyer 2021-04-20T16:18:11.269700Z

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

piyer 2021-04-20T16:23:33.269800Z

[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"]

piyer 2021-04-20T16:24:23.270Z

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

piyer 2021-04-20T16:24:36.270200Z

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

jumar 2021-04-20T16:57:55.270400Z

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

piyer 2021-04-20T18:00:56.275100Z

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

piyer 2021-04-20T18:01:00.275300Z

that is what I have.

Karo 2021-04-20T18:14:59.279600Z

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

valtteri 2021-04-20T18:21:44.279700Z

nth function can be used to get the… nth element

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

1
valtteri 2021-04-20T18:22:33.279900Z

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

tony 2021-04-20T18:25:05.280100Z

vec

2
Karo 2021-04-20T18:29:46.280500Z

nth or vec are what I need. thanks

2021-04-20T19:29:30.280800Z

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

2021-04-20T19:29:40.281Z

or use a promise-chan

1