Fork me on GitHub

is there a null pointer safe version of this? '' (.. this getEventData getCustomer getUserGuid) ''


maybe a way to supply default?

Ivan Koz19:04:21

don't call if something is nil?


Hrm. some-> could be useful here...

Ivan Koz19:04:04

(if nil

(or nil 5)

Ivan Koz19:04:29

it really depends which value is possibly nil

Ivan Koz19:04:20

some-> will work but make sure there is no side effects, which will be strange for java


right: don't call if something is nil in the chain


it should short-circuit and give nil or possibly a default


ill look at some->


maybe should be some->> ?


I'm just using getters so no side effect on java side.


(some-> this
would probably work?


i didn't need parenthesis on getters, but yes that did work.


I remember reading somewhere in Clojurians not too long ago that core.spec had changed Clojure to such a degree that it demanded a change to many intros to the language. Can anyone point me towards a "spec-centric" tour/intro of Clojure?

Eric Ervin20:04:08

Getting Clojure has a spec chapter

👍 4

probably the change that they were referring to is the fact that you need spec on the classpath to use the clojure jar now. So you would have to(it would be easier to) use something like the clj tool, whereas before something like java -jar /path/to/clojure-1.x.0.jar used to be sufficient.

Alex Miller (Clojure team)20:04:08

I don't think it's true that spec demanded a change to existing intros. spec is almost entirely an ala carte usage and could be totally ignored for intro purposes.

Alex Miller (Clojure team)20:04:28

The 3rd ed of Programming Clojure does include a spec chapter though.

Ivan Koz20:04:09

can't wait to read it ^

Alex Miller (Clojure team)20:04:20

destined to be somewhat wrong when spec 2 comes out :)

Ivan Koz20:04:11

@alexmiller do you think its worth it to jump onto spec 2 skipping current version?

Eric Ervin20:04:30

spec 2 specific boogaloo

Alex Miller (Clojure team)21:04:44

no, it's still actively changing

Alex Miller (Clojure team)21:04:51

which is why there is no released version

Ivan Koz21:04:06

Any unofficial predictions based on your experience when it will be ready?


I'll do my usual drive-by comment that we have a branch of our code at work that runs on Spec2 (so our transition will be as painless as possible) 🙂

🚗 4
Ivan Koz21:04:46

your drive-by comments are always on point 😉


Elsewhere I believe Alex said they hoped to have it released before Conj (November) but it could be anywhere from "a few" to "six months or so" 🙂


I think it depends on what you're building. If you're just experimenting and learning Clojure and focusing on the clojure.spec part, then playing with Spec2 so you can compare it to Spec1 and see the shift in thinking is worthwhile.


If you're building product, you probably don't want to bet on Spec2 just yet, unless you're comfortable living on the very bleeding edge (like we do).


But also, if you're not really going deep in clojure.spec, using Spec1 is fine for now.

Alex Miller (Clojure team)21:04:26

the only people that should be actively using spec 2 are people wanting to give bleeding edge feedback while we develop

Alex Miller (Clojure team)21:04:50

that's a small group of people, but their feedback has been really helpful and we greatly appreciate it


I think a number of folks who've watched Rich's "Maybe Not" talk would find Spec2 and the evolution of schema/`select` edifying 🙂


But, yeah, it's still changing a lot and that's to be expected.