beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
stagmoose 2021-06-20T01:37:51.384400Z

Thanks for all your reply. I'll look them up.

vinurs 2021-06-20T03:15:27.385500Z

is there any way to generate dynamic args for for

(for [a1 [1 2 3]
      a2 [1 2 3]]
  ;;do sth
  )
to
(for [a1 [1 2 3]
      a2 [1 2 3]
      ...
      an [1 2 3]
      ]
  ;;do sth
  )

2021-06-20T23:25:15.389400Z

for can be built by using map and mapcat

2021-06-20T23:26:42.389600Z

(for [x xs] e) => (map (fn [x] e) es)

2021-06-20T23:28:41.389800Z

(for [x xs y ys] e) => (mapcat (fn [x] (map (fn [y] e) ys)) xs)

2021-06-20T23:28:44.390Z

Etc

2021-06-20T03:22:41.385800Z

You could write a macro that generates a for expression with a different number of bindings determined at compile time, but instead you might want to consider a function that generates the cross product of its input sequences.

2021-06-20T03:24:03.386Z

For example, the cartesian-product function in the math.combinatorics library mentioned in the library's README here: https://github.com/clojure/math.combinatorics

vinurs 2021-06-20T03:29:17.386300Z

@andy.fingerhut thanks for your help

quan xing 2021-06-20T08:22:34.387300Z

• I want to learn Clojure, where is a good tutorial

sova-soars-the-sora 2021-06-21T16:56:50.395800Z

Living Clojure is a great book -- your local library might have some clojure books or you could request your local library to get some ^.^

quan xing 2021-06-29T10:06:44.228300Z

Thanks everyone

Stas Makarov 2021-06-20T08:34:40.387400Z

try "resources" from https://www.reddit.com/r/Clojure/

practicalli-john 2021-06-20T09:29:15.387700Z

There are lots of free resources (some commercial ones too) https://clojure.org/community/resources If you like learning fromvideo, take a look at https://practical.li/ (there are free books too)

sandeep 2021-06-20T16:57:53.388200Z

101 videos on clojure is enough for getting job ?

practicalli-john 2021-06-20T20:49:01.388600Z

Creating all those videos helped me get my current job, I cannot guarantee if it would get anyone else a job :)

practicalli-john 2021-06-20T20:51:56.388800Z

If a person can do the first 60 or so challenges on http://4clojure.com and come up with some nice answers for the Clojure track on http://Exercism.io, that would certainly help give a very good grounding in the core Clojure language. Then it just depends on what other esoteric requirements a company as part of their hiring process

👍 1