#clojure log - Jul 18 2014

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:04 BorisKourt: Hi, I have been following this Stasis guide: http://cjohansen.no/building-static-sites-in-clojure-with-stasis and am almost at the end with everything running smoothly. Unfortunately I hit a snag with Optimus exporting:

0:04 Exception in thread "main" java.lang.IllegalArgumentException: Parameter declaration missing, compiling:(cjohansen_no/web.clj:13:43)

0:04 This is in the ns statement

0:05 It appeared when I added [optimus.export] into the :require

0:23 Got messed up thinking that it was in the NS as the line number pointed to the end of that. It was a defn instead of dfn.

0:23 err def*

3:53 hhenkel: Good morning all. Anyone able to tell me what I'm missing here: https://www.refheap.com/88320

3:54 I would expect to get a String as well in the "TRACE given-bean"

3:58 Sorry, I meant "TRACE type given-bean:"

4:00 mthvedt: hhenkel: looks like you’re mapping onto a String?

4:00 a string is a seq of chars

4:04 hhenkel: mthvedt: Ah yes, absolutely....request is a list and I'm trying to map every item (which holds different values) to the function

4:07 mthvedt: I'm currently not getting it how to map two values of every item...I'm makeing a coffee break, will be back in about 20 min.

4:12 mthvedt: hhenkel: not sure what you’re trying to do, but it looks like you want to make a closure, and map that to one seq

4:13 something like (map #(get-read-request mbean %) seq-of-attributes)

4:40 hhenkel: mthvedt: The break helped...I figured it out. It is totally unnecessary to use map there in my code.... :(

4:40 mthvedt: coffee solves everything

5:18 wombawomba: how do I thread a list? I tried (apply (-> "a b c d") [.toUpperCase (.replace "A" "X")]) but it doesn't seem to work

5:22 hyPiRion: wombawomba: (-> "a b c d" .toUpperCase (.replace "A" "X"))

5:22 bsteuber: ,(-> "a b c d" .toUpperCase (.replace "A" "X"))

5:22 clojurebot: "X B C D"

5:23 hyPiRion: If you want to thread an arbitrary list, you have to use thrush.

5:23 $google fogus trush

5:23 lazybot: [fogus: Thrush in Clojure – Redux] http://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/

5:24 wombawomba: yeah the problem is that I want to do this in a function that takes the list

5:25 hyPiRion: the -> macro is a macro, so it cannot be applied or reduced -- it's not a function

5:25 bsteuber: wombawomba: you'll need a macro for this, since -> is a macro too

5:26 wombawomba: right

5:27 bsteuber: (defmacro thread-abcd [actions] `(-> "a b c d" ~@actions))

5:27 wombawomba: perhaps there's a way to achieve the same effect without using ->?

5:27 pyrtsa: ,(reduce #(%2 %1) "a b c d" [#(.toUpperCase %) #(.replace % "A" "X")])

5:27 clojurebot: "X B C D"

5:27 pyrtsa: wombawomba: ^

5:27 wombawomba: yeah, I'll just do that then :)

5:28 I guess that's what the thrush thing does too

5:28 thanks

5:28 bsteuber: yes but then you need to use functions and not just .toUpperCase

5:28 pyrtsa: Yep, that's thrush written out.

5:28 wombawomba: right. I think I can avoid using methods

5:51 AeroNotix: is there a library for common lisp which implements core.clj?

6:06 sandbags: I am trying to use the Java library Twitter4J. I found it on Maven as {:group-id "org.twitter4j" :artefact-id "twitter4j" :version "4.0.2"} and have [org.twitter4j/twitter4j "4.0.2"] as a depedenency in project.clj but lein deps is saying it can't retrieve org/twitter4j/twitter4j/4.0.2/twitter4j-4.0.2.pom from central

6:06 any hints as to where i went wrong?

6:07 stevenfx: sandbags: I seem to be having issues with downloading any deps at the moment including clojure itself

6:07 sandbags: stevenfx: same error? or something different?

6:08 hrmm clojars.org isn't actually loading for me ... maybe a coincidence

6:08 stevenfx: I just created a test project and this is what I get https://www.refheap.com/88284

6:08 sandbags: not sure how clojars could affect my error anyway since the pom is coming from maven

6:08 stevenfx: possible

6:09 yeah I think lien checks central first

6:09 not sure

6:09 sandbags: your error looks much the same as mine

6:10 stevenfx: But oddly I can download the file with my browser

6:10 sandbags: not sure why it's not working for me though... mine is on maven

6:10 stevenfx: sandbags: what system you on?

6:10 sandbags: system?

6:10 stevenfx: OS

6:10 sandbags: OSX

6:10 10.9.3

6:10 stevenfx: yeah same here

6:11 maybe there some issue with jvm, Im looking for a fix so I can continue working

6:13 sandbags: this doesn't feel like a jvm issue to me

6:13 i'd be suspecting some of the plumbing that is used for dependency resolution is b0rked

6:13 odd if you can download the file by hand

6:14 clojars not loading is a bit of a smell

6:14 stevenfx: yeah I see the same now, clojars is blank

6:14 but central is still fine so it should still work?

6:15 sandbags: one would hope but that's a big assumption that clojars isn't a central part of the whole resolution process

6:24 so the question is, who is responsible for clojars.org? I'm sure that info is on the clojars website :)

6:25 stevenfx: sandbags: technomancy and ato i think?

6:25 https://github.com/ato/clojars-web/wiki/Contact

6:25 Not sure if its still like that

6:27 I think central gets searched first http://goo.gl/DI4tlx

6:27 sandbags: odd that it fails for me as the POM i need is on central

6:30 stevenfx: whats your dep again? Let me add it to my test project

6:30 sandbags: [org.twitter4j/twitter4j "4.0.2"]

6:33 i'm not 100% sure that's right, i'm not very au fait with Maven

6:33 but my other attempts failed in a different way telling me the dependency couldn't be found, rather than couldn't be downloaded

6:34 stevenfx: Nope, same issue wont work https://www.refheap.com/88328

6:34 No you are correct http://search.maven.org/#artifactdetails|org.twitter4j|twitter4j|4.0.2|pom

6:35 sandbags: okay that's useful to know... took a bit of guesswork on my part

6:35 stevenfx: Let me check on another system to see if the issue is the same brb

6:41 sandbags: Same issue on my linux laptop

6:42 technomancy: You there?

6:44 sandbags: unlikely now, he's in US

6:44 stevenfx: yeah, was worth a try :)

6:49 I added a issue to https://github.com/ato/clojars-web/issues/231

6:49 Not sure if it should have gone somewhere else?

6:51 jelfs: Disclaimer - I have very little idea what I'm doing

6:51 stevenfx: sandbags: see if this page loads - https://clojars.org/org.clojure/clojure

6:51 jelfs: I have some code accessing mongdb via monger ...

6:51 and some tests that exercise this code

6:51 stevenfx: The main webpage does not load but that loads for me

6:51 jelfs: I had an idea that I might benefit from a data access protocol

6:52 so I could swap out the monger with some in memory atom to speed up tests

6:52 Is this insane or sensible?

6:53 sandbags: stevenfx: yes that loads for me as well

6:53 jelfs: If sensible do I have a single defrecord that implements the protocol and decides what method to use

6:53 or do I have two implementations of the protocol and somehow decide which one to use at runtime

6:53 is reify an appropriate solution?

6:54 hyPiRion: Is there any parsec port in Clojure?

6:54 * hyPiRion needs to Google before asking.

6:55 ssideris: is instaparse a good candidate?

6:58 hyPiRion: ssideris: Oh, it was just out of curiosity.

7:01 But no, not for streaming parsers, which I am working on now.

7:03 ssideris: oh ok, didn't know that parsec was streaming

7:10 sandbags: i'm trying to work out what on earth i should download if i want to install this lib myself

7:10 but the POM file is just an XML document, it's not the code

7:10 hrmm... i have a feeling i've been here before

7:11 stevenfx: sandbags: there is two ways

7:11 sandbags: and you can't depend on POM's in project.clj

7:11 yes... i think i've been here before, you can only add artefacts

7:11 (or whatever the word is that isn't a POM)

7:11 yes

7:11 i can successfully require twitter4j-core

7:12 of course i have no idea which of these artefacts i actually need :)

7:13 stevenfx: yeah that seems to be a pain

7:13 I feel like I just arrived in the stone age :b

7:14 sandbags: bundler and rubygems have their warts, but it feels a lot less of a pain than this :)

7:14 on the other hand we could just be amazed that such a Heath-Robinson machine works at all when it works :-)

7:14 stevenfx: but I think we might be the only two with this issue?

7:15 because no one else has complained yet

7:15 sandbags: i no longer have an issue per se

7:15 stevenfx: lol I still have issues getting deps from maven central or clojars :)

7:16 sandbags: if i could just remember next time that you can't depend on a POM i will be in good shape

7:16 stevenfx: but I have a fresh lein install with no cached deps

7:17 maybe thats why no one has realized?

7:17 sandbags: i feel your pain

7:17 could be

7:17 stevenfx: oh well, maybe its time for coffee and a break :D

7:17 sandbags: it's not unusual for bootstrap cases to be less well tested

7:18 stevenfx: true

7:19 Il bug one of the maintainers to check if its just me when they come online

7:19 if I am online still :)

7:19 sandbags: if you gist your steps, if i'm around later and you aren't i'll bring it up

7:20 hhenkel: Hi all, any hint what the problem is: https://www.refheap.com/88333 ?

7:20 stevenfx: Thanks sandbags, let me do that after my break

7:22 agarman: hhenkel: looks like trying to use a function as a number

7:23 hhenkel: agarman: yes that is what I understand from the exception but I don't understand why at the moment.

7:23 Is there something wrong with the doall ?

7:24 server-config is a lazySeq

7:24 agarman: hhenkel: without seeing the pos?, I can't really say

7:25 hhenkel: there's no call to pos? in the snippet here, but that's what's failing

7:26 hhenkel: nvm, dorun has pos? call, I'm looking there...a moment

7:26 yeah, you're calling the wrong version of doall

7:26 hhenkel: agarman: I don't have any pos? in my code.

7:27 From the stack trace the error is within the snippet.

7:27 That would explain things....so how to call a "different" version?

7:27 agarman: if doall has two arguments, the first is a number, second a collection

7:29 hhenkel: But the exception is that the function could not be casted to a number or am O wrong?

7:29 agarman: hhenkel: are you trying to schedule requests for each server config?

7:30 hhenkel: yes I do

7:30 agarman: then do you mean to do (doall (#(map schedule-requests % data-channel atat-pool) server-config))?

7:31 hhenkel: But that will happen later on, I'm allready failing to call my function "schedule-requests"

7:36 agarman: That looks "better" though I get a different error now.

7:37 agarman: I now see an error "java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core.async.impl.channels.ManyToManyChannel"

7:38 agarman: I guess I need a (repeat data-channel) ?

7:38 And also for the atat-pool thing. It looks like it is working with that now.

7:43 agarman: hhenkel: good :-)

7:50 hhenkel: agarman: Are you familar with async? I'm seeing an "IllegalArgumentException" but there is no stacktrace so I'm not sure where it happens

7:51 Here is the error

7:51 https://www.refheap.com/88335

7:52 The part after "TRACE response" is what I'd like to put into the channel.

7:58 agarman: hhenkel: can't really help w/o more context, all I can tell is that somewhere there's code trying to take! or <! from an arraylist

7:59 hhenkel: agarman: hmm, I guess the response gives me a java.arraylist and I need to cast it to somethin clojure like

8:02 agarman: Casting with (into [] (...)) seems to help

8:06 luxbock: could anyone here explain what the => macro in Prismatic's schema does? I don't understand the documentation

8:06 hhenkel: agarman: Hmm I've been glad too soon. Seems like I need to figure out what datatype I can put on the channel first.

8:10 agarman: Okay, figured out that I just copied stuff from "old" code where I was handling https reponse data. There is no need to do a !< at all...

8:49 stevenfx_: would look good with a clojure icon :) http://vorillaz.github.io/devicons/

8:51 CookedGr1phon: does anyone know if I can include aliases with a leiningen plugin?

9:14 hyPiRion: CookedGr1phon: you can with middleware, I think. But couldn't you provide the functionality within the plugin task you define?

9:16 CookedGr1phon: hyPiRion: yeah, but it feels clunkier calling set-profile and executing subtasks when I could express it in an alias in a way that the user could look at it and change the steps/profile they want to execute with

9:16 i want to set the profile and do three subtasks

9:16 I've done that now anyway

9:51 moses: This question has to come up a lot, but Om, Reagent or Quiescent?

9:51 Anyone with experience in all three care to offer an opinion?

10:33 boxed: anyone know of a pprint version that can handle output that is largeish.. like ~200k?

10:33 hcumberdale: hi

10:33 stuartsierra: boxed: dunno, but brandonbloom has a pprint that's supposed to be faster than core's.

10:34 hcumberdale: (apply (fn [_ w _ wo] {:w w :wo wo}) [true '((a b) (c)) false '((d) (e f))]) << is there a better way

10:34 trying to split a structure by some fn with group-by, want to dismiss the "true" "false" and directly get the two resulting structures

10:35 arrdem: $google github bbloom fipp

10:35 lazybot: [brandonbloom/fipp · GitHub] https://github.com/brandonbloom/fipp

10:35 stuartsierra: hcumberdale: vals ?

10:36 boxed: stuartsierra: hmmm… java.lang.ClassNotFoundException: jsr166y.ForkJoinPool :(

10:37 hcumberdale: thx stuartsierra !!

10:37 stuartsierra: boxed: Sounds like you're trying to use Clojure reducers on JDK 1.6

10:37 boxed: well crap

10:38 thanks

10:38 stuartsierra: You can add a dependency on jsr166y (http://search.maven.org/#artifactdetails%7Corg.codehaus.jsr166-mirror%7Cjsr166y%7C1.7.0%7Cjar) or get a JDK 1.7

10:39 boxed: stuartsierra: cool, thanks

10:39 stuartsierra: On a related note, it would be awesome to teach a bot how to query search.maven.org and Clojars.

10:40 arrdem: yeah, that'd be nice. maybe if I ever get around to building a clojurebot clone that doesn't ignore me and has a grimoire command that'll happen.

10:41 boxed: stuartsierra: that worked and is pretty damn fast, thanks again

10:41 stuartsierra: http://search.maven.org/#api

10:41 boxed: arrdem: well I’m currently working on making the cheatsheet usable from other code :P

10:42 arrdem: boxed: 's legit. I'm gonna try and spend some quality time with Grimoire later today if I can get this hello world demo working.

10:43 gotta figure out a way to modularize examples so that I can take example PRs without having to re-apply the patches by hand every time I blow the whole site away.

10:44 Glenjamin: are they not one file per example at the mo?

10:45 arrdem: Glenjamin: nope, it's one file with an include prefix for every version.

10:45 sadly.

10:45 it needs to be one file per example

10:45 https://raw.githubusercontent.com/arrdem/grimoire/master/_includes/1.4.0/clojure.core/DASH__GT/examples.md

10:45 case in point

10:45 Glenjamin: i see

10:46 boxed: what’s the plan? to have a non-versioned filename and if there’s a specific version file use that instead?

10:47 Glenjamin: can you use yaml frontmatter perhaps?

10:47 i dunno how flexible jekyll is, but being able to tag files as version X+ would be neat

10:48 arrdem: jekyll's not that flexible.

10:48 I suspect this is gonna be the thing that forces me to build a "real" static site gen from one of the Clojure frameworks.

10:48 but we'll see.

10:50 I really don't want to go to a db backed site, both for performance and for ease of contribution/management.

10:52 _alejandro: Is it possible to use project.clj to force a jdk version? e.g. fail if JDK < 1.7 ?

10:52 Glenjamin: yeah, i think github pages + PRs is a solid model

10:52 especially as the number of people who can merge PRs goes up

10:53 arrdem: Right. Besides, GH/PRs provides "auth" at zero cost/effort to me :P

10:53 boxed: yea, the key is to have a lot of committers

11:00 deathknight: Got my feet wet with clj-amazon...realized I must learn the way of the macro *_*

11:01 wink: If you stare into the macro, the macro stares back at you.

11:01 arrdem: of macros and basilisks?

11:02 deathknight: hah!

11:02 given enough time, a macro will compile itself

11:02 arrdem: I don't think that's how deterministic pattern engines work :P

11:03 deathknight: given enough time!

11:41 gfredericks: does the JVM not have any mechanism for globally setting an uncaught exception handler?

11:42 arrdem: does the JVM have a mechanism for entering arbitrary code execution at global scope?

11:42 gfredericks: the jvm has scope?

11:43 arrdem: I apologize I'm snarking. No. There shouldn't be such a thing. All exception handling is installed on a per-code block basis in an exception handler table that's part of each individual method.

11:44 bbloom: arrdem: um no

11:44 gfredericks: yes

11:44 arrdem: bbloom: rly?

11:44 * arrdem digs for spec

11:45 stevenfx: devicons that’s trending on HN will add a clojure icon :) http://goo.gl/LcSKxG

11:45 bbloom: http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.UncaughtExceptionHandler.html

11:46 gfredericks: bbloom: that's per thread

11:46 arrdem: (inc bbloom)

11:46 lazybot: ⇒ 37

11:46 bbloom: gfredericks: read the "see also"

11:46 you can also do it per thread group

11:46 and thread groups form a hierarchy

11:47 you can also set the "default" handler which will affect threads that don't override the handler

11:49 stevenfx: well its time to go home, have a good weekend everyone

11:54 gfredericks: bbloom: oh I missed that static method -- cool, thanks!

12:12 CookedGr1phon: I'm running clojure on android, trying to get it up and running on the newer ART runtime

12:12 and I have been successful... if I remove all uses of the locking macro

12:13 I'm tempted to put it down to an ART runtime bug, but if anyone has any insights I'd appreciate it

12:13 boxed: fucking midje “no such namespace” bullshit >_<

12:31 arrdem: 250k for the EDN with all the metadata etc… compresses to 47k

12:32 andyf: boxed: I am an atheist, but IMO the serenity prayer contains useful advice (see e.g. Wikipedia)

12:32 boxed: :P

12:33 the vast majority is the meta info like the doc string etc

12:34 sritchie: dnolen_: hmm, running into an odd thing - I’ve got a dropdown component that’s successfully triggering a state update via om/update! (actually, passing its value through a channel to an upper component that does the update!),

12:34 but the update doesn’t trigger a re-render

12:35 so the dropdown component’s value doesn’t change, even though the state is indeed changed

12:35 dnolen_: sritchie: my experience is that 90% of the time there's a mistake somewhere in case like this

12:35 sritchie: :) I believe it

12:36 dnolen_: sritchie: otherwise you need to show me a minimal example that has nothing to do w/ your project

12:36 sritchie: yup, understood… let me see if I can isolate it

12:37 seangrove: dnolen_: Some cljs webgl art https://www.dropbox.com/s/vgw61ivobkx597f/glint_webgl_abstract_art.mp4

12:37 elben: Is there a way to *not* include the clojurescript deps when using hickory (https://github.com/davidsantiago/hickory)? The project.clj has clojurescript listed in the main :dependencies

12:37 sritchie: this is the thing I was doing yestsreday that I worried would screw up the re-rendering

12:37 https://gist.github.com/sritchie/1d202fc672ddf905cd13

12:37 seangrove: dnolen_: It's been pretty fun combining cljs and webgl so far

12:37 sritchie: “static” and “dynamic” are cursors

12:37 and this is what’s changing in the global state: :selection (-> dynamic :entries (get (:id e)))

12:37 dnolen_: seangrove: pretty :)

12:37 arrdem: elben: lein's documentation specifies how to write dependency exclusions.

12:38 sritchie: I’ll keep playing with it

12:38 elben: arrdem: oh that’s right, thank you for pointint that out

12:38 sritchie: dnolen_: ah! the higher level re-render does get triggered. I’ll figure this one out, on track now

12:42 munderwo: Hi all. Im trying a really simple split string with question mark form and its not working. see https://www.refheap.com/88343 for what Im trying to do and what Im getting.

12:42 Any help? I can split on other things but obviously the ? is a special character?

12:43 justin_smith: munderwo: ^ matches the beginning of a line

12:44 munderwo: *facepalm*

12:44 nbeloglazov: munderwo: also you don't need to use 2 slashes: "\?"

12:44 munderwo: thanks justin_smith I know it would be something easy.. damn regex's that I never learnt...

12:44 boxed: andyf: without the metadata: 46k uncompressed :P

12:45 justin_smith: ,(clojure.string/split "/2010-04-01/Accounts/ACe248350937deb36e8f5e19c882d1679b/Messages.json?PageSize=50&Page=5" #"\?") munderwo

12:45 clojurebot: ["/2010-04-01/Accounts/ACe248350937deb36e8f5e19c882d1679b/Messages.json" "PageSize=50&Page=5"]

12:45 munderwo: nice thanks!

12:45 justin_smith: you were also escaping the '?' wrong, with an extra \

12:46 munderwo: also, there are classes available that do proper URL deconstruction

12:46 arohner_: munderwo: you can probably also use something like https://github.com/cemerick/url

12:47 munderwo: Oh cool. I found a different one, but that one looks better. In this case I just need the url part, but probably later on construction and deconstruction will be helpful. Also in this case I dont have the host or protocol part so I thought that might be difficult. Thanks!

12:48 justin_smith: munderwo: in my experience when I don't have the host or protocol part that is because I am serving the request, and ring breaks up the parts for me (and my routing library makes sure it gets sent to the right code)

12:49 munderwo: Yeah, this in particular is a client for a third-party api. So I only have what they give me :)

12:54 sritchie: dnolen_: yeah, was a stupid misnamed key

12:54 dnolen_: sritchie: k cool

13:22 arrdem: Bronsa: t.e.jvm.transform/get-class has to do classloading, right?

13:27 Bronsa: arrdem: well it returns a Class instance so it does load it

13:27 arrdem: mmk. That's what I thought.

13:28 there's reordering weirdness happening here... classes are being generated out of order and it's not good.

13:29 Bronsa: arrdem: tej or oxcart?

13:29 arrdem: oxcart. your code is working fine.

13:29 Bronsa: phew

14:24 augustl: in "components", what exactly is map->Database in the new-database function in the readme? https://github.com/stuartsierra/component

14:24 I don't understand how to implement the component/system-map since it operates on these magic map->Database thingies

14:25 gfredericks: um

14:25 stuartsierra: map->Database is a constructor function generated automatically by `(defrecord Database …)`

14:26 augustl: ah, I haven't used records all that much, thanks

14:26 (map->Database {:host host :port port}) will be the same as (Database. host port) then I guess

14:26 stuartsierra: yes

14:27 With the map->Record form you can omit some of the keys and they will get nil values.

14:28 augustl: for me, it would have been useful if the first component/system-map call in the README had something like (ExampleComponent. x y) instead of (new-scheduler)

14:30 stuartsierra: Noted. My use cases almost always have custom constructor functions.

14:31 Maybe I'll add something like "Keys in the system map are usually keywords. Values in the system map are *instances* of components, usually records or maps."

14:34 augustl: it was really just the map->RecordName that confused me, wasn't aware it existed :)

14:37 gfredericks: it doesn't get a lot of publicity outside of component

14:44 PigDude: korma seems to not support composing queries at all

14:45 at a superficial level it does, but the API doesn't allow you to work with a naked (where CONDS), etc.

14:45 please somebody tell me i'm wrong about this ...

14:45 amalloy: PigDude: korma is famous for being easy right up until it's impossible

14:45 cbp: that is what happens when your api is all macros

14:46 PigDude: amalloy: :( i was going to use plain jdbc but the guy i'm working with pushed really hard for korma backend

14:46 amalloy: who is this guy? push him in the back end

14:46 PigDude: the docs example (-> (select* users) (where {:first "john" :last "doe"})) is deceptive because the (where) is getting (and needs) two args

14:46 technomancy: now you get bonus i-told-you-so points

14:46 PigDude: amalloy: somebody smarter than me? :)

14:47 ok, thanks guys

14:47 cbp: when a lib's api is just macros it just mostly spells trouble

14:47 PigDude: i had misgivings about korma first time i used it and looked at its code

14:47 arrdem: macros |are| misgivings

14:47 PigDude: haha

14:47 yea, it really makes the api clumsy

14:47 makes me miss django orm :P

14:48 * cbp stares

14:48 PigDude: or sqlalchemy. i'm not going full orm but are there projects like this in clojure?

14:48 that will allow you to compose queries this way

14:48 cbp: I use strings

14:48 amalloy: PigDude: that's not really deceptive: it's blatantly clear that where gets two args there

14:49 PigDude: amalloy: that's why i asked here, maybe i am wrong, but docs say "You can also call the (where) and (having) predicates like any normal function, allowing you to compose your predicate clauses as if they were standard Clojure code." and i cannot achieve this usage

14:50 i'm pretty sure this line is misleading

14:51 bbloom: i've just given up on trying to "compose" sql

14:51 $google yesql

14:51 lazybot: [krisajenkins/yesql · GitHub] https://github.com/krisajenkins/yesql

14:52 arrdem: not yasql?

14:52 bbloom: copy/paste reuse tends to work just fine for sql :-/

14:52 that, or you can build your .sql file from a .sql.cat script

14:53 weeee cat<<! heredocs

14:54 PigDude: bbloom: :\

14:54 bbloom: i've worked on large projects that take the sql-as-string approach and it has certain limitations

14:54 bbloom: and in my experience, more defects

14:55 bbloom: it would work fine for this application though

14:55 bbloom: PigDude: that's the beauty of the catscript & yesql (or similar) approach: you can visually inspect the generated sql, which is static at program start

14:55 cbp: man that sounds like a pretty bad idea to me

14:55 bbloom: and you can commit the generated code to see if your generator breaks it

14:55 cbp: sql is hard to read therefore let's stuff it in randomly named files all over the place

14:55 PigDude: neat, will have to take a look

14:55 arrdem: cbp: /resources/sql/*?

14:55 bbloom: i've seen LOTS of rails apps w/ serious security flaws b/c a tiny change in one place causes a where clause or join to disappear or something like that

14:56 i much rather have manually written sql per use case, then do custom generation where i actually need abstraction

14:56 if your table scheme is static (and it is 99% of the time) your queries should be static too

14:56 cbp: arrdem: that's not that much better than /

14:56 bbloom: schema*

14:57 arrdem: cbp: sure, but you're also not mashing it into src/

14:57 PigDude: bbloom: shouldn't conflate ActiveRecord with all db/schema/query abstraction

14:57 bbloom: sqlalchemy is very low-level, for isntance

14:57 cbp: now your sql queries probably have to follow some directory structure and some naming conventions and ugh what a pita

14:57 bbloom: PigDude: i've used sqlalchemy before as well, it's much nicer than active record and also much nicer than arel (the internals of active record which copied sqlalchemy)

14:58 but as far as i can tell, if you're not going to pull a full Linq, you might as well not even try

14:58 cbp: If syntax highlighting is so important surely you can just use IDEA

14:58 PigDude: bbloom: i'll tell that to all the projects using sqlalchemy :)

14:58 bbloom: PigDude: there are plenty of good use cases for query abstraction

14:58 PigDude: and you could do far worse than sqlalchemy

14:58 PigDude: bbloom: at my last job we were using it on small facility servers, i don't know how easy it would be to use linq in such a context

14:59 bbloom: and you can do far better: https://en.wikipedia.org/wiki/Language_Integrated_Query

14:59 PigDude: hehe you mean FORCE.COM? :)

14:59 bbloom: PigDude: don't get me started on SOQL

14:59 PigDude: aka SOQL

14:59 bbloom: what a disaster

14:59 PigDude: hehe

14:59 yea

15:00 bbloom: sqlalchemy also has quite a few subprojects

15:00 the query generation is fine, but the schema generation is just as bad an idea as activerecord

15:00 although scheme reflection is not terrible

15:01 s/scheme/schema again

15:01 argh

15:02 amalloy: bbloom: just add an autocorrect rule for scheme->schema. it will prove entertaining in future discussions anyway

15:02 PigDude: bbloom: hehe i gave a presentation last week on clojurescript and closure tools, so much ambiguity

15:25 jcromartie: I can't get lein cljsbuild to compile the simplest possible cljs file

15:26 cbp: an empty file?

15:26 augustl: when creating jar files for folks to self-host, I suppose having a plain old properties file in the same dir as the jar is a sane way of providing configurability?

15:35 jcromartie: well just a js/alert

15:35 it might be my project's insane deps

15:35 but I just get a massive stack trace from the clojurescript compiler… I'm trying to make a minimal test case

15:35 I'm adding cljs to my existing app

15:35 which is quite large

15:37 cbp: cljs gives pretty massive stack traces

15:37 bryanmaass: PigDude: is that talk avaliable online anywhere?

15:40 jcromartie: (ns app.core)

15:40 (js/alert "loaded")

15:40 that's my file

15:41 I don't even feel bad pasting it here

15:41 now, the stack trace...

15:41 https://gist.github.com/jcromartie/6153611f4ef070b51738

15:41 :)

15:42 cbp: shouldn't the path be src/cljs/app/core.cljs?

15:44 mm actually i guess it might not say the whole path

15:59 stuartsierra: That's not a Clojure stack trace. That's not even a Java stack trace. It's something generated by a library trying to make the Java stack trace "pretty."

15:59 And probably losing information on the way.

15:59 amalloy: jcromartie: are you sure that's the source file you're compiling? the stacktrace for that suggests your ns form has an empty :use-macros clause in it or something

16:00 stuartsierra: ~seen talios

16:00 clojurebot: talios was last seen joining #clojure, 888 minutes ago

16:00 amalloy: $seen talios

16:00 lazybot: talios was last seen quitting 14 hours and 1 minute ago.

16:01 stuartsierra: thanks amalloy

16:01 amalloy: cause math is hard

16:08 stuartsierra: Fun with class loaders http://dev.clojure.org/jira/browse/CLASSPATH-6

16:09 mdrogalis: Fun. Sure. D:

16:09 * mdrogalis takes 3 steps back.

16:09 * arrdem hands mdrogalis a 20' pike

16:10 mdrogalis: Haha.

16:16 stuartsierra: Or, ways in which `java -jar` is not the same as `java -cp` for $800, please, Alex.

16:16 amalloy: stuartsierra: this is sorta a symptom of pretending that all classloaders use the classpath, right? that is, the real, general mechanism is this opaque "i need the class or resource named X, please find it", but we've built stuff assuming that it's based on a list of resource paths to look in?

16:16 stuartsierra: amalloy: yes

16:21 amalloy: stuartsierra: i'm curious, since you tested this ticket: does loading the resources by name with c.j.io/resource work? or are they totally unobtainable?

16:23 stuartsierra: amalloy: interesting question, trying it ...

16:24 amalloy: i'd guess that they are in fact loadable by name

16:25 stuartsierra: amalloy: Yes, loading resources still works.

16:27 PigDude: bryanmaass: only slides http://oinksoft.com/closure-tools/sgdg-jul14/

16:31 mikerod: stuartsierra: I like this line "There is no obvious API for getting the Class-Path property of the manifest file without opening and reading the contents of the JAR file."

16:31 Why must Java make the ClassLoader API so hard to deal with.

16:31 stuartsierra: This particular case looks like it might be an oversight.

16:31 mikerod: it always comes back to opening jars and digging things out yourself. :(

16:32 stuartsierra: Obviously, internally there's some code that reads the manifest.

16:32 In OpenJDK I can find it in sun.misc.URLClassPath.

16:32 mikerod: ah

16:33 stuartsierra: But the Launcher class doesn't use that when you call .getURLs.

16:35 augustl: in "components", does it make sense to create a bunch of threads when creating the component, and start them in Lifecycle/start? /cc stuartsierra

16:35 alandipert: jcromartie, that's the error you get when clojure 1.6 and 1.5 are in play and you're trying to cljs with a version using 1.6

16:36 stuartsierra: augustl: sure

16:36 augustl: I suppose creating a Thread object doesn't have any special overhead

16:36 stuartsierra: Or create & start the threads in Lifecycle/start, not much difference.

16:37 augustl: the reason I want to split it up is that I want the threads in shutdown, so I can kill them. That way the start method only starts, it's not responsible for also returning that collection of thread objects as well

16:37 s/shutdown/stop

16:37 stuartsierra: `start` still has to return the component containing all the thread instances.

16:39 augustl: ah, right

16:40 martinklepsch: can I alias a function in a way that preserves metadata and it's signature?

16:41 amalloy: martinklepsch: you can, and ztellman/potemkin contains such a feature. i'd advise against doing it without a strong reason, but i no longer think it's as unspeakably evil as i used to

16:41 ztellman: amalloy: good, goooooood, give into the namespace aliasing

16:42 aperiodic: amalloy: do you mind explaining what changed your mind?

16:43 martinklepsch: amalloy: the reason is that a library maps very directly to methods of annother API and not having the function gives the impression it's not implemented

16:43 amalloy: more here: https://github.com/clojurewerkz/elastisch/issues/96

16:43 stuartsierra: (refer 'clojure.set :rename {'union 'u})

16:43 alandipert: i used to think everything ztellman did was evil until started using it all

16:44 martinklepsch: (I'm not sure either if it's the best way to go, so feel free to enlight me with your opinions :)

16:44 amalloy: one of ztellman's READMEs somewhere arguing that you shouldn't have to make your public api mirror your internal structure. so you have the real internal structure for use within your library, and some set of hand-curated external api namespaces to make using it possible without knowing the internal structure

16:44 ztellman: alandipert: thanks for providing the anchor quote for my three part series: "Fall and Decline of the Clojure Emprie"

16:45 bacon1989: ,(def x (atom nil))(not= @x nil)

16:45 clojurebot: #'sandbox/x

16:45 ztellman: that would be https://github.com/ztellman/potemkin#import-vars

16:45 bacon1989: ,(println (not= @x nil))

16:45 clojurebot: false\n

16:45 bacon1989: ?

16:46 man, i'm getting different results, maybe it's something else

16:46 amalloy: ztellman: it was actually the factual api server. i wouldn't be caught dead reading potemkin's readme

16:46 ztellman: amalloy: I'll get right on open sourcing that

16:47 stuartsierra: martinklepsch: If it's just for local use, `refer` does what you need.

16:47 Zekka: Hey: I'm a Haskell programmer who's using Clojure for a work project and finding it kind of hard to debug -- do any of you have suggestions for how I ought to be doing it?

16:48 I'm mostly upset because it seems like the bulk of the errors I get occur at runtime and don't get to the heart of the issue -- because of the lack of type constraints they occur as soon as a problem actually happens, not i.e. at the entry point to the part of the code where the problem first happens

16:48 (so if I accidentally pass a widget to a function expecting a string, for instance, but which stores it instead of operating on it immediately, it'll gleefully store it and then fail when operating on it instead of failing at the point of storing it)

16:49 gfredericks: Zekka: there's a spectrum of tactics

16:49 stuartsierra: Zekka: assertions and pre/post conditions are generally your friend in these cases.

16:49 Zekka: I know Clojure has optional type-annotations but when I'm using libraries that don't use them or encourage you to use them it seems to me like there's not a reasonable way of going about it

16:49 martinklepsch: stuartsierra: basically I want to define a fun-b in the same namespace that looks exactly like fun-a including (doc fun-b) etc

16:50 stuartsierra: sure that refer is the way to go still? reading the documentation I'm not sure how I'd accomplish that

16:50 Zekka: stuartsierra: Do you have any docs you can recommend?

16:51 stuartsierra: martinklepsch: No, refer won't do that. I wouldn't do that either.

16:51 Zekka: (actually, in general I wish I was better at debugging code in dynamic languages: it's really hard!)

16:52 arrdem: $google fogus :pre :post

16:52 lazybot: [fogus: Clojure's :pre and :post] http://blog.fogus.me/2009/12/21/clojures-pre-and-post/

16:52 martinklepsch: stuartsierra: so in respect to that issue (https://github.com/clojurewerkz/elastisch/issues/96) could you give me any advice what you think would be a good idea to do? just leave it as is? /cc amalloy

16:52 Zekka: Thanks!

16:53 * arrdem adds :pre and :post to Grimoire's todo list

16:53 augustl: stuartsierra: btw, just wanted to say nice job on actually managing to sell dependency injection as a _good_ thing at euroclojure :)

16:53 gfredericks: unrelated: I am uncomfortable using lazy seqs in such a way that realizing one extra element is catastrophic

16:54 stuartsierra: martinklepsch: I don't understand the issue, sorry.

16:54 augustl: thanks!

16:54 Zekka: arrdem: Would an idiomatic usage be to define an i.e. takes-widget function that adds an 'is really a widget' precondition to the function's argument?

16:54 augustl: stuartsierra: ended up doing something similar at current client which is a Groovy shop - spring-context stand-alone in a small Gradle based app does the same job

16:55 Zekka: (in general, is using higher-order functions to wrap existing functions with assertions the 'correct' approach?)

16:55 arrdem: Zekka: I do that sort of thing all the time. Write a static type sig, and pre/post validate it.

16:55 amalloy: Zekka: clojure doesn't really have optional type annotations. typehints are optimization tips for the compiler, not safety constraints

16:55 arrdem: Zekka: introspecting fns to say "is this really the kind of fn I expect" doesn't really work tho unless you're willing to manually manage metadata

16:56 Zekka: arrdem: It's less introspecting and more writing higher-order functions that add the pre/post tags as in the example

16:56 Do you usually put the pre/post tags directly onto your functions or do you add them using separate higher-order functions to keep them general?

16:57 amalloy: martinklepsch: i don't understand what question you're asking either

16:57 Zekka: I can pastebin an example if it's not clear what I'm getting at.

16:58 actually, not sure how to write an exaxmple that's clearer than what I already said

16:59 arrdem: I mean... you seem to be asking if it's idiomatic to write {:pre [(is-my-complex-type? foo)]}..

16:59 Zekka: arrdem: That's not quite it

17:00 mikerod: Zekka: I like Prismatic schema a lot

17:00 Zekka: The article you linked defines a function that takes an existing function and wraps it to add those checks, which it didn't have before

17:00 mikerod: $google prismatic schema

17:00 lazybot: [Prismatic/schema · GitHub] https://github.com/Prismatic/schema

17:00 celwell: I have a clojure web app on Amazon Beanstalk, and I"m using Amazon RDS for a mysql db I'm connectin to. Does clojure have an equivalent of phpMyAdmin that I can use to manage the database efficiently, or am I stuck with the command line?

17:01 alandipert: celwell, you could just use phpMyAdmin, no?

17:01 Zekka: Is it ordinary style to write functions of that kind so that you can write code that's 'polymorphic over functions that meet this group of assertions'

17:01 polymorphic over 'functions that meet this group of assertions'*

17:02 systemfault: celwell: Not sure why you couldn’t use mysqlworkbench or phpmyadmin.

17:02 martinklepsch: amalloy: hah, ok. Let me try again: there is an API the elasticsearch clojurewerkz library implements. This API contains the various query types for querying elasticsearch. Two query types are almost identical ("term" & "terms" query) and implemented in one function, therefore they don't show up in the codox documentation and someone could falsely assume that the "terms" query is not implemented. That's what I did. Is

17:02 there any way to get it into the API docs without duplicating code or do you think it should just not be in there then?

17:02 amalloy: (I'm sorry for the very long text)

17:02 celwell: alandipert: then I would have to create another beanstalk instance, right? (or are you saying run phpmyadmin locally but connect remotely to aws?)

17:02 augustl: any suggestions on how to fix this code so the component start adds a list of all the created threads to the component? https://gist.github.com/augustl/3e9ecb8fc813b72ec402

17:02 Zekka: More generally I'm trying to ask if there are other ways to express that kind of polymorphism which are preferred, or whether that polymorphism typically comes about

17:02 amalloy: i would just do what everyone else in that issue thread is saying: define another function that calls it

17:02 if you want to instead alias it and copy the metadata, then go ahead i guess, but i don't see the value in it

17:03 alandipert: celwell, ah, right - i see what you mean now. no, not aware of JVM resident phpmyadmin options in or out of clj

17:03 augustl: thinking of looking into ways of using zeromq that doesn't involve all this manual thread creation, but perhaps just a single executor that I can return and kill in stop

17:03 Zekka: mikerod: This looks interesting!

17:03 stuartsierra: augustl: (doall (for [n (range 4) (doto (Thread. …))))

17:03 augustl: stuartsierra: ah, doall, thanks :)

17:04 stuartsierra: augustl: I gave up on ZeroMQ for this reason.

17:04 Zekka: Once I make sure there aren't glaring bugs in my current program I'll see if I can integrate this

17:04 augustl: stuartsierra: it's nice for rpc though :)

17:04 alandipert: Zekka, you can group implementations around a single function ("precondition") with multimethods, or you can group types by capability with protocols (similar to typeclasses)

17:05 augustl: apparently there are ways to create a single poller thread that dispatches to a thread pool

17:05 alandipert: Zekka, what you're asking for sounds like perl subset types or maybe dependent types, is that what you're looking for?

17:05 Zekka: alandipert: Do Clojure's contracts work for protocol and multimethods?

17:05 mikerod: Zekka: I have found the Prismatic schema to be easy to throw on top of my existing structure. I like how it allows you to "minimally" specific constraints for fn. Also, the schema representation is built-in good and uniform documentation.

17:05 alandipert: Zekka, implementations of either can have conditions, yes

17:05 Zekka, what isn't possible is type-level conditions on either

17:06 Zekka: alandipert: Not really: it's more that I'm trying to use pre/postconditions to approximate what I usually get from types in a pure language

17:06 I'm trying to make specific statements about behavior but those statements aren't the sort of thing that would necessarily require dependent types to make

17:06 technomancy: I wonder how horrible it would be to write something that doseqs over the current namespace's ns-publics and wraps everything that isn't metadata opted-out with a "this function should never take/return nil" pre/post

17:06 kinda tempted

17:07 Zekka: i.e. you don't need dependent types in a pure language to say 'and this feature of the environment isn't changed', but you probably need pre/post conditions to check that in a dynamic language with side effects

17:07 stuartsierra: Aha! Re earlier discussion of CLASSPATH-6, URLClassLoader reads JAR manifest files lazily, as needed, to load resources.

17:07 Zekka: So I'm trying to see if I can express polymorphism constrained by pre/postcondition groups

17:07 stuartsierra: So it would be tricky to get a list of *all* the URLs it might eventually read.

17:07 Zekka: alandipert: Sorry if I'm not too clear for what it's worth

17:07 alandipert: Zekka, for modeling domain objects you may consider defrecord, which would allow your domain maps to participate in protocols

17:08 Zekka, well, afaict nobody understands eachother in this arena :-)

17:08 Zekka, i would just encourage you to explore the various clojure approaches to polymorpism and get a feel, one will stick out at the end to you i bet

17:08 Zekka: Alright

17:09 Right now I'm a little cross because I told my boss 'I hear Clojure is pretty reliable and stable and more concise than Java for this application' etc. and so far I'm a little frustrated

17:09 augustl: is there a function like this around? Take varargs of lists and vals, return a single flattened list (x [1 2 3] "b" [1] 2) -> [1 2 3 "b" 1 2]

17:09 Zekka: hopefully I'll either get so frustrated I can motivate a rewrite or I'll get used to it and stop complaining

17:10 (For what it's worth Java is actually very bad in the regard I'm describing: it has static types but you can't use them at all for reasoning about behavior the way I'm describing: at least Clojure apparently has cheap assertions)

17:10 augustl: Zekka: I haven't followed the discussion, but have you seen core.typed?

17:10 Zekka: augustl: No, I haven't

17:10 Jaood: Zekka: but haskell

17:10 augustl: Schema is also a nice alternative to preconditions

17:10 Zekka: ^^

17:11 Zekka: I'm thinking I might introduce schema

17:11 technomancy: if you're used to programming with a type system, it's normal for getting adjusted to clojure to take a while.

17:11 mikerod: Prismatic schema really dominates pre/post conditions from what I've seen. Once I have that in place, I haven't really seem too many issues with delayed errors due to invalid data (and types) passed around

17:12 Zekka: augustl: Right now my major priorities are 'stop annoying bugs that I could ordinarily use the type system to deal with (as much as is possible)' and 'don't screw up my ability to work with library code that doesn't know or care about types'

17:12 Can you evaluate core.typed and schema in those dimensions? (Schema looks very good in them from a distance.)

17:12 mikerod: The advantages are just reusable structures to express your conditions, well-structured error messages, automatically adds some doc strings to schema.macros/defn, etc

17:12 technomancy: there's more you need to keep in your head since you don't have the compiler backing you up, it also forces you to design simpler data models *because* you have to keep more in your head

17:13 mikerod: Zekka: I'd imagine core.typed is a bit more invasive since you need to use it extensively to gain benefits out of the static type checking.

17:13 Zekka: I don't really expect to be able to catch type-related bugs statically: it'd be nice but I don't expect it

17:13 mikerod: I feel like assertions is more appropriate for a usecase like this

17:13 one of the libraries we use (Seesaw) really loves coercion and other sticky things that are probably hard to express with a sensibly anal type system

17:14 mikerod: Zekka: schema can have assertions turned on.

17:14 if that's what you are getting at

17:14 Zekka: but assertions/pre/postconditions probably wouldn't break anything

17:14 mikerod: I got the impression that schema mostly used assertions/pre/postconditions while core.typed performed some kind of deeper static analysis

17:15 mikerod: schema is an opt-in runtime-checked assertions

17:15 Zekka: although that might be partially based just on my preconceived, half-baked notions of what it means when someone says "we're giving you a type system"

17:15 mikerod: core.typed is static analysis for type-correctness

17:15 Zekka: mikerod: That's about what I figured

17:15 mikerod: so with schema, you can annotate a single fn

17:16 without considering anything else

17:16 arrdem: I suspect that schema or a hand rolled equivalent is what you want..

17:16 core.typed can be really hard to work with and relatively limited.

17:16 Zekka: arrdem: I'm thinking the same

17:16 mikerod: My impression for core.typed is you really need to "buy in" and annotate a lot, so that there can be meaningful static analysis done between the interaction points between fn's.

17:16 arrdem: I've caught real errors with core.typed..

17:16 but it can be a real pain

17:17 yeah I'm with mikerod here.

17:17 Zekka: Unless I can make a ton of random library maintainers also commit to core.typed I don't think I can probably make it work here

17:17 arrdem: I built a typechecked CPU simulator with core.typed but there was a _lot_ of buy-in involved.

17:17 and that for was a sub-1k LOC project

17:17 Zekka: What's the advantage of working in Clojure with core.typed over a language designed around typesafety from the start?

17:17 mikerod: arrdem: I have been interested in core.typed, but I haven't been in position to go to the lengths it would require to switch to it

17:18 Zekka: (like, I don't know, Scala -- disclaimer being that I haven't worked in Scala)

17:18 mikerod: Zekka: I think that is a good question. I do not know the answer. :P

17:18 It's a Lisp on the JVM! - that's why

17:18 arrdem: Zekka: I think that's an open research question :P

17:18 mikerod: (joking)

17:18 martinklepsch: amalloy: sounds fair. thank you for guiding me :)

17:18 arrdem: but seriously.

17:19 technomancy: Zekka: the canonical answer is that the JVM's use of subclassing is incompatible with hindley-milner, and type systems that aren't HM are kind of a pain in the neck.

17:19 mikerod: The idea of an add-on type system is very interesting to me. I'm definitely torn on these things.

17:19 technomancy: "canonical"

17:19 mikerod: like add-on type system vs built-in and based around like Haskell

17:19 Zekka: technomancy: What do people say when other people say "that's fine, don't allow subclassing"?

17:19 Because that's the sort of thing I would say.

17:20 technomancy: meaning "what people tell me when I complain that none of the JVM-hosted languages have good inference"

17:20 Zekka: (maybe it's just because I find inheritance very confusing most of the time when I encounter it)

17:20 technomancy: Zekka: because that means "don't use all these libs that are half the point of being on the JVM in the first place"

17:20 Zekka: (the basics are fairly simple but I feel like I run into a lot of semantic potholes)

17:20 technomancy: "don't create subclasses yourself" isn't enough

17:20 mikerod: I think subclasses are evil

17:21 catern: i think classes are evil

17:21 amalloy: Zekka: i would say core.typed is a really cool effort, but i wouldn't use it as a newcomer to clojure. better to drink the kool-aid of the new language until you can program in it and *then* decide whether you want an add-on like core.typed. don't try to make clojure like haskell until you're comfortable with clojure already (and for my part, i try not to make haskell like clojure)

17:21 mikerod: :)

17:21 catern: I think OO is evil

17:22 technomancy: yeah, what amalloy said. force yourself to use nothing but maps for like a month to get rid of your typed habits before making a judgment =)

17:22 Zekka: amalloy: Generally I'd agree: it's mostly the case here that I'm actually accountable to someone for the code I produce here

17:22 meaning that if while experimenting I produce crappy code I'll have billed them for crappy code, which isn't ethical

17:22 amalloy: well. decide whether you're learning or building. if you can't do both productively, pick one

17:23 like, learning is great, but if you're making tons of compromises on the learning in order to build something you think is billable, what you're learning is counterproductive

17:23 technomancy: being able to throw away learning code is a wonderful luxury =)

17:23 Zekka: I'm actually guilty of a misdecision much earlier: we weren't originally going to use Clojure, but when I suggested it folks agreed because they didn't think there would be very much of it

17:24 currently about 10% of our project is Clojure now because many of the things we planned to do in Java were much quicker in Clojure and paring away the interface to be small/simple to work with involved adding much more responsibility to the Clojure code

17:24 amalloy: it sounds like you decided to bill someone for a project you write while clojure, without knowing whether you could build anything in it; it's a bit unfair to call it unethical *now* when someone suggests you prioritize learning it

17:25 Zekka: It's a quantity we could probably rewrite but I have a feeling that in this case, good clojure > bad clojure > Java

17:25 amalloy: *while learning

17:25 Zekka: amalloy: That's pretty accurate.

17:25 dnolen_: Zekka: bad Clojure is probably at least as bad if not worse than bad Java

17:25 alandipert: imo a new prog. language is nothing compared the learning typically involved for a domain, which few would argue is unethical to bill for

17:26 dnolen_: Clojure gives lots of shotguns pointed at all limbs

17:26 jcromartie: alandipert: so, what is the fix for the 1.5/1.6 cljs issue?

17:26 alandipert: sorry that was a long time ago, I was AFK

17:26 Zekka: dnolen_: I'd say from current experience it's pretty bad but not in the same ways

17:26 alandipert: jcromartie, downgrade cljs or upgrade/exclude whatever in your project is bringing in 1.5

17:26 dnolen_: Zekka: yeah

17:26 Zekka: It's harder to debug and harder to pick apart for overall structure because unlike Java it's not really very uniform

17:26 amalloy: dnolen_: i'm now imagining television ads for "Crazy Rich's Limb and Shotgun Emporium"

17:26 dnolen_: amalloy: lol

17:26 jcromartie: alandipert: oh, that would probably be [org.clojure/clojure "1.5.1"] :)

17:27 Zekka: On the other hand it's quicker to refactor and I don't feel like I'm running into as many 'correct way/reasonable way' tradeoffs as I do when I work in Java

17:27 (Java's verbosity and poor facilities for abstraction have made significant parts of the project much larger and much less flexible than they could have been, IMHO)

17:27 jcromartie: THANKS LEININGEN

17:29 nullptr: (inc leiningen)

17:29 lazybot: ⇒ 3

17:29 amalloy: 3???????

17:29 (inc leiningen)

17:29 lazybot: ⇒ 4

17:29 arrdem: (inc leiningen)

17:29 lazybot: ⇒ 5

17:29 catern: (inc leiningen)

17:29 lazybot: ⇒ 6

17:29 jcromartie: I was being sarcastic

17:29 (dec leiningen)

17:29 lazybot: ⇒ 5

17:29 arrdem: 0_0

17:29 amalloy: jcromartie: you were probably being wrong too, for what it's worth

17:30 jcromartie: hah

17:30 catern: (inc technomancy)

17:30 lazybot: ⇒ 123

17:30 Zekka: dnolen_: IMHO we're better off with the bad clojure than the bad java, and that's not me arguing from the 'Clojure is an allegedly better language' stance

17:30 dnolen_: Zekka: well good Clojure is a thing a beauty so you have something to work towards ;)

17:30 jcromartie: I would like to be able to "lein new" and get clojure 1.6.0

17:31 nullptr: a lot of the most common mistakes are common across languages -- misunderstanding/misuse of "lazy" is one i see everywhere

17:31 Zekka: (I have trouble saying "Clojure is a better language" because it seems to depend very heavily on who is writing it: it's not like Haskell where it's really hard to screw things up beyond repair, even if you're inexperienced)

17:31 alandipert: can't argue taste anyway

17:31 amalloy: dnolen_: a clojure program is like a sculpture by michaelangelo: you start with ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), and gradually carve off the parts that aren't part of your program

17:32 dnolen_: amalloy: haha

17:32 arrdem: amalloy: but how do I get a (()()) from that...

17:32 Zekka: (in certain hands I bet the Clojure implementation's usually much better than the Java implementation, though)

17:32 technomancy: the only meaningful definition of "better language" is "tends to produce better programs" which is ridiculously context-dependent

17:32 jcromartie: oh it does now

17:32 but just a bit late

17:33 Zekka: technomancy: I'm using it very informally here, in the sense of "would I tell a friend he should totally do his next project in it?"

17:33 catern: blub man

17:33 clojure is better than java, no contest

17:33 amalloy: Zekka: well, in haskell it's really hard to screw things up beyond repair as a newbie because it's really hard to do *anything*

17:33 arrdem: $karma blub

17:33 lazybot: blub has karma 0.

17:33 catern: likewise, haskell is better than java, and go is better than java

17:33 amalloy: how good programs in language X are will depend on the person writing them no matter what X is

17:34 technomancy: same as my gripe over people saying "a faster language"

17:34 languages aren't fast or slow, programs are

17:34 mikerod: Java is just the assembly language of the JVM

17:34 Zekka: amalloy: I'd say one of its major design features is "you're not allowed to do the wrong thing"

17:34 catern: says the person in the IRC channel of a slow language :)

17:35 shanemhansen: My favorite quote ever from a phd student who was a haskeller "I love haskell because every time I try and do anything it's like a research project".

17:35 amalloy: clojure, haskell, java, php - they're all great at what they want to do. you just have to drown yourself in koolaid

17:35 Zekka: And it accomplishes that by turning all the normal techniques for doing anything into wrong things

17:35 shanemhansen: It's either a shame or a benefit

17:35 I mean on one hand you have really ingenious designs like lens, but you also have a lot of work-in-progress designs like monad transformers

17:36 where there are still a lot of sharp edges and unpleasant bits

17:36 So a lot of things you ordinarily take for granted are still areas of research, even though the research is pretty complete in a lot of cases

17:36 (Monad transformers do 90% of what you wouuld like them to do, but they really suck at 10%)

17:36 hiredman: php even has goto now, so you can write a proper compiler targeting it

17:37 arrdem: oh dear...

17:37 Zekka: also sometimes the 'correct' design is actually super scary and requires you to squat over some research papers: i.e. Pipes and streaming IO

17:38 (Pipes eliminates a lot of drawbacks of standard IO approaches, but the disadvantage is you'll drown in types)

17:38 (it's not really about IO but about coroutines)

17:41 I might port some of my old Haskell code to Clojure, I've got some really dense projects that I bet would be a lot simpler

17:43 technomancy: Zekka: people say that Java IDEs allow you to use more complicated class hierarchies than you normally would with an un-aided human intellect; I wonder if there is a parallel to good type systems.

17:43 seems like a double-edged sword

17:43 Zekka: technomancy: I'd say that a lot of the time when I run into Haskell types, there's the unfortunate problem that they're very hard to understand, but also as small as they can be

17:43 I brought up monad transformers, which are conceptually pretty simple

17:43 technomancy: like, when you're writing C, you are forced into a sort of ruthless simplicity

17:44 Zekka: the problem is that for the things they *don't* do, there's no way to express them

17:44 There's a structure that's general enough to express the things they don't do, but it's really complicated

17:44 And as far as I know nobody knows a simpler one

17:45 So I feel like it basically comes down to the problem that some things are just very hard to reason about -- if you're in a purely functional language then you have to think about those things, types or not, and if you're in an impure language you can ignore a lot of the rough edges

17:46 and I generally prefer being required to reason about those things than the alternative of letting them happen by magic

17:47 arrdem: damnit where's gtrak when you need him..

17:47 Zekka: Of course, a lot of what imperative languages already expose are among the simpler things that you can do in Haskell

17:47 They basically have one monad that's pretty expressible in one monad transformer stack

17:48 but if you want to define a language that doesn't choke on corners when you want, I don't know, extensible flow control maybe, then things get a little rough

17:52 technomancy: Here's what some of the problems look like: 'how can you turn pure things into effectful things, treating all effectful things as essentially the same kind of thing and allowing various kinds of effectfulness to be composed', 'how can you turn mutation, modification, and access into the same kind of thing such that composing accessors yields an accessor'

17:52 They're not intrinsically about types but they make types pretty valuable

17:59 akurilin: quick question: has anybody figured out a good approach for multi-database access in Korma? As in, say I have an OLTP and an OLAP instance, right now korma's choice of target DB is determined through global state

18:05 Jaood: akurilin: I hear the approach to korma is to not use it

18:08 mr-foobar: is there a protocol for Symbol ?

18:11 technomancy: mr-foobar: symbols predate protocols

18:12 amalloy: they implement clojure.lang.Named, if that's any help

18:13 mr-foobar: amalloy: do you mean https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Named.java ?

18:46 gfredericks: mr-foobar: yes that's what he meant

18:47 augustl: does it make sense to have a "component" (Stuart Sierra's stuff) that just starts doing some stuff when the app starts up, such as migrating a database, starting workers, etc?

18:48 mr-foobar: gfredericks: i need a subset of symbols/namespaces apis. lang.Named won't do it.

18:49 gfredericks: mr-foobar: what's your higher level goal?

18:50 augustl: ...sure? what aspect are you worried about?

18:50 augustl: gfredericks: no idea :)

18:50 arrdem: happy weekend people. I'm gone.

18:50 augustl: are you telling me I get to choose/have to design my own system??

18:50 lazybot: augustl: Definitely not.

18:50 gfredericks: augustl: the thing I've found the most awkward is batch stuff

18:50 cbp: rip arrdem

18:51 arrdem: r i p volvo

18:51 augustl: gfredericks: hmm, what kind of batch stuff for example?

18:51 mr-foobar: gfredericks: state machine using a dispatch table.

18:52 gfredericks: augustl: ETL, e.g.

18:52 error handling in a batch context is different from a steady state context

18:54 akurilin: Jaood: what do you mean?

19:01 augustl: akurilin: isn't there a lower level API where you can pass in the conn?

19:02 been a while since I did sql from clojure.. But I would also imagine that it's possible to have korma just return the sql statement objects you can pass to jdbc

19:06 jcromartie: phew

19:06 now that I have lein-cljsbuild and lein-ring humming along smoothly, this is quite nice

19:07 with some middleware for edn back and forth

19:10 mi6x3m: any out-of-the-box html formatter for clojure?

19:26 Raynes: mi6x3m: 'html formatter'

19:26 jcromartie: clojure.lang.ExceptionInfo: Could not locate cljs/core/async/macros__init.class or cljs/core/async/macros.clj on classpath

19:27 why not?

19:27 never mind

19:27 needed to reload after project.clj change

19:27 I should really take 5 seconds before posting to IRC

19:28 AWizzArd: jcromartie: happens to the best

19:29 jcromartie: this must be The Right Way™ to do web development… core.async on the client and server, EDN going back and forth… damn

19:29 I mean seriously

19:29 AWizzArd: jcromartie: btw, what are you doing with core.async?

19:30 jcromartie: well since dnolen's client-side core.async demos made me cry, I just wanted to try it

19:30 I have a big Clojure web app, and so far it's very traditional: the server renders HTML and sometimes we throw some JS up that makes it fancy

19:30 mi6x3m: Raynes: what compojure used to do

19:31 AWizzArd: I would like to know if CSP is equivalent to FRP.

19:31 jcromartie: I've steered away from single page web apps in general because of JS callback hell

19:31 mi6x3m: jcromartie: wise :)

19:31 jcromartie: but now that I've seen Om and core.async on the client in general, I feel like it's powerful enough to make the teetering tower of abstraction worth it

19:31 mi6x3m: single page is doomed

19:32 jcromartie: mi6x3m: you think? that's not what I'm saying

19:32 I love URLs

19:32 don't get me wrong

19:32 clojurebot: excusez-moi

19:32 mi6x3m: I am saying it :)

19:32 AWizzArd: jcromartie: if you use Om you will probably need a slider widget too.

19:32 mi6x3m: single page creates hell for everyone

19:32 AWizzArd: mi6x3m: why is that?

19:33 jcromartie: I might agree… it depends

19:33 mi6x3m: AWizzArd: take search engines for starters

19:33 jcromartie: it breaks a lot of good things about the web

19:33 nullptr: good point -- everytime i use gmail i'm just like "ugh, why can't you be more like '98 hotmail?!"

19:33 mi6x3m: then URL generation, JS managing etc.

19:33 it's hard to analize content when the content is not static

19:34 nullptr: and seriously, google maps? mapquest was good enough.

19:35 jcromartie: there are some great single page apps for sure

19:35 Google Maps is where it works nicely

19:36 I don't want to click on a city and wait for the load

19:36 but for Wikipedia, it would probably be a huge mistake

19:37 AWizzArd: but there is pushState

19:38 We have a single page app, but fully indexable by search engines.

19:38 Direct links are supported, browser navigation

19:38 It’s pretty easy to do with CLJS+Om.

19:41 Is CSP a superset of FRP? Are they both semantically equivalent?

19:42 tbaldridge: maybe you know it? :)

19:59 akurilin: augustl: Oh I see, hm yeah that's fair

19:59 augustl: good idea

21:39 benkay: does anyone have a hack to prevent cider from popping up an os x java applet when jacking in?

21:44 amalloy: benkay: see https://developer.apple.com/library/mac/documentation/java/Reference/Java_PropertiesRef/Articles/JavaSystemProperties.html - you can probably set apple.awt.UIElement or java.awt.headless

22:00 mackin: does anyone know of any clojure startup jobs

22:08 uvtc: I've got a fairly large set of maps; what's the best way to find one of them based on the value of some particular key? Here's what I've got: <https://gist.github.com/uvtc/c1c4cbd6f57c85466e7e>.

22:33 ambrosebs: uvtc: filter is lazy, both those methods look identical.

22:34 uvtc: ambrosebs, Ah! Thanks for that observation! Didn't realize that (no pun intended). :)

22:34 ambrosebs: :)

22:42 TimMc: Haha, best project name: https://github.com/kimhyunkang/r5.rs

22:42 (Scheme implemented in Rust.)

22:42 uvtc: Hehehe

22:43 .oO(would be nice to see a clojure.rs...)

22:44 Frozenlock: .oO(would be nice to see a clojure.clj...)

22:54 TimMc: snrk

Logging service provided by n01se.net