#clojure logs

2014-10-07

01:45johann_hey room. i'm working on a project where i grab images off the web and display them in quil
01:48johann_i'm using http-kit to grab the images and it returns a promise with the response. in the body there is a byteinputstream of the image
01:48johann_the thing that i am confused about is going from byteinputstream to bufferedimage
01:50johann_i'm using the javax.imageio.ImageIO/read method and passing in the byteinputstream and it seems kind of arbitrary when it works without error or when i get a nullpointerexception
03:51H4nsi got a clojure design question: i have a set of restful handlers that operate on a persistent model, and i would like to send out asynchronous messages into the rest of my system whenever certain handlers are called. now, what is the best way to make the core.async channel available to the handlers?
03:52H4nsi'm using compojure for routing, so i use defroutes to define the routes and a bunch of ring middlewares. now, somehow i fail to come up with a good idea how i could install the routes and at the same time pass the channel to the handlers. any ideas/examples?
03:54H4nsor maybe i don't want to pass a channel at all, but rather use some higher level library that allows another component to observe the handlers?
04:01kungiH4ns: I recently had a similar problem where I needed to inject a component as dependency into a bunch of routes.
04:02kungiH4ns: Have a look at this macro here for inspiration: https://github.com/ggenikus/comcomp
04:02kungiH4ns: but beware this macro has some serious flaws.
04:03kungiH4ns: The idea is to inject the dependency into each request when it reaches a route
04:03H4nskungi: thanks! i'll have a look.
04:04H4nskungi: i've just found wrap-routes, which may actually be all that is required.
04:04kungiH4ns: wrap-routes?
04:04H4nskungi: http://weavejester.github.io/compojure/compojure.core.html#var-wrap-routes
04:09H4nshm. maybe not. there ought to be a very simple, macro-less solution.
04:15magopianis "Arne Brasseur" (@plexus) here?
04:17dysfunis there a collection library that evicts things on a LRU basis up to a specified limit?
04:20dysfunhrm, looks like LinkedHashMap can be used in this way
05:26perplexacfleming: i didn't have time to look into it yet, sorry :)
05:26perplexagonna play around a bit with cursive at the weekend
05:34kenrestivoi vaguely remember seeing a project someone did that would show you the github projects which depend (via lein project.clj) on some given project
05:35kenrestivoif that makes any sense. basically, a nice tree or search that would show what projects make use of which libraries
05:42kenrestivonm, found it: https://github.com/search?q=foobar+filename%3Aproject.clj&type=Code&ref=searchresults
05:51cflemingperplexa: Ok, cool - let me know if you have problems, either here or by email
05:51cflemingkenrestivo: Check out http://crossclj.info, it's really great
05:51perplexaalrighty :) thx
05:54kenrestivocfleming: wow, that's pretty amazing. and very helpful for comprehending the projects of people who :refer :all
05:55cflemingkenrestivo: No doubt, I use it a lot to see how people are using functions I'm interested in too.
05:55cflemingkenrestivo: The UI is pretty dense and takes some getting used to, but it's really powerful.
06:06kenrestivowho wrote that? is it based on codeq/datomic? great stuff.
06:07ro_stwhat are you talking about?
06:07ro_stcrossclj?
06:08cflemingkenrestivo: It's written by Francesco Bellomi. It's not open source right now, AFAIK it's not codeq or datomic.
06:08cflemingro_st: Right.
08:38kungiI am trying to load css files i bundeled into an uberjar like this: (io/file (io/resource "public/bootstrap/css/bootstrap.css"))
08:38kungiBut I receive a IllegalArgumentException "Not a file"
08:39kungi jar:file:/Users/kungi/Code/clj-demgen/target/clj-demgen-2.0.7-standalone.jar!/public/bootstrap/css/bootstrap.css
08:39kungiWhat am I doing wrong here?
08:54kungiMeh! I found it. I cannot access a file in a jar file in that way.
08:58ordnungswidrigkungi: (io/resource "…") should be sufficient and will return you an inputstream IIRC.
09:00kungiordnungswidrig: Yes but I wanted to get the lastModified time
09:01kungiI solved the problem as follows:
09:01kungi(defn- get-last-modified [url]
09:01kungi (.. (io/resource url)
09:01kungi (openConnection)
09:01kungi (getLastModified)))
09:01kungiordnungswidrig: where are you from in germany?
09:01ordnungswidrigkungi: neu-ulm
09:01kungiordnungswidrig: quite "near". We are creating a new clojure user group in mannheim
09:02ordnungswidrigkungi: that will only work as long as the resource is loaded from a jar. not every implementation or "UrlConnection" supports "getLastModified".
09:02clgvkungi: you have a different definition of "near" ;)
09:02kungiclgv: that's why I said 'quite :-)
09:02ordnungswidrigI might give a visit to that group some when. If you like I can give a talk on liberator or web dev.
09:03ordnungswidrigclgv: kunig is using the american midwest definition of "near"
09:03kungiordnungswidrig: Hmm it seems to work when I run it outside of a jar in lein repl
09:03clgvordnungswidrig: hehe
09:04kungi:-D
09:04agarman_kungi: the behavior will be surprising if your URL starts with something other than file://
09:05kungiagarman_: hmm can this happen when I use it on something created by (io/resource)?
09:06ordnungswidrigkunig: that depends on the classloader
09:06kungiordnungswidrig: Now we reach the end of my Java knowlege.
09:06ordnungswidrigkungi: and beware that a classloader normally does not reload resources. Therefor I question whether it's useful to determine the last modification date of a resource
09:07agarman_kungi: yeah, what ordnungswidrig said :-)
09:07ordnungswidrigkungi: maybe you can describe what you want to achieve more generally
09:09kungiI want to force the browser to reload css and js files which have changed since the last visit.
09:09agarman_don't put them in resources then
09:09kungiI determine the last modified date and append it to the url
09:10ordnungswidrigkungi: https://github.com/mmcgrana/ring/wiki/Interactive-Development
09:10elfenlaidhi all, quick silly question, are there some analog of haskell's STM:retry in clojure or I must use watcher?
09:10ordnungswidrigups, wrong link
09:10ordnungswidrigelfenlaid: yep, lookup (ref) (dosync) et. al.
09:11kungiordnungswidrig: Looks wrong
09:11elfenlaidordnungswidrig: thank you :)
09:12ordnungswidrigkungi: https://github.com/weavejester/lein-ring is able to reload on change
09:12kungiordnungswidrig: Yes but this does not prevent the browser of my client from caching my js files
09:12ordnungswidrigkungi: if you only need it for dev, then you might be able to depend on file:///… urls and just not fail else
09:12agarman_kungi: you need to include ring-dev middleware
09:13ordnungswidrigkunig: you should serve a proper last-modified header then
09:13kungiordnungswidrig: no not only for dev
09:13kungiWhen I deploy a new version of my webapp I want to force the clients browser to reload the css and js files that have changed
09:14ordnungswidrigoki, "wrap-not-modified" is your friend here. https://github.com/ring-clojure/ring/wiki/Static-Resources
09:14agarman_https://clojars.org/ring/ring-devel
09:16kungiordnungswidrig: looks like that's exactly what I need
09:21kungiordnungswidrig: Thank you!
09:25arrdemcfleming: killed the old Grimoire instance. no idea how that survived.
09:26arrdemcfleming: yeah there will be a Grimoire 0.4.0 with a omnipresent search box for keyboard only nav at some point
09:27arrdemcfleming: blockers on that are my learning clojurescript, free time and a couple solid UX sketches
09:50elfenlaidI end up with like this http://dpaste.com/3V0TH3Z , another interesting question is should I worry about an overhead of add-watcher \ remove-watcher ?
09:59kungiordnungswidrig: When using ring.middleware.not-modified in an uberjar I get two content-length headers with the same value in the respones.
09:59kungiordnungswidrig: This create weird errors.
10:00kungiordnungswidrig: Do you have a pointer where I might start to debug this?
10:01ordnungswidrighmm, that's a good question
10:10clgvelfenlaid: what exactly are you trying to solve with that?
10:27elfenlaidclgv: well, I'm planning to build a toy spider with configurable number of connections per host
10:28clgvelfenlaid: ok. what does this concrete piece of code try to achieve?
10:29justin_smithshared queue and each thread taking URLs from the queue to visit and depositing URLs from links would be much more straightforward
10:30elfenlaidjustin_smith: actually your are right :)
10:31elfenlaidclgv: it's kind of connections queue
10:31xeqielfenlaid: have you considered a ThreadPoolExecutor ?
10:32elfenlaidxeqi: well, no :) I will google for that, thanks :)
10:33justin_smithyeah, a ThreadPoolExecutor and a ConcurrentLinkedQueue seems like a natural combo for this
10:34clgvelfenlaid: yeah, you should use a threadpoolexecutor to limit the number of parallel activities
10:34clgvelfenlaid: that's why I asked ;)
10:36corecodehi
10:36corecodewhat's the suggestion to use swt with clojure?
10:37corecodei'm a total newb to clojure and java; i can't find a recent swt package in clojars or maven
10:38elfenlaidclgv: trying to mix channel in that monster :) http://dpaste.com/3Q0E31A
10:38justin_smithcorecode: well there is a maven repo for swt https://code.google.com/p/swt-repo/
10:39corecodejustin_smith: so eclipse can't figure it out themselves?
10:39corecodeoh my.
10:39justin_smith?
10:39justin_smithI don't know
10:39justin_smithyeah looks like it
10:39corecodenow i just need to figure out how to use this repo with lein
10:40clgvelfenlaid: no, just forget that monster
10:40vermaso if I have a javascript object and I need to access a property like: positions.attributes.position.array, is there something more elegant than (.-array (.-position (.-attributes positions))) ?
10:41clgvcorecode: are you sold on SWT? since there is the awesome seesaw library for swing
10:41justin_smithcorecode: [org.eclipse.swt/org.eclipse.swt.win32.win32.x86_64 "4.4"] in your deps vector
10:41elfenlaidclgv: if you say so :)
10:41justin_smithyeah, seesaw will likely be much more peasant to use
10:41corecodeclgv: i am not committed at all
10:41clgvcorecode: afaik there is no port for SWT so far
10:41corecodeclgv: i'm trying to learn a bit of opengl and clojure
10:42corecodejustin_smith: that probably won't work for linux?
10:42justin_smithcorecode: on that page they list the artifact ids for other platforms
10:43justin_smithI was just showing the translation from pom.xml syntax to project.clj
10:43justin_smith(of course you need to add their repo to :repositories too)
10:43clgvcorecode: I think there should be a portable dependency for SWT
10:44TravisDDoes anyone know of any papers talking about stopping rules for random restarts for global optimization?
10:44corecodejustin_smith: i was more wondering how i can add the repo url
10:44justin_smithclgv: so what, it would ship every platform version?
10:44corecodebut sure, i can try to use seesaw
10:45justin_smithcorecode: relevant part of the sample project.clj https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L78
10:45Luyt_iamdustan: Having any luck with Clojure on codeeval.com yet? My solutions also get rejected because they take too much memory (120MB for example). The hint I get is "Reduce memory usage to 20MB or less". Easier said than done!
10:45justin_smithcorecode: there is little to nothing about project.clj construction that is not answered by example in that marvelous file
10:46clgvjustin_smith: yeah, I think there is an option to do that similar to how other native libraries are handled
10:46justin_smithLuyt_: with clojure, that is going to be pretty difficult
10:46justin_smithclgv: and how are they handled? by shipping all the common native deps in the uberjar?
10:46Luyt_justin_smith: I agree. Codeeval should adjust their memory usage criteria for submitted solutions in Clojure.
10:47clgvjustin_smith: yeah probably. I think for dev it should be fine, but for releases you probably only want to have platform specific builds to limit jar file size
10:47justin_smithyeah - not that we limit size of much of anything in the clojure world :P
10:48Luyt_justin_smith: There was some discussion about it on https://getsatisfaction.com/codeeval/topics/clojure_time_memory_stats_seem_wrong , but I think it has low priority at codeeval.
11:34clgvLuyt_: well memory usage is a matter of configuration of the used jvm as well. how do they do it for java?
11:35Luyt_clgv: I don't know ;-) I can't look into the kitchen of Codeeval.com ;-)
11:36Luyt_clgv: Oh, and I've never submitted a Java solution. Do they accept those, too?
11:36clgvLuyt_: java is listed in the ranking screenshots
11:37Luyt_clgv: Oh! Maybe they've tuned the criteria for Java solutions more careful than for Clojure. But I'm not interested in writing Java, I want to submit my solutions in Clojure!
11:38justin_smithclgv: my guess is that the java code is rated on the runtime mem usage as opposed to the compile time usage. in clj land we bring out compile time into runtime.
11:38clgvjustin_smith: hmm maybe.
11:39justin_smithotherwise c++ would not do very well
11:41clgvthey should just prestart a repl and then load the solution file and start the evaluation. but I guess they want to stay with their commandline approach
11:48clgvjustin_smith: btw it seems there is no portable maven artifact for swt - maybe I confused it with a different lib relying on native dependencies
11:49m1dnight_Is it normal that (def varname...), not on to in a let body, gives a warning in Cursive?
11:49m1dnight_varname can not be resolved
11:50m1dnight_But everything works fine :)
11:50clgvhuh?
11:50m1dnight_*not on top
11:50clgvm1dnight_: you mean like (let [...] (def varname ...)) ?
11:50m1dnight_yes
11:50m1dnight_(I know i should put it in the let, but I did it while experimenting
11:50clgvm1dnight_: that's a very bad idea and show that you did not understand the destinction between variables and local bindings
11:51Bronsaclgv: how is that a bad idea?
11:52Bronsait's certainly not used much, but there's nothing wrong with it
11:52clgvBronsa: ok some contex info is missing - I assume the `let` is within a function. which is the most frequent case when this is reported ;)
11:52clgvfor a few variables I use a surrounding `let` as well...
11:52m1dnight__experimenting_
11:53clgvm1dnight_: I guess it might be a feature of cursive's code analyzer?
11:53m1dnight_But the warning "can not be resolved" implies it can't find the variable in scope, but it is so I'm not sure wether it's a bug or a feature
11:54justin_smithm1dnight_: pragmatically speakign, a def inside a let, whether inside a defn or not, is rarely needed, and very frequently a sign that someone is making a beginner mistake. I can see how this would not be a priority case for the cursive analyzer to get correct.
11:54clgvm1dnight_: a bug of the analyzer is possible as well ^^
11:55m1dnight_justin_smith: I know, I know. I was just experimenting with proxies and swing so I quickly put in a def to try it out
11:55m1dnight_Nothing is set in stone here :p
11:55clgvis cursive opensource?
11:55justin_smithm1dnight_: right, just saying cursive has likely had few test cases like this
11:55justin_smithso the chances it has weird corner case behavior is high
11:55Bronsaclgv: don't think so
11:56m1dnight_cfleming: ^ Perhaps you are interested.
11:57clgvBronsa: hmm yeah, would probably reduce the chances to sell it later on (as announce in its beginning)
11:58justin_smithm1dnight_: yeah, cfleming is the cursive dev
11:58justin_smithm1dnight_: cursive has a bug tracker, right?
11:58m1dnight_Not sure, I wanted to make sure I'm not overseeing something beforeI report a bug
11:58m1dnight_So I'll do that right away :)
11:59m1dnight_overlooking*
11:59justin_smithm1dnight_: https://github.com/cursiveclojure/cursive you can probably create an issue here
11:59justin_smithlooks official
12:00kungiIs anyone working at http-kit?
12:01justin_smithkungi: as in being a http-kit developer, or as in using it in production?
12:01kungijustin_smith: I think both is appropriate
12:01justin_smithI use http-kit in a few projects
12:02kungijustin_smith: have you ever used ring.middlerware.not-modified with http-kit
12:02justin_smithno, not at all
12:03kungijustin_smith: using this ring middleware in conjunction with the creation of an uberjar results in http-kit delivering a response containing:
12:03kungiContent-Length: 101595
12:03kungiContent-Length: 0
12:03kungi
12:03kungiWhich just confuses every browser
12:03justin_smithyeah, that's weird
12:03justin_smithis this an http-kit specific issue?
12:03kungiProbably because of this: https://github.com/http-kit/http-kit/issues/127
12:04kungijustin_smith: I have not tested this with another server
12:05justin_smithyou are right, this looks very similar to that issue - in fact, if I am reading correctly, the fix to that issue may have even caused this issue
12:06kungijustin_smith: the funny thing is: It only appears when I compile my code into an uberjar
12:06justin_smithkungi: what if you expanded the resources directory onto disk and loaded resources from there as a workaround?
12:07justin_smithjust speculating that this would even work...
12:07kungijustin_smith: that might work, but I still don't understand why this happens
12:08justin_smithkungi: continuing to blantantly speculate... because you can't get a last modified time from a resource inside a jar?
12:09kungijustin_smith: I don't think this is correct.
12:09justin_smithnot at all unlikely :)
12:09kungijustin_smith: Let me gist some stuff
12:11justin_smithsure - going out for coffee myself, be back shortly
12:11kungijustin_smith: https://gist.github.com/Kungi/4436d93ec8a99062fc09
12:11kungijustin_smith: I get a Last-Modified: date when querying the ubarjar version which seems to be correct.
12:12justin_smithyou get double Content-Length headers in both cases
12:12kungijustin_smith: But in one case they match and in one they don't
12:12justin_smiththat looks like an http-kit bug (or, very unlikely, a but in the not-modified middleware)
12:12clojurebotI don't understand.
12:12kungijustin_smith: That seems to be the "real" problem
12:12justin_smithyeah
12:13justin_smithhave you considered making an uberwar via lein ring, and seeing if it behaves nicely in a tomcat or jetty container?
12:13Bronsahallelujah http://dev.clojure.org/jira/browse/CLJ-1297#changehistory-21390
12:13kungijustin_smith: not yet
12:14kungijustin_smith: But I should do this
12:15justin_smithOK, getting coffee, brb
12:20clgvBronsa: great :)
12:22kungijustin_smith: I updated the gist. When I query the uberjar version without an if-modified-since header I get the same discrepancy in context-length.
12:23perplexahm.
12:24perplexawhen i have a vector and i want only certain items based on attributes, i'd use reduce + into? or is there something else?
12:25kungiperplexa: filter?
12:25PeregrinePDXfilter
12:25noonian^
12:26Bronsafilterv if you want a vector back
12:26perplexai think i also need to transform them ;x
12:26phillordfor with :when
12:26Bronsa,(map inc (filter odd? (range 10)))
12:26clojurebot(2 4 6 8 10)
12:26perplexabasically i have a set of java objects and want a different set of only paths ;p
12:26PeregrinePDXYep what Bronsa said.
12:27Bronsaor as phillord suggests, ##(for [a (range 10) :when (odd? a)] (inc a))
12:27lazybot⇒ (2 4 6 8 10)
12:27noonianor 'for' if you are feeling fancy
12:27perplexaok thx, map+filter looks like what i want
12:27perplexa,inc Bronsa
12:27clojurebot#<core$inc clojure.core$inc@1e9b69e>
12:27perplexadamn :D
12:28clgvperplexa: you are lucky it did not eval Bronsa ;)
12:28perplexaor for.. mmh :)
12:28perplexahaha
12:28perplexayou mean one of them is enough? :P
12:28perplexa(inc Bronsa)
12:28lazybot⇒ 56
12:29perplexa(inc phillord)
12:29lazybot⇒ 2
12:29perplexa\o/
12:29perplexaalways a pleasure to leech your knowledge!
12:31Bronsam1dnight_: fyi I just finished installing cursive and I don't see any warning for (let [a 1] (def b))
12:36m1dnight_strange..
12:36m1dnight_https://github.com/cursiveclojure/cursive/issues/527
12:36m1dnight_This is the issue
12:36m1dnight_Oh yes, it's only if the let is in the body of the function
12:36m1dnight_a top level let does not show the symptoms
12:38justin_smithm1dnight_: one complication could be that putting def inside a defn creates the var at the defn's compile time, but does not put any value into it
12:38luxbockdoes clojure.test have a built-in way of testing if a function is supposed to throw (a specific) error?
12:38justin_smithm1dnight_: when the defn is invoked, the var finally gets a value
12:39justin_smithluxbock: yes, the thrown-with-message syntax with is
12:39clgvm1dnight_: humm but the it looks more likea feature ;)
12:39Bronsam1dnight_: ah that's more reasonable
12:40luxbockjustin_smith: ah it's a special case of `is`, that's why I missed it
12:40justin_smithluxbock: or if you don't care about the message, just thrown? (is (thrown? the.exception.Type ...))
12:40justin_smithyeah, it's weird
12:40Bronsam1dnight_: that code should definitely warn. it works in clojure mostly because of a side-effect of implementation details of def
12:40luxbockI've been using speclj but I think for my next project I'll just use clojure.test
12:42luxbockI keep accidently writing test functions that have errors in them but those errors never show up anywhere so I mistakenly think they work fine
12:42luxbockI guess I need to write tests for my tests
12:43m1dnight_Oh really? What is that then Bronsa ? You've piqued my interest :p
12:44Bronsam1dnight_: nothing terribly interesting actually, just that vars get created at analysis time rather than at runtime to allow forms like (defn a ([] (a 1)) ([x] x))) to compile
12:45justin_smithm1dnight_: Bronsa: which is what I was trying to say above, though I called it "compile time"
12:46Bronsajustin_smith: sorry, I didn't read your message
12:47justin_smithnp - is saying compile time simply less specific, or is it inaccurate in this case?
12:47m1dnight_Hmmm, I don't really know enough of about clojure's process so get it
12:47Bronsajust as good
12:47m1dnight_I can only relate to a scheme interpreter with a compilation step
12:47m1dnight_brb, going home :)
12:48justin_smithhaha
12:48Bronsajustin_smith: actually, kinda inaccurate now that I think about it. if interning happened at compilation time, the snippet I provided would not compile
12:49justin_smithahh, so there are separate analysis / compilation steps, and it needs to happen in the former
12:50Bronsajustin_smith: yeah, Compiler.java actually has different passes
12:55bbloomBronsa: rich just changed one ticket from 1.8 back to 1.7 :-) heh
12:56Bronsabbloom: two actually, the IAtom one and the catching - instead of _ one
12:56bbloomBronsa: what's the catch one?
12:56Bronsabbloom: but also marked as incomplete a bunch of ones without any comment :/
12:56Bronsabbloom: http://dev.clojure.org/jira/browse/CLJ-1297
13:12luxbockhow do I disable logging during my tests? I tired to use (timbre/set-level! :error) to only get :error-level logs but that didn't work and there's no doc-string for set-level!
13:17mi6x3mclojure, would you always keep the first named argument on the same line as the function name?
13:17mi6x3m(foo :boo "boo" vs. (foo\n:boo "boo" ?
13:18mi6x3mm1dnight_: seesaw?
13:18m1dnight_no, just proxies
13:18justin_smithmi6x3m: depends - with more than 3 args to assoc, I often put the first arg on the same line as assoc, and the rest with a new line per pair
13:18m1dnight_it's much cleaner than java, imo
13:18mi6x3mjustin_smith: yes, exactly, but you don't put the first pair on a new line also?
13:19justin_smith(assoc m\n:a 0\n:b 1...)
13:19mi6x3myeah I see, though so
13:19mi6x3mit's somehow intuitive but I get unsure sometimes
13:21justin_smithmi6x3m: this is not without controversial elements, but it's good m1dnight_:
13:21justin_smitherr
13:21justin_smithhttps://github.com/bbatsov/clojure-style-guide
13:21justin_smithdidn't mean to tag m1dnight_ there, sorry
13:22mi6x3mjustin_smith: yeah, that guide is very nice, thanks :)
13:23csd_How would you compile/package a project that has two distinct processes that would run simultaneously? E.g. would you have two separate uberjars and -main functions?
13:23justin_smithcsd_: how much do they share code?
13:24csd_One process scrapes into a db, the other process accesses the db
13:24justin_smithcsd_: if more than a little, I would use the busybox approach (check the args to see which function -main dispatches out to)
13:24martinklepschI'm going through the core.logic tutorial and wrote a sibling function: https://gist.github.com/mklappstuhl/4f35b0208a2ac0f7668e
13:25martinklepsch(based on the core.logic tutorial)
13:25justin_smithcsd_: so how about one jar with one -main which calls either scrape-main or access-main depending on args?
13:25csd_oh thats not a bad idea
13:26csd_to be less vague, i want the scraper to run daily, while the other process provides a ring server
13:27justin_smithcould the scraper be a scheduled task embedded in the same process?
13:28martinklepschnow that sibling function returns it's argument as well. how would I remove that from the result set?
13:28arrdembbloom: wait - vs _ is back from 1.8?
13:28csd_i don't really know much about scheduled tasks. i had been debating using something like quartzite versus cron but figured i'd just use cron as it would be simpler to implement
13:28bbloomarrdem: seems so i guess. Bronsa spotted it
13:28arrdembbloom: I saw that it got triaged approved, but I thought it was still 1.8. I welcome it...
13:29csd_if i used cron i could use your idea of calling main with a different argument
13:29justin_smithcsd_: you could check out java.util.concurrent.ScheduledThreadPoolExecutor
13:30csd_what would you do? i just dont have enough experience to know what's best
13:30bja_is there a builtin schema for a function type?
13:30csd_bja: like IFn?
13:31justin_smithcsd_: call .SceduleAtFixedRate on a (ScheduledThreadPoolExecutor.) - you can pass an fn of no args as the first method arg
13:32bja_I mean, IFn definitely works, but isn't IFn not clojure.lang.IFn in cljs?
13:32justin_smithcsd_: well, I forgot to include the pool size in the constructor, but I think you will see that the API is straightforward
13:32tac_,(doc partial)
13:32clojurebot"([f] [f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & ...]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."
13:32csd_justin_smith: thanks ill check that out
13:32tac_partial is partial application?
13:32csd_bja_: don't know about cljs sorry
13:33justin_smithtac_: yes, it returns a new function that takes N fewer arguments when supplied with a function and N args
13:33bbloomBronsa: arrdem: can look at http://dev.clojure.org/jira/secure/ViewProfile.jspa?name=richhickey to see more complete 1.8 -> 1.7 recoveries... seems like the mass move to 1.8 wasn't so much rejection as opting for "opt in", which seems sensible
13:37sevvieto whomever published "Clojure in the Open", thank you.
13:40hiredmanwoa https://github.com/clojure/clojure/commit/8765800e23a057957986c7d2bbb1f09cd3f1a676
13:42cflemingm1dnight_ justin_smith Bronsa clgv: Right, that's more or less a feature of Cursive
13:43cflemingIt'll index recursively from the top level inside let, do, etc as deep as you like but won't continue indexing inside defn
13:43justin_smithyeah, I think we narrowed it down that the error was in the code, not cursive's handling of it
13:43justin_smithdeclare would be a simple workaround if you really need the def to happen inside a defn
13:44cflemingWell, the code is valid for some definition of valid, i.e. it does actually work
13:44cflemingBut it's unusual and not recommended, right
13:45m1dnight_cfleming: It seems to happen in this case as well: (defn f [args] (fn [arg1 arg2] (def something ..) ...)))
13:46m1dnight_(I happen to stumble upon this whilst translating a scheme program to clojure
13:46m1dnight_)
13:46justin_smithm1dnight_: if you really need to do that, (declare something) at the top level would eliminate the warning I think
13:47m1dnight_yeah, i'll leave it be for the moment and check if I can replace it with a let in the second pass
13:47m1dnight_I do have to read up on why exactly it is so bad to do this though
13:47cflemingm1dnight_: Right - that might be idiomatic in Scheme but it's not in Clojure
13:48technomancym1dnight_: internal define in scheme is completely different from clojure's def
13:48cflemingCursive will only look inside do and let-like forms (including letfn) from the top level.
13:48justin_smithdef is for globals only in clj, and you are creating a global but not binding it when the form gets analyzed in the compilation stage, only when the function runs does the global finally have a value
13:48m1dnight_All I know is that in Scheme it acts the same as a let binding..
13:48hiredmanclojure's def always defines a global var with a name
13:48m1dnight_I get it
13:49m1dnight_justin_smith: but (def x <val>) inside a function does not make it accesible out of the scope of the function body, or does it?
13:50cflemingm1dnight_: Yes, it creates a global var
13:50justin_smithit does
13:50justin_smithglobals only
13:50justin_smiththat's what everyone has been saying
13:50technomancywhile it's not technically true, you can assume there's no such thing as a local var
13:50m1dnight_oh, well thats mindblowing (to me at least) :p
13:51justin_smithtechnomancy: easier just to say that def is only for globals I think :)
13:51technomancyjustin_smith: there are no local vars that are worth using? =)
13:51justin_smithm1dnight_: very different from scheme
13:51justin_smithtechnomancy: you can make local vars, just not with def
13:51m1dnight_Okay now I get it :)
13:51technomancyjustin_smith: you can and shouldn't.
13:53justin_smithwait, shouldn't create a local var with def or shouldn't create local vars?
13:53technomancyjustin_smith: I mean it's best to pretend with-local-vars doesn't exist
13:54justin_smithhehe, OK
13:55dbaschwithout-local-vars
13:55justin_smithhas someone created the "useless" lib yet?
13:57technomancyonce they do I would happily take a PR updating lein's tutorial to use it
13:58m1dnight_what's the useless lib?
13:58justin_smitha running joke on this channel
13:58justin_smithincludes functions like "without-redefs"
13:58justin_smithunconcat
13:58justin_smith(that one may be marginally non-useless actually)
13:59m1dnight_oh lol :p
14:00dbaschtake-all and remove-all
14:00justin_smithflatten
14:00justin_smithoh wait that one is in clojure.core
14:01dbaschlol
14:01technomancylol
14:01Bronsa(inc justin_smith)
14:01lazybot⇒ 88
14:11gfredericksI thought I might have something related that I actually created at some point; after 3 minutes crawling through my github repos I found https://github.com/gfredericks/clojure-useless
14:12gfredericksall it has is a roundabout identity function
14:12gfrederickspatches welcome
14:13technomancywow, created by lein1
14:13technomancy(C) <- how gauche we were in those ancient days
14:14justin_smitha remarkably well named namespace https://github.com/gfredericks/clojure-useless/blob/master/src/clojure_useless/core.clj
14:14technomancyI like that the file exists in the first place
14:14gfrederickstechnomancy: I should just make a commit out of `lein new`
14:15technomancyI choose to interpret it as a commentary on how dumb core.clj files are to begin with
14:15justin_smithtechnomancy: there are layers here to be sure
14:19kryfttechnomancy: Because there's no reason to have such a generic file name instead of a more descriptive one?
14:19gfredericksokay all the files have been enfreshinated
14:19technomancykryft: yes, but more broadly because there's no reason for clojure to put single-segment namespaces in the default package
14:21gfrederickstechnomancy: would that be a breaking change?
14:21technomancygfredericks: I don't think you could do it in a compatible way?
14:21technomancyalso dumb: the requirement for underscores in file names
14:22dbaschgfredericks: perhaps my do-or-do-not macro https://www.refheap.com/91360
14:22technomancyit's the same insistence that .clj files map closely to their .class equivalence; it's wasted countless hours
14:23gfrederickstechnomancy: I mean what would break if it changed? just compiled code or something?
14:24gfredericks"it changed" meaning single-segment namespaces do something besides the default package
14:24technomancygfredericks: I feel like if you assumed all java code calling clojure went through the official API you might be able to pull it off
14:24justin_smithdbasch: I like how my first glance of do-or-do-not leads me to think "I would wrap that in try/catch" - deep yoda joke there
14:24technomancybut given that the official API is relatively new (and even if it weren't, there would be people who didn't use it) odds are not great
14:25gfrederickstechnomancy: I'm glad I don't manage a language
14:25technomancygfredericks: I guess to be fair when AOT was designed it wasn't clear what the patterns would be
14:26technomancyhindsight is 20/20 etc
14:26gfrederickstechnomancy: heck it's hard enough to even guess what functions you as the maintainer will think are useful 5 years out
14:26technomancygfredericks: before AOT was added, there was no clojure.core, it was just clojure
14:26technomancyand a bunch of things broke, but there was nothing in production, so it was fine
14:26gfrederickstechnomancy: TIL
14:27technomancyif I've learned anything from tetris, it's that your achievements disappear and your mistakes pile up.
14:27gfredericksclojurebot: it is time for clojure history anecdotes with technomancy
14:27clojurebotc'est bon!
14:27gfredericksha
14:28joshuafcole(inc technomancy)
14:28lazybot⇒ 140
14:28joshuafcoleI expect to quote that for many years to come
14:28technomancyit's funny because there was a lot of hand-wringing about next vs rest breaking compatibility only ~ix months later
14:28technomancy~six
14:28clojurebotGabh mo leithscéal?
14:28technomancyoops
14:29gfredericksI feel like I vaguely remember that
14:29technomancythat struck me as a much less invasive change
14:29hiredmanthe nil puning thing
14:29technomancyoh, but the book was almost ready to be printed, so that counts for a lot
14:29gfredericksoh so it was breaking book compatibility
14:30technomancyit's logistically pretty difficult to ship a patch for those things
14:31joshuafcoleYou'd have to mail the patch files themselves and gluesticks to merge them in with
14:31gfredericksand you pretty much have to make sure the length change is a whole number of pages
14:31gfrederickselse you'd be patching like the whole second half of the book
14:32m1dnight_:D
14:33gfredericksLeiningen: The Definitive Guide
14:33joshuafcoleV 0.1.3-SNAPSHOT ?
14:33technomancyLeiningen: the Good Parts
14:34justin_smithDependency Design Patterns: Object Oriented Leinengen
14:35jeremyheilerSeven Leiningen Plugins in Seven Days
14:35joshuafcoleWe're scant steps away from BuzzFeed now
14:35gfredericksleiningen in :action
14:35jeremyheilerLeinFeed
14:36joshuafcoleOne Schoolteacher from Minnesota tried using leiningen, and what she discovered about dependency management might just change your life
14:36gfredericksDownloading A Leiningen Bash File From Github and Putting It On Your Path and Chmoding It To Be Executable in Five Easy Steps
14:37gfredericks"How to use Brew to sudo apt-get install leiningen"
14:37joshuafcolehaha
14:37danneuis there a way to refer to the current function in its body without knowing the function's name? like (defn foo ([] (recur 1)) ([x] (println x)))?
14:37TimMcjoshuafcole: :-D
14:37joshuafcoleI didn't know you could brew install debian!
14:38justin_smithdanneu: you can use recur just like that
14:38TimMctechnomancy: Ship the book as a 3-ring binder in the first place. That helps.
14:38TimMc(with patches)
14:38danneujustin_smith: i get a mismatched arg-count to recur
14:39joshuafcolehah
14:39borkdudeI thought about writing a leiningen plugin named "copy": it copies an entire project but changes the project name to "dest" in "lein copy dest"
14:39dbaschdanneu: yes, just (recur)
14:39TimMc(note: this is actually a thing)
14:39borkdudemaybe pretty useless ;)
14:39dbaschdanneu: oh, you want to call another arity
14:39csd_justin_smith: any idea what's wrong with my syntax/usage?
14:39csd_((-> (ScheduledThreadPoolExecutor. 10) (.scheduleAtFixedRate #(println "hello") 0 5 TimeUnit/SECONDS)) (Thread/sleep 5000))
14:40csd_I'm getting an error about java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask cannot be cast to clojure.lang.IFn
14:40justin_smithcsd_: looks like you have extra parens
14:40justin_smithyeah, extra parens will do that
14:40hiredman(foo bar) is calling foo with the argument bar
14:41joshuafcolerainbow parens + paredit were a huge quality of life improvement for me when I started to get serious about clojure
14:41dbaschdanneu: why would you want to avoid mentioning the function name?
14:41joshuafcoleextra/to few/mismatched parens became dramatically less likely
14:41csd_justin_smith: i don't think so
14:42justin_smiththat thread does not return a thing you can call
14:42hiredman^- (foo bar) is calling foo with the argument bar
14:43csd_what do you mean? i was thinking that if you go into Thread/sleep that the scheduler would keep hitting the function
14:43TimMcdanneu: Yes, you give the function another argument, and you call it like (foo foo ...) instead of (foo ...)
14:43danneudbasch: it's painful. especially when it's early development and there's still a lot of churn in my fn names as i work things out. my i find out when i restart my jvm that half my fns refer to fns that dont exist anymore
14:43justin_smithcsd_: your (-> ...) call is in the function position
14:43justin_smithcsd_: it does not return a function
14:43TimMcand from there you're on your way to the y combinator
14:43csd_ohhhhhh
14:46borkdudecfleming to be honest I don't get the "default" build configuration thing in Intellij. how do you launch one, without copying one
14:47justin_smithcsd_: without the extraneous parens or the sleep, that code runs for me
14:47justin_smith(once I import the proper classes)
14:47cflemingborkdude: Yeah, that is confusing. Think of the default builds as templates, which you copy to create your configs.
14:48csd_justin_smith: I wrapped it in a do loop, but I don't receive the println with or without the sleep statement
14:49kenrestivois anyone using gloss with its new channel capabilities to do frame sync on a network stream? are there any examples out there (done some searching, haven't found anything quite yet)
14:49justin_smithcsd_: it prints in the repl's terminal for me (even though I ran it in an emacs nrepl buffer) but I expect that of threads
14:49pepijndevosWhat's the deal with primecoin? Just go a primecoin for a merged Clojure patch. dafuq.
14:49justin_smithcsd_: since *out* is a dynamic var
14:49ztellmankenrestivo: the channel capabilities aren't exactly new
14:49csd_oh there it is
14:49ztellmanI think they're three years old at this point
14:49ztellmanmaybe more
14:50csd_that is something that is still confusing to me--which buffer cider prints to when
14:50pepijndevosTips Paid 17.19 XPM (17.19 XPM of this is unclaimed, and will be refunded to the project after being unclaimed for 1 month.)
14:50justin_smithcsd_: *out* is bound dynamically per thread, so new threads will look for the root binding, which isn't the repl window
14:50justin_smithcsd_: yes, it is weird
14:51csd_how can i kill these threads in the repl?
14:51ztellmankenrestivo: check out https://github.com/ztellman/aleph/blob/master/src/aleph/formats.clj#L499
14:51dbaschpepijndevos: a primecoin is about $0.20
14:52kenrestivoztellman: from the man himself! thanks!
14:53pepijndevosIs it like an official thing, or some random dude just put $5 on that site?
14:54justin_smithcsd_: you need a handle to the executor or at least the task that got scheduled I think
14:54justin_smithcsd_: though I think technically there is a way to get a collection of all threads, find yours, and mess with that directly
14:54csd_gotcha
14:54csd_ok thanks for your help with this
14:54justin_smithnp
14:55technomancypepijndevos: huh, sounds like bitcoin, except computing actually useful results instead of garbage?
14:55pepijndevostechnomancy, right... well... useful in some sense of the world.
14:55technomancysure
14:55technomancynow if we could use it to detect extraterrestrial intelligence ... =)
14:55pepijndevoskinda like those @home screensavers haha
14:56pepijndevosThat would be a valuable currency, one starcoin for every alien found.
15:10danneukenrestivo: here's an example of using gloss to decode bitcoin msgs over the wire https://github.com/ztellman/gloss/issues/27#issuecomment-28149170 - though the gist doesn't actually demonstrate gloss.io/decode-stream, it's what i used in real life in place of that gloss.io/lazy-decode-all example
15:15kenrestivodanneu: thanks
15:18borkdudecfleming how about referring doc and source in repl by default?
15:19TimMcpepijndevos: Oh man, thank you for reminding me of SETI@home!
15:28turbofailinteresting response to that "good bad and ugly" talk: http://www.cl.cam.ac.uk/~srk31/blog/2014/10/07
15:28justin_smithturbofail: yeah, I liked that article
15:28turbofaildefinitely captured some things that i was having trouble putting to words
15:29puredangerone thing I had hoped to do this year at Strange Loop was provoke conversation about typing (not with an agenda really other than having the conversation)
15:30puredangerso I'm chalking those articles up as a win :)
15:30technomancyI wrote out a ton of types over the weekend; it was a blast https://github.com/technomancy/cooper/blob/master/cooper/cooper.rkt
15:31justin_smithturbofail: puredanger: one thing I really liked about that article was positioning typing as a special case of invariants. Some of which can be expressed with type systems, some of which (currently) cannot. Most languages have some mechanism of describing and/or ensuring invariants, and we can have a productive conversation with a starting point like that.
15:32puredangerindeed, I think he captured some subtle points with clarity
15:38turbofailtechnomancy: where is that space dinosaur from?
15:38technomancyturbofail: http://midasflesh.com
15:38technomancyit's super-great
15:39justin_smithI can concur, it's an awesome comic
15:40technomancyit's a graphic novel about what if midas's flesh actually turned things to gold; the whole earth is a solid gold lump floating in space, discovered by a group of freedom fighters who try to harness his body as a superweapon.
15:40technomancyalso one of the freedom fighters happens to be a dinosaur who uses lasers and jetpacks. need I say more?
15:40turbofailheh
15:40m1dnight_typesystem discussions are always kind of dangerous :p
15:40m1dnight_Will read the paper though, looks interesting
15:40m1dnight_If you have more, please share! :)
15:41m1dnight_I'm following a course this year about formal definitions of type systems and my interest is sparked
15:42kenrestivothings not to discuss in polite company: politics, religion, sex, editors, and type systems
15:42justin_smithm1dnight_: on the contrary, type systems are very safe, now sit down in this chair and let us buckle you in nice and snug. What's that you say, you want to get up and get a drink of water? We'd like a viable proof of that please.
15:43m1dnight_hahaha :D
15:43justin_smithtechnomancy: btw, hypercard clone - cool!
15:43hiredmanalternatively things you only discuss in polite company
15:44technomancyjustin_smith: thanks! we'll see where it goes. it's been a lot of fun so far.
15:44technomancyhoping to post on my blog about it soon
15:47mikerodI thought the "good, bad, and ugly" talk on types was very opinionated and wasn't always strongly backed something concrete, other than feelings
15:48mikerodI was interested in being convinced of some points on typing, but instead just felt it was a "rant"
15:49m1dnight_hmm, if I pass (rest '(1 2 3)) to (fn [operands] ..) I get an error that I passed two arguments instead of one
15:49m1dnight_what am I missing here?
15:49m1dnight_Shouldn't rest be a list and thus operands be bound to*a* list?
15:50Bronsam1dnight_: can you paste the actual code?
15:50m1dnight_ sure
15:50m1dnight_hold on
15:50m1dnight_https://www.refheap.com/91364
15:51m1dnight_I would expect (evaluate-application) to receive a list, but it's not happening, for some reason
15:51m1dnight_oooh, the apply
15:51m1dnight_Now I get it
15:52Bronsayeah, it's the apply on (evaluate-application operator)
15:52Bronsam1dnight_: you want (fn [& operands] instead of (fn [operand] if I understand correctly
15:55daGrevishi! is it bad to map fn with sideeffects?
15:56justin_smithdaGrevis: only if you don't do it eagerly - it will just break if you use map for side effects and don't force the result
15:56daGrevisi need to call fn on each element in list and it doesn't work without doall so it feels kind of hackish
15:56justin_smithdoseq?
15:56clojurebotdoseq is like for, but for side effects instead of values
15:56justin_smiththanks, clojurebot
15:58daGreviswow, thanks!
15:58technomancyI would say it's bad either way
15:58daGrevistil
15:58technomancymap indicates you're interested in values
15:59daGreviswell my exact situation is that i have webrtc connections and a send-data fn. i want to call send-data on each connection
15:59daGrevislike a foreach in python for example
15:59daGrevistechnomancy, i don't care about return values
15:59justin_smithyeah, doseq is probably what you want then
16:00scgilarditechnomancy: I think you've won me over on if vs. when
16:01scgilardi... in which the virtues of the one-armed if are extolled
16:02technomancyscgilardi: nice; welcome to the club.
16:02daGrevisyes, doseq works perfectly! thanks
16:03technomancyI'll have them send your club sweater to the address we have on file.
16:03justin_smitha one armed if framed me - now I am a Fugitive
16:03scgilardi:)
16:04jeremyheilerwhy is a one armed if better than when?
16:05technomancyjeremyheiler: it communicates intent to return a value rather than perform a side effect
16:05jeremyheilerah, cool
16:05scgilardiso more "when is a one-armed if better than when"
16:06technomancyindeed
16:07wei_it’s more annoying to put in debugging “info” forms into if statements, but that’s a bit of an edge case
16:07technomancywei_: (doto x prn) can be put nearly anywhere
16:08wei_ah. i always forget that doto isn’t just for java interop
16:08technomancymy favourite is (doto 'my.ns require in-ns) in the repl =)
16:09wei_lol. when do you require + in-ns over simply ns ?
16:09technomancywei_: in the repl, if the ns exists on disk
16:09justin_smithwei_: simply ns creates the namespace without loading any of your code that goes with it
16:10wei_i see
16:11wei_just found a good alternative to my usual (ns proj.core) (load “core”)
16:20m1dnight_Is it possible in clojure to do something like set-cdr! ? I want to insert a variable in a list, but I need to append something to that list later on..
16:20m1dnight_But yeah, immutable structures and all
16:21justin_smithm1dnight_: not without doing evil stuff that relies on implementation details
16:21m1dnight_I presumed
16:21m1dnight_darn
16:21justin_smithmaybe you want a finger-tree?
16:21justin_smithyou can do things like that efficiently with immutible finger-trees
16:22justin_smithhttps://github.com/clojure/data.finger-tree
16:22m1dnight_looks like a good idea yes :D
16:22m1dnight_thanks justin_smith
16:22justin_smithnp
16:23m1dnight_Porting this scheme evaluator is not as easy as I anticipated
16:23donbonifaciohey, I have the following coll: [ [:a 11] [:b 2]] [:c 3] ] (an array of pairs). How's a good way to get only two of them, randomly?
16:24justin_smithdonbonifacio: would it be ok to get the same one twice?
16:24donbonifaciono, just once
16:24donbonifaciornd-nth and sets?
16:24justin_smithI was just thinking that, yeah
16:24m1dnight_lazy seq of permuatations and random get twice?
16:25justin_smitha set makes sense if none of the items would appear twice
16:25justin_smithm1dnight_: that's O(n) for each select / remove though
16:25m1dnight_well, that's true
16:25justin_smithyou can't do rand-nth on a set though
16:25donbonifaciohumz
16:26justin_smithpick two random ints above -1 and below (count coll) that are not equal and get those two indexes?
16:27QerubI’m writing a macro that takes a var name as an argument. How can I get access to the var inside the macro body outside of a backquote context? (defmacro m [var-name] (comment “var-name is a symbol, how do I get a var in the right namespace?“))
16:28Qerubfind-var would have worked if var-name was fully qualified.
16:29justin_smith,(let [input [[:a 0] [:b 1] [:c 2] [:d 4]] places (take 2 (distinct (repeatedly #(rand-int (count input)))))] (map (vec input) places)) ; donbonifacio
16:29clojurebot([:a 0] [:b 1])
16:29justin_smithdistinct ensures you don't get two identical indexes
16:29jassaHi there
16:29jassadoes anyone know what would be the best way to prevent output when running tests?
16:29donbonifaciothanks justin_smith :) I'll study that
16:29nkozoQerub: resolve
16:30Qerubnkozo: Ooh, shiny. Will that resolve the symbol in the namespace of the macro invoker?
16:30nkozoQerub: yes, to resolve in other namespace use ns-resolve
16:31justin_smithjassa: preventing output at what level? you can use nohup to prevent output of any command line invocation, or with-out-str to make a particular function scope create a string instead of printing
16:31nkozoQerub: resolve is only a helper wrapping ns-resolve
16:31justin_smiths/function scope/lexical scope
16:31Qerubnkozo: So is *ns* bound to the namespace of the macro invoker?
16:32cflemingborkdude: I could do that - does REPLy do that by default?
16:32nkozoQerub: I think yes, but try it, maybe I'm remembering wrong
16:32borkdudecfleming in the user namespace it does I think
16:32Qerubnkozo: Allright. Thanks a bunch!
16:32cflemingborkdude: There are a couple of things that are loaded by default that I do, but I can't remember the details.
16:33borkdudecfleming but maybe that's what happened, I wasn't in the user namespace
16:33justin_smithdonbonifacio: regarding "studying that", likely the one trickiest thing in that code is that a vector acts as a function of index to value at that index when used as a function -- thus the redundant call to vec, since I expect it would be used in a function that may not get a vec as an argument
16:33borkdudecfleming so never mind then ;)
16:34cflemingborkdude: Right, it's clojure.main/repl-requires
16:35cflemingborkdude: Which includes doc and source.
16:35donbonifaciojustin_smith: yes, thanks for the extra description :)
16:35borkdudecfleming cool
16:35justin_smith,([10 9 8 7 6] 3)
16:35clojurebot7
16:39jassa@justin_smith: I'm using lein to run my tests, and I'm trying to omit all the output from "println" statements and similars
16:39nkozoQerub, but take care when calling macros from macros: https://gist.github.com/nahuel/a07db3003ad22bda17a0
16:39jassajustin_smith: I've tried using `with-out-str` but it returns a string where I would like to return some other data
16:41jassajustin_smith: I first attempted defining a log method that received a msg and would only output it if the current environment is not a testing environment.. but I couldn't find a way to determine if I'm running a test env
16:41Qerubnkozo: Thanks, that will probably bite me.
16:43justin_smithjassa: sounds like a logger configuration issue
16:44arohnerjassa: this probably isn't helpful, but that's easy if you build your app around stuartsierra/component
16:44justin_smithjassa: for printlns why not just (binding [*out* ...] ...)
16:44arohnerwhich I highly recommend anyways
16:44justin_smithproviding some output stream that does not print
16:46jassaThanks guys I'll check that out
16:55mercwithamouthso would you say Om isn't production ready?
16:56mdrogalisThat ship has sailed. :)
17:10kenrestivoship?
17:11justin_smithkenrestivo: http://en.wiktionary.org/wiki/that_ship_has_sailed
17:12kenrestivoi'm familiar with the idiom. i wasn't so clear on what you were referring to?
17:13justin_smith"I already use it in production, so it's too late to decide if it is production ready" maybe
17:13mercwithamouth=( someone told me it wasn't production ready...i don't see why it wouldnt be
17:14mercwithamouthnot that i'm all that knowledgeable as of yet
17:15dbaschReal artists ship. The realest artists Titanic.
17:16dbasch“the ship can’t sink, sir. It’s as production-ready as it gets”
17:17m1dnight_Hmmm, I'm making another stupid mistake and I'm asking for your help, again :p
17:18mercwithamouth=P
17:18m1dnight_I have defined a deftype "Binding" in namespace meta-clojure.prototype.binding. I want to use this type in ns meta-clojure.core
17:18m1dnight_So I type (ns meta-clojure.core (:import [meta-clojure.prototype.binding Binding]))
17:19m1dnight_But that doesn't seem to work. (ClassNotFoundException)
17:19hiredmanunless the namespace has been loaded the type hasn't been created
17:19m1dnight_So I tried :use, replace dash with underscore, omit "Binding",.. I can't figure it out
17:19puredangerhow do you intend to "use" it?
17:20puredangerconstruct instances?
17:20m1dnight_yes, indeed
17:20m1dnight_example: https://www.refheap.com/91370
17:20clojurebotNo entiendo
17:20justin_smithm1dnight_: require the ns, then import the type?
17:21m1dnight_justin_smith: then I get "unable to resolve classname Binding"
17:21puredangerif you require the ns, you can just use the constructor function ->Binding
17:21Bronsam1dnight_: you need to require the namespace, if you don't need to test for `instance?` just use ->Binding
17:21justin_smithm1dnight_: you have to munge the class name for import
17:21justin_smithmeta_clojure.prototype.binding
17:22m1dnight_I tried that as well, "unable to resolve classname" :p
17:22m1dnight_But in the namespace itself I can just cal (Binding. "foo" "bar"), so shouldn't that work as well in the core namesapce?
17:22m1dnight_namespace*
17:23m1dnight_(:require [meta_clojure.prototype.binding]) # This is what's required at the moment. I thought that should work.
17:23Bronsam1dnight_: (ns .. (:require [meta-clojure.prototype.binding :refer [->Binding]])) or (ns .. (:require meta-clojure.prototype.binding) (:import meta_clojure.prototype.binding.Binding)) should do it
17:23puredangerdeftypes have the dual nature of Clojure construct and Java class implementing the Clojure construct. generally I prefer to treat it as a Clojure construct as much as possible, so would use ->Binding rather than import and Binding.
17:23ed-ghello, does anyone know how to define a composite primary key in Korma?
17:24m1dnight_well the latter did the trick Bronsa
17:24BronsaI sometime wish deftype generated an instance check predicate too
17:24m1dnight_require and import
17:25puredangerBronsa: +1
17:25m1dnight_(inc Bronsa) ; Am I doing this right? :p
17:25lazybot⇒ 57
17:25m1dnight_It's confusing though, the namespace stuff. Regular functions only require a :use or :import, but deftype requires require and import.
17:25m1dnight_(I'm blaming me, though)
17:26puredangerBronsa: btw, I suspect there may be questions re the great jira shuffling, if so let me know
17:27Bronsam1dnight_: forget about :use, it's only :require and :import. functions only need :require, java classes need :import. deftypes need their containing namespaces to be :required too so that the classes actually get compiled
17:27justin_smithm1dnight_: import is never needed, it's a convenience so you don't have to type out the full package with the class
17:27m1dnight_Oh, let me try something, brb
17:28Bronsapuredanger: sure :)
17:28m1dnight_Oh indeed, require loads the namespace, and then I can identify Binding with (meta_clojure.prototype.binding.Binding. ..)
17:29m1dnight_so import is as you said justin_smith , for convenience's sake
17:29Qerubnkozo: Here’s what I needed `resolve` for earlier: https://gist.github.com/qerub/216a7945831a30ed0d63#file-fancy-defn-clj-L24 (proof of concept of schema.core.defn augmented with automatically generated clojure.core.typed annotations via circle.schema-typer, *phew*)
17:29puredangerBronsa: the general gist is people are actively using or wanting to use transducers in production so we pushed almost everything not yet done into 1.8 and plan to drive with haste towards 1.7, which will primarily be transducers + possibly feature expressions
17:29Bronsapuredanger: there were tears of joy shed by many earlier today when CLJ-1297 got applied
17:29Bronsapuredanger: yeah guessed as much
17:29puredangeryou're welcome :)
17:30puredangermany battles were fought today :)
17:30puredangerone thing that would be great to have more wider feedback on is http://dev.clojure.org/jira/browse/CLJ-1529
17:31mdrogalispuredanger: That's really nice to hear - about 1.7 :)
17:31puredangerRich would really like to do something re the compilation speed there. I have resurrected a subset of fastload with his prior work into a second patch there.
17:31justin_smithcfleming: I wonder if the racket folks are imitating you here https://twitter.com/racketlang/status/519565183937970176
17:32puredangerI am currently running some tests on various projects to compare perf differences. may also need to address the semantic differences if Zach's is faster (which seems likely atm)
17:32puredangerwould love to hear feedback on those from private code bases
17:33mdrogalisI'll give it a whirl
17:34puredangerquestion 1 is whether class-for-name.diff yields any compilation problems or errors as it has a semantic change (I think this is unlikely based on my own research so far) and 2 - what is perf improvement from either
17:34cflemingjustin_smith: Ha, nice - I doubt I can claim that they're copying me, but that looks great
17:35ztellmanpuredanger: I feel like there would have been a bug report if someone stumbled across the current semantics
17:35ztellmanit's such a weird precedence
17:35puredangeragreed, I think it's unlikely
17:35puredangerand I've run with this patch on a bunch of projects
17:35Bronsauhm, so, other than . also catch and new currently privilege classes over locals
17:36Bronsashould they get handled aswell if ztellman's patch gets accepted?
17:36puredangerthat is the other question to figure out - where does this change semantics and how and what needs to change
17:36ztellmanBronsa: currently let-bound variables that share names with classes are shadowed by the classes
17:36hiredmanwell, they don't privilege right? new and catch *must* have classes
17:36cflemingpuredanger: what is the status of feature expressions? I saw the design doc had been updated.
17:36Bronsa,(let [String 1] (String. ""))
17:36clojurebot""
17:37hiredman. could get a class or local
17:37ztellmanunless you have code that looks like (catch Exception String ...)
17:37Bronsahiredman: yeah I guess you're right
17:37ztellmanit doesn't affect you
17:37cflemingpuredanger: I'll see if I can find some time to compile Cursive with that patch and see if it helps
17:39puredangercfleming: that page has current state of work although I was told the many ways it should be improved today :) in essence, the path is to use same syntax as .cljx but to build that into Clojure and ClojureScript
17:39cflemingpuredanger: Ok, are you going to be updating that soon? I'd be interested in knowing what I'm in for.
17:40puredangeryes
17:40puredanger1.7 remaining work is now down to http://dev.clojure.org/jira/secure/IssueNavigator.jspa?mode=hide&amp;requestId=10519
17:40puredangerso that's my current focus
17:40cflemingpuredanger Bronsa: Tears of joy were also shed by me when 1330 was merged in.
17:41Bronsapuredanger: oh by the way, there are a bunch of tickets that are "completed" but not "closed", that hurts my feelings. Mind if I close them?
17:41puredangerexample?
17:41Bronsa"resolved" actually
17:41Bronsahttp://dev.clojure.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+=+CLJ+AND+fixVersion+=+&quot;Release+1.7&quot;+AND+status+=+Resolved+ORDER+BY+priority+DESC&amp;mode=hide
17:42Bronsacfleming: :P
17:42puredangercfleming: you were no small reason for 1330 going in, so thanks on that
17:42puredangerBronsa: I'll take care of them
17:42Bronsapuredanger: cool
17:43cflemingpuredanger: What's the use case for user-defined feature expressions?
17:44puredangermany examples floating around. one would be specializing something in cljs for node
17:44cflemingpuredanger: And am I reading that correctly that I could do #+(cljs and node) ?
17:44puredangeryes
17:45cflemingpuredanger: Damn
17:45puredangerI get that a lot
17:45cflemingpuredanger: I suspect it's usually more appreciative than that one was ;)
17:45Bronsa(inc puredanger)
17:45lazybot⇒ 16
17:46puredangerI'm glad it was appreciative :)
17:46cflemingpuredanger: Supporting that is going to be... interesting.
17:46puredangerthere are patches out there for clj, tools.reader, cljs that do most of what's on the page
17:48cflemingpuredanger: So I could construct a frankenclojure with those features now to test with?
17:49puredangeryep. I have done so and rebuilt some mixed clj/cljs projects with them (instead of clix) with some success
17:50cflemingpuredanger: Ugh, I should have read that page more recently - I read it ages ago when it was just an RFC really
17:50cflemingpuredanger: Supporting debugging with this is going to be hard.
17:51puredangeryes, it presents some difficulties.
17:52cflemingpuredanger: Is there an ETA? Sounds like soon, right?
17:53puredangerI'll be working on it tomorrow. gotta run atm…
17:53cflemingpuredanger: I meant for the final release - no worries, I won't have time to work on this for a while anyway.
17:55puredangeryes, soon as it's done OR if there are unresolvable issues then will get kicked out of 1.7
17:56nkozocore.async question: (def c (chan)) (go (<! c) (println :hi)) (def c nil) .. now nothing is referencing the channel, will GC trigger a channel close so the go loop will continue execution?
17:56nkozoor both the chan and the go-block will be GC'ed without continuing the execution?
17:57hiredmanI may be wrong, but I am pretty sure the go block is referencing the channel
17:57nkozohiredman: in that case, who is referencing the go block?
17:58hiredmannkozo: for informal reasoning purposes just assume a go block is a gc root like a thread
17:59hiredman(the go block when parked needs be put somewhere with some information about what it is parked awaiting for)
17:59nkozohiredman: so my sample will leak memory?
18:00hiredmannkozo: if you spin up a thread trying to pull something from a queue you never put anything in, is that leaking memory?
18:02nkozohiredman: ok, I had a misconception where go-blocks are referenced from the channels they are parking on, so GC'ing the channel will GC the go block
18:03hiredmannkozo: I suppose that could be the case
18:03nkozohiredman: thanks
18:07hiredmanyou may be right, so that is an interesting question, I doubt the channel is closed before it is gc'ed
18:10m1dnight_aw yisss, evaluation of defines and primitives works!
18:10m1dnight_time to go to bed :D
18:13m1dnight_only downside, I have implemented my own linkedlist such that I can modify an environment
18:13m1dnight_There probably is a pure functional way but I can't think of one with a fried brain atm
18:15justin_smithm1dnight_: if you want a mutable list with easy insert and setcdr, why not java.util.LinkedList?
18:16justin_smithoh wait, maybe java.util.LinkedList doesn't have a setcdr
18:16m1dnight_well, I wanted to stay away from java for.. some reason
18:17m1dnight_I did get to know deftype and definterface though
18:17m1dnight_so not all was in vain
18:20gfredericksm1dnight_: writing a lisp or something?
18:27m1dnight_gfredericks: yes, I need to build a prototype for my thesis to test combination of actor model (which i also implemented) and STM (for which I have a meta implementation)
18:27m1dnight_Since the software lab at my uni is a fan of scheme I decided to implement a simple scheme IDE
18:28m1dnight_and no IDE without evaluation, so i'm quickly mashing up an evaluator
18:29m1dnight_And the source code would be an an STM storage and the evaluator, syntax checker, parenthesis balancer etc would be actors acting on that STM
18:31gfredericksHUH.
18:31gfredericksactors with shared memory is not an oxymoron?
18:33justin_smithgfredericks: wouldn't the shared or unshared status of the memory be just an implementation detail? now if your actor system mutated the messages,then you aren't doing actors...
18:34m1dnight_gfredericks: that is the entire point. Study how we can combine them safely without violating constraints of either model.
18:35gfredericksI assumed "acting on that STM" was something like a bunch of clojure threads punching some refs
18:35gfredericksrather than passing messages
18:35m1dnight_If there were to be violations (e.g., sending a message in a transaction resulting in multiple sends to an actor), how to mitigate them
18:35m1dnight_exactly what you say :)
18:36m1dnight_clojure threads being actors in this case
18:36tuftactors in a more abstract sense it sounds like vs erlang's or something
18:36m1dnight_But if I were to hold message sends back until the transactino completes, i would solve that problem.
18:36m1dnight_no I'm sticking to the vanilla actor model, except he locality semantics
18:36m1dnight_the*
18:38m1dnight_but I'm starting off with a meta-implementation for actors and STM. This way I can combine them both and add/remove semantics
18:38justin_smithm1dnight_: I often do that "transactino" typo - we should get Bronsa to make a "super lightweight stm" lib, where all the vars are named in Italian, and transactions are replaced by transactinos
18:39m1dnight_:D :D :D
18:39m1dnight_anyway, i'm off to bed
18:39m1dnight_tomorrow is thesis-day!
18:39m1dnight_nn guys o/
18:50AeroNotixis there a library/function that can turn a state change into a channel read? I want to alt on a timeout and a state update
18:59brainproxyhmm, been awhile since I upgraded my cider/emacs stuff... when I try to do cider-connect, I can enter the host but then it wanders off into trying to do some tramp/ssh thing
18:59brainproxythere
18:59brainproxywhich is not what I want... I'd like to just spec the port and make a direct connection
19:03nwolfebrainproxy: so you don't want to cider-jack-in then?
19:09brainproxyI think I just want cider-connect
19:09brainproxythe repl is running on an external host
19:09brainproxyon port 7888
19:10nwolfeAh, just making sure. Not familiar enough with cider-connect to help
19:10justin_smithbrainproxy: I hope this is on a locked down lan that you don't share btw
19:11brainproxyjustin_smith: yes, sure, it's in a dev env on my laptop consisting of various layers of vagrant and docker
19:14brainproxyI'm experiencing what's described here: https://github.com/clojure-emacs/cider/issues/822
19:14brainproxybut it seems like it should have been solved...
19:19dbasch“A clojure library designed to… well, that part is up to you” http://goo.gl/ezp9zi
19:19dbasch56k results
19:19gfredericksokay I'm gonna figure out a way to suppress leiningen's tools.nrepl dependency
19:19gfredericksI'm thinking a leiningen middleware at worst right?
19:20gfredericksgonna need to make a library called lein-nrepl-suppressor
19:20technomancygfredericks: remove it entirely, instead of replace it?
19:21gfrederickswell I want to replace it by a dep with a different group name
19:21gfredericksso depends on your perspective I guess
19:21technomancyoh, I see
19:23nooniangfredericks: i've only gotten that to work by building it yourself and linking your lein script to it
19:23gfredericksnoonian: building what?
19:23noonianleiningen
19:23gfredericksnoonian: do you know why a middleware wouldn't work?
19:25nooniangfredericks: not specifically but i didn't go that far before giving up and I was pretty new to clojure at the time, what would the middleware do exactly? dynamically modify the classpath?
19:27gfredericksnoonian: middleware can arbitrarily edit the project map, so I assume just fish around for the nrepl dep under :dependencies and remove it
19:27technomancygfredericks: the problem there is if you mash the project map directly it doesn't survive a re-merge of profiles
19:28nooniangfredericks: that would probably work. thinking back I think my problem was harder because i wanted to use the new version of tools.cli in a leiningen plugin so that was running inside the leiningen process
19:29gfrederickstechnomancy: oh man what on earth? why? huh?
19:29gfredericksre-merge??
19:29lazybotgfredericks: What are you, crazy? Of course not!
19:30technomancygfredericks: consider this... if you merge the default profiles into a project map, how do you un-merge them if you realize later you need a different set of profiles?
19:30visofwhat is the best way to create map with value as a list and each time append to this list, as example, i need to collection all 4 and 3 length words from text, and the result should be {:four [....] :three [....]}
19:30visofwhat is the best way to this
19:30visof?
19:30technomancyif you can solve that in a way that isn't "keep the original project map around as metadata and merge the new profiles into that instead" please let me know and we will use it for lein 3
19:30noonianvisof: update-in
19:31noonianmight be off, one sec
19:31noonian,(update-in {:foo []} [:foo] conj "bar")
19:31clojurebot{:foo ["bar"]}
19:31gfrederickstechnomancy: okay so if I mash both the project map and its metadata then...nevermind
19:32gfrederickstechnomancy: I'll dig as deep as I need to into this and let you know what I come up with :)
19:32technomancygfredericks: yeah, that would do it. it's just ... un-ideal
19:33technomancygfredericks: my quip earlier about "Leiningen: the Good Parts" was partly about this specific misfeature
19:52nooniantechnomancy: the atreus looks sweet btw! i randomly caught your emacs chat thing with sasha chua when i was looking into org-mode and your workshop inspired me to get an ergodox :P
19:52technomancynoonian: thanks =)
19:52technomancyI forget, did she link to http://atreus.technomancy.us?
19:53gfrederickstechnomancy: but it's not the original project map that has tools.nrepl, it's the base profile, amirite?
19:53Cr8I got an ergodox - but those tiny diodes man
19:53Cr8still working on it =P
19:53nooniani don't think so, that was months ago and i just now saw the atreus (i think someone linked to it from redit)
19:54technomancynoonian: cool, on r/mechanicalkeyboards?
19:54noonianyeah, i ordered the most recent kit on massdrop so i'm learning to sodder and collecting tools now heh
19:54nooniantechnomancy: yeah in response to someones ergodox pics i think
19:54noonianthe comments i mean
19:54technomancygfredericks: well, profiles are looked up in the project map
19:55gfrederickswell I can't just remove :base
19:55gfredericksdo the full profiles get nested in there first?
19:55technomancygfredericks: I think you need to reach into :profiles and possibly :profiles on metadata too, but I'm super fuzzy on this
19:56gfredericksI imagine if I examined how with-profile is implemented I would understand all the pieces involved?
19:56technomancyyou'll want to explore in a repl
19:57gfredericksclojurebot: you'll |want| to explore in a repl
19:57clojurebotAck. Ack.
19:57technomancywords to live by
19:57technomancynoonian: do you have a link to the thread?
19:58_pr0t0type_Hey guys, how do I correctly route a directory (with static assets) correctly using Ring?
19:58_pr0t0type_I'm tried: (GET "/styles" [] (resp/resource-response "app/styles" {:root "public"}))
19:58_pr0t0type_doesn't work
19:59nooniantechnomancy: i'll check my history it was like yesterday but gimme a sec i'm at work
20:02justin_smith_pr0t0type_: what is the relative path of the resource directory in your project?
20:04_pr0t0type_justin_smith: its a leiningen project (lein new compojure) which serves all static assests out of the {project_root}/resource/public/ path
20:04justin_smithresource or resources?
20:05_pr0t0type_resources
20:05_pr0t0type_sorry
20:05_pr0t0type_if I try to route a specific file (ie index.html) it works just fine
20:05_pr0t0type_but I can't make it work with
20:05_pr0t0type_dirs for some reason
20:05_pr0t0type_for instance, this works:
20:05_pr0t0type_(GET "/" [] (resp/resource-response "app/" {:root "public"}))
20:05_pr0t0type_sorry, I mean
20:05_pr0t0type_(GET "/" [] (resp/resource-response "app/index.html" {:root "public"}))
20:06_pr0t0type_works
20:07justin_smiththe right way to do this, if you have a directory of static resources, is not to define a route, but to use wrap-resources
20:07justin_smithresource-response is to define one endpoint, wrap-resources is to define an endpoint for each resource under that path
20:08_pr0t0type_I see
20:08justin_smithwrap-resources is a middleware that gets applied to your handler
20:08justin_smithsorry, not wrap-resources, but wrap-resource
20:08_pr0t0type_Let see if this worksl Can I thread it via the (defroutes) call?
20:08justin_smithhttps://github.com/mmcgrana/ring/wiki/Static-Resources
20:09_pr0t0type_ie
20:09_pr0t0type_(-> (defroutes app-routes …) (wrap-resource))
20:09_pr0t0type_lets see...
20:09justin_smithyeah, except wrap-resources also take a base directory argument (likely "public"
20:09justin_smith)
20:10_pr0t0type_gotcha
20:11nooniantechnomancy: i'm sorry i can't seem to find it. it might not have been in a reddit thread afterall
20:11_pr0t0type_Yes!
20:11_pr0t0type_justin_smith: it worked, thanks dude
20:11justin_smithnp
20:11_pr0t0type_(def app
20:11justin_smithusually works for me :)
20:11_pr0t0type_:)
20:12technomancynoonian: no worries
20:54gfrederickstechnomancy: actually I might just use :injections to monkey-patch my nrepl changes and not worry about it
21:01iamdustanLuyt_: nah. I’ve abandoned codeeval for exercism.io
21:15brainproxyRaynes: is laser dead/dying?
21:16Raynesbrainproxy: I don't currently have time to work on it, enlive is being maintained again (AFAIK), and almost nobody used laser in the first place.
21:16brainproxyRaynes: gotcha, thanks for the quick feedback
21:17RaynesIf somebody wanted to work on it, they're totally welcome to. But I have little incentive to when I'm the only person using it :P
21:17brainproxylooks like cgrand has something new-ish cooking w/ enliven?
21:17brainproxythough looks like enlive has been updated more recently than enliven
21:34gfredericksthis whidbey plugin seems to think that a profile called :repl is used whenever you run `lein repl`; but that does not happen for me
21:34gfredericksanybody know if that's *supposed* to happen?
21:38jeremyheilergfredericks: the readme seems to show the repl profile as an example
21:38jeremyheilerof putting your stuff in a diff profile, not as if the repl profile is already there
21:39gfredericksjeremyheiler: it does it internally too
21:39jeremyheilerhmm
21:39gfredericksif I use the plugin in the basic fashion, it does nothing for `lein repl` but does for `lein with-profile +repl repl`
21:39jeremyheileroh i see
21:40gfredericksindependently I can't figure out how it expects to work as a middleware alongside the builtin pr-str middleware
21:40gfredericksright now I'm actually seeing the incorrect behavior of having both of them running at once
21:41gfrederickseither I see a string literal with pretty-printed data inside it, or a trivially-pretty-printed string of data (depending on what order the two go in), and I've seen both
21:41gfredericksI also saw it work correctly a few weeks back but have no idea how to reproduce that
21:44gfredericksoh nevermind I see what it does
21:44gfredericksit's right after the "Here's where things get ugly" comment :)
21:46jeremyheilerheh, i was just looking at that part
21:47jeremyheilerstill, it expliclitly alters the repl profile
21:47gfrederickssure, my original question is whether I should expect the repl profile to be active for the repl command
21:48jeremyheilerah
21:49arrdemAFAIK it is
21:49arrdemcider does `lein repl :user` tho..
21:49gfredericksyeah?
21:49gfrederickswell still I'm not using cider in this instance
21:50arrdemjust a thought
21:50jeremyheileri dont' think repl is a built in profile, if that's what you mean
21:56jeremyheilerok, it is there. so... why isn't it active then? hmm
21:56gfrederickswhat's there?
21:56gfredericksin the repl task?
21:57jeremyheileryeah
21:57jeremyheilerhttps://github.com/technomancy/leiningen/blob/master/src/leiningen/repl.clj#L285
21:57gfredericksI'm getting the same behavior on another machine
21:57jeremyheileri treid it and got the same too
21:58gfredericksphew
21:59gfrederickswell I think I have to declare defeat right there for the evening and pick up being defeated some other day
21:59jeremyheilerheh.
22:00gfredericksjeremyheiler: thanks for poking around
22:00jeremyheilerit was fun
22:05cfleminggfredericks jeremyheiler: I feel a bit better after reading this, the lein profile system never fails to make me feel dumb when I try to figure out how it works.
22:09jeremyheilerheh! i like it conceptually, tho
22:10cflemingjeremyheiler: Sure, in theory it's quite simple, but you know what they say about theory and practise
22:11pdkis it that they say to spell practice with a c
22:12jeremyheilercfleming: yeah, you get things like !important :-P
22:13cflemingpdk: They could start with that, yes
22:34technomancygfredericks: :repl not getting loaded might be a 2.5.0 bug
22:53danielcomptonamalloy: flatland/useful doesn't accept github issues. Should I put one on amalloy/useful?
22:54amalloydanielcompton: yeah, i suppose so. i wish flatland were still the primary, but then my user profile looks like i never do anything
22:55danielcomptonamalloy: because 'popular repositories' only shows ones you own?
22:55arrdemamalloy: I think they fixed that... I'm totally getting credit for shit done on the grimoire group
22:55danielcomptonamalloy: you would get to 'contribute' to your own repo :)
22:58cddrIf I add an explicit System/exit as the last line of a lein plugin, it causes the task to exit much more quickly. Does anyone have any idea why that would be?
22:59arrdemcddr: waiting for threads to exit usually
23:03devn,shutdown-agents
23:03clojurebot#<core$shutdown_agents clojure.core$shutdown_agents@182cbe9>
23:03devn,(shutdown-agents)
23:03clojurebot#<AccessControlException java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)>
23:04devn,(doc shutdown-agents)
23:04clojurebot"([]); Initiates a shutdown of the thread pools that back the agent system. Running actions will complete, but no new actions will be accepted"
23:06cddrInteresting. Thanks!
23:12justin_smitharrdem: wait, he was asking why the Shutdown caused it to exit sooner, not why it would hang and not shut down...
23:15cddrIt hangs for about 20seconds before eventually shutting down. I replaced the System/exit with a line printing the number of running threads and get 5 so that does seem to be plausible.
23:16justin_smithoh, OK, I misunderstood the discussion, clearly
23:18cddrNah I'm just bad at IRC.
23:18caardamn how is this not taken
23:21justin_smithyou would think some crusty old lisper would have taken that one
23:22arrdemthat's what I was expecting...
23:23arrdemalthough having more than two c[ad]*r in one channel would probably be silly
23:24justin_smithtalk to the caaar because the cadar ain't listenin honey
23:25justin_smithactually that didn't make any sense at all, apologies
23:30zanesWhy when I add [plumbing.core :refer [map-vals]] do I get the warning, WARNING: update already refers to: #'clojure.core/update in namespace: plumbing.core, being replaced by: #'plumbing.core/update?
23:30zanesI didn’t refer ‘update’.
23:30zanesWhy is it mad?
23:31arrdemzanes: plumbing is defining plumbing.core/update, which shadows clojure.core/update in the namespace plumbing.core
23:31justin_smithyou automatically refer clojure.core
23:31arrdemzanes: it's just a warning. you're ok
23:31justin_smithyou can use (:refer-clojure :exclude [update]) in your ns decl to fix this
23:31zanesOh! So it’s Prismatic’s fault?
23:31arrdemzanes: yep
23:32zanesThey didn’t :refer-clojure :exclude [update]?
23:32zanesI see.
23:32zanesThat’s irritating.
23:32arrdemzanes: bingo
23:32arrdemzanes: see if there's a ticket open :P
23:32justin_smithoh, they would need to do the :exclude
23:32justin_smithupdate is a recent function right?
23:32justin_smith(doc update)
23:32clojurebot"([m k f] [m k f x] [m k f x y] [m k f x y ...] [m k f x y ...]); 'Updates' a value in an associative structure, where k is a key and f is a function that will take the old value and any supplied args and return the new value, and returns a new structure. If the key does not exist, nil is passed as the old value."
23:32zanesI guess this is what I get for using the 1.7.0 beta.
23:32arrdemjustin_smith: yeah
23:32justin_smithit could be newer than prismatic
23:32arrdemjustin_smith: it's new in 1.7
23:32zanesYeah.
23:32zanesI bet they’re still on 1.6.x.
23:32jeremyheileroh nice, finally getting update!
23:32zanesNever mind. My anger is misplaced.
23:33arrdem&(:added (meta #'clojure.cure/update))
23:33lazybotjava.lang.RuntimeException: Unable to resolve var: clojure.cure/update in this context
23:33zanesclojure.cure sounds nice.
23:33arrdem&(:added (meta #'clojure.core/update))
23:33lazybotjava.lang.RuntimeException: Unable to resolve var: clojure.core/update in this context
23:33dbaschbut it’s not in 1.6
23:33arrdem&*clojure-version*
23:33zanesI bet lazybot isn’t on 1.7.
23:33lazybot⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}
23:33jeremyheiler,*clojure-version*
23:33clojurebot{:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}
23:33justin_smithclojure.cure/boys-don't-cry
23:33arrdemoh god lazybot's on 1.4 lol
23:34jeremyheiler,(:added (meta #'clojure.core/update))
23:34clojurebot"1.7"
23:34cddrkeep em coming justin_smith
23:34devn,(:added (meta #'clojure.core/random-sample))
23:34clojurebot"1.7"
23:34justin_smithcddr: I try
23:35dbaschstill no take-all and remove-all
23:35devn,(:doc (meta #'clojure.core/update))
23:35clojurebot"'Updates' a value in an associative structure, where k is a\n key and f is a function that will take the old value\n and any supplied args and return the new value, and returns a new\n structure. If the key does not exist, nil is passed as the old value."
23:35devn,(:arglist (meta #'clojure.core/update))
23:35clojurebotnil
23:35devn,(keys (meta #'clojure.core/update))b
23:35clojurebot(:ns :name :added :file :static ...)
23:35devn,(sort (keys (meta #'clojure.core/update)))
23:35clojurebot(:added :arglists :column :doc :file ...)
23:35devn,(:arglists (meta #'clojure.core/update))
23:35clojurebot([m k f] [m k f x] [m k f x y] [m k f x y ...] [m k f x y ...])
23:36jeremyheilerwait, the last two are the same?
23:36aconberehey, clojurescript question, I'm running through the om readme, and I have my cljs build set up like they say. But when I load my page I get an error about "goog" not defined.
23:36aconberedo I need to load the goog library?
23:36jeremyheileroh, i bet it's just clojurebot cutting it off
23:36devnjeremyheiler: yeah
23:37devn,*print-length*
23:37clojurebot5
23:37jeremyheilercool
23:37devn,(binding [*print-length* 10] (take 10 (range 100)))
23:37clojurebot(0 1 2 3 4 ...)
23:37devn:(
23:37jeremyheilerheh
23:37dbaschaconbere: are you compiling in dev or prod mode?
23:37devn,(set! *print-length* 10)
23:37clojurebot10
23:37devn,(binding [*print-length* 10] (take 10 (range 100)))
23:37clojurebot(0 1 2 3 4 ...)
23:37aconberedbasch: that's a hard question to answer :P
23:38aconberedbasch: which set of options do you consider dev and prod?
23:38aconbere(I'm trying to compile currently with the set of options they call "release")
23:38dbaschaconbere: so release is probably what used to be prod
23:38aconberemakes sense
23:38aconberehttps://gist.github.com/aconbere/0e07d63293638ea654fd
23:39dbaschThe last time that happened to me it had something to do with advanced optimizations
23:39dbaschit worked fine with compiling in dev
23:41dbaschaconbere: does it work with optimizations whitespace?
23:42aconberelet me try!
23:42aconbereI tried :optimizations :none
23:42aconbereand it didn't help
23:43devn,(do (set! *print-length* 10) (take 10 (range 10)))
23:43clojurebot(0 1 2 3 4 5 6 7 8 9)
23:43TEttinger,(do (set! *print-length* 10) (range))
23:43clojurebot(0 1 2 3 4 5 6 7 8 9 ...)
23:44TEttinger,(do (set! *print-length* 20) (range))
23:44clojurebot(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...)
23:45arrdemoh just hurry up and hit Freenode's message limit
23:45TEttingerfine
23:45TEttinger,(do (set! *print-length* 1000) (range))
23:45clojurebot(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 1...
23:46TEttingerhuh, no ) at the end
23:46TEttinger,(do (set! *print-length* 1000) (range 1000 2000))
23:46clojurebot(1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079...
23:47dbaschthat’s numberwang
23:47devn:D
23:48justin_smithlet's rotate the board...
23:48justin_smith(channel rotates, revealing a scala usergroup, and continues to rotate, bringing us back to normal)
23:48devn,(do (set! *print-length* 1000) (interpose \s (map char (range))))
23:48clojurebot(\
23:49kenrestivobot torture!
23:49aconbereomg
23:49aconberedbasch: I'm dumb, I was accidentally building my dev build >_<
23:50devnbotsnack
23:50TEttinger,(do (set! *print-length* 1000) (interpose \space (map char (range 160 256))))
23:50clojurebot(\  \space \¡ \space \¢ \space \£ \space \¤ \space \¥ \space \¦ \space \§ \space \¨ \space \© \space \ª \space \« \space \¬ \space \­ \space \® \space \¯ \space \° \space \± \space \² \space \³ \space \´ \space \µ \space \¶ \space \· \space \¸ \space \¹ \space \º \space \» \space \¼ \space \½ \space \¾ \space \¿ \space \À \space \Á \space \Â \space \Ã \space \Ä \space \Å \space \�
23:50devn!botsnack
23:50devn,botsnack
23:50clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: botsnack in this context, compiling:(NO_SOURCE_PATH:0:0)>
23:50devn:(
23:50justin_smith~botsnack
23:50clojurebotThanks, but I prefer chocolate
23:50dbasch~chocolate
23:50clojurebotactually I decided I prefer botsnacks after all.
23:50devn:(
23:50TEttinger,(do (set! *print-length* 1000) (map str (interpose \space (map char (range 160 256)))))
23:50clojurebot(" " " " "¡" " " "¢" " " "£" " " "¤" " " "¥" " " "¦" " " "§" " " "¨" " " "©" " " "ª" " " "«" " " "¬" " " "­" " " "®" " " "¯" " " "°" " " "±" " " "²" " " "³" " " "´" " " "µ" " " "¶" " " "·" " " "¸" " " "¹" " " "º" " " "»" " " "¼" " " "½" " " "¾" " " "¿" " " "À" " " "Á" " " "Â" " " "Ã" " " "Ä" " " "Å" " " "Æ" " " "Ç" " " "È" " " "É" " " "Ê" " " "Ë" " " "Ì" " " "Í" " " "Î" "
23:50justin_smith$botsnack
23:50lazybotjustin_smith: Thanks! Om nom nom!!
23:50arrdem$botsmack
23:51devnTEttinger: what im looking for is the simplest way to return the max length of message
23:51devnincluding ...
23:51TEttingeron freenode?
23:51irctcwow, don't know that we have $botsnack ...
23:51devnTEttinger: yeah
23:51irctc$botsnack
23:51lazybotirctc: Thanks! Om nom nom!!
23:51justin_smith,(map int "☃")
23:51clojurebot(9731)
23:51devn:D
23:51TEttingerdevn, it gets complicated with unicode
23:51justin_smith,(char 9731)
23:51clojurebot\☃
23:51devn,(map int "☣")
23:51clojurebot(9763)
23:52justin_smithvery nice
23:52devnTEttinger: indeed :D
23:52devnTEttinger: im betting it can be fit into a single message though
23:52devn(unicode invariants that is)
23:52justin_smith(map int "🐩") ; poodle
23:52justin_smith,(map int "🐩") ; poodle
23:52clojurebot(55357 56361)
23:53TEttinger,(apply str (repeat 256 "-☃"))
23:53clojurebot"-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃
23:53devn,(map int "𐤄")
23:53clojurebot(55298 56580)
23:53TEttinger,(apply str (repeat 256 "-a"))
23:53clojurebot"-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-...
23:54devn,(map int "𝇙")
23:54clojurebot(55348 56793)
23:55devn,(map int "𐆠")
23:55clojurebot(55296 56736)
23:55devnhm
23:56devn,(map int "𐆛")
23:56clojurebot(55296 56731)
23:56devn,(map int "�")
23:56clojurebot(65533)
23:59zanesI think I just wrote the transducer version of condp.
23:59zanesI can’t tell if this was a good idea or not.