Fork me on GitHub

yes, exactly


so is there another way I can test my code without actually running it on aws? Is planck not the right this for this?


@derpocious I don't have any experience with AWS Lambda, so I don't know what is entailed in running the server. Having said that, Planck and its planck.http library can make HTTP get calls to any HTTP server.


Yes, you absolutely can make HTTP calls from Lambda.


You might check #aws-lambda, a very quiet forum but there are people over there with direct experience.


There is ring middleware that adapts the inbound AWS events, so you can (if you like) write as if you’re “just” a ring app with compojure routing and so forth.


hmm will planck.http work if I deploy it to aws?


There is a Linux version of Planck available, and if you manage to deploy it there, it can make outbound HTTP calls (presuming AWS Lambda allows that). But, I suspect you need to respond to AWS Lambda events of some sort... I don't know how you would get Planck to respond to those. (Ignorance on my part.)


ok thanks. do I need to change my project.clj to add planck? Or require something special in my core.cljs file which is now using cljs-http?


@derpocious Hmm. I don't think I understand the overall goal you are trying to achieve.

Drew Verlee01:02:59

Anyone have a recommendation for learning Java? I feel like most good books would need to be updated to include every new version of java…

Drew Verlee01:02:52

Like, remember all that stuff we said in the last book. Forget that, we have steams and lambdas now…


@drewverlee My recommendation? Don't bother 😆


(I have a bunch of Java books lying around -- I try to keep on top of this stuff even tho' I haven't programmed in Java since... maybe Java 5?)


I quite enjoyed Java 8 in Action. Let me dig up what else I have...


Hah, the introduction of lambdas in Java was what finally caused me to decide I couldn't take it any longer and I jumped to Clojure.


Hmm, almost everything else I have is fairly language agnostic or polyglot...


I never learned any Java post generics, really


I have a bunch of old Java print books... I'd have to go digging around in the library for those... all the ebooks I keep on my phone, laptop, and desktop.


Even JCiP, which is awesome, becomes a bit irrelevant once you learn how to use Clojure atoms


I guess this is a biased channel for such a discussion 🙂


Yeah, it's kind of old hat nowadays, with Clojure and even Scala to some extent.


And Kotlin has coroutines now...

Drew Verlee02:02:43

Well, assuming working in Clojure is a goal. 1. I believe I have a better chance of moving a team from java to clojure then getting a job in Clojure. I dont know if ppl are aware but “mid level clojure dev” is basically non existent (maybe if your in cali?) 2. convincing ppl usually means trust and trust is typically earned (in part) by demonstrating mastery in an area the target is interested in. So in this case i believe getting better at java is my best chance of working in clojure. This discussion is quickly moving towards job-dicusss though… That being said, I work in java all of a sudden and my someone on my team just made a website to generate objects we use commonly, something about that is really sad and if i have any hope of doing better though, i need to learn more…


Re: 1 -- yup, very aware. It's unfortunate, but understandable with the size of the industry.


Re: 2 -- yup, and a lot of (junior) devs get excited about Language X and try and push for it and either get disappointed that no one listens or else it gets adopted and is a disaster (changing tech is hard).


I don't think anyone could pay me enough to work in Java again. So much Java work is soul-crushingly rote and mindless, with so much needless ceremony around it.


Look at Kotlin or Scala opportunities. Even Groovy. Anything but Java.


hey, is anyone here experienced with aws lambda? I asked a question in the aws-lambda room. trying to use cljs-http or some clojurescript http client that works on aws-lambda. thanks 🙂


What can I do when lein figwheel dev does not offer the repl? The last line is Prompt will show when Figwheel connects to your application. But even after browser loads the page, I don’t get the prompt.


How to debug the problem?


@duminda you could double check the browser console to check if it is trying to connect, or some error happened before it could connect


@noisesmith: Yep: Cannot read property 'chan' of undefined (in async.cljs)


sounds like some deps are out of sync, or some error in the code that would bootstrap figwheel?


Ok, running lein clean and then running lein figwheel dev takes care of the problem.


haha I guess "lein clean" is the new "turn it off and on again"


What’s the idiomatic way to create a vector from a lazy sequence? i.e. (some-function (take 5))


(into [] (take 5)) doesn’t work


(into [] (take 5 (range))) or (vec (take 5 (range)))


(By saying (take 5) you are creating a transducer.)


So, (into [] (take 5) (range)) works, if you want to use (take 5)


Is there a ready-made function which would let me traverse a vector along with the indices? i.e.

(traverse-vec (fn [index elem] (println index elem)) [5 2 9 8])
0 5
1 2
2 9
3 8


@duminda you're looking for map-indexed i believe.

Cayetano Soriano09:02:29

Hi, does anyone using sonarqube with clojure for CI?, Wich plugin are you usinig?


Can anyone point me in the right direction to get this to work (derive MyClass cljs.core.LazySeq)? It's failing in my repl. Thanks!


I think you can start from documentation) second argument (parent) must be a namespace-qualified keyword or keyword but not a class


by the way - what kind of relation you want to make?


I want to build a new type or record that behaves almost exactly the same as inbuilt clojure data structures, and then use multimethods to change some particular behaviour.


From the docs "You can also use a class as the child (but not the parent, the only way to make something the child of a class is via Java inheritance)." Does this mean I can't use derive with clojure.lang.PersistentVector and similar as the parent?


i'm getting a pretty strange compilation error, specifically around / (division). has anyone seen this before?

(/ screen-width 2)
produces the compilation error:
cljs.core//, all arguments must be numbers, got [#{nil clj-nil} number] instead.


@joshkh Looks weird, have you tried printing screen-width?


yes, however it never has a chance to print. the compiler comes back with that error message when it tries to compile


and yet it's fixable by wrapping screen-width with js/parseInt, which is even more confusing because that would return NaN if screen width didn't have a value (as indicated by the error message), and the division would surely fail (which it doesn't).


and it's not a run time error...


True, that's really strange.


thanks for confirming that. i thought i was going crazy. ¯\(ツ)


I'd try: clearing browser cache, stop figwheel, lein clean, start figwheel again


no dice 🙂


right, so my assumption is that the compiler can't know what the width function returns as it's interop with an external js library so it fails pessimistically. however, it would know that js/parseInt returns a number.


the following modification compiles as well when using core javascript functions (getClientWidth), so that must be it

(defn left-or-right [dom-node]
  (let [{x :x} (obj->clj (ocall dom-node :getBoundingClientRect))
        screen-width (ocall js/window :getClientWidth)]
    (> x (/ screen-width 2))))


@joshkh That might be a compiler bug. The intent is that it be fairly conservative if it can't infer the type of something and not emit warnings. But it seems something is making it think screen-width is nil... Hrm.


It might also be possible to suppress whatever is going on by adding a ^number hint.


Hey there! I’m pretty new to cljs and clojure, and I’m trying to get codox to work with a project. So far I am able to generate the API documentation, but I’d like to have it generate docs for a certain namespace. I’ve been following along on the GH page, but I am running into this error:

codox: unknown option(s): :namespaces


@joshkh Are you using a ClojureScript compiler prior to 1.9.456? (You might be seeing


@chris879 Are you sure you're using the latest version of Codox? The :namespaces change was only in 0.9.


(although I figure you're using 0.10.3 per the readme)


@seancorfield Yep, I’m using 0.10.3, I should have mentioned that I’m using boot too. I was able to figure it out by using the -f flag. Thanks!


I wonder if Codox could be made to read options from a file with Boot, to save having to specify command line options for everything?


So I actually found that I can pass :filter-namespaces through build.boot. Looks like it just acts as a wrapper of sorts here


@chris879 Yup, the deftask defines the command-line arguments in short form and long form and the values are bound to variables with the long form name.


And when you're invoking a Boot task from another task, you use named keyword arguments that match the long form name.


Boot's CLI is pretty nice...


Hi all… I’m not exactly a beginner but today I feel like one… Can anyone explain what I’m doing wrong here?

user=> (doseq [s ['doc '+]] (doc s))
What am I missing? Doesn’t doc expect a symbol? Why can’t I give it a symbol? Thanks!


doc is a macro


so it’s literally trying to find documentation for the var s


I want to build a new type or record that behaves almost exactly the same as inbuilt clojure data structures, and then use multimethods to change some particular behaviour.


From the docs "You can also use a class as the child (but not the parent, the only way to make something the child of a class is via Java inheritance)." Does this mean I can't use derive with clojure.lang.PersistentVector and similar as the parent?