beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
2021-01-26T00:07:20.349300Z

the good news is that it's possible to set message levels on a per-package basis, the bad news is that java logging config is overly complex

sova-soars-the-sora 2021-01-26T00:23:41.349500Z

haha awesome. well that's good to know. I see this Logger.LEVEL stuff ... blargh

2021-01-26T00:25:25.349700Z

yeah, you can even say "no warnings from com.google.cloud specifically"

2021-01-26T00:28:13.349900Z

the annoying part is there's multiple ways to say that, and which way you do it depends on your app because there are parallel and incompatible ways to configure

2021-01-26T00:28:31.350100Z

and you can get changes in which system is used caused by config files in your deps for example

sova-soars-the-sora 2021-01-26T00:33:19.350300Z

right on.. well maybe a hacky way to delete that message from the result will be fine. I washoping I could disable this logging on the google cloud console somewhere but it's complex and made for robots

sova-soars-the-sora 2021-01-26T02:25:37.350600Z

How would I go about saying I don't want any warnings from com.google.cloud?

sova-soars-the-sora 2021-01-26T02:25:51.350800Z

is this relevant? https://ask.clojure.org/index.php/8985/can-i-suppress-low-level-logs-with-tools-logging

sova-soars-the-sora 2021-01-26T02:28:08.351100Z

;/ doesn't seem to do it

2021-01-26T02:29:14.351300Z

it depends on which logging system you decide you are using, and which style of config file it uses (this is a weird mess because of the hyper-flexible way various java logging systems and compatibility layers are defined) - search for "architecture" here to see a diagram https://stackify.com/logging-java/

sova-soars-the-sora 2021-01-26T02:30:13.352Z

okay... thanks, i will do some learning. I really just want to suppress the WARNING: x on cloud translate

sova-soars-the-sora 2021-01-26T02:30:28.352500Z

since i plan on doing lots of translate calls and don't want the repl blasted

2021-01-26T02:30:30.352700Z

if only that were as simple as it should be

sova-soars-the-sora 2021-01-26T02:32:49.353Z

commence the weeping

sova-soars-the-sora 2021-01-26T02:33:38.353200Z

theoretically could i set the warning "status" to something other than warn

sova-soars-the-sora 2021-01-26T02:33:45.353400Z

and then see no more warnings?

sova-soars-the-sora 2021-01-26T02:34:11.353600Z

pardon my ignorance i know very little about this fiasco xD

2021-01-26T02:35:09.353800Z

all of the loggers have a concept of a "log level", which can be modified (either globally or on a per package basis) to suppress messages below a desired level

2021-01-26T02:35:49.354Z

warn, debug, error, info etc. have numeric constants and the normal style of config is to set a numeric level (via its symbol)

2021-01-26T02:36:20.354200Z

but many of the logging systems allow things that are more targeted than that (eg. per package config if someone else made their stuff too verbose / not verbose enough)

sova-soars-the-sora 2021-01-26T02:38:51.354400Z

Aha.

2021-01-26T02:42:47.355Z

Make use of this: https://twitter.com/markm208/status/1353495678509608960?s=20

sova-soars-the-sora 2021-01-26T02:51:01.355600Z

weeping continues

sova-soars-the-sora 2021-01-26T02:53:21.355800Z

How would one hide the warnings from a specific namespace or package?

sova-soars-the-sora 2021-01-26T04:09:54.356200Z

welp. I used their recommended export G_TRANS_CREDENTIALS thing on the command line instead of manually passing in an api key and... the warnings are gone

sova-soars-the-sora 2021-01-26T04:10:00.356400Z

but like... why google why

solf 2021-01-26T04:33:48.357Z

Is there a way to setup default :jvm-opts on deps.edn? It seems you can only do it under an alias

raspasov 2021-01-26T05:15:46.357300Z

(defn my-add [[n1 d1] [n2 d2]]
  (let [d3 (+ d1 d2)
        [-n d3'] (cond
                   (< d3 10) [0 d3]
                   (= d3 10) [1 0]
                   (< 10 d3) [1 (- d3 10)])]
    [(+ n1 n2 -n) d3']))
Using some elementary school math rules 🙂 (expressed within the cond)

seancorfield 2021-01-26T05:20:28.358100Z

@dromar56 There is currently no way to have a default set of JVM opts.

seancorfield 2021-01-26T05:21:20.358900Z

I'm curious about your use case? I don't see how you'd always want the same JVM opts no matter what aspect of the project you're running?

seancorfield 2021-01-26T17:52:39.385900Z

From the deps/CLI reference page: "JVM arguments may either be passed on the command line (with -J) or by using data stored in an alias under :jvm-opts and passed with -X or -A or -M" and also "The configuration file format (in deps.edn files) is an edn map with top-level keys :deps, :paths, and :aliases, plus provider-specific keys for configuring dependency sources." -- so it says there are three top-level keys and it also says :jvm-opts can be stored in an alias. I guess if you have suggestions for making it clearer, you could post that on http://ask.clojure.org

seancorfield 2021-01-26T17:55:42.386500Z

The closest equivalent to Leiningen's sample.project.clj is the example-deps.edn in the CLI install, which is copied to ~/.clojure on first use (and also remains in the installation). But that currently refers to -R and -C options which are both deprecated (or maybe even removed at this point). And it does not show :jvm-opts... I'll post a Q on http://ask.clojure.org about that...

solf 2021-01-27T02:41:24.415400Z

Thanks a lot!

blak3mill3r 2021-01-26T05:58:09.359800Z

@dromar56 One thing you could do is use a shell alias, for any options to clj that you use very frequently while developing

roelof 2021-01-26T06:15:14.360200Z

good morning all

😃 1
solf 2021-01-26T07:34:15.360300Z

I don't actually have a use-case that requires it. But I also very seldom use jvm options (I think today was the first time I used them for something other than setting the heap size). When I tried searching for how to set it using deps.edn, I found you could set them using :jvm-opts through an alias, but I didn't expect it would the only way.

solf 2021-01-26T07:35:06.361200Z

Without prior knowledge about when/how someone would want to use jvm opts, I assumed that it also worked as a top level option. This is actually related to an issue I have with the documentation of deps.edn: there's no succinct reference to it. I've read the manual on http://clojure.org, but most of the time I already know how to use it (more or less) and am just trying to find the exact syntax to do it. With leins, I used this: https://github.com/technomancy/leiningen/blob/master/sample.project.clj I haven't found an alternative to deps.edn, and that made my discovery that :jvm-opts is only an alias setting more difficult than it could have been

roelof 2021-01-26T07:41:44.363100Z

any shadow-expert who can help me with this How to solve this one :

cljs꞉cljs.user꞉>  @state/orders
nil
; No available JS runtime.
clj꞉cljs.user꞉>  @state
shadow-cljs.edn
{:source-paths ["src"]

 :dependencies [[binaryage/devtools "0.9.10"]
                [proto-repl "0.3.1"]
                [reagent "0.8.0"]]

 :nrepl        {:port 3333}

 :builds
 {:app {:target :browser
        :output-dir "public/js"
        :asset-path "/js"

        :modules
        {:main
         {:entries [giggin.core]}}

        :devtools
        {:after-load  giggin.core/main
         :http-root   "public"
         :http-port   3000}}}}

Christian 2021-01-26T07:47:15.363600Z

That wouldn't be confusig at all. Imagine you want to understand a bit of regex and somebody starts by introducing a nondeterministic finite automaton first, because that's basically the same thing 😄

Mno 2021-01-26T07:54:02.364500Z

The repl needs to something that runs js so it can run stuff

Mno 2021-01-26T07:54:32.365300Z

Since you're targeting a browser, you need to open the browser

Mno 2021-01-26T07:55:52.365800Z

Localhost:3000 it seems.

niveauverleih 2021-01-26T11:52:25.368300Z

I just found out that the Duffer brothers (stranger things) were from Durham NC. What is it that makes people from Durham special?

2021-01-28T18:34:22.091200Z

Having just moved to the area recently, I suspect it may also have to do with the vinegar based barbecue, which I never heard of before: https://www.youtube.com/watch?v=6ubTQfr_tyY&feature=youtu.be

roelof 2021-01-26T11:54:07.368800Z

@hobosarefriends I have a browser open

Mno 2021-01-26T11:58:29.368900Z

if you do (js/alert "test") does the alert window pop up?

Mno 2021-01-26T11:59:15.369100Z

(have you made sure that nothing else is running on that port?)

roelof 2021-01-26T12:02:50.369300Z

yep, I see then a popup with the text test on it on my browser

Mno 2021-01-26T12:07:51.369500Z

huh… then it is connected.. that’s pretty weird

Mno 2021-01-26T12:08:10.369700Z

maybe ask in #shadow-cljs

roelof 2021-01-26T12:09:09.369900Z

thanks

Mno 2021-01-26T12:09:35.370100Z

no probs, sorry I couldn’t solve it

roelof 2021-01-26T13:23:57.370500Z

it is solved

roelof 2021-01-26T13:24:18.370700Z

I had to use the namespace before the call

roelof 2021-01-26T13:24:27.370900Z

stupid beginners error

Mno 2021-01-26T13:37:06.371100Z

Good to hear my dude, and you seem to understand why it happened so that’s even better.

alexmiller 2021-01-26T13:54:40.371300Z

I think it's the Cheerwine

niveauverleih 2021-01-26T13:56:37.371500Z

Sounds appealing. They have cherry beer here in Belgium.

alexmiller 2021-01-26T13:59:19.371700Z

also good! :)

roelof 2021-01-26T14:03:33.371900Z

yep I understand now after soeme help of the shadow-cljs channel

Claudio Ferreira 2021-01-26T14:16:03.372600Z

Study Algo & Data Struc. in Java will help me become a better Clojure dev?

dpsutton 2021-01-26T14:17:17.373100Z

studying algo and data structures in any language will usually help you become a better developer in every other language you use

👍 5
2021-01-26T14:27:04.374500Z

I agree with @dpsutton,I work with devs where everything is either an object (as in C# object or a string, and every data structure is list. Then they wonder why everything is so slow. Learning data structures and algorithms will never not be a good idea.

roelof 2021-01-26T14:31:34.375600Z

is there a better idomatic way to turn for example 123 into (1 2 3) then this :

(map #(rem % 10) (take-while pos? (iterate #(quot % 10) 123)))

roelof 2021-01-27T10:27:15.432400Z

oke, but the mentor wanted a solution where I did not first convert it to a string and then convert back

2021-01-27T18:48:59.455100Z

Yes that's what I'm talking about

2021-01-27T18:49:06.455300Z

The one where you use mod

2021-01-27T18:50:53.455700Z

or the near-substitute, rem

💯 1
2021-01-27T19:01:39.455900Z

(defn num->list
 [num]
 (loop [acc '() q num r 0]
  (if (zero? q)
   acc
   (let [r (rem q 10)
         q (quot q 10)]
    (recur
     (conj acc r)
     q
     r)))))

(num->list 123)
;; => (1 2 3)

2021-01-27T19:09:09.456300Z

Or like you had it:

(defn num->list
 [num]
 (->> num
  (iterate #(quot % 10))
  (take-while pos?)
  (map #(rem % 10))
  (reverse)))

(num->list 123)
;; => (1 2 3)

2021-01-27T19:10:25.456700Z

Ya rem is what you want so it works on negative numbers as well.

roelof 2021-01-27T19:56:19.484700Z

I had the last one

tws 2021-01-26T14:47:14.375900Z

you could go via strings.

(map #(Character/getNumericValue %) (str 123)) ; => (1 2 3)

tws 2021-01-26T14:47:25.376100Z

not sure if that’s more idiomatic

roelof 2021-01-26T14:50:40.376500Z

thanks, Was hoping i could do it without parse to a string and then back from a string

tws 2021-01-26T14:57:31.376700Z

concise v. fast tradeoff

Christian 2021-01-26T15:17:08.377Z

Maybe you can use partition?

(partition 1 (str 123))
;; => ((\1) (\2) (\3))

roelof 2021-01-26T15:30:05.377200Z

could be a idea

2021-01-26T15:35:11.377400Z

@roelof is it required to work on positive integers only?

roelof 2021-01-26T15:35:34.377600Z

I think so

👍 1
Malik Kennedy 2021-01-26T15:37:29.377800Z

;; I took a try as well: 
(pr-str
 (map #(Integer/parseInt %)
      (str/split "123" #"")))

Malik Kennedy 2021-01-26T15:38:40.378Z

I use (str/split s #"") to split a string into strings on 1 character often, dunno if thats the best way

Malik Kennedy 2021-01-26T15:41:33.379100Z

;; Didn't notice this:
;; > positive integers only?
(fn [s]
  {:pre (pos-int? (Integer/parseInt s))}
  (pr-str
   (map #(Integer/parseInt %)
        (str/split s #""))))

Sibelius Seraphini 2021-01-26T15:46:19.379700Z

is there a prettier for clojure?

Sibelius Seraphini 2021-01-26T15:46:49.380400Z

I’ve found this https://github.com/brandonbloom/fipp, but not sure how to run this in a cli to pretty print my code

dpsutton 2021-01-26T15:48:28.380700Z

there's https://github.com/weavejester/cljfmt

✅ 2
Sibelius Seraphini 2021-01-26T15:51:40.381100Z

tks

tws 2021-01-26T15:55:40.381200Z

@mksybr you don’t need to split on #“”. Mapping a function over a string applies it to each character in turn automatically.

tws 2021-01-26T15:56:56.381400Z

(map #(Integer/parseInt %) s) is fine.

Malik Kennedy 2021-01-26T15:58:18.381700Z

Thanks for letting me know!

Malik Kennedy 2021-01-26T16:01:17.381900Z

Hrm...

1. Caused by java.lang.ClassCastException
   java.lang.Character cannot be cast to java.lang.String

Malik Kennedy 2021-01-26T16:01:57.382100Z

;; from
(map #(Integer/parseInt %) "123")

Malik Kennedy 2021-01-26T16:02:47.382300Z

AIUI, when you map over a String the function receives a value of type Character, not of String.

Malik Kennedy 2021-01-26T16:03:04.382500Z

And Integer/parseInt expects and only accepts a String

Christian 2021-01-26T16:05:49.383700Z

I have once seen a nice youtube? demo of clojure where the presenter is counting words of moby dick to demonstrate clojure. Does anyone know what I'm talking about?

practicalli-john 2021-01-27T10:33:27.433600Z

Yes, James did some great live coding sessions like this a while ago, great to bring them together. I did a short version of one of his examples to show how to use Cider and the Cider inspector https://www.youtube.com/watch?v=rQ802kSaip4

👀 1
Malik Kennedy 2021-01-26T16:10:08.384Z

;; coerce Character to String
(fn [s]
    {:pre (pos-int? (Integer/parseInt s))}
    (pr-str
     (map (comp #(Integer/parseInt %) str) s)))

tws 2021-01-26T16:13:54.384300Z

whoops, sorry, use #(Character/getNumericValue %) instead

Christian 2021-01-26T16:14:27.384500Z

Found it: https://www.youtube.com/watch?v=C-kF25fWTO8

💯 1
roelof 2021-01-26T16:28:32.384800Z

oke, but the inout is a number not a string

Mno 2021-01-26T17:04:47.385Z

I mean.. you can also count the length of the number.. and make a list that long by getting the remainders of the number and 10^x but that’s a bit convoluted

2021-01-26T17:16:11.385400Z

I like the original version - eg. to get a base other than 10 it only requires changing a constant

roelof 2021-01-26T17:55:07.386100Z

he my posts is gone

roelof 2021-01-26T17:55:22.386300Z

I have used the code like this :

(->> number
       (iterate #(quot % 10))
       (take-while pos?)
       (map #(rem % 10)))

2021-01-26T18:13:47.387Z

you need a reverse on that though

sova-soars-the-sora 2021-01-26T18:47:18.388300Z

So is there something special I have to do to make sure my clojure / lein program can access all my linux box environment variables? I am trying to run google translate on my remote box and I keep getting 403 invalid API key even though I have run export GOOG_APP_CREDS = /path/to/file ... the api key works on my local box ;/

2021-01-26T18:48:42.389100Z

System/getenv can see everything that your process sees, it shouldn't even be an issue on the java / clojure side

sova-soars-the-sora 2021-01-26T18:48:59.389300Z

That's what I was thinking.

sova-soars-the-sora 2021-01-26T18:49:18.389500Z

Hmm. perplexing

2021-01-26T18:49:47.389800Z

for debugging: (pprint (into {} (System/getenv)))

2021-01-26T18:50:14.390100Z

it might be that it needs the System property to be set

🙌 1
2021-01-26T18:50:28.390400Z

or that it's using some config instead of the environment

alexmiller 2021-01-26T18:50:56.391Z

depending on how you start an application, it may not be running your shell startup environment

💯 2
sova-soars-the-sora 2021-01-26T18:52:48.391300Z

gasp. is no there in the pprint list.

2021-01-26T18:54:02.392400Z

"export" is for the current shell and child shells, you need the export to happen in the parent of the java process - I usually prefer to add the env var as a prefix on the java command itself

sova-soars-the-sora 2021-01-26T18:56:22.393Z

Hmmm okay... what's that look like?

2021-01-26T18:57:38.393400Z

FOO=bar java ...

2021-01-26T18:58:02.393900Z

or env $(cat env_file) java ...

sova-soars-the-sora 2021-01-26T19:00:09.394500Z

brilliant

sova-soars-the-sora 2021-01-26T19:00:13.394700Z

thanks

sova-soars-the-sora 2021-01-26T19:00:29.394900Z

you saved me a lot of headscratching

sova-soars-the-sora 2021-01-26T19:00:42.395400Z

maybe 2 miles worth of headscratching if calculated by finger travel

😂 2
2021-01-26T19:00:53.395600Z

you can also access the environment of other processes if you have permission

user=> (-> (slurp "/proc/self/environ") (s/replace (String. (byte-array [0])) "\n") println)

2021-01-26T19:01:13.396200Z

("self" is the magic directory for the current pid, you can use an arbitrary pid there)

GGfpc 2021-01-26T19:04:08.397400Z

How do you deal with async methods in repl based development? Let's say I have a method that returns immediately and calls a callback when done, I can't evaluate it in the repl because I won't be able to access what is passed to the callback

2021-01-26T19:04:59.398200Z

@ggfpc12495 you can call def, or deliver to a promise, or swap! on an atom

2021-01-26T19:07:04.398500Z

(cmd)user=> (def p (promise))
#'user/p
(ins)user=> (.start (Thread. (fn [] (Thread/sleep 10000) (deliver p 42))))
nil
(ins)user=> @p
42

2021-01-26T19:07:17.398900Z

that ten second delay should be long enough to see the pause happen in a repl

2021-01-26T19:08:07.399600Z

@ggfpc12495 if your app design is consistently async, core.async can help keep things a little simpler (but it also imposes a number of constraints)

GGfpc 2021-01-26T19:08:43.400200Z

Your approach makes sense to me, but then are we not changing our code to fit a specific development process?

roelof 2021-01-26T19:08:53.400600Z

oke, accordingt o the test I do not. All tests are green with this code

GGfpc 2021-01-26T19:09:00.401100Z

I don't have much experience with Lisps but it feels weird coming from a Java world to do that

2021-01-26T19:09:26.401600Z

java is full of bizarre "patterns" that shoehorn models into a dev process

2021-01-26T19:10:39.402600Z

@ggfpc12495 on a slightly less glib note, clojure does tend to encourage a specific kind of design that makes repl usage easier, but in most cases this can be done in a way that is also decoupling concerns

2021-01-26T19:11:37.403800Z

the real thing to avoid is coupling things because it makes dev simpler without regard for your domain (DI / factories etc. can do this as easily as decomposing for repl usage does)

2021-01-26T19:12:07.404400Z

your adaptor might look like a function that takes a callback and returns a new one that also sets a promise, for example

2021-01-26T19:13:20.404500Z

user=> (map #(rem % 10) (take-while pos? (iterate #(quot % 10) 123)))
(3 2 1)

roelof 2021-01-26T19:13:38.404700Z

i know

roelof 2021-01-26T19:14:13.404900Z

but I have to calculate if a number is a amstrong number and those tests are still green

roelof 2021-01-26T19:14:34.405100Z

so it seems that this is reversed does not make a difference

GGfpc 2021-01-26T19:22:17.405500Z

Thanks will look into your suggestions

2021-01-26T19:28:19.405600Z

here's a minimal function which takes a promise and a callback, and creates a new cb that captures the value the callback sees

(ins)user=> (defn tracked-cb [p f] (fn [& args] (deliver p args) (apply f args)))
#'user/tracked-cb
(ins)user=> (defn printing-cb [x y] (println "callback:" x y))
#'user/printing-cb
(ins)user=> (def p (promise))
#'user/p
(ins)user=> (def cb (tracked-cb p printing-cb))
#'user/cb
(ins)user=> (.start (Thread. #(cb :a :b)))
nil
user=> callback: :a :b

(ins)user=> @p
(:a :b)
in general a lot of mocks / stubs / dependency injections can be replaced with regular functions

2021-01-26T19:29:43.405800Z

a promise (as a let binding rather than a def most likely) can similarly be used in tests - dual benefit that the value isn't ready until the promise is delivered to so the test won't do its comparison until the async result is ready

roelof 2021-01-26T19:44:41.407700Z

are there more free courses . I find this one also a lot about clojure and not much about components and so on

Daniel Stephens 2021-01-26T20:15:55.407800Z

You could always setup a function (I've called mine spy) that is able to wrap any other function and logs inputs and outputs. No reason you couldn't also get it to reset! some atoms of input and output if it's not a nice readable results.

(defn spy [f]
  (fn [& args]
    (println "--------------------------")
    (println "calling callback" f "with:")
    (clojure.pprint/pprint args)
    (println "--------------------------")
    (let [o (apply f args)]
      (println "--------------------------")
      (println "callback" f "returned:")
      (clojure.pprint/pprint o)
      (println "--------------------------")
      o)))
=> #'user/spy

(defn async-method [millis callback-fn]
  (future 
    (Thread/sleep millis)
    (callback-fn millis)))
=> #'user/async-method

(defn callback [millis] (println "In callback after" millis))
=> #'user/callback

(async-method 1000 (spy callback))
=>
#object[clojure.core$future_call$reify__8439
        0x4f45e549
        {:status :pending, :val nil}]
--------------------------
calling callback #object[user$callback 0x4ac10f16 user$callback@4ac10f16] with:
(1000)
--------------------------
In callback after 1000
--------------------------
callback #object[user$callback 0x4ac10f16 user$callback@4ac10f16] returned:
nil
--------------------------

tws 2021-01-26T20:16:53.408Z

i think i solved all those exercism-clojure problems, most anyway, if you want a reference.

tws 2021-01-26T20:17:10.408200Z

https://github.com/tschady/exercism-clojure wouldn’t want to post spoilers, up to you.

Daniel Stephens 2021-01-26T20:17:24.408500Z

oops, just seen this is basically what was already suggested in another thread!

tws 2021-01-26T20:17:42.408700Z

but my armstrong is pretty concise.

tws 2021-01-26T20:17:54.408900Z

my clojure was more naive then, so YMMV

roelof 2021-01-26T20:19:58.409100Z

oke, and are all your answers approved by a mentor ?

tws 2021-01-26T20:24:41.409300Z

i don’t understand

roelof 2021-01-26T20:26:30.409500Z

in exercism you can do the mentored track and a practice track

roelof 2021-01-26T20:26:42.409700Z

which one did you do ?

Sibelius Seraphini 2021-01-26T20:41:57.410400Z

I’m trying to make log/info and log/debug to show in my terminal, but I’ve got this error: ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... this is the code/project https://github.com/runopsio/sequence/blob/master/src/decimals/dynamodb.clj#L55

2021-01-26T20:44:51.410600Z

java logging config is severely brittle and counterintuitive, the big picture answer is "you need to pick a logger, configure it, and ensure code you care about is hooked up to it", but the specifics are full of gotchas. The best answers will probably be java specific in presentation.

2021-01-26T20:45:51.410800Z

the two stable outcomes I've seen are "magic .properties fill in resources that nobody touches" and "complex clojure.tools.logging code that nobody touches"

2021-01-26T20:48:26.411Z

You need to look at the deps tree, but my guess is something is pulling in log4j2, and tools.logging is defaulting to using that, where it looks like the project is trying to use logback

Sibelius Seraphini 2021-01-26T20:51:51.411200Z

is there a simple print or console.log (from js) but in clojure?

Sibelius Seraphini 2021-01-26T20:52:04.411400Z

I just wanna introspect some variables to understand this code

2021-01-26T20:52:36.411600Z

There are many

2021-01-26T20:52:52.411800Z

prn or println are maybe the most common

2021-01-26T20:54:08.412Z

*out* gives you access to a PrintWriter that writes to stdout by default, *err* to stderr

👍 1
tws 2021-01-26T21:02:22.412200Z

neither. it was 4 yrs ago, I just downloaded all the separate _test.clj , put them in 1 project and made em pass. from e.g. https://github.com/exercism/clojure/blob/master/exercises/armstrong-numbers/test/armstrong_numbers_test.clj

❤️ 1
Audrius 2021-01-26T21:20:31.413400Z

Hello, are records in use in the wild or maybe maps are more popular these days?

2021-01-26T21:23:34.413700Z

there's a really good flowchart about this, but the tl;dr is that everything is designed so you can write code using maps, and convert to records / types / generated classes etc. when you know you need it

roelof 2021-01-26T21:25:20.413900Z

aha,I do the mentored one so mine soutions get looked at my a xp person in clojure

seancorfield 2021-01-26T21:49:27.414500Z

It's worth noting that Clojure Applied talks up records fairly heavily but the author (Alex Miller) has said that if they do a 2nd Ed he would deemphasize records quite a bit and lean more heavily on plain hash maps.

blak3mill3r 2021-01-26T22:23:00.415Z

Records are in use in the wild, and maps are more popular, there are good reasons for both. Use maps, and switch to records when you have millions of maps with the same keys.