Fork me on GitHub
Noah Bogart00:12:29

Just got an email saying Elements of Clojure has been updated and is now fully released! what a good time to buy a copy

šŸ‘ 20
clj 28
šŸ†’ 8

Ooh! Given recent discussions I'd like that.


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.


Oh, I see. It's matching all non-\ characters. This must be a bug in the library.


It's supposed to be providing string escaping afaict.


> 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 šŸ™‚

Alex Miller (Clojure team)12:12:03

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


This is what Iā€™m trying to do

(defn build-provider [password]
  (proxy [xades4j.providers.impl.KeyStoreKeyingDataProvider$KeyStorePasswordProvider
      ([] 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 Double2Ds (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.

Alex Miller (Clojure team)21:12:03

This might have been a core spec bug. Could try adding latest version of org.clojure/core.specs.alpha

Alex Miller (Clojure team)21:12:27

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 šŸ™‚

Alex Miller (Clojure team)22:12:21

Why do people keep calling me?


This was a sloooow burner for me lol

šŸ˜‰ 4

@seancorfield I loved it. Honest and hilarious. šŸ™‚


Just watched the REBL talk too, loved to see people looking back at resurrecting Genera. It is time...