This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-06
Channels
- # adventofcode (54)
- # announcements (3)
- # babashka (34)
- # beginners (38)
- # calva (27)
- # cherry (5)
- # clj-kondo (34)
- # clojure (26)
- # clojure-bay-area (4)
- # clojure-berlin (3)
- # clojure-europe (26)
- # clojure-india (6)
- # clojure-nl (1)
- # clojure-norway (54)
- # clojure-uk (2)
- # conjure (3)
- # cursive (4)
- # data-science (1)
- # emacs (6)
- # events (4)
- # fulcro (2)
- # hugsql (6)
- # hyperfiddle (38)
- # lsp (3)
- # matrix (1)
- # membrane (5)
- # off-topic (27)
- # re-frame (3)
- # releases (1)
- # sci (8)
- # shadow-cljs (34)
- # squint (132)
How would one build a video streaming platform in full-stack CLJ/CLJS? :thinking_face:
read about the architecture of companies already doing this and do likewise, probably
(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)
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ā¦ š
What doesn't match? to me it looks like a misleading comment.
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
.
the transducible context sequence
allows you to pass a transducer to transform its internal stepping function
sequence does in fact respect reduced. Otherwise how else could (sequence (take 5) ...) work?
> sequence does in fact respect reduced.
Sorry, I meant that it ignores a value passed into reduced
, and not something being reduced?
.
Thanks for the clarity @U050ECB92
> 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