#clojure log - Apr 05 2015

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

0:09 sobel: is there a popular wrapper for windows executable jars? i'd rather not have to supply script-wrapper.

0:23 TEttinger: sobel: I use packr. it has issues with recent versions that have been difficult to figure out, though. do you need an installer?

0:23 $google lein-packr

0:23 lazybot: [Could not transfer artifact issue: ReasonPhrase Forbidden when lein ...] https://github.com/technomancy/leiningen/issues/1825

0:23 TEttinger: hm

0:24 justin_smith: funny that that issue would have more google juice than the lib itself

0:24 TEttinger: https://github.com/tommyettinger/lein-packr

0:25 it's not even the right lib, probably due to autocorrect

0:25 justin_smith: ahh

0:25 TEttinger: well I actually could use someone testing my packr plugin for lein

0:25 it also will bundle JREs for mac and linux 64-bit if you ask it to

0:27 the issue with the java project it uses is here, https://github.com/libgdx/packr/issues/33

0:28 there's some kind of weirdness with how they pass args to the VM that is incompatible with uberjars

0:32 an older version works OK though, so I use that

0:37 sobel: TEttinger: i'm not sure yet. i know i want an executable package but i'm not sure whether it needs its own installer or not yet.

0:38 i probably won't setup a windows VM to test it today but as early as monday i may do that

0:40 TEttinger: sobel, the nice thing about that lein-packr I put together is it can be run on linux or mac, at least in theory, and build a windows exe

0:52 sobel: i found another package that builds an executable for systems that use shell-magic. that is apparently easy. windows is always the odd on out, isn't it, though?

0:53 justin_smith: sobel: once upon a time that was a good thing for windows, now they are trying to turn around on that but it will be a while

6:10 zapho53: I have a Liberator REST api running on localhost:3000. I want to host static files which consume the REST api without resorting to JSONP but don't want the static files served from the REST api. Is this possible?

6:12 expez: https://gist.github.com/a55169701a4bc0b515c1 this macro doesn't catch the exceptions, they just bubble all the way up. How come?

6:52 sobel: justin_smith: i hear that, and i laugh at the beheomiath trying to emulate its slower, much less funded open-source competitors

6:53 too bad zapho53 left so quick.

10:57 hey clojurists: i'm sorta looking for a clojure-based OSS app that i might build my skills by contributing to. opinions here are worth more than a google search.

10:57 arrubin: sobel: Any particular areas of interest?

10:57 catern: argh, clojure

10:57 sobel: i say app, because i have a much easier time tuning in to user/domain needs than core library needs (especially in a new-to-me language environment)

10:57 catern: I would like you to have types

10:58 if only so I don't mess up with the arity of functions

10:59 sobel: arrubin: ya know, i'm interested in a lot of domains. Overtone has already made my list, because i like music and sound, for example.

10:59 arrubin: i don't have major exclusion criteria that i can think of

11:00 catern: there is a type system when you really need type safety

11:00 catern: i'm aware

11:01 sobel: it doesn't meet your needs?

11:01 catern: no

11:02 types are obviously objectively superior, but they're difficult to put in a lisp without weirdifying the syntax

11:02 sobel: i had a nominally rocky transition from strict type based signatures to combined arity-and-type (under postgresql) and eventually to arity-only with lisp

11:02 i can't agree that they are objectively superior. there is plenty that strong typing frustrates.

11:03 but when they're a necessary part of the language, you may as well lean on them hard for all they're good at.

11:03 i do

11:03 arrubin: sobel: Incanter?

11:04 sobel: arrubin: possibly interesting. i might be even more interested if there's a GIS/map project.

11:05 catern: sobel: I'm just curious, what was this "strict type based signature" language you were using?

11:05 arrubin: sobel: I think that the options for full applications is going to be limited. There are far more libraries.

11:05 sobel: catern: java, C++

11:05 arrubin: s/is going/are going/

11:06 sobel: arrubin: i know

11:06 catern: sobel: yeah, so not really "strict type based", more like "really horrible type systems that are badly designed"

11:06 not all type systems are alike!

11:06 sobel: catern: i quit splitting that hair 10 years ago, but yeah

11:08 loose typing bothers some people more than others. it's just another tool with tradeoffs some don't fully get.

11:11 tomjack: mustn't the hair remain split when evaluating or building new programming languages?

11:13 or can you maybe rationally quit splitting the hair forever by a universally-quantified argument about all possible type systems of a certain large class?

11:13 sobel: tomjack: valid point, but i was being pretty casual about what i don't do anymore: strict typing isn't "horrible" to me, but i do consider design of type systems

11:14 it's a matter of pragma not reason

11:14 tomjack: yeah, until you see something interesting and seemingly practically useful, no reason to split the hair :)

11:15 sobel: it was a lot more interesting when i did not understand a) FP, b) data, c) databases

11:17 before those things, i had some confidence i would eventually understand OO well enough to write it fluently. that NEVER happened. OO was a scam. i am here because Spring used reflection to knock down some of my frustrations but eventually I figured out I just wanted FP.

11:18 so i'm definitely in the dynamic camp these days but i do remember how much i got out of using type safety to enforce design correctness. it was a great lesson that i try to re-apply with FP but it's not a 1:1 match.

11:19 i'd be curious if anyone else had a similar pattern of migration from OO to Lisp.

11:19 tomjack: interesting, it's the opposite for me. FP (along with my utter lack of interest in OO) drives my interest in type systems

11:19 during OO days I migrated to dynamic types, then FP made me interested in static again :)

11:19 sobel: i wanted to compose with objects but found them too heterogeneous, and didn't really have anything motivating me to do the science (CS)

11:20 tolstoy: sobel: I kept writing "bad" OO by separating data objects from behavior objects (as I call em).

11:20 tomjack: that's bad OO? I still try to do that when forced to write OO stuff

11:20 tolstoy: That's why I scare quoted it.

11:20 Colleagues would say, "This isn't very OO."

11:21 Months later, they'd do the same thing as me. Much easier to maintain.

11:21 sobel: my gripe with OO was too many patterns for things that should be reusable behaviors, but can't be, because type safety.

11:21 SO much fits under that umbrella-gripe.

11:21 justin_smith: sobel: I'd say more "because OO is a bad abstraction" - the ml languages can do nice things with reusable functional abstraction and types

11:22 ml family, with haskell as a distant cousin

11:22 sobel: catern: i quit splitting that hair 10 years ago, but i have little positive to say about the C++/Java family of OO.

11:22 uh

11:22 tolstoy: There's a few folks who implemented an OO system on top of Clojure in about 100 lines.

11:22 sobel: holy paste buffers

11:22 tomjack: (tolstoy: ah, heh, yeah. many of my colleagues who are still on the OO wagon think that is "good OO" though. I think word hasn't fully trickled down from the OO commanders to the trenches yet)

11:22 tolstoy: I love the idea of using OO only when it suits, rather than a full on paradigm.

11:23 tomjack: It just made more sense for me to have a Database class that produced value objects, rather than a bunch of DAO objects.

11:24 sobel: databases are a classic problem for application devs. the database is not a domain.

11:24 tolstoy: tomjack: Easier to find out where the queries were, easier to morph, maybe not so good if the app was too huge. But that's the thing. Big app problem trump languages.

11:24 sobel: DAOs are for grouping access by domain. it should be application-level.

11:24 but what i see a lot of are DAOs that cover the entire set of domains the application might need.

11:25 tolstoy: sobel: I ended up using just one DAO.

11:25 sobel: or i see an ORM used to manufacture a bunch of crappy quasi-database-enabled application objects. that was really common when i supported Ruby devs.

11:26 tolstoy: lots of apps only really need one DAO. it's necessarily complex if an app really works in 2+ distinct domains.

11:27 tomjack: I found this quote from http://www.datomic.com/rationale.html amusing: "... This leads to the proverbial impedance mismatch. The problem, though, isn't that databases are insufficiently object-oriented, rather, that applications are insufficiently declarative."

11:27 sobel: i agree. i could say more, but don't have to. :)

11:29 vaguely related: my application designs are cleaner and more successful since i added SQL (performant, normalized designs with remote facades) to my toolbox

11:29 tolstoy: I never want to argue against something like Haskell, but I always get frustrated trying to read a simple JSON document in it. ;)

11:30 justin_smith: tolstoy: there's a reason I am here and not on #haskell, but I figure if we are going to disparage strong typing, haskell is the fair target, not C++

11:30 sobel: i think a lot of OO developers have exactly one hammer and it's not relational

11:30 fwwi i don't hold up C++ as anything but a target these days

11:32 tolstoy: justin_smith: I agree.

11:32 ane: c/c++ aren't strongly typed.. 'a' is both a valid int and a char

11:35 tomjack: I think any time someone says "* typed" you basically have to ignore the * and just figure out from context what they mean :)

11:36 mavbozo: regarding relational database such as MySQL, after using clojure for a while, i'm beginning to design my database access more like a rest api with a single endpoint and a single uri

11:37 tolstoy: mavbozo: If I understand you right, that's what I ended up doing. Looks totally wrong, but much, much easier to maintain.

11:38 For me, it felt like my struggles to get anything done amid fluid requirements drove me to that solution.

11:38 mavbozo: i totally gave up designing data object whose storage is outside my application process

11:38 better treat it like another rest api call with rest api failure handling

11:39 tolstoy: Yep.

11:39 Objects that have nice little methods on them are fine, I guess, but you get fooled when those methods do network requests.

11:40 justin_smith: yeah, the network cannot and should not be implicit or transperent

11:40 it has failure modes that local code just doesn't

11:40 mavbozo: another hard lesson i got from clojure, make IO explicit and separate

11:41 tolstoy: Yeah. That was a HUGE problem with SOAP generated objects.

11:41 Your design-brain can't help by think that calling a method will always return.

11:48 mavbozo: on a mass scale, almost every mvc web-framework out there gives tutorial/quickstart where the M in MVC is always your data and its persistence and the data is coded as class

11:53 so, when i watched Rich video where he said something like "just use map dammit!", I said "Huh?!"

11:55 after all those years of conditioning, it's hard to accept that I don't have to make a class to represent a certain data

11:59 arrubin: mavbozo: Stuart Sierra discusses that a bit in this talk: http://www.infoq.com/presentations/data-visibility-abstraction

12:01 mavbozo: arrubin, thank you. I'll definitely watch it.

12:06 sobel: mavbozo: a REST API is just another way to access a domain, and a DAO is the pattern I would use for that. it doesn't matter whether the data comes via HTTP, SQL, flat file, hardcoded test data, or whatever.

12:08 the whole point of making a DAO is to translate the domain into your application's architecture

12:08 the mistake i see too often is holding the database or databases in general as a domain.

12:11 if you don't know what your domain is, wrapping it in JSON changes little ;)

12:11 tomjack: what's a DAO look like in Clojure terms?

12:11 I mean, specifically your kind of DAO

12:12 I presume it's gonna be a DAX for some X which isn't O?

12:12 sobel: i think it would just be a library in lieu of an object

12:12 tomjack: right, cool, then I can read what you said above without it making me unhappy :)

12:13 justin_smith: haha

12:13 tomjack: presuming the library is mostly pure fns

12:13 sobel: it's more political for high-formality languages like java where you might need to publish enums, interfaces, and helper objects to make your domain library complete

12:14 tomjack: it's about isolating the transformations from what you get from your database to what you actually need to use in your app. i doubt i'm telling you anything new.

12:14 but i promise, when i address a ruby crowd, it is news.

12:15 (spent 4 years supporting Rails users, have probably seen everything by now!)

12:16 but more importantly, a DAO isn't a general db helper. you use a db helper to implement a DAO. it should take db-only code out of the app.

12:16 the ActiveRecord noobs i supported never did make that connection

12:21 justin_smith: NDM - nihilist domain modeling

12:22 (def world nil)

12:22 done

12:22 oh wait, even better: (def world (System/exit 0))

13:26 sobel: (undef world)

13:30 mavbozo: sobel, please recommend me a good reference for DAO design method

14:27 noncom|2: i have a lein project with a dependant project in checkouts, however it seems that lein cannot see the classes under :java-source-paths of the dependant project.. is this ok?

14:28 justin_smith: noncom|2: wouldn't the classes be compiled into the jar?

14:28 clojurebot: No entiendo

14:28 justin_smith: oh, checkout, right

14:30 noncom|2: yeah, but hmmm, looks like the situation is not like i have described.. maybe i have missed somehting..

14:33 sorry, i had a compilation issue in the dep proj

14:33 but lein is good too: it does not say about it, it silently fails

14:33 justin_smith: interesting

15:21 noncom|2: justin_smith: also, it is impossible to force lein recompile java files of a dep proj.. %)

15:21 wirrbel: I have an issue with transit and prismatic schema. Transit's read returns a map that I think matches the schema, yet prismatic schema complains that keys are not identical

15:22 {:non-native disallowed-key, :native disallowed-key, :non-native missing-required-key, :native missing-required-key}

15:22 so from the console output the keys seem identical

15:26 tomjack: hrmmm?

15:27 wirrbel: so the problem is that I require a key :native in the schema, and it is present in the map

15:27 the error message is contradictory

15:27 tomjack: it looks to me like there are two :native keys in the map

15:27 which should be impossible

15:28 wirrbel: this is not a map but the error message

15:28 tomjack: still looks impossible :)

15:28 unless, of course, the keys aren't identical, which must be the case!

15:28 wirrbel: thats why i am asking

15:29 is there a way to print with more detail?

15:29 tomjack: are you in clj or cljs?

15:29 wirrbel: clj

15:29 I have the impression that some space/unicode character could be there

15:30 tomjack: first thing I would do is make sure they're really all clojure.lang.Keyword by checking e.g. (map class (keys x))

15:31 wirrbel: ah

15:31 they could be strings instead of symbols?

15:31 tomjack: maybe, depending on how they're being printed

15:32 if you're at a repl and you just eval (keys x) you should be able to tell if they're strings

15:34 if they're all Keyword and you want to check for weirdness in the name, you can use (name k), and maybe look at e.g. (seq (.getBytes (name k))) ?

15:37 gfredericks: wirrbel: keep in mind "string" "symbol" and "keyword" are three distinct, similar things

15:38 wirrbel: hmm, I also may have misunderstood transit

15:43 I think I got it, I thought transit was mapping json to clojure datastructres directly, it seems to be more of a way to serialize clojure data in a json-compliant format

15:44 so I should really only use it as an intermediate format and not use it to parse arbitrary json

16:19 irctc: test

16:34 Guest82897: Hi everyone! I've got a question regarding printing function definitions to strings. E.g. I've got a function (fn [x] (inc x)) and I want to print it as the source string

16:34 what's the best way to do that?

16:39 mavbozo: ,(doc source)

16:39 clojurebot: "([n]); Prints the source code for the given symbol, if it can find it. This requires that the symbol resolve to a Var defined in a namespace for which the .clj is in the classpath. Example: (source filter)"

16:39 mavbozo: ,(source max)

16:39 clojurebot: Source not found\n

16:46 mavbozo: ##(source +)

16:46 lazybot: java.lang.RuntimeException: Unable to resolve symbol: source in this context

16:46 mavbozo: ,(source +)

16:46 clojurebot: Source not found\n

16:47 Guest82897: yeah, found that, but it takes a symbol that must be defined

16:47 gfredericks: Guest82897: by "source string" do you really need the original string or would the code-data be sufficient?

16:48 Guest82897: the code data would be better tbh

16:48 gfredericks: ,(defmacro my-fn [& args] `(vary-meta (fn ~@args) assoc :fn-form '~&form))

16:48 clojurebot: #'sandbox/my-fn

16:48 gfredericks: ,(def add-five (my-fn [x] (+ x 5)))

16:48 clojurebot: #'sandbox/add-five

16:48 gfredericks: ,(add-five 20)

16:48 clojurebot: 25

16:48 gfredericks: ,(-> add-five meta :fn-form)

16:48 clojurebot: (my-fn [x] (+ x 5))

16:49 gfredericks: i.e., you write your own fn macro and use that

16:49 noncom|2: whats the way to force lein to recompile java classes in a checkouts dep?

16:49 gfredericks: noncom|2: does `lein do clean, javac` not work?

16:50 I have no idea how checkouts and java classes interact, it might be completely non-functional

16:50 Guest82897: gfredericks: thanks for your help, think I understand better now :)

16:50 gfredericks: I thought checkouts were just a classpath hack

16:51 noncom|2: yeah, clean + javac would work, just as running lein on the dep :) but i thought there were a one-click solution probably

16:53 gfredericks: alias `lein dcj` to `lein do clean, javac`

16:53 mavbozo: (inc gfredericks)

16:53 lazybot: ⇒ 133

16:54 arrdem: $grim clj::clojure.core/concat

16:55 mavbozo: $grim clj::clojure.core/future-cancel

16:55 arrdem: mavbozo: looks like lazybot hasn't been redeployed since that PR was merged

16:56 noncom|2: yeah

16:56 what's the best way to find index of an element in a [] ?

16:56 (with a predicate)

16:57 take-while + count ?

16:57 mavbozo: arrdem: oh :) i have no idea what would happend if i type $grim

16:58 arrdem: mavbozo: https://github.com/Raynes/lazybot/blob/master/src/lazybot/plugins/grimoire.clj#L33

16:59 TL;DR should make lazybot print the Grimoire URL for the given platform and ns qualified symbol

17:00 mavbozo: arrdem: that's cool

17:45 gfredericks: noncom|2: ##(first (keep-indexed #(if (= :foo %2) %1) [:bar :baz :foo :tom]))

17:45 lazybot: ⇒ 2

17:46 noncom|2: wow

18:38 cfleming: Is ~/.lein/plugins still a thing in lein 2.x?

18:46 gfredericks: cfleming: I don't know what kind of backpat features exist but I have no knowledge of that being a thing otherwise

18:46 cfleming: gfredericks: Yeah, looking at the code I don't think it exists any more

18:46 gfredericks: I'm not a Super Certified Limeagain Eggs Bert though

18:46 cfleming: There's a super certification for that?

18:46 TIL

18:47 joe128: hi

18:47 gfredericks: cfleming: you have to be certified to authoritatively make negative claims like that

18:48 cfleming: gfredericks: So reading the internet, it appears that they must give those certifications out with cornflakes.

18:48 joe128: are there a lot of clojure jobs

18:53 gfredericks: cfleming: that's where I got mine at least

18:53 wait I was claiming to not have one

18:53 crap

18:53 cfleming: You beat me to it

18:54 arrdem: lol

18:54 ##(meta ^:markdown "foo bar")

19:48 gfredericks: do you or does test.check have a generator for valid Clojure names?

19:56 gfredericks: arrdem: if you can make a regex for that I do

19:57 hyPiRion: arrdem: Clojure names? Like symbols?

19:57 arrdem: hyPiRion: da

19:57 gfredericks: test.check has something for symbols but I doubt it's exactly what the reader accepts if that's what you want

19:57 I could be wrong though

19:57 about it not being exactly right I mean

19:57 arrdem: yeah... okay

19:58 gfredericks: it's probably like alphanumeric w/o initial numbers or something basic like that

19:58 hyPiRion: #"[^@~(),\\;`\[\]{}~^\s:#/\'\d]((:?[^@~(),\\;`\[\]{}~^\s:])*[^@~(),\\;`\[\]{}~^\s:/])?" is pretty close I think

19:58 but there's been some time since I verified that one

19:58 arrdem: could probably crowbar it out of Reader..

19:59 (the regex instance that is)

19:59 gfredericks: and then you just plug that into https://github.com/gfredericks/test.chuck#string-from-regex

20:07 cfleming: arrdem: https://www.refheap.com/99257

20:11 gfredericks: that there looks like it might be a use case for character class intersection maybe

20:11 if you were to translate it to a regex I mean

20:11 cfleming: Yeah, I have the equivalent in regex form in my lexer somewhere

20:40 TEttinger: ,(re-find #"[^@~(),\\;`\[\]{}~^\s:#/\'\d]((:?[^@~(),\\;`\[\]{}~^\s:])*[^@~(),\\;`\[\]{}~^\s:/])?" "\ufeff")

20:40 clojurebot: ["" nil nil]

20:41 TEttinger: ,(ffirst (re-find #"[^@~(),\\;`\[\]{}~^\s:#/\'\d]((:?[^@~(),\\;`\[\]{}~^\s:])*[^@~(),\\;`\[\]{}~^\s:/])?" "\ufeff"))

20:41 clojurebot: \

20:41 TEttinger: yep!

20:41 BOM is a valid name by that, and by clojure

20:41 (inc gfredericks) ; being able to generate strings from regexes is quite cool

20:41 lazybot: ⇒ 134

20:42 TEttinger: (inc hyPiRion) ; I hope you didn't type that regex from memory

20:42 lazybot: ⇒ 73

20:52 netroby: ,(+ 3 4)

20:52 clojurebot: 7

20:53 justin_smith: ,(+)

20:53 clojurebot: 0

20:53 netroby: Oh, how to call lazybot?

20:53 (+ 1 2);

20:53 clojurebot: 3

20:53 justin_smith: &(+ 3 4 5)

20:53 lazybot: ⇒ 12

20:53 netroby: &(* 5 6)

20:53 lazybot: ⇒ 30

20:54 netroby: Nice. thanks you guys

20:54 justin_smith: &(*)

20:54 lazybot: ⇒ 1

20:54 TEttinger: huh

20:56 justin_smith: ?

21:00 TEttinger: justin_smith, odd that he just quite after learning how to use the bots

21:00 *quit

21:00 justin_smith: ahh

21:01 obviously he is going to use clojurebot and lazybot to mine buttcoins

21:02 arrdem: should've prepared an april 1 PR to add dogecoin support

21:02 TEttinger: to the moon!

21:02 justin_smith: (inc TEttinger)

21:02 lazybot: ⇒ 47

21:03 arrdem: (inc TEttinger)

21:03 lazybot: ⇒ 48

21:03 arrdem: forecast: not moon

21:05 TEttinger: Clojure 1.7 introduces some breaking changes as of april 1, 2015. To address the difficulty Java programmers have using parentheses, Clojure now uses the keyword "very " in place of any previous usage of "(", and " wow." in place of ")" . very + 1 2 wow.

21:08 rpaulo: heh

21:08 arrdem: very very very wow wow wow

21:09 https://github.com/arrdem/dogeon

21:10 TEttinger: (inc arrdem) ; wow.

21:10 lazybot: ⇒ 42

21:10 arrdem: (inc beer)

21:10 lazybot: ⇒ 1

21:10 arrdem: (inc doge)

21:10 lazybot: ⇒ 1

21:11 arrdem: I should make SimpleDB pluggable on the serializer just so for shits and giggles I can serialize DBs to DSON and back

21:11 justin_smith: { and } are replaced with such and wow (the duplicate wows are guaranteed differentiatable, though they do lead to wow placement bugs)

21:13 [, ] are many and wow

21:31 enn`: Has anyone else had issues with Github's CDN caching Clojars badges?

21:31 arrdem: enn`: everyone has

21:32 justin_smith: do we need any steenking badges??

21:32 lazybot: justin_smith: What are you, crazy? Of course not!

21:32 * arrdem spits, twirls 6gun

21:33 justin_smith: https://www.youtube.com/watch?v=nsdZKCh6RsU

21:37 Lewix: I'm looking for a theme or template to document a demo app

21:37 anyone used something like that before?

21:38 TEttinger: Lewix: is this more of an app or a library?

21:39 Lewix: TEttinger: an app that is starting small but the intent is to build up a library

21:39 TEttinger: answer to your question: more of a library*

21:39 TEttinger: well I mean is this something that programmers would use or end-users

21:40 https://fogus.github.io/marginalia/ is good if you're aiming for programmers and your library is open source

21:42 Lewix: TEttinger: programmers*

21:43 TEttinger: oh I forgot to mention it's not clojure related* - I just don't wanna have to deal with styling so i was hoping I could find a theme with documentation in mind

21:43 TEttinger: ah, not sure then

22:18 fryguy: if i'm in a namespace and I have a symbol referring to another namespace, what is the easiest way to call a function in the other namespace? (trying to set up a runner for project-euler, and figured putting each problem in it's own namespace with a run method would work)

22:18 justin_smith: fryguy: this is what require is for

22:19 fryguy: yah i'm using require and it's not seeming to do what I want, let me gist something

22:20 https://gist.github.com/bryanalves/46bfc4576ce6972df21d

22:21 justin_smith: fryguy: run is not visible during the compilation of run-problem

22:21 if you need to do it that way, use resolve

22:22 fryguy: what is require doing for me then if it's not making it visble?

22:22 justin_smith: fryguy: require does not run when the function is compiled

22:22 it runs when you call the function

22:22 the error is caused by the symbol not being in scope when you compile, this is why you need resolve

22:23 change (run) to ((resolve 'run))

22:23 fryguy: yah that just returns a reference to the function though, doesn't actually run it, do I need to call eval or something?

22:23 justin_smith: no, that calls it

22:24 extra parens

22:24 ,((resolve '+))

22:24 clojurebot: 0

22:24 fryguy: ah, there we go

22:24 is there a better way to do what i'm trying to do?

22:24 justin_smith: you could use load followed by resolve

22:25 you pretty much need resolve if you don't know the ns at compilation time

22:25 * gfredericks grumbles that (juxt) isn't (constantly [])

22:26 justin_smith: fryguy: resolve is much cheaper than eval

22:26 also less powerful, and it's good to use the least powerful tool

22:39 ~trolling is http://i.imgur.com/7XYz9Fg.jpg

22:39 clojurebot: Alles klar

22:42 lvh: gfredericks: (juxt) sounds like it should be (constantly [])

22:42 gfredericks: or is that what you're saying

22:42 gfredericks: yes

22:42 ,(juxt)

22:42 clojurebot: #error{:cause "Wrong number of args (0) passed to: core/juxt", :via [{:type clojure.lang.ArityException, :message "Wrong number of args (0) passed to: core/juxt", :at [clojure.lang.AFn throwArity "AFn.java" 429]}], :trace [[clojure.lang.AFn throwArity "AFn.java" 429] [clojure.lang.RestFn invoke "RestFn.java" 399] [sandbox$eval25 invoke "NO_SOURCE_FILE" -1] [clojure.lang.Compiler eval "Compiler.jav...

22:43 gfredericks: ((juxt)) would be a nice obfuscation tactic

22:47 ,((juxt +))

22:47 clojurebot: [0]

22:49 lvh: whaa

22:49 oh, right

22:50 gfredericks: Is that something that has been actively voted against

22:50 gfredericks: Or should we be filing a JIRA ticket

22:51 gfredericks: no idea

22:51 justin_smith: ,(= get (apply get ((juxt get get get) get get get)))

22:51 clojurebot: true

22:52 justin_smith: that's a decent brain fuck I think

22:53 Frozenlock: Mom, justin_smith is playing with his functions again!

22:54 gfredericks: I assume this is what OOP means by getters

22:54 justin_smith: indeed

22:54 ~get

22:54 clojurebot: Pardon?

22:55 justin_smith: ~get is (= get (apply get ((juxt get get get) get get get)))

22:55 clojurebot: In Ordnung

22:55 * lvh tries to remember what (juxt ...) does when you give it multiple args

22:55 tclamb: ,(= get (get get get get))

22:55 clojurebot: true

22:55 justin_smith: ,((juxt + * - /) 1 2 3) ; lvh

22:55 clojurebot: [6 6 -4 1/6]

22:56 tclamb: ,(nil? (get get get))

22:56 clojurebot: true

22:56 justin_smith: tclamb: yup, I think you've pretty much figured it out :)

22:57 ,((juxt + * - /) 1 2 3 4)

22:57 clojurebot: [10 24 -8 1/24]

22:57 gfredericks: ,((get get get get) (get get get get) (get get get get) (get get get get))

22:57 clojurebot: #object[clojure.core$get "clojure.core$get@7d6eca8a"]

22:57 justin_smith: get fractals

22:59 lvh: justin_smith: oh, okay, that's pretty consistent I guess

22:59 I feel like I only ever have used juxt with keywords, and maps as args

22:59 gfredericks: ,((fn f [] (if (< 0.4 (rand)) 'get (repeatedly 4 f))))

22:59 clojurebot: (get get get get)

22:59 gfredericks: ,((fn f [] (if (< 0.4 (rand)) 'get (repeatedly 4 f))))

22:59 clojurebot: (get get (get get (get ((get ((get get get get) get ((((get # get #) (get get # get) get get) get get ((# # # #) (get get # #) (# get get get) (# get get #))) get get get) get) get get) get get get) ((get get (get get (get get (get get get (get get (get get # #) (# # # get))) get) (get get ((get (# # get #) (get get # get) get) get get (get (get get get get) (get get get get) get)) get)) get) (get...

22:59 gfredericks: ,((fn f [] (if (< 0.4 (rand)) 'get (repeatedly 4 f))))

22:59 clojurebot: get

22:59 gfredericks: ,(defn getter [] (if (< 0.4 (rand)) 'get (repeatedly 4 getter)))

22:59 clojurebot: #'sandbox/getter

23:00 justin_smith: gfredericks: that gives me lots of stack overflow errors

23:00 gfredericks: ,(getter)

23:00 clojurebot: (get (get get get get) (((((((((get get get #) get (get get # #) get) get get (get (get get get get) get get)) get get (get (get get (get # get #) get) get ((# get get get) (get get get #) (get # get #) get))) get get get) get get get) get (get get get get) (get ((get get get get) (((get get get get) get ((# get get #) (# get get get) get get) (get get (get # # get) (# # # get))) get ((get get get...

23:00 gfredericks: how do I make it less biggly

23:00 justin_smith: hrm

23:00 gfredericks: ,(defn getter [x] (if (< x (rand)) 'get (repeatedly 4 #(getter (+ x 0.1)))))

23:00 clojurebot: #'sandbox/getter

23:00 gfredericks: ,(getter 0.5)

23:00 clojurebot: get

23:00 gfredericks: ,(getter 0.5)

23:01 clojurebot: eval service is offline

23:01 gfredericks: &(defn getter [x] (if (< x (rand)) 'get (repeatedly 4 #(getter (+ x 0.1)))))

23:01 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

23:01 gfredericks: consarnit

23:01 you bots

23:02 justin_smith: consarnit is a very good lispy mixed oath

23:29 DAG nabbit is acceptable if you are doing graph algorithms

23:32 gfredericks: oh man

23:36 TEttinger: (dag/nab it)

23:39 lvh: is there some pattern for "these maps are equal but only for the keys I'm explicity specifying, I don't care about anything else"

23:39 I guess maybe I kind of want a map of keys to predicate functions

23:39 (I am writing a test to see if some headers returned by a handler are sane)

23:39 justin_smith: I would do (apply = (map #(select-keys % [:keys :that :matter]) inputs))

23:40 lvh: yeah, that's what I have

23:41 thanks!

Logging service provided by n01se.net