This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-01
Channels
- # 100-days-of-code (5)
- # adventofcode (234)
- # aleph (13)
- # announcements (2)
- # architecture (3)
- # bangalore-clj (1)
- # beginners (312)
- # calva (7)
- # cider (6)
- # cljdoc (3)
- # cljs-dev (30)
- # cljsrn (2)
- # clojure (40)
- # clojure-austin (2)
- # clojure-dev (65)
- # clojure-greece (1)
- # clojure-italy (29)
- # clojure-kc (1)
- # clojure-russia (2)
- # clojure-uk (26)
- # clojurebridge (1)
- # clojurescript (4)
- # cursive (11)
- # data-science (1)
- # datomic (43)
- # docker (1)
- # duct (7)
- # emacs (3)
- # figwheel-main (7)
- # fulcro (8)
- # garden (3)
- # graphql (8)
- # hyperfiddle (4)
- # off-topic (10)
- # other-languages (12)
- # pathom (4)
- # portkey (1)
- # remote-jobs (3)
- # rum (8)
- # shadow-cljs (40)
- # tools-deps (68)
- # unrepl (2)
- # vim (5)
Just got an email saying Elements of Clojure has been updated and is now fully released! what a good time to buy a copy
user=> (clojure.string/split "-m edge.main" #"[^\\]\s")
#_=> ["-" "edge.main"]
I'm a little confused, where is my "m" going? I thought htat [^\\]
was saying "not \", but clearly not.> The one-jar mechanism already passed command line arguments through to main, I have added a One-Jar-Main-Args manifest argument to allow for default arguments to be provided to main. Whitespaces can be escaped using backslash. Yeah, the regex is just broken š I guess I get to fix it then
i wonder if i figure it out correctly from memoize source that it doesn't have any limiting on the memory that it uses ?
at least at first sight it seems so
clojure.core/memoize
creates an atom containing a map, and can assoc
new key/value pairs into it, but never removes anything, yes.
so one has to be reasonably careful when using it .. ok š
Yep, if you need full configureability, use core.memoize / core.cache
I have
public abstract class KeyStoreKeyingDataProvider implements KeyingDataProvider
{
/**
* Provides a password to load the keystore.
*/
public interface KeyStorePasswordProvider
{
char[] getPassword();
}
How do I access KeyStorePasswordProvider
from clojure? Trying to extend this with proxy
I tried KeyStoreKeyingDataProvider/KeyStorePasswordProvider
but it does not find the class
won't this do ? KeyStoreKeyingDataProvider$KeyStorePasswordProvider
just like java.util.Map$Entry works for the Entry interface in Map
@kulminaator I tried that but it still does not work with proxy
I get
No matching ctor found for class
xades_signature.core.proxy$java.lang.Object$KeyStoreKeyingDataProvider$KeyEntryPasswordProvider$KeyStoreKeyingDataProvider$KeyStorePasswordProvider$d860b872
This is what Iām trying to do
(defn build-provider [password]
(proxy [xades4j.providers.impl.KeyStoreKeyingDataProvider$KeyStorePasswordProvider
xades4j.providers.impl.KeyStoreKeyingDataProvider$KeyEntryPasswordProvider]
[password]
(getPassword
([] password)
([_ _] password))))
I've been away from Clojure for a bit, and I'm trying to switch an app written for 1.7.0 over to 1.9.0. The app has a bit of (unavoidable) nasty Java interop using :gen-class
. In 1.7.0 and 1.8.0, I can include this in my ns
statement:
(:gen-class ... :methods [[foo [] "[D"] [bar [] "[Lyow.Double2D"]] ...)
in order to declare functions returning, respectively, an array of doubles ("[D") and an array of Double2D
s (which are defined by the library I'm using). In 1.9.0 this syntax isn't accepted, it appears. Can someone point me to docs on Java array type identifiers in 1.9.0? Nothing in the changelog jumped out at me as relevant, but maybe I missed it, and this is kind of obscure info--not easy to find or search for. Thanks.This might have been a core spec bug. Could try adding latest version of org.clojure/core.specs.alpha
Hard to search on phone, sorry to not include all info
OK, I'll try that. Thanks @U064X3EF3.
@U064X3EF3 I went the route of using 1.10.0-RC2 (which uses recent specs.alpha, I assume), and that fixed the problem. Thanks!
@pvillegas12 i might be misreading this but why is that [password] in proxy declaration there not just [] ? you were talking about an interface but by the sound of the error clojure is looking for a constructor with that argument
my intent is to create a class which implements those two interfaces with password
as the only instance variable
is proxy
the way to achieve this?
you can make things implement interfaces but that slot there is not for your instance variables, it's arguments for constructor of the first class if it's a class ... and in your case the first thing is an interface
a truly flawed example but perhaps get's my message across
thanks @kulminaator! removing the [password]
makes it work š
thanks for pointing me in the right direction
ah ok, you figured it out without me adding a hideous example here, great š
i was about to copy paste it
Some of that was painfully on point -- and there were some wonderful references to other talks at Conj (did you spot the picture of the flan?). Folks were just dying with laughter... Great humor, wonderfully delivered š
@seancorfield I loved it. Honest and hilarious. š