Fork me on GitHub
#clojure
<
2016-02-15
>
jtackett02:02:20

anyone know why does my angel list account say I won't work on distributed teams?

rbertrand02:02:29

Does anyone have experience with JWrapper or Install4j?

zcaudate08:02:50

@onetom: you can do some sort of a wrapper: eg, (<call> (:client amazon))

michael_at_sosupper13:02:35

Can someone recommend a test framework? I'm somewhat new to testing (I've used expectations a little in the past). I am aware of names like clojure.test, Midje, and Expectations

yogsototh13:02:44

@michael_at_sosupper: I use the basic clojure.test and you should really take a look in clojure.test.check

yogsototh13:02:57

and also using it with schema

edbond15:02:25

Hi! Where can I see example of transducer with internal state and cleanup? I am using async/pipeline fn with transducer to take page screenshots and want to cleanup browser windows.

mdaley15:02:13

@michael_at_sosupper: where I work we've used midje extensively. It's great although things do sometimes get rather involved once you get into complex situations; perhaps that's just us though!

michael_at_sosupper15:02:10

@mdaley: Thanks. Sometimes it's hard to tell what tools/packages are actually being used (and are worth learning)

mdaley15:02:24

@michael_at_sosupper: I think we have around 100 RESTful services in our system that are pretty much all testing through a combination of midje and things like this - https://github.com/whostolebenfrog/rest-cljer - which allows us to do isolated acceptance testing. So, used extensively, but some people at work are starting to question its 'lack of composabiity' and are working on an alternative idea.

michael_at_sosupper16:02:03

@mdaley: interesting. sounds like it's worth a look for me. What I'm doing is small for now simple_smile

mdaley16:02:23

@michael_at_sosupper: all the approaches work, although I've found midje more useful for our purposes. Hope it works out!

stathissideris16:02:40

@michael_at_sosupper: I've heard bad things about midge, mainly because it's so macro-heavy. You may be interested in this: https://juxt.pro/radar.html

dm316:02:20

I liked midje on smaller projects, didn't have a chance to use it on bigger ones though

cch116:02:05

Is this a good place to ask leiningen questions?

cch116:02:52

Is there a way to set JVM system properties from the command line?

delaguardo16:02:33

export JVM_OPTS="-Xms2G -server" lein run @cch1 try this

cch116:02:29

That’s an interesting end-run, @delaguardo ! Thanks!

cch116:02:53

ps - hope to see you at Clojure West!

sonnyto18:02:07

I'm trying to write a macro to unwrap a list. for example (unwrap (1 2 3)) should give 1 2 3. I dont know how to do this

sonnyto18:02:18

is this even possible?

hans18:02:04

@sonnyto: a macro always expands to one form.

jcromartie19:02:39

is Stuart Sierra's "component" still the best at what it does?

sarcilav19:02:04

I’ve been testing Mount https://github.com/tolitius/mount so far, so good

mdaley19:02:06

Haven't tried it but this is a possible light weight alternative: https://github.com/tolitius/mount

mdaley19:02:24

Oh, same time! Snap!

roberto19:02:34

I’d recommend you try out both to see what suits your use case. They both have strengths and weaknesses.

ghadi19:02:00

component is still primo.

jcromartie19:02:05

I need to give it a solid look. We have our own start/stop rigged up but it is a little bit hairy.

roberto19:02:29

extra points to component for having a small code base (that I can understand)

sarcilav19:02:23

@roberto: that is always a big plus

jcromartie20:02:09

yeah I just took a look and it's refreshingly simple

benzn22:02:41

So, I'm deep in the macro rabbit hole at the moment

benzn22:02:31

And I've hit a rather perplexing error (unfortunately not too uncommon)

benzn22:02:22

(var (first (second `[foo (bar 1)])))
CompilerException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol

benzn22:02:58

Which is surprising, considering:

(first (second `[foo (bar 1)]))
=> autodiff.core/bar

benzn22:02:14

(type (first (second `[foo (bar 1)])))
=> clojure.lang.Symbol

benzn22:02:05

fwiw

(var bar)
=> #'autodiff.core/bar

benzn22:02:10

i'm assuming var itself is a macro that is doing something weird here?

echristopherson22:02:32

apparently var is a special form

echristopherson22:02:31

> The symbol must resolve to a var, and the Var object itself (not its value) is returned. The reader macro #'x expands to (var x).

benzn22:02:14

yeah, using the reader macro results in the same error

benzn22:02:35

in case there's an easier way to achieve what i'm doing... I have a macro that defines special functions and I am adding a key to the metadata of the definition so that i could (in theory) read it back out and do a basic form of type checking

benzn22:02:27

so I have something that expands to roughly:

`(def ~(vary-meta name assoc :equation true) (fn [] ..))

benzn22:02:20

ok, yeah, I guess var acts macro-esque

benzn22:02:37

if you define a macro to read the metadata, i can get out the right metadata

benzn22:02:55

wait, i take that back

jswart22:02:11

Does the answer below the accepted clear it up for you? http://stackoverflow.com/a/5596183

benzn22:02:53

not really

jswart22:02:59

I don’t know your use case but if it were me I would make something simpler like a map that had a type key and a fn key.

benzn22:02:01

i can add metadata and read it out in the REPL

benzn22:02:29

but i'm just having trouble getting from a form in a macro to something that var doesn't explode on

benzn22:02:07

i.e. (var (first '(foo 1)))

benzn22:02:55

i'd like that to be equivalent to (var foo), but alas it refuses

jswart23:02:03

So var is a special form which means something akin to “the normal rules of evaluation are different”. var expects a symbol and does not evaluate what is passed to it. Something like this (let [x '(foo 1) x' (symbol (first x))] (var x’)) may be required.

jswart23:02:14

Others will likely know of something better to do in this situation.

jswart23:02:11

Even though now that I think about it that is not likely to work either.

benzn23:02:20

i just found something that did

benzn23:02:23

it's pretty gross

benzn23:02:43

(eval (into () [(first (second '[1 (test-backprop 1)])) 'var]))

benzn23:02:45

but let me try some variations of that let form

jswart23:02:41

I did something similar recently but I’m having trouble finding the code to see if it really was tangential,.. or I’m just crazy simple_smile

benzn23:02:08

using let, var can't resolve the variable bound in the let

jswart23:02:43

yep, that is what I realized after the fact

jswart23:02:05

seems like I was doing dynamic lookups for namespaces… not exactly the same. I don’t think I’ll be much help after all 😞

benzn23:02:29

well, you helped anyway simple_smile

benzn23:02:16

For those following along, this is the final function that works:

(defn is-eq [func] (:equation (meta (eval (into () [func 'var])))))

currentoor23:02:29

I'd like to convert HTML documents to PDFs. I don't see any Clojure solutions for this. Has anyone use this? https://github.com/flyingsaucerproject/flyingsaucer Thoughts?