This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-09
Channels
- # aleph (21)
- # architecture (5)
- # boot (25)
- # cider (1)
- # cljs-dev (115)
- # clojure (59)
- # clojure-brasil (3)
- # clojure-dev (4)
- # clojure-italy (20)
- # clojure-nl (2)
- # clojure-portugal (6)
- # clojure-russia (12)
- # clojure-spec (43)
- # clojure-uk (37)
- # clojurescript (76)
- # datomic (123)
- # emacs (3)
- # graphql (2)
- # hoplon (5)
- # jobs-discuss (1)
- # jobs-rus (4)
- # keechma (7)
- # lein-figwheel (13)
- # leiningen (7)
- # lumo (2)
- # off-topic (17)
- # om (6)
- # onyx (26)
- # parinfer (19)
- # planck (2)
- # re-frame (80)
- # reagent (9)
- # ring (1)
- # spacemacs (45)
- # testing (1)
- # vim (28)
would :foo:bar
be considered a "valid" keyword ? (I know the reader happily accepts a bit anything, but I am thinking in terms of "the reader unspoken law")
I guess so, since it "inherits" from symbol rules and symbols state: "Symbols beginning or ending with ':' are reserved by Clojure. A symbol can contain one or more non-repeating ':'s."
Hi, trying to create a healthcheck for Kafka. Something that tells me if the service can consume and produce to a topic. Have you done anything similar or are you aware of anything like that?
If the above approach is not optimal, what direction would you advise me to look into? Thanks
hi, did you mean to post this to this channel? Seems more like a Kafka question than a Clojure question? I don’t mean to be obnoxious; I like and use both and I’m happy to help… just wondering what angle you’re approaching this via
I have a map that has a :year
and a :month
entry. There are obviously valid and invalid combinations of these two integers. How do I write a spec that checks the combination of them?
related: if the map had :month and :day keys, which had to be a valid combination (number of days in a month), how would you spec that ? what's the solution in general for combinations of things that might be in different parts of a data structure ?
you can spec your maps with multiple s/keys (and predicates) and then merge them, or s/and them
so one registered spec per group of things and (s/and ::foo ::bar ::baz) (or merge depending on your needs)
it's also a clean way to separate gen for these groups of dependent things (ex twitter.name twitter.screen_name twitter.profile_image_url), so that they make sense
has anyone here used clj-debugger?
Are there any projects to allow users to define .foo files, where the .foo files can have reader macros / other syntactical weirdness for supporting DSLs that 'compile down' to clojure?
@qqq where would the file name to parser dispatch happen? are you thinking of integrating with the OS file picking, the browser or email client file picking?
if you want to parse something that is mostly clojure but some custom parsing rules, it’s easy to make transit use this - transit parse takes a map for parsing dispatch and you can invent whatever tags you like and use them as first class args based on the file name
@noisesmith : I want to be able to extend the compiler to support .foo in addition to .clj files
you fork clojure then
and write some java
the language wasn’t designed to be extensible on that level
the compiler was written in java and doesn’t have runtime extension points
I see, I incorrectly thought the compiler was written in clj (and magically bootstrapped)
@qqq https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java - where the magic happens
a bunch of classes matching kinds of expressions, with emit methods on them https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L721
in particular, I bet with the right injections, I can hack boot/lein to do interpose on the *.foo files
if you are willing to define a preprocessor that takes format foo and outputs clojure - that’s a lot more doable
you just can’t expect clojure’s built in loading / compiling to be extended
(without forking)
you could look at the defunct cljx and what it did (superseded by cljc)
well maybe not defunct - just not as useful for new projects going forward (I’m sure there’s folks still using it)
my suspicion is the lack of this feature is intentional
common lisp had a user extensible reader, and Hickey seems to avoided that kind of thing
What's the point of marking clojure/clojurescript dependencies as :scope "provided"
in a leiningen project? What exactly is affected?
it means the consumer of your lib never pulls in the dep via you - it must ask for it explicitly itself
(or get it via some other dep path)
So there's no point in including in for an end project? (not a lib)
it’s especially useful when your lib / app will run in an environment where the given dep is preloaded
@ghopper yeah, not much point there
:thumbsup: Thanks
unless you run in a container!
in a container, your frontend may need things that the container should be getting without your input (think servelets / applets / that sort of thing)
That makes sense. :thumbsup:
Would it be true to say that every method of a multimethod must be the same arity as the dispatch function?
I just got an answer over in #scrum. Apparently cljs allows for extra arguments to functions which weren't defined, which I wasn't aware of.