Fork me on GitHub
#clojure
<
2018-12-01
>
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
dominicm09:12:17

Ooh! Given recent discussions I'd like that.

dominicm09:12:36

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.

dominicm09:12:40

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

dominicm09:12:58

It's supposed to be providing string escaping afaict.

dominicm09:12:44

> 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

kulminaator11:12:03

i wonder if i figure it out correctly from memoize source that it doesn't have any limiting on the memory that it uses ?

kulminaator11:12:12

at least at first sight it seems so

andy.fingerhut12:12:07

clojure.core/memoize creates an atom containing a map, and can assoc new key/value pairs into it, but never removes anything, yes.

kulminaator12:12:10

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

pvillegas1218:12:34

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

pvillegas1218:12:53

I tried KeyStoreKeyingDataProvider/KeyStorePasswordProvider but it does not find the class

kulminaator18:12:12

won't this do ? KeyStoreKeyingDataProvider$KeyStorePasswordProvider

kulminaator18:12:51

just like java.util.Map$Entry works for the Entry interface in Map

pvillegas1219:12:09

@kulminaator I tried that but it still does not work with proxy

pvillegas1219:12:21

I get

No matching ctor found for class
   xades_signature.core.proxy$java.lang.Object$KeyStoreKeyingDataProvider$KeyEntryPasswordProvider$KeyStoreKeyingDataProvider$KeyStorePasswordProvider$d860b872

pvillegas1219:12:36

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))))

mars0i19:12:02

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

mars0i08:12:54

OK, I'll try that. Thanks @U064X3EF3.

mars0i17:12:03

@U064X3EF3 I went the route of using 1.10.0-RC2 (which uses recent specs.alpha, I assume), and that fixed the problem. Thanks!

kulminaator19:12:37

@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

pvillegas1219:12:27

my intent is to create a class which implements those two interfaces with password as the only instance variable

pvillegas1219:12:43

is proxy the way to achieve this?

kulminaator19:12:37

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

kulminaator19:12:34

a truly flawed example but perhaps get's my message across

pvillegas1219:12:10

thanks @kulminaator! removing the [password] makes it work šŸ˜„

pvillegas1219:12:17

thanks for pointing me in the right direction

kulminaator19:12:57

ah ok, you figured it out without me adding a hideous example here, great šŸ˜„

kulminaator19:12:01

i was about to copy paste it

seancorfield22:12:08

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?

20
potetm02:12:11

This was a sloooow burner for me lol

šŸ˜‰ 4
mseddon22:12:05

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

mseddon22:12:08

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