Fork me on GitHub
#clojure
<
2023-12-06
>
joshcho02:12:37

How would one build a video streaming platform in full-stack CLJ/CLJS? :thinking_face:

Cora (she/her)05:12:43

read about the architecture of companies already doing this and do likewise, probably

šŸ‘ 1
raspasov07:12:07

Curious why this example says ā€œwrong resultā€ at the last line:

raspasov07:12:27

As in, the result is correct (I thinkā€¦)

raspasov07:12:22

(def v (vec (concat (range 5) [:x])))
=> #'user/v
v
=> [0 1 2 3 4 :x]
(def xf (comp (take 10) (halt-when keyword?) (map inc)))
=> #'user/xf
(sequence xf v)

=> (1 2 3 4 5)

valerauko07:12:49

I think they're expecting it to return :x as the other examples do

raspasov07:12:08

I seeā€¦

raspasov07:12:21

Yeah.. the behavior does not match the docstring when sequence is used . I assume thereā€™s a good reason for that that Iā€™m not aware ofā€¦ šŸ™‚

delaguardo08:12:24

What doesn't match? to me it looks like a misleading comment.

p-himik09:12:34

into and transduce will result in :x, which is exactly what the docstring of halt-when describes. sequence will result in (1 2 3 4 5), which is not what the docstring of halt-when describes. The good reason here is that sequence returns a lazy seq - it cannot possibly produce :x. sequence completely ignores reduced.

ā˜ļø 1
āž• 1
ghadi18:12:13

the reasoning is not exactly correct above

ghadi18:12:24

the transducible context sequence allows you to pass a transducer to transform its internal stepping function

ghadi18:12:51

sequence never exposes the eventual/final result of all steps

ghadi18:12:21

(e.g. the acc argument to a reducing function)

ghadi18:12:29

same for channels, the final result of "reduction" has no meaning

ghadi18:12:20

sequence does in fact respect reduced. Otherwise how else could (sequence (take 5) ...) work?

ghadi18:12:04

it's the result of reduction that is not exposed

ghadi18:12:28

transduce/reduce/into all are about producing a final result

p-himik18:12:22

> sequence does in fact respect reduced. Sorry, I meant that it ignores a value passed into reduced, and not something being reduced?.

raspasov18:12:52

Thanks for the clarity @U050ECB92

J17:12:29

Hi! On test.check how to pass the seed option in the defspec macro?

iperdomo17:12:56

> The difference from quick-check is partly just syntactic, and partly that it defines a test instead of running it. https://clojure.org/guides/test_check_beginner#_defspec

iperdomo17:12:29

my understanding if you need the seed when running your test, right?

J19:12:07

Yes I want to running the test with the specific seed (because of test fail)

J20:12:39

You can do this directly:

(defspec my-test 10
  ...)

(my-test 1 :seed 12345)