This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-14
Channels
- # aws (6)
- # babashka (31)
- # beginners (69)
- # biff (9)
- # boot (9)
- # bristol-clojurians (1)
- # calva (20)
- # chlorine-clover (2)
- # cider (8)
- # cljsrn (24)
- # clojure (25)
- # clojure-norway (4)
- # clojure-spec (29)
- # clojure-uk (7)
- # conjure (23)
- # datahike (5)
- # datomic (39)
- # emacs (4)
- # fulcro (4)
- # graalvm (11)
- # honeysql (1)
- # lambdaisland (1)
- # leiningen (8)
- # liberator (1)
- # libpython-clj (3)
- # malli (6)
- # mxnet (1)
- # off-topic (94)
- # pedestal (13)
- # re-frame (4)
- # releases (2)
- # shadow-cljs (8)
- # spacemacs (22)
- # sql (9)
- # vim (1)
What is a good pattern to do this with core.async. I have a producer that writes to a bounded channel and consumer that reads from the channel, if either of the processes fails, then also the another process should stop. Also there should be two threads, so that simultaneously a new message is beeing produced while earlier messages are processed by the consumer.
Hello, I might be missing something obvious, but why does (println :a.b.c/1)
produces a
Syntax error reading source at (a.clj:1:18).
Invalid token: :a.b.c/1
but (keyword "a.b.c/1")
produces the keyword as expected?@rahul080327 the keyword function is more lenient than the reader
:1 is accepted because it once accidentally worked and they don't like breaking existing code
it was never meant to
There are libraries out there that assume :1
works. They changed Clojure at one point in an alpha to disallow such keywords and it broke code so they decided to continue allowing them (even tho' they are not "legal").
Does anyone know why Rich Hickey choose the boolean logic system that Clojure has? I would be interested in knowing not only his reasoning for this choice, but also the advantages and tradeoffs of this choice.
Assuming you are referring to the recent one [here](https://download.clojure.org/papers/clojure-hopl-iv-final.pdf). Yes, unfortunately, he doesn’t mention it.
it might be useful to compare scheme (has #t and #f for booleans, empty list is truthy), and common lisp (empty list is nil is falsey)
clojure's approach is very similar to scheme, except it adds a nil that can be used both as empty list and as falsey
Clojure for Lisp programmers talk has some discussion by Rich of the choices, targeted at an audience of people who know Common Lisp and Scheme
If I recall correctly, true/false come from the JVM, and easier interop strongly calls out for having a representation for those in Clojure explicitly. nil as another falsey value is I believe something that Rich considers so useful for if
, when
, and cond
conditional expressions, that he wanted to have that in the language as falsey, too.
That Clojure for Lisp Programmers talk does have some other disccusion by Rich for at least some other design decisions in the Clojure language.
I just re-watched the ants simulation demo yesterday, and he did mention it was Common Lisp semantics plus Java’s true/false for simplifying interop.
I am configuring Ring's site-defaults and setting the session store to cookie but it's requiring a a byte array. How can I convert my string to that? Full error:
WARNING: The secret key for the session cookie store should be a byte array.
String secret keys have been deprecated.
Execution error (AssertionError) at ring.middleware.session.cookie/cookie-store (cookie.clj:124).
Assert failed: the secret key must be exactly 16 bytes
(valid-secret-key? key)
someone had a blog post a couple of weeks ago abut sorting sets by a map value which is proving to be pretty google-proof. does anyone #rememberaurl ?
Not sure if you are thinking of this http://clojure.org guide article, or something else? https://clojure.org/guides/comparators
I went searching in Zulip for sort
and set
but they get mentioned a lot across a lot of topics so I couldn't find anything obviously related... can you provide anything more precise @U0GFU866B?
it was not the comparators guide @U0CMVHBL2, it was a blog post which appeared in my clojure RSS feed. I wish I had more to go on than that. And yes, @U04V70XH6 it's pretty search-proof. I'm sure i can get a naive answer by REPL-grinding but I recall this post as having done the thinking for me