This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-10
Channels
- # announcements (1)
- # apache-kafka (1)
- # beginners (61)
- # bigdata (1)
- # brompton (3)
- # buddy (1)
- # calva (18)
- # clara (2)
- # clj-commons (1)
- # clj-kondo (21)
- # cljs-dev (2)
- # clojure (32)
- # clojure-europe (10)
- # clojure-filipino (4)
- # clojure-france (2)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-spec (28)
- # clojure-uk (14)
- # clojurescript (6)
- # conjure (1)
- # cursive (5)
- # data-science (1)
- # datahike (2)
- # datomic (9)
- # emacs (4)
- # esprit (17)
- # fulcro (14)
- # jobs (1)
- # jobs-discuss (18)
- # lsp (1)
- # malli (27)
- # msfs2020 (22)
- # off-topic (7)
- # pathom (3)
- # portal (1)
- # re-frame (23)
- # reagent (4)
- # reitit (1)
- # remote-jobs (1)
- # shadow-cljs (5)
- # sql (11)
- # tools-deps (77)
- # vim (19)
Why does clojure.datafy/nav take a v(alue)? Why would I return a value, instead of just navigating into a data structure (similar to get-in)?
question about lazy sequences. tree-seq
and distinct
are both documented to return lazy sequences.
(let [all-nodes (distinct (tree-seq (fn [node]
(not (member node '(true false))))
(fn [bdd]
(for [child '(:positive :negative)
:when (or draw-false-leaf
(child bdd))]
(child bdd)))
bdd))
apex-node (first all-nodes)
leaf-nodes (intersection '(true false) all-nodes)
internal-nodes (difference all-nodes leaf-node)
(group-by :label internal-nodes)]
...)
how many times is tree-seq
called here? Is it called everytime someone tries to iterate across all-nodes
? For example, to compute apex-node
, leaf-nodes
, and internal-nodes?
What should I do to assure that tree-seq
and distinct
are called no more than once?Is there a function like map
or mapcat
which does the following? (doseq [n leaf-nodes] (write-leaf n))
, in common lisp the function is named mapc
. it is the equivalent of map
but does not construct a list of output values of the given function, rather it just returns its sequence argument.
What is the convention with README.md files in a project directory? my project has several name spaces which could conceivably be thought of as stand-alone, although their primary purpose is to support the main application. I don't really want to write a HUGE readme file which includes all the namespaces. I'd rather have the main README.md just document the high level summaries and interfaces, and have other files which the README.md links to.
I've made the mistake in the past of filling up REAME.md files with lots of relative links, but that confuses engines which like to copy the .md file elsewhere, and thus breaking the links.
- - - Completely different question: is there a way to make macros behave will with the compiler? For example, I'm writing a macro which has similar semantics to case/cond, and the macro is able to discover unreachable clauses. The macro could at this point emit a warning telling the user about the unreachable code, because presumably it is not what the user intended.
using the sbcl Common Lisp compiler, if a macro calls (warn ...)
then those warnings are handled by the compiler, and correlated with the line of code which emitted the warning.
@jimka.issy You can use namespace doc strings instead of nested readme's or readme's with a table of contents. https://stuartsierra.com/2016/clojure-how-to-ns.html#docstring
Hi, does anybody know why lein repl would make my terminal prompt disappear? If I quit the repl I can't use shell commands anywhere.
delete buffer
yes in shell mode
yes, but after that the prompt is also missing on the OSX terminal as well as emacs shell
can you reproduce this without lein? start a different program, kill the buffer and then see if you observe the same behavior?
I kill java and angular builds all the time, but it doesn't have this effect
I can check to see if it does this if I kill it with a regular terminal outside of emacs
I am using the chestnut template
This issue sounds like it might be fairly specific to the #emacs channel, at least as far as Clojure is concerned.
if I do it outside of emacs it still works...
ok I will ask there
Anyone recalls a severe, surprising difference between clojure.data.json, cheshire and jsonista? Be it in encoding or decoding. e.g. anything that could cause a production issue, maybe a subtle one. Doing some quick testing I found that c.d.j doesn't support types such as dates/bytes/chars (at least OOTB), and also that it drops the namespace out of qualified keywords. Other than that they seemed equivalent (which I checked by piggy backing into cheshire and jsonista unit tests), although I have yet to code a comprehensive test
what is the correct way to print the content of a lazy seq? format %s
prints something like clojure.lang.LazySeq@f105783a
@jimka.issy use pr-str
inside other things that expect strings, or prn
itself if the lazy seq is the only thing ot print
so (format "%s" (pr-str ls))
or (prn ls)
in general, pr-str
and prn
give you the output you'd expect at the repl, which uses the same code by default
Hm, interesting if you use cl-format
rather than format
, the contents of the sequence are printed 🙂
(cl-format false "label ~A appears ~D times in transitions of ~A: transitions=~A"
label freq q (:transitions q))
~A
means print aesthetically
I'd be surprised if the formatter for ~A
wasn't calling pr-str, or some of the same implementation code pr-str uses
~A is sort of a do-what-i-mean printer.