Fork me on GitHub
#clojure
<
2019-02-09
>
Alex Miller (Clojure team)00:02:32

I don’t think that works anymore in modern jvms

seancorfield01:02:10

-J-Xverify:none still seems to make a difference on OpenJDK 11 vs OpenJDK 8. The -client and tiered stuff, not so much.

Alex Miller (Clojure team)01:02:53

I thought they didn’t allow you to turn off the verifier anymore, but been a while since I looked at it

Alex Miller (Clojure team)02:02:55

In any case, don’t turn off the verifier :)

seancorfield02:02:08

> (per that wiki page -- but see the caveats around that) 🙂

wei16:02:03

seeing this error running an old version of a library (liberator 0.12.2) on java 11 using the clojure cli:

CompilerException java.lang.ClassNotFoundException: javax.xml.ws.ProtocolException, compiling:(liberator/conneg.clj:1:1)
is there a workaround for this? I believe it's a general issue running old libraries on java 11, and the answer is to add the dependency using --add-modules but I'm not sure how to do that. also, it's a regression test so I can't upgrade the liberator library

Chris18:02:39

I think in Java 11 the better solution is to add the javax jaxb dependencies (available on Maven).

wei06:02:36

@cbowdon thanks, that worked for me

jjttjj18:02:58

how do people typically deal with missing values NA or NaN type values when doing data science type stuff in clojure? Is using nil or ##NaN obviously better?

jjttjj18:02:08

and checking for this everywhere?

Chris18:02:29

Is there a best practice for namespaced keys in nested maps? e.g. I have this structure with namespaced keys but see it is rather verbose:

{:document/entities 
  {:entity/extracted ... 
   :entity/tagged ... }}

jjttjj18:02:14

@cbowdon you can do this to save a little repetition:

{:document/entities 
                #:entity{:extracted []
                         :tagged [] }} 

Chris19:02:23

Thanks - sorry I should have said I’m aware of that syntax but even then it doubles up on entity/entities in this example.

jjttjj19:02:55

I'm not 100% what you mean, do you mean you want the :entity keyword qualifier somehow inferred from it being below :document/entities in the tree?

jjttjj19:02:38

I think a lot of the qualified keyword stuff is a place where verbosity has been hard to avoid in my experience

Chris19:02:47

Yes, or if there’s some better way to design my data so it’s not necessary

drone19:02:41

I think records could be useful for this. but, gasp, that means making use of types

shaun18:02:43

@cbowdon If you want to reduce the verbosity in your code, I'd look at using tagged literals. I put together an example of doing that https://gist.github.com/shaunparker/c89ac63cba98d05d9586a837654b1c1e. If you have clojure installed locally you can run clojure -Sdeps '{:deps {keyword-tagged-literal-ex {:git/url "" :sha "bb8513e88698c0cf12108b6df19a96679661c3cc"}}}' -m example

Chris19:02:23

Whoa, interesting stuff. Thanks Shaun, I shall have to give it a try

trevor19:02:09

I’m working a testing framework but I’m struggling to filter/compare namespaced maps

phill19:02:46

clojure.data/diff ?

trevor19:02:54

Not quite what I’m looking for. I want to ask.. is this map from this particular namespace

phill19:02:10

What does it mean for a map to be from a namespace?

phill19:02:34

Each key in a map may be namespace-qualified.

phill19:02:44

The utility of namespaced keys is precisely that one map can contain a variety of them

trevor20:02:01

Okie, thanks

trevor19:02:49

#::step{:name 'some-name}

trevor19:02:10

with an arbitrary map that may be namespaced

jjttjj19:02:16

will all keys in the map have the same namespace?

dpsutton19:02:30

just to point out, maps cannot be namespaced. there's a shorthand for when all of the keys share the same namespace but this is a property of those keys and not the map

dpsutton19:02:59

however, could you walk over things and collapse maps whose entries are keywords which all share the same namespace into a single entry?

jjttjj19:02:27

(-> #:step{:name 'some-name} first key namespace) if you can count on the map's key entries to all have the same NS

dpsutton19:02:29

not sure what your goal is but you could walk and strip namespaces, or assert that all entries have the same namespace or something. But i'm not clear what your goal is and how namespace keys really affect that

trevor19:02:05

I think the answer is to just walk the keys and see if it conforms