#clojure logs

2015-04-05

00:09sobelis there a popular wrapper for windows executable jars? i'd rather not have to supply script-wrapper.
00:23TEttingersobel: I use packr. it has issues with recent versions that have been difficult to figure out, though. do you need an installer?
00:23TEttinger$google lein-packr
00:23lazybot[Could not transfer artifact issue: ReasonPhrase Forbidden when lein ...] https://github.com/technomancy/leiningen/issues/1825
00:23TEttingerhm
00:24justin_smithfunny that that issue would have more google juice than the lib itself
00:24TEttingerhttps://github.com/tommyettinger/lein-packr
00:25TEttingerit's not even the right lib, probably due to autocorrect
00:25justin_smithahh
00:25TEttingerwell I actually could use someone testing my packr plugin for lein
00:25TEttingerit also will bundle JREs for mac and linux 64-bit if you ask it to
00:27TEttingerthe issue with the java project it uses is here, https://github.com/libgdx/packr/issues/33
00:28TEttingerthere's some kind of weirdness with how they pass args to the VM that is incompatible with uberjars
00:32TEttingeran older version works OK though, so I use that
00:37sobelTEttinger: 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.
00:38sobeli probably won't setup a windows VM to test it today but as early as monday i may do that
00:40TEttingersobel, 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
00:52sobeli 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?
00:53justin_smithsobel: 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
06:10zapho53I 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?
06:12expezhttps://gist.github.com/a55169701a4bc0b515c1 this macro doesn't catch the exceptions, they just bubble all the way up. How come?
06:52sobeljustin_smith: i hear that, and i laugh at the beheomiath trying to emulate its slower, much less funded open-source competitors
06:53sobeltoo bad zapho53 left so quick.
10:57sobelhey 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:57arrubinsobel: Any particular areas of interest?
10:57caternargh, clojure
10:57sobeli 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:57caternI would like you to have types
10:58caternif only so I don't mess up with the arity of functions
10:59sobelarrubin: 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:59sobelarrubin: i don't have major exclusion criteria that i can think of
11:00sobelcatern: there is a type system when you really need type safety
11:00caterni'm aware
11:01sobelit doesn't meet your needs?
11:01caternno
11:02caterntypes are obviously objectively superior, but they're difficult to put in a lisp without weirdifying the syntax
11:02sobeli 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:02sobeli can't agree that they are objectively superior. there is plenty that strong typing frustrates.
11:03sobelbut when they're a necessary part of the language, you may as well lean on them hard for all they're good at.
11:03sobeli do
11:03arrubinsobel: Incanter?
11:04sobelarrubin: possibly interesting. i might be even more interested if there's a GIS/map project.
11:05caternsobel: I'm just curious, what was this "strict type based signature" language you were using?
11:05arrubinsobel: I think that the options for full applications is going to be limited. There are far more libraries.
11:05sobelcatern: java, C++
11:05arrubins/is going/are going/
11:06sobelarrubin: i know
11:06caternsobel: yeah, so not really "strict type based", more like "really horrible type systems that are badly designed"
11:06caternnot all type systems are alike!
11:06sobelcatern: i quit splitting that hair 10 years ago, but yeah
11:08sobelloose typing bothers some people more than others. it's just another tool with tradeoffs some don't fully get.
11:11tomjackmustn't the hair remain split when evaluating or building new programming languages?
11:13tomjackor 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:13sobeltomjack: 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:14sobelit's a matter of pragma not reason
11:14tomjackyeah, until you see something interesting and seemingly practically useful, no reason to split the hair :)
11:15sobelit was a lot more interesting when i did not understand a) FP, b) data, c) databases
11:17sobelbefore 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:18sobelso 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:19sobeli'd be curious if anyone else had a similar pattern of migration from OO to Lisp.
11:19tomjackinteresting, it's the opposite for me. FP (along with my utter lack of interest in OO) drives my interest in type systems
11:19tomjackduring OO days I migrated to dynamic types, then FP made me interested in static again :)
11:19sobeli wanted to compose with objects but found them too heterogeneous, and didn't really have anything motivating me to do the science (CS)
11:20tolstoysobel: I kept writing "bad" OO by separating data objects from behavior objects (as I call em).
11:20tomjackthat's bad OO? I still try to do that when forced to write OO stuff
11:20tolstoyThat's why I scare quoted it.
11:20tolstoyColleagues would say, "This isn't very OO."
11:21tolstoyMonths later, they'd do the same thing as me. Much easier to maintain.
11:21sobelmy gripe with OO was too many patterns for things that should be reusable behaviors, but can't be, because type safety.
11:21sobelSO much fits under that umbrella-gripe.
11:21justin_smithsobel: I'd say more "because OO is a bad abstraction" - the ml languages can do nice things with reusable functional abstraction and types
11:22justin_smithml family, with haskell as a distant cousin
11:22sobelcatern: i quit splitting that hair 10 years ago, but i have little positive to say about the C++/Java family of OO.
11:22sobeluh
11:22tolstoyThere's a few folks who implemented an OO system on top of Clojure in about 100 lines.
11:22sobelholy paste buffers
11:22tomjack(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:22tolstoyI love the idea of using OO only when it suits, rather than a full on paradigm.
11:23tolstoytomjack: It just made more sense for me to have a Database class that produced value objects, rather than a bunch of DAO objects.
11:24sobeldatabases are a classic problem for application devs. the database is not a domain.
11:24tolstoytomjack: 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:24sobelDAOs are for grouping access by domain. it should be application-level.
11:24sobelbut what i see a lot of are DAOs that cover the entire set of domains the application might need.
11:25tolstoysobel: I ended up using just one DAO.
11:25sobelor 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:26sobeltolstoy: lots of apps only really need one DAO. it's necessarily complex if an app really works in 2+ distinct domains.
11:27tomjackI 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:27sobeli agree. i could say more, but don't have to. :)
11:29sobelvaguely related: my application designs are cleaner and more successful since i added SQL (performant, normalized designs with remote facades) to my toolbox
11:29tolstoyI never want to argue against something like Haskell, but I always get frustrated trying to read a simple JSON document in it. ;)
11:30justin_smithtolstoy: 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:30sobeli think a lot of OO developers have exactly one hammer and it's not relational
11:30sobelfwwi i don't hold up C++ as anything but a target these days
11:32tolstoyjustin_smith: I agree.
11:32anec/c++ aren't strongly typed.. 'a' is both a valid int and a char
11:35tomjackI think any time someone says "* typed" you basically have to ignore the * and just figure out from context what they mean :)
11:36mavbozoregarding 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:37tolstoymavbozo: If I understand you right, that's what I ended up doing. Looks totally wrong, but much, much easier to maintain.
11:38tolstoyFor me, it felt like my struggles to get anything done amid fluid requirements drove me to that solution.
11:38mavbozoi totally gave up designing data object whose storage is outside my application process
11:38mavbozobetter treat it like another rest api call with rest api failure handling
11:39tolstoyYep.
11:39tolstoyObjects that have nice little methods on them are fine, I guess, but you get fooled when those methods do network requests.
11:40justin_smithyeah, the network cannot and should not be implicit or transperent
11:40justin_smithit has failure modes that local code just doesn't
11:40mavbozoanother hard lesson i got from clojure, make IO explicit and separate
11:41tolstoyYeah. That was a HUGE problem with SOAP generated objects.
11:41tolstoyYour design-brain can't help by think that calling a method will always return.
11:48mavbozoon 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:53mavbozoso, when i watched Rich video where he said something like "just use map dammit!", I said "Huh?!"
11:55mavbozoafter 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:59arrubinmavbozo: Stuart Sierra discusses that a bit in this talk: http://www.infoq.com/presentations/data-visibility-abstraction
12:01mavbozoarrubin, thank you. I'll definitely watch it.
12:06sobelmavbozo: 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:08sobelthe whole point of making a DAO is to translate the domain into your application's architecture
12:08sobelthe mistake i see too often is holding the database or databases in general as a domain.
12:11sobelif you don't know what your domain is, wrapping it in JSON changes little ;)
12:11tomjackwhat's a DAO look like in Clojure terms?
12:11tomjackI mean, specifically your kind of DAO
12:12tomjackI presume it's gonna be a DAX for some X which isn't O?
12:12sobeli think it would just be a library in lieu of an object
12:12tomjackright, cool, then I can read what you said above without it making me unhappy :)
12:13justin_smithhaha
12:13tomjackpresuming the library is mostly pure fns
12:13sobelit'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:14sobeltomjack: 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:14sobelbut i promise, when i address a ruby crowd, it is news.
12:15sobel(spent 4 years supporting Rails users, have probably seen everything by now!)
12:16sobelbut 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:16sobelthe ActiveRecord noobs i supported never did make that connection
12:21justin_smithNDM - nihilist domain modeling
12:22justin_smith(def world nil)
12:22justin_smithdone
12:22justin_smithoh wait, even better: (def world (System/exit 0))
13:26sobel(undef world)
13:30mavbozosobel, please recommend me a good reference for DAO design method
14:27noncom|2i 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:28justin_smithnoncom|2: wouldn't the classes be compiled into the jar?
14:28clojurebotNo entiendo
14:28justin_smithoh, checkout, right
14:30noncom|2yeah, but hmmm, looks like the situation is not like i have described.. maybe i have missed somehting..
14:33noncom|2sorry, i had a compilation issue in the dep proj
14:33noncom|2but lein is good too: it does not say about it, it silently fails
14:33justin_smithinteresting
15:21noncom|2justin_smith: also, it is impossible to force lein recompile java files of a dep proj.. %)
15:21wirrbelI 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:22wirrbel{:non-native disallowed-key, :native disallowed-key, :non-native missing-required-key, :native missing-required-key}
15:22wirrbelso from the console output the keys seem identical
15:26tomjackhrmmm?
15:27wirrbelso the problem is that I require a key :native in the schema, and it is present in the map
15:27wirrbelthe error message is contradictory
15:27tomjackit looks to me like there are two :native keys in the map
15:27tomjackwhich should be impossible
15:28wirrbelthis is not a map but the error message
15:28tomjackstill looks impossible :)
15:28tomjackunless, of course, the keys aren't identical, which must be the case!
15:28wirrbelthats why i am asking
15:29wirrbelis there a way to print with more detail?
15:29tomjackare you in clj or cljs?
15:29wirrbelclj
15:29wirrbelI have the impression that some space/unicode character could be there
15:30tomjackfirst thing I would do is make sure they're really all clojure.lang.Keyword by checking e.g. (map class (keys x))
15:31wirrbelah
15:31wirrbelthey could be strings instead of symbols?
15:31tomjackmaybe, depending on how they're being printed
15:32tomjackif you're at a repl and you just eval (keys x) you should be able to tell if they're strings
15:34tomjackif 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:37gfrederickswirrbel: keep in mind "string" "symbol" and "keyword" are three distinct, similar things
15:38wirrbelhmm, I also may have misunderstood transit
15:43wirrbelI 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:44wirrbelso I should really only use it as an intermediate format and not use it to parse arbitrary json
16:19irctctest
16:34Guest82897Hi 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:34Guest82897what's the best way to do that?
16:39mavbozo,(doc source)
16:39clojurebot"([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:39mavbozo,(source max)
16:39clojurebotSource not found\n
16:46mavbozo##(source +)
16:46lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
16:46mavbozo,(source +)
16:46clojurebotSource not found\n
16:47Guest82897yeah, found that, but it takes a symbol that must be defined
16:47gfredericksGuest82897: by "source string" do you really need the original string or would the code-data be sufficient?
16:48Guest82897the code data would be better tbh
16:48gfredericks,(defmacro my-fn [& args] `(vary-meta (fn ~@args) assoc :fn-form '~&form))
16:48clojurebot#'sandbox/my-fn
16:48gfredericks,(def add-five (my-fn [x] (+ x 5)))
16:48clojurebot#'sandbox/add-five
16:48gfredericks,(add-five 20)
16:48clojurebot25
16:48gfredericks,(-> add-five meta :fn-form)
16:48clojurebot(my-fn [x] (+ x 5))
16:49gfredericksi.e., you write your own fn macro and use that
16:49noncom|2whats the way to force lein to recompile java classes in a checkouts dep?
16:49gfredericksnoncom|2: does `lein do clean, javac` not work?
16:50gfredericksI have no idea how checkouts and java classes interact, it might be completely non-functional
16:50Guest82897gfredericks: thanks for your help, think I understand better now :)
16:50gfredericksI thought checkouts were just a classpath hack
16:51noncom|2yeah, clean + javac would work, just as running lein on the dep :) but i thought there were a one-click solution probably
16:53gfredericksalias `lein dcj` to `lein do clean, javac`
16:53mavbozo(inc gfredericks)
16:53lazybot⇒ 133
16:54arrdem$grim clj::clojure.core/concat
16:55mavbozo$grim clj::clojure.core/future-cancel
16:55arrdemmavbozo: looks like lazybot hasn't been redeployed since that PR was merged
16:56noncom|2yeah
16:56noncom|2what's the best way to find index of an element in a [] ?
16:56noncom|2(with a predicate)
16:57noncom|2take-while + count ?
16:57mavbozoarrdem: oh :) i have no idea what would happend if i type $grim
16:58arrdemmavbozo: https://github.com/Raynes/lazybot/blob/master/src/lazybot/plugins/grimoire.clj#L33
16:59arrdemTL;DR should make lazybot print the Grimoire URL for the given platform and ns qualified symbol
17:00mavbozoarrdem: that's cool
17:45gfredericksnoncom|2: ##(first (keep-indexed #(if (= :foo %2) %1) [:bar :baz :foo :tom]))
17:45lazybot⇒ 2
17:46noncom|2wow
18:38cflemingIs ~/.lein/plugins still a thing in lein 2.x?
18:46gfrederickscfleming: I don't know what kind of backpat features exist but I have no knowledge of that being a thing otherwise
18:46cfleminggfredericks: Yeah, looking at the code I don't think it exists any more
18:46gfredericksI'm not a Super Certified Limeagain Eggs Bert though
18:46cflemingThere's a super certification for that?
18:46cflemingTIL
18:47joe128hi
18:47gfrederickscfleming: you have to be certified to authoritatively make negative claims like that
18:48cfleminggfredericks: So reading the internet, it appears that they must give those certifications out with cornflakes.
18:48joe128are there a lot of clojure jobs
18:53gfrederickscfleming: that's where I got mine at least
18:53gfrederickswait I was claiming to not have one
18:53gfrederickscrap
18:53cflemingYou beat me to it
18:54arrdemlol
18:54arrdem##(meta ^:markdown "foo bar")
19:48arrdemgfredericks: do you or does test.check have a generator for valid Clojure names?
19:56gfredericksarrdem: if you can make a regex for that I do
19:57hyPiRionarrdem: Clojure names? Like symbols?
19:57arrdemhyPiRion: da
19:57gfrederickstest.check has something for symbols but I doubt it's exactly what the reader accepts if that's what you want
19:57gfredericksI could be wrong though
19:57gfredericksabout it not being exactly right I mean
19:57arrdemyeah... okay
19:58gfredericksit's probably like alphanumeric w/o initial numbers or something basic like that
19:58hyPiRion#"[^@~(),\\;`\[\]{}~^\s:#/\'\d]((:?[^@~(),\\;`\[\]{}~^\s:])*[^@~(),\\;`\[\]{}~^\s:/])?" is pretty close I think
19:58hyPiRionbut there's been some time since I verified that one
19:58arrdemcould probably crowbar it out of Reader..
19:59arrdem(the regex instance that is)
19:59gfredericksand then you just plug that into https://github.com/gfredericks/test.chuck#string-from-regex
20:07cflemingarrdem: https://www.refheap.com/99257
20:11gfredericksthat there looks like it might be a use case for character class intersection maybe
20:11gfredericksif you were to translate it to a regex I mean
20:11cflemingYeah, I have the equivalent in regex form in my lexer somewhere
20:40TEttinger,(re-find #"[^@~(),\\;`\[\]{}~^\s:#/\'\d]((:?[^@~(),\\;`\[\]{}~^\s:])*[^@~(),\\;`\[\]{}~^\s:/])?" "\ufeff")
20:40clojurebot["" nil nil]
20:41TEttinger,(ffirst (re-find #"[^@~(),\\;`\[\]{}~^\s:#/\'\d]((:?[^@~(),\\;`\[\]{}~^\s:])*[^@~(),\\;`\[\]{}~^\s:/])?" "\ufeff"))
20:41clojurebot\
20:41TEttingeryep!
20:41TEttingerBOM is a valid name by that, and by clojure
20:41TEttinger(inc gfredericks) ; being able to generate strings from regexes is quite cool
20:41lazybot⇒ 134
20:42TEttinger(inc hyPiRion) ; I hope you didn't type that regex from memory
20:42lazybot⇒ 73
20:52netroby,(+ 3 4)
20:52clojurebot7
20:53justin_smith,(+)
20:53clojurebot0
20:53netrobyOh, how to call lazybot?
20:53netroby(+ 1 2);
20:53clojurebot3
20:53justin_smith&(+ 3 4 5)
20:53lazybot⇒ 12
20:53netroby&(* 5 6)
20:53lazybot⇒ 30
20:54netrobyNice. thanks you guys
20:54justin_smith&(*)
20:54lazybot⇒ 1
20:54TEttingerhuh
20:56justin_smith?
21:00TEttingerjustin_smith, odd that he just quite after learning how to use the bots
21:00TEttinger*quit
21:00justin_smithahh
21:01justin_smithobviously he is going to use clojurebot and lazybot to mine buttcoins
21:02arrdemshould've prepared an april 1 PR to add dogecoin support
21:02TEttingerto the moon!
21:02justin_smith(inc TEttinger)
21:02lazybot⇒ 47
21:03arrdem(inc TEttinger)
21:03lazybot⇒ 48
21:03arrdemforecast: not moon
21:05TEttingerClojure 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:08rpauloheh
21:08arrdemvery very very wow wow wow
21:09arrdemhttps://github.com/arrdem/dogeon
21:10TEttinger(inc arrdem) ; wow.
21:10lazybot⇒ 42
21:10arrdem(inc beer)
21:10lazybot⇒ 1
21:10arrdem(inc doge)
21:10lazybot⇒ 1
21:11arrdemI should make SimpleDB pluggable on the serializer just so for shits and giggles I can serialize DBs to DSON and back
21:11justin_smith{ and } are replaced with such and wow (the duplicate wows are guaranteed differentiatable, though they do lead to wow placement bugs)
21:13justin_smith[, ] are many and wow
21:31enn`Has anyone else had issues with Github's CDN caching Clojars badges?
21:31arrdemenn`: everyone has
21:32justin_smithdo we need any steenking badges??
21:32lazybotjustin_smith: What are you, crazy? Of course not!
21:33justin_smithhttps://www.youtube.com/watch?v=nsdZKCh6RsU
21:37LewixI'm looking for a theme or template to document a demo app
21:37Lewixanyone used something like that before?
21:38TEttingerLewix: is this more of an app or a library?
21:39LewixTEttinger: an app that is starting small but the intent is to build up a library
21:39LewixTEttinger: answer to your question: more of a library*
21:39TEttingerwell I mean is this something that programmers would use or end-users
21:40TEttingerhttps://fogus.github.io/marginalia/ is good if you're aiming for programmers and your library is open source
21:42LewixTEttinger: programmers*
21:43LewixTEttinger: 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:43TEttingerah, not sure then
22:18fryguyif 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:18justin_smithfryguy: this is what require is for
22:19fryguyyah i'm using require and it's not seeming to do what I want, let me gist something
22:20fryguyhttps://gist.github.com/bryanalves/46bfc4576ce6972df21d
22:21justin_smithfryguy: run is not visible during the compilation of run-problem
22:21justin_smithif you need to do it that way, use resolve
22:22fryguywhat is require doing for me then if it's not making it visble?
22:22justin_smithfryguy: require does not run when the function is compiled
22:22justin_smithit runs when you call the function
22:22justin_smiththe error is caused by the symbol not being in scope when you compile, this is why you need resolve
22:23justin_smithchange (run) to ((resolve 'run))
22:23fryguyyah that just returns a reference to the function though, doesn't actually run it, do I need to call eval or something?
22:23justin_smithno, that calls it
22:24justin_smithextra parens
22:24justin_smith,((resolve '+))
22:24clojurebot0
22:24fryguyah, there we go
22:24fryguyis there a better way to do what i'm trying to do?
22:24justin_smithyou could use load followed by resolve
22:25justin_smithyou pretty much need resolve if you don't know the ns at compilation time
22:26justin_smithfryguy: resolve is much cheaper than eval
22:26justin_smithalso less powerful, and it's good to use the least powerful tool
22:39justin_smith~trolling is http://i.imgur.com/7XYz9Fg.jpg
22:39clojurebotAlles klar
22:42lvhgfredericks: (juxt) sounds like it should be (constantly [])
22:42lvhgfredericks: or is that what you're saying
22:42gfredericksyes
22:42gfredericks,(juxt)
22:42clojurebot#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:43gfredericks((juxt)) would be a nice obfuscation tactic
22:47gfredericks,((juxt +))
22:47clojurebot[0]
22:49lvhwhaa
22:49lvhoh, right
22:50lvhgfredericks: Is that something that has been actively voted against
22:50lvhgfredericks: Or should we be filing a JIRA ticket
22:51gfredericksno idea
22:51justin_smith,(= get (apply get ((juxt get get get) get get get)))
22:51clojurebottrue
22:52justin_smiththat's a decent brain fuck I think
22:53FrozenlockMom, justin_smith is playing with his functions again!
22:54gfredericksI assume this is what OOP means by getters
22:54justin_smithindeed
22:54justin_smith~get
22:54clojurebotPardon?
22:55justin_smith~get is (= get (apply get ((juxt get get get) get get get)))
22:55clojurebotIn Ordnung
22:55tclamb,(= get (get get get get))
22:55clojurebottrue
22:55justin_smith,((juxt + * - /) 1 2 3) ; lvh
22:55clojurebot[6 6 -4 1/6]
22:56tclamb,(nil? (get get get))
22:56clojurebottrue
22:56justin_smithtclamb: yup, I think you've pretty much figured it out :)
22:57justin_smith,((juxt + * - /) 1 2 3 4)
22:57clojurebot[10 24 -8 1/24]
22:57gfredericks,((get get get get) (get get get get) (get get get get) (get get get get))
22:57clojurebot#object[clojure.core$get "clojure.core$get@7d6eca8a"]
22:57justin_smithget fractals
22:59lvhjustin_smith: oh, okay, that's pretty consistent I guess
22:59lvhI feel like I only ever have used juxt with keywords, and maps as args
22:59gfredericks,((fn f [] (if (< 0.4 (rand)) 'get (repeatedly 4 f))))
22:59clojurebot(get get get get)
22:59gfredericks,((fn f [] (if (< 0.4 (rand)) 'get (repeatedly 4 f))))
22:59clojurebot(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:59gfredericks,((fn f [] (if (< 0.4 (rand)) 'get (repeatedly 4 f))))
22:59clojurebotget
22:59gfredericks,(defn getter [] (if (< 0.4 (rand)) 'get (repeatedly 4 getter)))
22:59clojurebot#'sandbox/getter
23:00justin_smithgfredericks: that gives me lots of stack overflow errors
23:00gfredericks,(getter)
23:00clojurebot(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:00gfrederickshow do I make it less biggly
23:00justin_smithhrm
23:00gfredericks,(defn getter [x] (if (< x (rand)) 'get (repeatedly 4 #(getter (+ x 0.1)))))
23:00clojurebot#'sandbox/getter
23:00gfredericks,(getter 0.5)
23:00clojurebotget
23:00gfredericks,(getter 0.5)
23:01clojureboteval service is offline
23:01gfredericks&(defn getter [x] (if (< x (rand)) 'get (repeatedly 4 #(getter (+ x 0.1)))))
23:01lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
23:01gfredericksconsarnit
23:01gfredericksyou bots
23:02justin_smithconsarnit is a very good lispy mixed oath
23:29justin_smithDAG nabbit is acceptable if you are doing graph algorithms
23:32gfredericksoh man
23:36TEttinger(dag/nab it)
23:39lvhis 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:39lvhI guess maybe I kind of want a map of keys to predicate functions
23:39lvh(I am writing a test to see if some headers returned by a handler are sane)
23:39justin_smithI would do (apply = (map #(select-keys % [:keys :that :matter]) inputs))
23:40lvhyeah, that's what I have
23:41lvhthanks!