This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-10
Channels
- # announcements (1)
- # beginners (2)
- # calva (41)
- # cider (3)
- # cljdoc (2)
- # cljs-dev (23)
- # clojure (94)
- # clojure-dev (23)
- # clojure-russia (5)
- # clojure-spec (9)
- # clojure-uk (85)
- # clojurescript (94)
- # code-reviews (1)
- # cursive (5)
- # datomic (1)
- # emacs (8)
- # figwheel (1)
- # figwheel-main (10)
- # fulcro (27)
- # graphql (11)
- # hyperfiddle (1)
- # jobs-discuss (10)
- # kaocha (3)
- # luminus (7)
- # lumo (1)
- # off-topic (85)
- # onyx (1)
- # pedestal (1)
- # re-frame (3)
- # shadow-cljs (21)
- # tools-deps (1)
- # yada (6)
Can someone help me with this please: (sigh... Java is so... frustrating) https://clojureverse.org/t/abstract-java-class-confusion/3153
is the afterNavigateTo method going to be called on a thread where *out*
is bound to something so the output of the prn will end up where you can see it?
depends what you mean by required, the jvm doesn't enforce it, but the java language does, so if you don't you may violate assumptions of people doing java
So I thought about what you said about thread, and put (throw (Exception. "shit happens"))
there in the function, but it doesn't seem to be called at all
are you wrapping the driver in an event firing webdriver, registing with the event firing webdriver, then manipulating the regular driver?
yeah... but now I'm even more confused. There's an absctract class, there's also an interface, some examples I'm googling using the class, some using interface
because if you are doing what I asked if you are doing, then of course it isn't working
Thank you very much @U0NCTKEV8 Really appreciate your help. I was confused because I never had to extend abstract Java class in Clojure before
I can't seem to find a 1.10.0-beta5 version of the linux-install script. I'm looking at the 1.9.0.xxx version, and the core of the problem is I don't know what xxx would be in http://1.10.0-beta5.xxx, assuming it's actually built somewhere. Is it only built on full release?
The linux install script probably does Clojure 1.9.0 by default, but then you can run a clj
command line that specifies what Clojure version you want to override 1.9.0
e.g. clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-beta5"}}}'
Alex Miller included that sample command line in his announcement to the clojure Google group for 1.10.0-beta5
hmm. but that means you've already got a clojure installed. I'm trying to build a jdk11 + clj 1.10 image.
The version of Clojure used at your repl depends only on your deps.edn files
The version of Clojure used to run the program that build your classpath is bundled into clj and is always Clojure 1.9
That part would run fine with 1.10 too, but 1.10 has not yet been released yet, so...
This is not a thing that’s provided - if you want it, you’ll have to build it
This is not a thing that’s provided - if you want it, you’ll have to build it
Also FYI, #tools-deps is a good place for any future questions about stuff like this
Ok, I'll ask there in the future. but just to clarify, there isn't a https://download.clojure.org/install/clojure-tools-1.10.0-beta5.xxx.tar.gz ?
I don't know if that URL exists, but there is a 1.10.0-beta5 JAR for Clojure on Maven central, where all Clojure versions are published: https://search.maven.org/artifact/org.clojure/clojure/1.10.0-beta5/jar
no, there is no clojure tools built on any 1.10 release, because it’s unnecessary
the clojure-tools-1.9.0… can be used with any version of Clojure (it just uses Clojure 1.9 internally and is of the same approximate vintage)
the clojure-tools jar is an uberjar that happens to include Clojure, and lots of other stuff. it is intentionally not published on Maven because publishing uberjars on Maven is imo wrong
when 1.10 goes GA, I’ll switch over to building the clojure tools with it (and defaulting to it for projects), but there is no rush for that
Ok, so it sounds like the answer for my use case is just run the usual installer, add the config file, and clj -e '(println "hello world")'
just a deps.edn with {:deps {org.clojure/clojure {:mvn/version "1.10.0-beta5"}}}
or inline it with clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-beta5"}}}' -e '(println "hello world")'
(the classpath for the jvm is being built with Clojure 1.9, but you don’t care. you’re running Clojure 1.10 in the execution jvm)
I've been working on a book about Clojure and Kubernetes, and building up exemplary examples has been, shall we say, interesting.
cool, what publisher?
well pragprog was great to work with
I did a bit of work with apress long ago that was … not great
although it was long enough ago that would prob not use that as relevant info
The original "The Pragmatic Programmer" got me to think of this as more than something I just stumbled into.
part of what got me on this kick was sitting down to update my clj+k8s tutorial. https://github.com/jwhitlark/clj-on-k8s-quickstart
If you are taking suggestions for the next steps, I am curious about 7. Istio example
🙂
Oh and if you have experience with the Gateway
I’d be curious to hear about it too! ( https://istio.io/docs/tasks/traffic-management/ingress/#configuring-ingress-using-an-istio-gateway )
Let me see what I can do. When I was first working on this, Istio was in heavy flux, so I was waiting for it to calm down.
Also, PSA, there's work going on with docker-clojure: https://github.com/Quantisan/docker-clojure/pull/56
What is the easiest way to add Clojure (or CLJS) as a scripting language on top of a C/Rust application? People often embed Lua as a scripting language. I would like to use Clojure or CLJS as the scripting part.
You could embed v8 into rust. Then use cljs-in-cljs to compile provided code and run it on the v8 engine.
spec question: I have activated instrument
in my test ns and now I’m getting a bunch of Unable to construct gen
errors
however, I don’t want to generate anything, I just want to validate the args of my specced functions
I’m testing existing libraries (e.g. onyx
) against clojure 1.10.0-beta5
and seeing Call to clojure.core/ns did not conform to spec
exceptions.
1. Has something in Clojure 1.10.x fundamentally changed where existing import statements won’t work? e.g. (:import [java.nio.ByteOrder])
vs (:import java.nio.ByteOrder)
2. Or, is this just a question of enforcing new best-practices by default and we can change this build-failure to a warning only via some build flag?
this is wrong and has never actually had any effect: (:import [java.nio.ByteOrder])
1.10 makes it an error
either (:import java.nio.ByteOrder) or (:import [java.nio ByteOrder]) are correct
you should report anything like this to the lib maintainer so they can fix
fair enough, it’s actually been reported already - https://github.com/onyx-platform/onyx/issues/879
I actually fixed the namespaces locally, but then it failed because a transitive dependency also had similar problems.
Hi! Can you recommend any videos (Screencasts?) that exemplify REPL-driven development, to wow my colleagues? (the flapping birds talk is awesome but aged, and cljs-focused) Thank you!!!
Article + video: https://vvvvalvalval.github.io/posts/what-makes-a-good-repl.html
Den of Clojure: Build Your Own Logic Engine with Timothy Baldridge https://www.youtube.com/watch?v=y1bVJOAfhKY
Hello all! Java 11 has a nice feature to eval .java files. Example command: *java HelloWorld.java will compile and execute single java file. I need to load from git a single java file and execute it from Clojure code in runtime. Any advice, how to do it?
Of course, I can run it as shell (separate process), but I need to load java clases and run them in my runtime, like clojure code.
AFAIK clojure has no special superpowers when it comes to compiling class files, so you might have to shell out to that new command. After you have compiled class files you should be able to use import
or clojure.lang.DynamicClassLoader
to load them into your process
There is an example of using the DynamicClassLoader
in the docs for import
Your biggest problem will probably be (mumblemumble something classpaths mumble mumble), but it should be solveable.
Curious as to what you are planning to use on the fly class compiling for though
thanks for advices! they are helpful. we are building a metadata system and we need to load data transformation code from local git or nexus. so data will be transformed on the fly, based on meta data description.
Hi all! So I am trying to figure things out with the Java interop. I have an instance of a Java class on which I want to call its "add" method each time for a collection. Normally in pure clojure I would just use map and be on my way, but I need to maintain the state of the instance, to get the right result will all the elements added in. What would be the best approach here? An atom for keeping the state perhaps? If anybody got some pointers on this or an example it would be much appreciated!
If you prefer a map like syntax, you can also use run!
(run! #(.add myJavaObj %) coll))
(let [javaObj (java.util.ArrayList.)]
(run! #(.add javaObj %) [1 2 3 4]) javaObj)
=> [1 2 3 4]
Can someone show me the right way to reference a lib on a local drive from deps.edn? That's supported out of the box, right?
Thank you, is it described anywhere? Sorry my google is... slow this Saturday... a lot of smoke here in SF Bay because of wildfires
Wait, are you using the Internet via transmission of smoke signals, and in the SF Bay area? Yeah, you are hosed 🙂
And it looks like the people working on Wi-Fi standard 802.11ac already thought of the connection between that name and "avian carriers". Of course: https://mentor.ieee.org/802.11/dcn/11/11-11-1236-00-00ac-lb178-d1-0-gen-bucket-comments.xls