This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-06
Channels
- # admin-announcements (1)
- # alda (2)
- # beginners (5)
- # boot (59)
- # clara (6)
- # cljs-dev (40)
- # cljsrn (32)
- # clojure (28)
- # clojure-austin (1)
- # clojure-belgium (67)
- # clojure-greece (60)
- # clojure-ireland (1)
- # clojure-japan (1)
- # clojure-russia (55)
- # clojure-spain (14)
- # clojure-spec (39)
- # clojure-uk (26)
- # clojurescript (152)
- # clojurewerkz (1)
- # cursive (21)
- # datomic (3)
- # dirac (15)
- # emacs (7)
- # events (2)
- # funcool (4)
- # hoplon (43)
- # immutant (1)
- # lambdaisland (1)
- # lein-figwheel (6)
- # leiningen (1)
- # off-topic (1)
- # om (23)
- # onyx (67)
- # other-languages (6)
- # pedestal (7)
- # planck (13)
- # proton (3)
- # protorepl (2)
- # re-frame (6)
- # reagent (5)
- # ring-swagger (6)
- # spacemacs (1)
- # specter (2)
- # yada (27)
hi guys, is there any good lib to generate elasticsearch mappings from datomic schema ? thanks
you can avoid docker redoing stuff from scratch by not doing stuff from scratch, create an image or whatever it is called from the current state of your project and use that instead of whatever base you are currently using
does anyone have an opinion on when to instrument a function with clojure.spec and when to add :pre assertions?
im having trouble deciding which to use
if I’m dispatching a multimethod on a vector, e.g. (defmulti foo (fn [a b] [a b]))
, can I specify a default value for one of the elements in defmethod
?
say I wanted to write a (defmethod foo [:a :default] [a b])
that would dispatch on all invocations for which the first argument is :a
@anmonteiro i can't check it but can you write a signature like (defmethod foo [:a _ ] (blah blah ...))
@dpsutton: nope Unable to resolve symbol: _ in this context
I’m going to do it like this: https://github.com/circleci/frontend/blob/52920ff80942305ca4d1421e8ac8493e0467c111/src-cljs/frontend/controllers/api.cljs#L51
I’ll declare my dispatch vectors with [:foo :default]
and in the default implementation, I’ll get-method
for [a :default]
should work
Would it be obnoxious to have lein figwheel
clean the :target-path
after someone changes the :dependencies
in their project.clj
?
Hello all, there is a library to work with OpenNMS, for monitoring platforms. So to use the instance of it in java we have to :
WSManEndpoint endpoint = new WSManEndpoint.Builder("")
.withServerVersion(WSManVersion.WSMAN_1_0)
.withStrictSSL(false)
.build();
I saw the source code that is like :
... public class WSManEndpoint
{
private final URL url;
private final String username;
private final String password;
private final boolean gssAuth;
private final boolean strictSSL;
private final WSManVersion serverVersion;
private final Integer maxElements;
private final Integer maxEnvelopeSize;
private final Integer connectionTimeout;
private final Integer receiveTimeout;
private WSManEndpoint(Builder builder)
{
this.url = builder.url;
this.username = builder.username;
this.password = builder.password;
this.gssAuth = builder.gssAuth;
this.strictSSL = builder.strictSSL;
this.serverVersion = builder.serverVersion;
this.maxElements = builder.maxElements;
this.maxEnvelopeSize = builder.maxEnvelopeSize;
this.connectionTimeout = builder.connectionTimeout;
this.receiveTimeout = builder.receiveTimeout;
}
public static class Builder
{
private final URL url;
private boolean strictSSL = true;
private String username;
private String password;
private boolean gssAuth = false;
private WSManVersion serverVersion = WSManVersion.WSMAN_1_2;
private Integer maxElements;
private Integer maxEnvelopeSize;
private Integer connectionTimeout;
private Integer receiveTimeout;
public Builder(String url)
throws MalformedURLException
{ ...
So, I trying to use it with:
(ns delldrac.core
(:import (org.opennms.core.wsman WSManClient WSManConstants WSManEndpoint WSManVersion))
(:gen-class))
(.. (WSManEndpoint.Builder. "")
(withServerVersion WSManVersion/WSMAN_1_0)
(withStrictSSL false)
(build))
clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: WSManEndpoint.Builder, compiling:(C:\Trabalho\delldrac\src\clj\delldrac\core.clj:21:7)
What I´m doing wrong?See: http://stackoverflow.com/questions/7140843/how-to-access-static-inner-java-class-via-clojure-interop
It has to be imported explicitly though, it doesn't just get imported because it's nested in the already imported one. /cc @fabrao
humm, using like this
(:import (org.opennms.core.wsman WSManClient WSManConstants WSManEndpoint WSManEndpoint$Builder WSManVersion))
works. Sorry about my newbe question 😞the problem is, the interop stuff with clojure is really for interop with the jvm, not with java the language
and it is not always obvious to people that there is a difference between what happens on the jvm, and features in the java language, and who knows what and where those differences are
java the langauge varargs, inner classes, generics, and I am sure others I am forgetting, are all places where the jvm differs from java the lanaguage
and in those places, clojure "java interop" exposes what the jvm does, not what java the language does
so for each one of those: varargs get handled as a trailing array param, inner classes become Foo$InnerBar, generic params become Object...
since java the language is an existence proof that java's interpretation can exist on the jvm, all we need is someone to write some crazy macros that implement java the language's view on top of clojure's built in jvm view
(defmacro as-if-java [& body] ...)