#clojure log - Oct 07 2014

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

1:45 johann_: hey room. i'm working on a project where i grab images off the web and display them in quil

1:48 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

1:48 the thing that i am confused about is going from byteinputstream to bufferedimage

1:50 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

3:51 H4ns: i 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?

3:52 i'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?

3:54 or 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?

4:01 kungi: H4ns: I recently had a similar problem where I needed to inject a component as dependency into a bunch of routes.

4:02 H4ns: Have a look at this macro here for inspiration: https://github.com/ggenikus/comcomp

4:02 H4ns: but beware this macro has some serious flaws.

4:03 H4ns: The idea is to inject the dependency into each request when it reaches a route

4:03 H4ns: kungi: thanks! i'll have a look.

4:04 kungi: i've just found wrap-routes, which may actually be all that is required.

4:04 kungi: H4ns: wrap-routes?

4:04 H4ns: kungi: http://weavejester.github.io/compojure/compojure.core.html#var-wrap-routes

4:09 hm. maybe not. there ought to be a very simple, macro-less solution.

4:15 magopian: is "Arne Brasseur" (@plexus) here?

4:17 dysfun: is there a collection library that evicts things on a LRU basis up to a specified limit?

4:20 hrm, looks like LinkedHashMap can be used in this way

5:26 perplexa: cfleming: i didn't have time to look into it yet, sorry :)

5:26 gonna play around a bit with cursive at the weekend

5:34 kenrestivo: i vaguely remember seeing a project someone did that would show you the github projects which depend (via lein project.clj) on some given project

5:35 if that makes any sense. basically, a nice tree or search that would show what projects make use of which libraries

5:42 nm, found it: https://github.com/search?q=foobar+filename%3Aproject.clj&type=Code&ref=searchresults

5:51 cfleming: perplexa: Ok, cool - let me know if you have problems, either here or by email

5:51 kenrestivo: Check out http://crossclj.info, it's really great

5:51 perplexa: alrighty :) thx

5:54 kenrestivo: cfleming: wow, that's pretty amazing. and very helpful for comprehending the projects of people who :refer :all

5:55 cfleming: kenrestivo: No doubt, I use it a lot to see how people are using functions I'm interested in too.

5:55 kenrestivo: The UI is pretty dense and takes some getting used to, but it's really powerful.

6:06 kenrestivo: who wrote that? is it based on codeq/datomic? great stuff.

6:07 ro_st: what are you talking about?

6:07 crossclj?

6:08 cfleming: kenrestivo: It's written by Francesco Bellomi. It's not open source right now, AFAIK it's not codeq or datomic.

6:08 ro_st: Right.

8:38 kungi: I am trying to load css files i bundeled into an uberjar like this: (io/file (io/resource "public/bootstrap/css/bootstrap.css"))

8:38 But I receive a IllegalArgumentException "Not a file"

8:39 jar:file:/Users/kungi/Code/clj-demgen/target/clj-demgen-2.0.7-standalone.jar!/public/bootstrap/css/bootstrap.css

8:39 What am I doing wrong here?

8:54 Meh! I found it. I cannot access a file in a jar file in that way.

8:58 ordnungswidrig: kungi: (io/resource "…") should be sufficient and will return you an inputstream IIRC.

9:00 kungi: ordnungswidrig: Yes but I wanted to get the lastModified time

9:01 I solved the problem as follows:

9:01 (defn- get-last-modified [url]

9:01 (.. (io/resource url)

9:01 (openConnection)

9:01 (getLastModified)))

9:01 ordnungswidrig: where are you from in germany?

9:01 ordnungswidrig: kungi: neu-ulm

9:01 kungi: ordnungswidrig: quite "near". We are creating a new clojure user group in mannheim

9:02 ordnungswidrig: kungi: that will only work as long as the resource is loaded from a jar. not every implementation or "UrlConnection" supports "getLastModified".

9:02 clgv: kungi: you have a different definition of "near" ;)

9:02 kungi: clgv: that's why I said 'quite :-)

9:02 ordnungswidrig: I might give a visit to that group some when. If you like I can give a talk on liberator or web dev.

9:03 clgv: kunig is using the american midwest definition of "near"

9:03 kungi: ordnungswidrig: Hmm it seems to work when I run it outside of a jar in lein repl

9:03 clgv: ordnungswidrig: hehe

9:04 kungi: :-D

9:04 agarman_: kungi: the behavior will be surprising if your URL starts with something other than file://

9:05 kungi: agarman_: hmm can this happen when I use it on something created by (io/resource)?

9:06 ordnungswidrig: kunig: that depends on the classloader

9:06 kungi: ordnungswidrig: Now we reach the end of my Java knowlege.

9:06 ordnungswidrig: kungi: 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

9:07 agarman_: kungi: yeah, what ordnungswidrig said :-)

9:07 ordnungswidrig: kungi: maybe you can describe what you want to achieve more generally

9:09 kungi: I want to force the browser to reload css and js files which have changed since the last visit.

9:09 agarman_: don't put them in resources then

9:09 kungi: I determine the last modified date and append it to the url

9:10 ordnungswidrig: kungi: https://github.com/mmcgrana/ring/wiki/Interactive-Development

9:10 elfenlaid: hi all, quick silly question, are there some analog of haskell's STM:retry in clojure or I must use watcher?

9:10 ordnungswidrig: ups, wrong link

9:10 elfenlaid: yep, lookup (ref) (dosync) et. al.

9:11 kungi: ordnungswidrig: Looks wrong

9:11 elfenlaid: ordnungswidrig: thank you :)

9:12 ordnungswidrig: kungi: https://github.com/weavejester/lein-ring is able to reload on change

9:12 kungi: ordnungswidrig: Yes but this does not prevent the browser of my client from caching my js files

9:12 ordnungswidrig: kungi: if you only need it for dev, then you might be able to depend on file:///… urls and just not fail else

9:12 agarman_: kungi: you need to include ring-dev middleware

9:13 ordnungswidrig: kunig: you should serve a proper last-modified header then

9:13 kungi: ordnungswidrig: no not only for dev

9:13 When 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

9:14 ordnungswidrig: oki, "wrap-not-modified" is your friend here. https://github.com/ring-clojure/ring/wiki/Static-Resources

9:14 agarman_: https://clojars.org/ring/ring-devel

9:16 kungi: ordnungswidrig: looks like that's exactly what I need

9:21 ordnungswidrig: Thank you!

9:25 arrdem: cfleming: killed the old Grimoire instance. no idea how that survived.

9:26 cfleming: yeah there will be a Grimoire 0.4.0 with a omnipresent search box for keyboard only nav at some point

9:27 cfleming: blockers on that are my learning clojurescript, free time and a couple solid UX sketches

9:50 elfenlaid: I end up with like this http://dpaste.com/3V0TH3Z , another interesting question is should I worry about an overhead of add-watcher \ remove-watcher ?

9:59 kungi: ordnungswidrig: When using ring.middleware.not-modified in an uberjar I get two content-length headers with the same value in the respones.

9:59 ordnungswidrig: This create weird errors.

10:00 ordnungswidrig: Do you have a pointer where I might start to debug this?

10:01 ordnungswidrig: hmm, that's a good question

10:10 clgv: elfenlaid: what exactly are you trying to solve with that?

10:27 elfenlaid: clgv: well, I'm planning to build a toy spider with configurable number of connections per host

10:28 clgv: elfenlaid: ok. what does this concrete piece of code try to achieve?

10:29 justin_smith: shared queue and each thread taking URLs from the queue to visit and depositing URLs from links would be much more straightforward

10:30 elfenlaid: justin_smith: actually your are right :)

10:31 clgv: it's kind of connections queue

10:31 xeqi: elfenlaid: have you considered a ThreadPoolExecutor ?

10:32 elfenlaid: xeqi: well, no :) I will google for that, thanks :)

10:33 justin_smith: yeah, a ThreadPoolExecutor and a ConcurrentLinkedQueue seems like a natural combo for this

10:34 clgv: elfenlaid: yeah, you should use a threadpoolexecutor to limit the number of parallel activities

10:34 elfenlaid: that's why I asked ;)

10:36 corecode: hi

10:36 what's the suggestion to use swt with clojure?

10:37 i'm a total newb to clojure and java; i can't find a recent swt package in clojars or maven

10:38 elfenlaid: clgv: trying to mix channel in that monster :) http://dpaste.com/3Q0E31A

10:38 justin_smith: corecode: well there is a maven repo for swt https://code.google.com/p/swt-repo/

10:39 corecode: justin_smith: so eclipse can't figure it out themselves?

10:39 oh my.

10:39 justin_smith: ?

10:39 I don't know

10:39 yeah looks like it

10:39 corecode: now i just need to figure out how to use this repo with lein

10:40 clgv: elfenlaid: no, just forget that monster

10:40 verma: so 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:41 clgv: corecode: are you sold on SWT? since there is the awesome seesaw library for swing

10:41 justin_smith: corecode: [org.eclipse.swt/org.eclipse.swt.win32.win32.x86_64 "4.4"] in your deps vector

10:41 elfenlaid: clgv: if you say so :)

10:41 justin_smith: yeah, seesaw will likely be much more peasant to use

10:41 corecode: clgv: i am not committed at all

10:41 clgv: corecode: afaik there is no port for SWT so far

10:41 corecode: clgv: i'm trying to learn a bit of opengl and clojure

10:42 justin_smith: that probably won't work for linux?

10:42 justin_smith: corecode: on that page they list the artifact ids for other platforms

10:43 I was just showing the translation from pom.xml syntax to project.clj

10:43 (of course you need to add their repo to :repositories too)

10:43 clgv: corecode: I think there should be a portable dependency for SWT

10:44 TravisD: Does anyone know of any papers talking about stopping rules for random restarts for global optimization?

10:44 corecode: justin_smith: i was more wondering how i can add the repo url

10:44 justin_smith: clgv: so what, it would ship every platform version?

10:44 corecode: but sure, i can try to use seesaw

10:45 justin_smith: corecode: relevant part of the sample project.clj https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L78

10:45 Luyt_: 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:45 justin_smith: corecode: there is little to nothing about project.clj construction that is not answered by example in that marvelous file

10:46 clgv: justin_smith: yeah, I think there is an option to do that similar to how other native libraries are handled

10:46 justin_smith: Luyt_: with clojure, that is going to be pretty difficult

10:46 clgv: and how are they handled? by shipping all the common native deps in the uberjar?

10:46 Luyt_: justin_smith: I agree. Codeeval should adjust their memory usage criteria for submitted solutions in Clojure.

10:47 clgv: justin_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:47 justin_smith: yeah - not that we limit size of much of anything in the clojure world :P

10:48 Luyt_: 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:34 clgv: Luyt_: well memory usage is a matter of configuration of the used jvm as well. how do they do it for java?

11:35 Luyt_: clgv: I don't know ;-) I can't look into the kitchen of Codeeval.com ;-)

11:36 clgv: Oh, and I've never submitted a Java solution. Do they accept those, too?

11:36 clgv: Luyt_: java is listed in the ranking screenshots

11:37 Luyt_: 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:38 justin_smith: clgv: 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:38 clgv: justin_smith: hmm maybe.

11:39 justin_smith: otherwise c++ would not do very well

11:41 clgv: they 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:48 justin_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:49 m1dnight_: Is it normal that (def varname...), not on to in a let body, gives a warning in Cursive?

11:49 varname can not be resolved

11:50 But everything works fine :)

11:50 clgv: huh?

11:50 m1dnight_: *not on top

11:50 clgv: m1dnight_: you mean like (let [...] (def varname ...)) ?

11:50 m1dnight_: yes

11:50 (I know i should put it in the let, but I did it while experimenting

11:50 clgv: m1dnight_: that's a very bad idea and show that you did not understand the destinction between variables and local bindings

11:51 Bronsa: clgv: how is that a bad idea?

11:52 it's certainly not used much, but there's nothing wrong with it

11:52 clgv: Bronsa: 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:52 for a few variables I use a surrounding `let` as well...

11:52 m1dnight_: _experimenting_

11:53 clgv: m1dnight_: I guess it might be a feature of cursive's code analyzer?

11:53 m1dnight_: 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:54 justin_smith: m1dnight_: 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:54 clgv: m1dnight_: a bug of the analyzer is possible as well ^^

11:55 m1dnight_: 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:55 Nothing is set in stone here :p

11:55 clgv: is cursive opensource?

11:55 justin_smith: m1dnight_: right, just saying cursive has likely had few test cases like this

11:55 so the chances it has weird corner case behavior is high

11:55 Bronsa: clgv: don't think so

11:56 m1dnight_: cfleming: ^ Perhaps you are interested.

11:57 * m1dnight_ is unsure if he was the dev or not, so if not, I apologize

11:57 clgv: Bronsa: hmm yeah, would probably reduce the chances to sell it later on (as announce in its beginning)

11:58 justin_smith: m1dnight_: yeah, cfleming is the cursive dev

11:58 m1dnight_: cursive has a bug tracker, right?

11:58 m1dnight_: Not sure, I wanted to make sure I'm not overseeing something beforeI report a bug

11:58 So I'll do that right away :)

11:59 overlooking*

11:59 justin_smith: m1dnight_: https://github.com/cursiveclojure/cursive you can probably create an issue here

11:59 looks official

12:00 kungi: Is anyone working at http-kit?

12:01 justin_smith: kungi: as in being a http-kit developer, or as in using it in production?

12:01 kungi: justin_smith: I think both is appropriate

12:01 justin_smith: I use http-kit in a few projects

12:02 kungi: justin_smith: have you ever used ring.middlerware.not-modified with http-kit

12:02 justin_smith: no, not at all

12:03 kungi: justin_smith: using this ring middleware in conjunction with the creation of an uberjar results in http-kit delivering a response containing:

12:03 Content-Length: 101595

12:03 Content-Length: 0

12:03

12:03 Which just confuses every browser

12:03 justin_smith: yeah, that's weird

12:03 is this an http-kit specific issue?

12:03 kungi: Probably because of this: https://github.com/http-kit/http-kit/issues/127

12:04 justin_smith: I have not tested this with another server

12:05 justin_smith: you 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:06 kungi: justin_smith: the funny thing is: It only appears when I compile my code into an uberjar

12:06 justin_smith: kungi: what if you expanded the resources directory onto disk and loaded resources from there as a workaround?

12:07 just speculating that this would even work...

12:07 kungi: justin_smith: that might work, but I still don't understand why this happens

12:08 justin_smith: kungi: continuing to blantantly speculate... because you can't get a last modified time from a resource inside a jar?

12:09 kungi: justin_smith: I don't think this is correct.

12:09 justin_smith: not at all unlikely :)

12:09 kungi: justin_smith: Let me gist some stuff

12:11 justin_smith: sure - going out for coffee myself, be back shortly

12:11 kungi: justin_smith: https://gist.github.com/Kungi/4436d93ec8a99062fc09

12:11 justin_smith: I get a Last-Modified: date when querying the ubarjar version which seems to be correct.

12:12 justin_smith: you get double Content-Length headers in both cases

12:12 kungi: justin_smith: But in one case they match and in one they don't

12:12 justin_smith: that looks like an http-kit bug (or, very unlikely, a but in the not-modified middleware)

12:12 clojurebot: I don't understand.

12:12 kungi: justin_smith: That seems to be the "real" problem

12:12 justin_smith: yeah

12:13 have you considered making an uberwar via lein ring, and seeing if it behaves nicely in a tomcat or jetty container?

12:13 Bronsa: hallelujah http://dev.clojure.org/jira/browse/CLJ-1297#changehistory-21390

12:13 kungi: justin_smith: not yet

12:14 justin_smith: But I should do this

12:15 justin_smith: OK, getting coffee, brb

12:20 clgv: Bronsa: great :)

12:22 kungi: justin_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:23 perplexa: hm.

12:24 when i have a vector and i want only certain items based on attributes, i'd use reduce + into? or is there something else?

12:25 kungi: perplexa: filter?

12:25 PeregrinePDX: filter

12:25 noonian: ^

12:26 Bronsa: filterv if you want a vector back

12:26 perplexa: i think i also need to transform them ;x

12:26 phillord: for with :when

12:26 Bronsa: ,(map inc (filter odd? (range 10)))

12:26 clojurebot: (2 4 6 8 10)

12:26 perplexa: basically i have a set of java objects and want a different set of only paths ;p

12:26 PeregrinePDX: Yep what Bronsa said.

12:27 Bronsa: or as phillord suggests, ##(for [a (range 10) :when (odd? a)] (inc a))

12:27 lazybot: ⇒ (2 4 6 8 10)

12:27 noonian: or 'for' if you are feeling fancy

12:27 perplexa: ok thx, map+filter looks like what i want

12:27 ,inc Bronsa

12:27 clojurebot: #<core$inc clojure.core$inc@1e9b69e>

12:27 perplexa: damn :D

12:28 clgv: perplexa: you are lucky it did not eval Bronsa ;)

12:28 perplexa: or for.. mmh :)

12:28 haha

12:28 you mean one of them is enough? :P

12:28 (inc Bronsa)

12:28 lazybot: ⇒ 56

12:29 perplexa: (inc phillord)

12:29 lazybot: ⇒ 2

12:29 perplexa: \o/

12:29 always a pleasure to leech your knowledge!

12:31 Bronsa: m1dnight_: fyi I just finished installing cursive and I don't see any warning for (let [a 1] (def b))

12:36 m1dnight_: strange..

12:36 https://github.com/cursiveclojure/cursive/issues/527

12:36 This is the issue

12:36 Oh yes, it's only if the let is in the body of the function

12:36 a top level let does not show the symptoms

12:38 justin_smith: m1dnight_: 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:38 luxbock: does clojure.test have a built-in way of testing if a function is supposed to throw (a specific) error?

12:38 justin_smith: m1dnight_: when the defn is invoked, the var finally gets a value

12:39 luxbock: yes, the thrown-with-message syntax with is

12:39 clgv: m1dnight_: humm but the it looks more likea feature ;)

12:39 Bronsa: m1dnight_: ah that's more reasonable

12:40 luxbock: justin_smith: ah it's a special case of `is`, that's why I missed it

12:40 justin_smith: luxbock: or if you don't care about the message, just thrown? (is (thrown? the.exception.Type ...))

12:40 yeah, it's weird

12:40 Bronsa: m1dnight_: that code should definitely warn. it works in clojure mostly because of a side-effect of implementation details of def

12:40 luxbock: I've been using speclj but I think for my next project I'll just use clojure.test

12:42 I 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:42 I guess I need to write tests for my tests

12:43 m1dnight_: Oh really? What is that then Bronsa ? You've piqued my interest :p

12:44 Bronsa: m1dnight_: 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:45 justin_smith: m1dnight_: Bronsa: which is what I was trying to say above, though I called it "compile time"

12:46 Bronsa: justin_smith: sorry, I didn't read your message

12:47 justin_smith: np - is saying compile time simply less specific, or is it inaccurate in this case?

12:47 m1dnight_: Hmmm, I don't really know enough of about clojure's process so get it

12:47 Bronsa: just as good

12:47 m1dnight_: I can only relate to a scheme interpreter with a compilation step

12:47 brb, going home :)

12:48 justin_smith: haha

12:48 Bronsa: justin_smith: actually, kinda inaccurate now that I think about it. if interning happened at compilation time, the snippet I provided would not compile

12:49 justin_smith: ahh, so there are separate analysis / compilation steps, and it needs to happen in the former

12:50 Bronsa: justin_smith: yeah, Compiler.java actually has different passes

12:55 bbloom: Bronsa: rich just changed one ticket from 1.8 back to 1.7 :-) heh

12:56 Bronsa: bbloom: two actually, the IAtom one and the catching - instead of _ one

12:56 bbloom: Bronsa: what's the catch one?

12:56 Bronsa: bbloom: but also marked as incomplete a bunch of ones without any comment :/

12:56 bbloom: http://dev.clojure.org/jira/browse/CLJ-1297

13:12 luxbock: how 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:17 mi6x3m: clojure, would you always keep the first named argument on the same line as the function name?

13:17 (foo :boo "boo" vs. (foo\n:boo "boo" ?

13:17 * m1dnight_ just used some eventhandles in clojure and thinks they're leaner than java..

13:18 mi6x3m: m1dnight_: seesaw?

13:18 m1dnight_: no, just proxies

13:18 justin_smith: mi6x3m: 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:18 m1dnight_: it's much cleaner than java, imo

13:18 mi6x3m: justin_smith: yes, exactly, but you don't put the first pair on a new line also?

13:19 justin_smith: (assoc m\n:a 0\n:b 1...)

13:19 mi6x3m: yeah I see, though so

13:19 it's somehow intuitive but I get unsure sometimes

13:21 justin_smith: mi6x3m: this is not without controversial elements, but it's good m1dnight_:

13:21 err

13:21 https://github.com/bbatsov/clojure-style-guide

13:21 didn't mean to tag m1dnight_ there, sorry

13:22 mi6x3m: justin_smith: yeah, that guide is very nice, thanks :)

13:23 csd_: 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:23 justin_smith: csd_: how much do they share code?

13:24 csd_: One process scrapes into a db, the other process accesses the db

13:24 justin_smith: csd_: if more than a little, I would use the busybox approach (check the args to see which function -main dispatches out to)

13:24 martinklepsch: I'm going through the core.logic tutorial and wrote a sibling function: https://gist.github.com/mklappstuhl/4f35b0208a2ac0f7668e

13:25 (based on the core.logic tutorial)

13:25 justin_smith: csd_: so how about one jar with one -main which calls either scrape-main or access-main depending on args?

13:25 csd_: oh thats not a bad idea

13:26 to be less vague, i want the scraper to run daily, while the other process provides a ring server

13:27 justin_smith: could the scraper be a scheduled task embedded in the same process?

13:28 martinklepsch: now that sibling function returns it's argument as well. how would I remove that from the result set?

13:28 arrdem: bbloom: wait - vs _ is back from 1.8?

13:28 csd_: 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:28 bbloom: arrdem: seems so i guess. Bronsa spotted it

13:28 arrdem: bbloom: I saw that it got triaged approved, but I thought it was still 1.8. I welcome it...

13:29 csd_: if i used cron i could use your idea of calling main with a different argument

13:29 justin_smith: csd_: you could check out java.util.concurrent.ScheduledThreadPoolExecutor

13:30 csd_: what would you do? i just dont have enough experience to know what's best

13:30 bja_: is there a builtin schema for a function type?

13:30 csd_: bja: like IFn?

13:31 justin_smith: csd_: call .SceduleAtFixedRate on a (ScheduledThreadPoolExecutor.) - you can pass an fn of no args as the first method arg

13:32 bja_: I mean, IFn definitely works, but isn't IFn not clojure.lang.IFn in cljs?

13:32 justin_smith: csd_: well, I forgot to include the pool size in the constructor, but I think you will see that the API is straightforward

13:32 tac_: ,(doc partial)

13:32 clojurebot: "([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:32 csd_: justin_smith: thanks ill check that out

13:32 tac_: partial is partial application?

13:32 csd_: bja_: don't know about cljs sorry

13:33 justin_smith: tac_: yes, it returns a new function that takes N fewer arguments when supplied with a function and N args

13:33 bbloom: Bronsa: 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:37 sevvie: to whomever published "Clojure in the Open", thank you.

13:40 hiredman: woa https://github.com/clojure/clojure/commit/8765800e23a057957986c7d2bbb1f09cd3f1a676

13:42 cfleming: m1dnight_ justin_smith Bronsa clgv: Right, that's more or less a feature of Cursive

13:43 It'll index recursively from the top level inside let, do, etc as deep as you like but won't continue indexing inside defn

13:43 justin_smith: yeah, I think we narrowed it down that the error was in the code, not cursive's handling of it

13:43 declare would be a simple workaround if you really need the def to happen inside a defn

13:44 cfleming: Well, the code is valid for some definition of valid, i.e. it does actually work

13:44 But it's unusual and not recommended, right

13:45 m1dnight_: cfleming: It seems to happen in this case as well: (defn f [args] (fn [arg1 arg2] (def something ..) ...)))

13:46 (I happen to stumble upon this whilst translating a scheme program to clojure

13:46 )

13:46 justin_smith: m1dnight_: if you really need to do that, (declare something) at the top level would eliminate the warning I think

13:47 m1dnight_: yeah, i'll leave it be for the moment and check if I can replace it with a let in the second pass

13:47 I do have to read up on why exactly it is so bad to do this though

13:47 cfleming: m1dnight_: Right - that might be idiomatic in Scheme but it's not in Clojure

13:48 technomancy: m1dnight_: internal define in scheme is completely different from clojure's def

13:48 cfleming: Cursive will only look inside do and let-like forms (including letfn) from the top level.

13:48 justin_smith: def 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:48 m1dnight_: All I know is that in Scheme it acts the same as a let binding..

13:48 hiredman: clojure's def always defines a global var with a name

13:48 m1dnight_: I get it

13:49 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:50 cfleming: m1dnight_: Yes, it creates a global var

13:50 justin_smith: it does

13:50 globals only

13:50 that's what everyone has been saying

13:50 technomancy: while it's not technically true, you can assume there's no such thing as a local var

13:50 m1dnight_: oh, well thats mindblowing (to me at least) :p

13:51 justin_smith: technomancy: easier just to say that def is only for globals I think :)

13:51 technomancy: justin_smith: there are no local vars that are worth using? =)

13:51 justin_smith: m1dnight_: very different from scheme

13:51 technomancy: you can make local vars, just not with def

13:51 m1dnight_: Okay now I get it :)

13:51 technomancy: justin_smith: you can and shouldn't.

13:53 justin_smith: wait, shouldn't create a local var with def or shouldn't create local vars?

13:53 technomancy: justin_smith: I mean it's best to pretend with-local-vars doesn't exist

13:54 justin_smith: hehe, OK

13:55 dbasch: without-local-vars

13:55 justin_smith: has someone created the "useless" lib yet?

13:57 technomancy: once they do I would happily take a PR updating lein's tutorial to use it

13:58 m1dnight_: what's the useless lib?

13:58 justin_smith: a running joke on this channel

13:58 includes functions like "without-redefs"

13:58 unconcat

13:58 (that one may be marginally non-useless actually)

13:59 m1dnight_: oh lol :p

14:00 dbasch: take-all and remove-all

14:00 justin_smith: flatten

14:00 oh wait that one is in clojure.core

14:01 dbasch: lol

14:01 technomancy: lol

14:01 Bronsa: (inc justin_smith)

14:01 lazybot: ⇒ 88

14:11 gfredericks: I 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:12 all it has is a roundabout identity function

14:12 patches welcome

14:13 technomancy: wow, created by lein1

14:13 (C) <- how gauche we were in those ancient days

14:14 justin_smith: a remarkably well named namespace https://github.com/gfredericks/clojure-useless/blob/master/src/clojure_useless/core.clj

14:14 technomancy: I like that the file exists in the first place

14:14 gfredericks: technomancy: I should just make a commit out of `lein new`

14:15 technomancy: I choose to interpret it as a commentary on how dumb core.clj files are to begin with

14:15 justin_smith: technomancy: there are layers here to be sure

14:19 kryft: technomancy: Because there's no reason to have such a generic file name instead of a more descriptive one?

14:19 gfredericks: okay all the files have been enfreshinated

14:19 technomancy: kryft: yes, but more broadly because there's no reason for clojure to put single-segment namespaces in the default package

14:21 gfredericks: technomancy: would that be a breaking change?

14:21 technomancy: gfredericks: I don't think you could do it in a compatible way?

14:21 also dumb: the requirement for underscores in file names

14:22 dbasch: gfredericks: perhaps my do-or-do-not macro https://www.refheap.com/91360

14:22 technomancy: it's the same insistence that .clj files map closely to their .class equivalence; it's wasted countless hours

14:23 gfredericks: technomancy: I mean what would break if it changed? just compiled code or something?

14:24 "it changed" meaning single-segment namespaces do something besides the default package

14:24 technomancy: gfredericks: 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:24 justin_smith: dbasch: 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:24 technomancy: but 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:25 gfredericks: technomancy: I'm glad I don't manage a language

14:25 technomancy: gfredericks: I guess to be fair when AOT was designed it wasn't clear what the patterns would be

14:26 hindsight is 20/20 etc

14:26 gfredericks: technomancy: heck it's hard enough to even guess what functions you as the maintainer will think are useful 5 years out

14:26 technomancy: gfredericks: before AOT was added, there was no clojure.core, it was just clojure

14:26 and a bunch of things broke, but there was nothing in production, so it was fine

14:26 gfredericks: technomancy: TIL

14:27 technomancy: if I've learned anything from tetris, it's that your achievements disappear and your mistakes pile up.

14:27 gfredericks: clojurebot: it is time for clojure history anecdotes with technomancy

14:27 clojurebot: c'est bon!

14:27 gfredericks: ha

14:28 joshuafcole: (inc technomancy)

14:28 lazybot: ⇒ 140

14:28 joshuafcole: I expect to quote that for many years to come

14:28 technomancy: it's funny because there was a lot of hand-wringing about next vs rest breaking compatibility only ~ix months later

14:28 ~six

14:28 clojurebot: Gabh mo leithscéal?

14:28 technomancy: oops

14:29 gfredericks: I feel like I vaguely remember that

14:29 technomancy: that struck me as a much less invasive change

14:29 hiredman: the nil puning thing

14:29 technomancy: oh, but the book was almost ready to be printed, so that counts for a lot

14:29 gfredericks: oh so it was breaking book compatibility

14:30 technomancy: it's logistically pretty difficult to ship a patch for those things

14:31 joshuafcole: You'd have to mail the patch files themselves and gluesticks to merge them in with

14:31 gfredericks: and you pretty much have to make sure the length change is a whole number of pages

14:31 else you'd be patching like the whole second half of the book

14:32 m1dnight_: :D

14:33 gfredericks: Leiningen: The Definitive Guide

14:33 joshuafcole: V 0.1.3-SNAPSHOT ?

14:33 technomancy: Leiningen: the Good Parts

14:34 justin_smith: Dependency Design Patterns: Object Oriented Leinengen

14:35 jeremyheiler: Seven Leiningen Plugins in Seven Days

14:35 joshuafcole: We're scant steps away from BuzzFeed now

14:35 gfredericks: leiningen in :action

14:35 jeremyheiler: LeinFeed

14:36 joshuafcole: One Schoolteacher from Minnesota tried using leiningen, and what she discovered about dependency management might just change your life

14:36 gfredericks: Downloading A Leiningen Bash File From Github and Putting It On Your Path and Chmoding It To Be Executable in Five Easy Steps

14:37 "How to use Brew to sudo apt-get install leiningen"

14:37 joshuafcole: haha

14:37 danneu: is 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:37 TimMc: joshuafcole: :-D

14:37 joshuafcole: I didn't know you could brew install debian!

14:38 justin_smith: danneu: you can use recur just like that

14:38 TimMc: technomancy: Ship the book as a 3-ring binder in the first place. That helps.

14:38 (with patches)

14:38 danneu: justin_smith: i get a mismatched arg-count to recur

14:39 joshuafcole: hah

14:39 borkdude: I 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:39 dbasch: danneu: yes, just (recur)

14:39 TimMc: (note: this is actually a thing)

14:39 borkdude: maybe pretty useless ;)

14:39 dbasch: danneu: oh, you want to call another arity

14:39 csd_: justin_smith: any idea what's wrong with my syntax/usage?

14:39 ((-> (ScheduledThreadPoolExecutor. 10) (.scheduleAtFixedRate #(println "hello") 0 5 TimeUnit/SECONDS)) (Thread/sleep 5000))

14:40 I'm getting an error about java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask cannot be cast to clojure.lang.IFn

14:40 justin_smith: csd_: looks like you have extra parens

14:40 yeah, extra parens will do that

14:40 hiredman: (foo bar) is calling foo with the argument bar

14:41 joshuafcole: rainbow parens + paredit were a huge quality of life improvement for me when I started to get serious about clojure

14:41 dbasch: danneu: why would you want to avoid mentioning the function name?

14:41 joshuafcole: extra/to few/mismatched parens became dramatically less likely

14:41 csd_: justin_smith: i don't think so

14:42 justin_smith: that thread does not return a thing you can call

14:42 hiredman: ^- (foo bar) is calling foo with the argument bar

14:43 csd_: what do you mean? i was thinking that if you go into Thread/sleep that the scheduler would keep hitting the function

14:43 TimMc: danneu: Yes, you give the function another argument, and you call it like (foo foo ...) instead of (foo ...)

14:43 danneu: dbasch: 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:43 justin_smith: csd_: your (-> ...) call is in the function position

14:43 csd_: it does not return a function

14:43 TimMc: and from there you're on your way to the y combinator

14:43 csd_: ohhhhhh

14:46 borkdude: cfleming to be honest I don't get the "default" build configuration thing in Intellij. how do you launch one, without copying one

14:47 justin_smith: csd_: without the extraneous parens or the sleep, that code runs for me

14:47 (once I import the proper classes)

14:47 cfleming: borkdude: Yeah, that is confusing. Think of the default builds as templates, which you copy to create your configs.

14:48 csd_: justin_smith: I wrapped it in a do loop, but I don't receive the println with or without the sleep statement

14:49 kenrestivo: is 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:49 justin_smith: csd_: 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:49 pepijndevos: What's the deal with primecoin? Just go a primecoin for a merged Clojure patch. dafuq.

14:49 justin_smith: csd_: since *out* is a dynamic var

14:49 ztellman: kenrestivo: the channel capabilities aren't exactly new

14:49 csd_: oh there it is

14:49 ztellman: I think they're three years old at this point

14:49 maybe more

14:50 csd_: that is something that is still confusing to me--which buffer cider prints to when

14:50 pepijndevos: Tips 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:50 justin_smith: csd_: *out* is bound dynamically per thread, so new threads will look for the root binding, which isn't the repl window

14:50 csd_: yes, it is weird

14:51 csd_: how can i kill these threads in the repl?

14:51 ztellman: kenrestivo: check out https://github.com/ztellman/aleph/blob/master/src/aleph/formats.clj#L499

14:51 dbasch: pepijndevos: a primecoin is about $0.20

14:52 kenrestivo: ztellman: from the man himself! thanks!

14:53 pepijndevos: Is it like an official thing, or some random dude just put $5 on that site?

14:54 justin_smith: csd_: you need a handle to the executor or at least the task that got scheduled I think

14:54 csd_: though I think technically there is a way to get a collection of all threads, find yours, and mess with that directly

14:54 csd_: gotcha

14:54 ok thanks for your help with this

14:54 justin_smith: np

14:55 technomancy: pepijndevos: huh, sounds like bitcoin, except computing actually useful results instead of garbage?

14:55 pepijndevos: technomancy, right... well... useful in some sense of the world.

14:55 technomancy: sure

14:55 now if we could use it to detect extraterrestrial intelligence ... =)

14:55 pepijndevos: kinda like those @home screensavers haha

14:56 That would be a valuable currency, one starcoin for every alien found.

15:10 danneu: kenrestivo: 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:15 kenrestivo: danneu: thanks

15:18 borkdude: cfleming how about referring doc and source in repl by default?

15:19 TimMc: pepijndevos: Oh man, thank you for reminding me of SETI@home!

15:28 turbofail: interesting response to that "good bad and ugly" talk: http://www.cl.cam.ac.uk/~srk31/blog/2014/10/07

15:28 justin_smith: turbofail: yeah, I liked that article

15:28 turbofail: definitely captured some things that i was having trouble putting to words

15:29 puredanger: one 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:30 so I'm chalking those articles up as a win :)

15:30 technomancy: I wrote out a ton of types over the weekend; it was a blast https://github.com/technomancy/cooper/blob/master/cooper/cooper.rkt

15:31 justin_smith: turbofail: 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:32 puredanger: indeed, I think he captured some subtle points with clarity

15:38 turbofail: technomancy: where is that space dinosaur from?

15:38 technomancy: turbofail: http://midasflesh.com

15:38 it's super-great

15:39 justin_smith: I can concur, it's an awesome comic

15:40 technomancy: it'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:40 also one of the freedom fighters happens to be a dinosaur who uses lasers and jetpacks. need I say more?

15:40 turbofail: heh

15:40 m1dnight_: typesystem discussions are always kind of dangerous :p

15:40 Will read the paper though, looks interesting

15:40 If you have more, please share! :)

15:41 I'm following a course this year about formal definitions of type systems and my interest is sparked

15:42 kenrestivo: things not to discuss in polite company: politics, religion, sex, editors, and type systems

15:42 justin_smith: m1dnight_: 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:43 m1dnight_: hahaha :D

15:43 justin_smith: technomancy: btw, hypercard clone - cool!

15:43 hiredman: alternatively things you only discuss in polite company

15:44 technomancy: justin_smith: thanks! we'll see where it goes. it's been a lot of fun so far.

15:44 hoping to post on my blog about it soon

15:47 mikerod: I thought the "good, bad, and ugly" talk on types was very opinionated and wasn't always strongly backed something concrete, other than feelings

15:48 I was interested in being convinced of some points on typing, but instead just felt it was a "rant"

15:49 m1dnight_: hmm, if I pass (rest '(1 2 3)) to (fn [operands] ..) I get an error that I passed two arguments instead of one

15:49 what am I missing here?

15:49 Shouldn't rest be a list and thus operands be bound to*a* list?

15:50 Bronsa: m1dnight_: can you paste the actual code?

15:50 m1dnight_: sure

15:50 hold on

15:50 https://www.refheap.com/91364

15:51 I would expect (evaluate-application) to receive a list, but it's not happening, for some reason

15:51 oooh, the apply

15:51 Now I get it

15:52 Bronsa: yeah, it's the apply on (evaluate-application operator)

15:52 m1dnight_: you want (fn [& operands] instead of (fn [operand] if I understand correctly

15:55 daGrevis: hi! is it bad to map fn with sideeffects?

15:56 justin_smith: daGrevis: 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:56 daGrevis: i need to call fn on each element in list and it doesn't work without doall so it feels kind of hackish

15:56 justin_smith: doseq?

15:56 clojurebot: doseq is like for, but for side effects instead of values

15:56 justin_smith: thanks, clojurebot

15:58 daGrevis: wow, thanks!

15:58 technomancy: I would say it's bad either way

15:58 daGrevis: til

15:58 technomancy: map indicates you're interested in values

15:59 daGrevis: well my exact situation is that i have webrtc connections and a send-data fn. i want to call send-data on each connection

15:59 like a foreach in python for example

15:59 technomancy, i don't care about return values

15:59 justin_smith: yeah, doseq is probably what you want then

16:00 scgilardi: technomancy: I think you've won me over on if vs. when

16:01 ... in which the virtues of the one-armed if are extolled

16:02 technomancy: scgilardi: nice; welcome to the club.

16:02 daGrevis: yes, doseq works perfectly! thanks

16:03 technomancy: I'll have them send your club sweater to the address we have on file.

16:03 justin_smith: a one armed if framed me - now I am a Fugitive

16:03 scgilardi: :)

16:04 jeremyheiler: why is a one armed if better than when?

16:05 technomancy: jeremyheiler: it communicates intent to return a value rather than perform a side effect

16:05 jeremyheiler: ah, cool

16:05 scgilardi: so more "when is a one-armed if better than when"

16:06 technomancy: indeed

16:07 wei_: it’s more annoying to put in debugging “info” forms into if statements, but that’s a bit of an edge case

16:07 technomancy: wei_: (doto x prn) can be put nearly anywhere

16:08 wei_: ah. i always forget that doto isn’t just for java interop

16:08 technomancy: my favourite is (doto 'my.ns require in-ns) in the repl =)

16:09 wei_: lol. when do you require + in-ns over simply ns ?

16:09 technomancy: wei_: in the repl, if the ns exists on disk

16:09 justin_smith: wei_: simply ns creates the namespace without loading any of your code that goes with it

16:10 wei_: i see

16:11 just found a good alternative to my usual (ns proj.core) (load “core”)

16:20 m1dnight_: 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:20 But yeah, immutable structures and all

16:21 justin_smith: m1dnight_: not without doing evil stuff that relies on implementation details

16:21 m1dnight_: I presumed

16:21 darn

16:21 justin_smith: maybe you want a finger-tree?

16:21 you can do things like that efficiently with immutible finger-trees

16:22 https://github.com/clojure/data.finger-tree

16:22 m1dnight_: looks like a good idea yes :D

16:22 thanks justin_smith

16:22 justin_smith: np

16:23 m1dnight_: Porting this scheme evaluator is not as easy as I anticipated

16:23 donbonifacio: hey, 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:24 justin_smith: donbonifacio: would it be ok to get the same one twice?

16:24 donbonifacio: no, just once

16:24 rnd-nth and sets?

16:24 justin_smith: I was just thinking that, yeah

16:24 m1dnight_: lazy seq of permuatations and random get twice?

16:25 justin_smith: a set makes sense if none of the items would appear twice

16:25 m1dnight_: that's O(n) for each select / remove though

16:25 m1dnight_: well, that's true

16:25 justin_smith: you can't do rand-nth on a set though

16:25 donbonifacio: humz

16:26 justin_smith: pick two random ints above -1 and below (count coll) that are not equal and get those two indexes?

16:27 Qerub: I’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:28 find-var would have worked if var-name was fully qualified.

16:29 justin_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:29 clojurebot: ([:a 0] [:b 1])

16:29 justin_smith: distinct ensures you don't get two identical indexes

16:29 jassa: Hi there

16:29 does anyone know what would be the best way to prevent output when running tests?

16:29 donbonifacio: thanks justin_smith :) I'll study that

16:29 nkozo: Qerub: resolve

16:30 Qerub: nkozo: Ooh, shiny. Will that resolve the symbol in the namespace of the macro invoker?

16:30 nkozo: Qerub: yes, to resolve in other namespace use ns-resolve

16:31 justin_smith: jassa: 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:31 nkozo: Qerub: resolve is only a helper wrapping ns-resolve

16:31 justin_smith: s/function scope/lexical scope

16:31 Qerub: nkozo: So is *ns* bound to the namespace of the macro invoker?

16:32 cfleming: borkdude: I could do that - does REPLy do that by default?

16:32 nkozo: Qerub: I think yes, but try it, maybe I'm remembering wrong

16:32 borkdude: cfleming in the user namespace it does I think

16:32 Qerub: nkozo: Allright. Thanks a bunch!

16:32 cfleming: borkdude: There are a couple of things that are loaded by default that I do, but I can't remember the details.

16:33 borkdude: cfleming but maybe that's what happened, I wasn't in the user namespace

16:33 justin_smith: donbonifacio: 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:33 borkdude: cfleming so never mind then ;)

16:34 cfleming: borkdude: Right, it's clojure.main/repl-requires

16:35 borkdude: Which includes doc and source.

16:35 donbonifacio: justin_smith: yes, thanks for the extra description :)

16:35 borkdude: cfleming cool

16:35 justin_smith: ,([10 9 8 7 6] 3)

16:35 clojurebot: 7

16:39 jassa: @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:39 nkozo: Qerub, but take care when calling macros from macros: https://gist.github.com/nahuel/a07db3003ad22bda17a0

16:39 jassa: justin_smith: I've tried using `with-out-str` but it returns a string where I would like to return some other data

16:41 justin_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:41 Qerub: nkozo: Thanks, that will probably bite me.

16:43 justin_smith: jassa: sounds like a logger configuration issue

16:44 arohner: jassa: this probably isn't helpful, but that's easy if you build your app around stuartsierra/component

16:44 justin_smith: jassa: for printlns why not just (binding [*out* ...] ...)

16:44 arohner: which I highly recommend anyways

16:44 justin_smith: providing some output stream that does not print

16:46 jassa: Thanks guys I'll check that out

16:55 mercwithamouth: so would you say Om isn't production ready?

16:56 mdrogalis: That ship has sailed. :)

17:10 kenrestivo: ship?

17:11 justin_smith: kenrestivo: http://en.wiktionary.org/wiki/that_ship_has_sailed

17:12 kenrestivo: i'm familiar with the idiom. i wasn't so clear on what you were referring to?

17:13 justin_smith: "I already use it in production, so it's too late to decide if it is production ready" maybe

17:13 mercwithamouth: =( someone told me it wasn't production ready...i don't see why it wouldnt be

17:14 not that i'm all that knowledgeable as of yet

17:15 dbasch: Real artists ship. The realest artists Titanic.

17:16 “the ship can’t sink, sir. It’s as production-ready as it gets”

17:17 m1dnight_: Hmmm, I'm making another stupid mistake and I'm asking for your help, again :p

17:18 mercwithamouth: =P

17:18 m1dnight_: I have defined a deftype "Binding" in namespace meta-clojure.prototype.binding. I want to use this type in ns meta-clojure.core

17:18 So I type (ns meta-clojure.core (:import [meta-clojure.prototype.binding Binding]))

17:19 But that doesn't seem to work. (ClassNotFoundException)

17:19 hiredman: unless the namespace has been loaded the type hasn't been created

17:19 m1dnight_: So I tried :use, replace dash with underscore, omit "Binding",.. I can't figure it out

17:19 puredanger: how do you intend to "use" it?

17:20 construct instances?

17:20 m1dnight_: yes, indeed

17:20 example: https://www.refheap.com/91370

17:20 clojurebot: No entiendo

17:20 justin_smith: m1dnight_: require the ns, then import the type?

17:21 m1dnight_: justin_smith: then I get "unable to resolve classname Binding"

17:21 puredanger: if you require the ns, you can just use the constructor function ->Binding

17:21 Bronsa: m1dnight_: you need to require the namespace, if you don't need to test for `instance?` just use ->Binding

17:21 justin_smith: m1dnight_: you have to munge the class name for import

17:21 meta_clojure.prototype.binding

17:22 m1dnight_: I tried that as well, "unable to resolve classname" :p

17:22 But in the namespace itself I can just cal (Binding. "foo" "bar"), so shouldn't that work as well in the core namesapce?

17:22 namespace*

17:23 (:require [meta_clojure.prototype.binding]) # This is what's required at the moment. I thought that should work.

17:23 Bronsa: m1dnight_: (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:23 puredanger: deftypes 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:23 ed-g: hello, does anyone know how to define a composite primary key in Korma?

17:24 m1dnight_: well the latter did the trick Bronsa

17:24 Bronsa: I sometime wish deftype generated an instance check predicate too

17:24 m1dnight_: require and import

17:25 puredanger: Bronsa: +1

17:25 m1dnight_: (inc Bronsa) ; Am I doing this right? :p

17:25 lazybot: ⇒ 57

17:25 m1dnight_: It's confusing though, the namespace stuff. Regular functions only require a :use or :import, but deftype requires require and import.

17:25 (I'm blaming me, though)

17:26 puredanger: Bronsa: btw, I suspect there may be questions re the great jira shuffling, if so let me know

17:27 Bronsa: m1dnight_: 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:27 justin_smith: m1dnight_: import is never needed, it's a convenience so you don't have to type out the full package with the class

17:27 m1dnight_: Oh, let me try something, brb

17:28 Bronsa: puredanger: sure :)

17:28 m1dnight_: Oh indeed, require loads the namespace, and then I can identify Binding with (meta_clojure.prototype.binding.Binding. ..)

17:29 so import is as you said justin_smith , for convenience's sake

17:29 Qerub: nkozo: 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:29 puredanger: Bronsa: 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:29 Bronsa: puredanger: there were tears of joy shed by many earlier today when CLJ-1297 got applied

17:29 puredanger: yeah guessed as much

17:29 puredanger: you're welcome :)

17:30 many battles were fought today :)

17:30 one thing that would be great to have more wider feedback on is http://dev.clojure.org/jira/browse/CLJ-1529

17:31 mdrogalis: puredanger: That's really nice to hear - about 1.7 :)

17:31 puredanger: Rich 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:31 justin_smith: cfleming: I wonder if the racket folks are imitating you here https://twitter.com/racketlang/status/519565183937970176

17:32 puredanger: I 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:32 would love to hear feedback on those from private code bases

17:33 mdrogalis: I'll give it a whirl

17:34 puredanger: question 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:34 cfleming: justin_smith: Ha, nice - I doubt I can claim that they're copying me, but that looks great

17:35 ztellman: puredanger: I feel like there would have been a bug report if someone stumbled across the current semantics

17:35 it's such a weird precedence

17:35 puredanger: agreed, I think it's unlikely

17:35 and I've run with this patch on a bunch of projects

17:35 Bronsa: uhm, so, other than . also catch and new currently privilege classes over locals

17:36 should they get handled aswell if ztellman's patch gets accepted?

17:36 puredanger: that is the other question to figure out - where does this change semantics and how and what needs to change

17:36 ztellman: Bronsa: currently let-bound variables that share names with classes are shadowed by the classes

17:36 hiredman: well, they don't privilege right? new and catch *must* have classes

17:36 cfleming: puredanger: what is the status of feature expressions? I saw the design doc had been updated.

17:36 Bronsa: ,(let [String 1] (String. ""))

17:36 clojurebot: ""

17:37 hiredman: . could get a class or local

17:37 ztellman: unless you have code that looks like (catch Exception String ...)

17:37 Bronsa: hiredman: yeah I guess you're right

17:37 ztellman: it doesn't affect you

17:37 cfleming: puredanger: I'll see if I can find some time to compile Cursive with that patch and see if it helps

17:39 puredanger: cfleming: 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:39 cfleming: puredanger: Ok, are you going to be updating that soon? I'd be interested in knowing what I'm in for.

17:40 puredanger: yes

17:40 1.7 remaining work is now down to http://dev.clojure.org/jira/secure/IssueNavigator.jspa?mode=hide&requestId=10519

17:40 so that's my current focus

17:40 cfleming: puredanger Bronsa: Tears of joy were also shed by me when 1330 was merged in.

17:41 Bronsa: puredanger: 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:41 puredanger: example?

17:41 Bronsa: "resolved" actually

17:41 http://dev.clojure.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+=+CLJ+AND+fixVersion+=+"Release+1.7"+AND+status+=+Resolved+ORDER+BY+priority+DESC&mode=hide

17:42 cfleming: :P

17:42 puredanger: cfleming: you were no small reason for 1330 going in, so thanks on that

17:42 Bronsa: I'll take care of them

17:42 Bronsa: puredanger: cool

17:43 cfleming: puredanger: What's the use case for user-defined feature expressions?

17:44 puredanger: many examples floating around. one would be specializing something in cljs for node

17:44 cfleming: puredanger: And am I reading that correctly that I could do #+(cljs and node) ?

17:44 puredanger: yes

17:45 cfleming: puredanger: Damn

17:45 puredanger: I get that a lot

17:45 cfleming: puredanger: I suspect it's usually more appreciative than that one was ;)

17:45 Bronsa: (inc puredanger)

17:45 lazybot: ⇒ 16

17:46 puredanger: I'm glad it was appreciative :)

17:46 cfleming: puredanger: Supporting that is going to be... interesting.

17:46 puredanger: there are patches out there for clj, tools.reader, cljs that do most of what's on the page

17:48 cfleming: puredanger: So I could construct a frankenclojure with those features now to test with?

17:49 puredanger: yep. I have done so and rebuilt some mixed clj/cljs projects with them (instead of clix) with some success

17:50 cfleming: puredanger: Ugh, I should have read that page more recently - I read it ages ago when it was just an RFC really

17:50 puredanger: Supporting debugging with this is going to be hard.

17:51 puredanger: yes, it presents some difficulties.

17:52 cfleming: puredanger: Is there an ETA? Sounds like soon, right?

17:53 puredanger: I'll be working on it tomorrow. gotta run atm…

17:53 cfleming: puredanger: I meant for the final release - no worries, I won't have time to work on this for a while anyway.

17:55 puredanger: yes, soon as it's done OR if there are unresolvable issues then will get kicked out of 1.7

17:56 nkozo: core.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:56 or both the chan and the go-block will be GC'ed without continuing the execution?

17:57 hiredman: I may be wrong, but I am pretty sure the go block is referencing the channel

17:57 nkozo: hiredman: in that case, who is referencing the go block?

17:58 hiredman: nkozo: for informal reasoning purposes just assume a go block is a gc root like a thread

17:59 (the go block when parked needs be put somewhere with some information about what it is parked awaiting for)

17:59 nkozo: hiredman: so my sample will leak memory?

18:00 hiredman: nkozo: if you spin up a thread trying to pull something from a queue you never put anything in, is that leaking memory?

18:02 nkozo: hiredman: 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:03 hiredman: nkozo: I suppose that could be the case

18:03 nkozo: hiredman: thanks

18:07 hiredman: you may be right, so that is an interesting question, I doubt the channel is closed before it is gc'ed

18:10 m1dnight_: aw yisss, evaluation of defines and primitives works!

18:10 time to go to bed :D

18:13 only downside, I have implemented my own linkedlist such that I can modify an environment

18:13 There probably is a pure functional way but I can't think of one with a fried brain atm

18:15 justin_smith: m1dnight_: if you want a mutable list with easy insert and setcdr, why not java.util.LinkedList?

18:16 oh wait, maybe java.util.LinkedList doesn't have a setcdr

18:16 m1dnight_: well, I wanted to stay away from java for.. some reason

18:17 I did get to know deftype and definterface though

18:17 so not all was in vain

18:20 gfredericks: m1dnight_: writing a lisp or something?

18:27 m1dnight_: 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:27 Since the software lab at my uni is a fan of scheme I decided to implement a simple scheme IDE

18:28 and no IDE without evaluation, so i'm quickly mashing up an evaluator

18:29 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:31 gfredericks: HUH.

18:31 actors with shared memory is not an oxymoron?

18:33 justin_smith: gfredericks: 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:34 m1dnight_: gfredericks: that is the entire point. Study how we can combine them safely without violating constraints of either model.

18:35 gfredericks: I assumed "acting on that STM" was something like a bunch of clojure threads punching some refs

18:35 rather than passing messages

18:35 m1dnight_: 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:35 exactly what you say :)

18:36 clojure threads being actors in this case

18:36 tuft: actors in a more abstract sense it sounds like vs erlang's or something

18:36 m1dnight_: But if I were to hold message sends back until the transactino completes, i would solve that problem.

18:36 no I'm sticking to the vanilla actor model, except he locality semantics

18:36 the*

18:38 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:38 justin_smith: m1dnight_: 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:39 m1dnight_: :D :D :D

18:39 anyway, i'm off to bed

18:39 tomorrow is thesis-day!

18:39 nn guys o/

18:50 AeroNotix: is 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:59 brainproxy: hmm, 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:59 there

18:59 which is not what I want... I'd like to just spec the port and make a direct connection

19:03 nwolfe: brainproxy: so you don't want to cider-jack-in then?

19:09 brainproxy: I think I just want cider-connect

19:09 the repl is running on an external host

19:09 on port 7888

19:10 nwolfe: Ah, just making sure. Not familiar enough with cider-connect to help

19:10 justin_smith: brainproxy: I hope this is on a locked down lan that you don't share btw

19:11 brainproxy: justin_smith: yes, sure, it's in a dev env on my laptop consisting of various layers of vagrant and docker

19:14 I'm experiencing what's described here: https://github.com/clojure-emacs/cider/issues/822

19:14 but it seems like it should have been solved...

19:19 dbasch: “A clojure library designed to… well, that part is up to you” http://goo.gl/ezp9zi

19:19 56k results

19:19 gfredericks: okay I'm gonna figure out a way to suppress leiningen's tools.nrepl dependency

19:19 I'm thinking a leiningen middleware at worst right?

19:20 gonna need to make a library called lein-nrepl-suppressor

19:20 technomancy: gfredericks: remove it entirely, instead of replace it?

19:21 gfredericks: well I want to replace it by a dep with a different group name

19:21 so depends on your perspective I guess

19:21 technomancy: oh, I see

19:23 * gfredericks starts using the groupId com.gfredericks.forks.<original-group-id> for forks

19:23 noonian: gfredericks: i've only gotten that to work by building it yourself and linking your lein script to it

19:23 gfredericks: noonian: building what?

19:23 noonian: leiningen

19:23 gfredericks: noonian: do you know why a middleware wouldn't work?

19:25 noonian: gfredericks: 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:26 * gfredericks sudo apt-get install maven2

19:27 gfredericks: noonian: middleware can arbitrarily edit the project map, so I assume just fish around for the nrepl dep under :dependencies and remove it

19:27 technomancy: gfredericks: the problem there is if you mash the project map directly it doesn't survive a re-merge of profiles

19:28 noonian: gfredericks: 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:29 gfredericks: technomancy: oh man what on earth? why? huh?

19:29 re-merge??

19:29 lazybot: gfredericks: What are you, crazy? Of course not!

19:30 technomancy: gfredericks: 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:30 visof: what 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:30 what is the best way to this

19:30 ?

19:30 technomancy: if 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:30 noonian: visof: update-in

19:31 might be off, one sec

19:31 ,(update-in {:foo []} [:foo] conj "bar")

19:31 clojurebot: {:foo ["bar"]}

19:31 gfredericks: technomancy: okay so if I mash both the project map and its metadata then...nevermind

19:32 technomancy: I'll dig as deep as I need to into this and let you know what I come up with :)

19:32 technomancy: gfredericks: yeah, that would do it. it's just ... un-ideal

19:33 gfredericks: my quip earlier about "Leiningen: the Good Parts" was partly about this specific misfeature

19:52 noonian: technomancy: 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:52 technomancy: noonian: thanks =)

19:52 I forget, did she link to http://atreus.technomancy.us?

19:53 gfredericks: technomancy: but it's not the original project map that has tools.nrepl, it's the base profile, amirite?

19:53 Cr8: I got an ergodox - but those tiny diodes man

19:53 still working on it =P

19:53 noonian: i don't think so, that was months ago and i just now saw the atreus (i think someone linked to it from redit)

19:54 technomancy: noonian: cool, on r/mechanicalkeyboards?

19:54 noonian: yeah, i ordered the most recent kit on massdrop so i'm learning to sodder and collecting tools now heh

19:54 technomancy: yeah in response to someones ergodox pics i think

19:54 the comments i mean

19:54 technomancy: gfredericks: well, profiles are looked up in the project map

19:55 gfredericks: well I can't just remove :base

19:55 do the full profiles get nested in there first?

19:55 technomancy: gfredericks: I think you need to reach into :profiles and possibly :profiles on metadata too, but I'm super fuzzy on this

19:56 gfredericks: I imagine if I examined how with-profile is implemented I would understand all the pieces involved?

19:56 technomancy: you'll want to explore in a repl

19:57 gfredericks: clojurebot: you'll |want| to explore in a repl

19:57 clojurebot: Ack. Ack.

19:57 technomancy: words to live by

19:57 noonian: 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 I'm tried: (GET "/styles" [] (resp/resource-response "app/styles" {:root "public"}))

19:58 doesn't work

19:59 noonian: technomancy: i'll check my history it was like yesterday but gimme a sec i'm at work

20:02 justin_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:04 justin_smith: resource or resources?

20:05 _pr0t0type_: resources

20:05 sorry

20:05 if I try to route a specific file (ie index.html) it works just fine

20:05 but I can't make it work with

20:05 dirs for some reason

20:05 for instance, this works:

20:05 (GET "/" [] (resp/resource-response "app/" {:root "public"}))

20:05 sorry, I mean

20:05 (GET "/" [] (resp/resource-response "app/index.html" {:root "public"}))

20:06 works

20:07 justin_smith: the 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:07 resource-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:08 justin_smith: wrap-resources is a middleware that gets applied to your handler

20:08 sorry, not wrap-resources, but wrap-resource

20:08 _pr0t0type_: Let see if this worksl Can I thread it via the (defroutes) call?

20:08 justin_smith: https://github.com/mmcgrana/ring/wiki/Static-Resources

20:09 _pr0t0type_: ie

20:09 (-> (defroutes app-routes …) (wrap-resource))

20:09 lets see...

20:09 justin_smith: yeah, except wrap-resources also take a base directory argument (likely "public"

20:09 )

20:10 _pr0t0type_: gotcha

20:11 noonian: technomancy: 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 justin_smith: it worked, thanks dude

20:11 justin_smith: np

20:11 _pr0t0type_: (def app

20:11 justin_smith: usually works for me :)

20:11 _pr0t0type_: :)

20:12 technomancy: noonian: no worries

20:54 gfredericks: technomancy: actually I might just use :injections to monkey-patch my nrepl changes and not worry about it

21:01 iamdustan: Luyt_: nah. I’ve abandoned codeeval for exercism.io

21:15 brainproxy: Raynes: is laser dead/dying?

21:16 Raynes: brainproxy: 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:16 brainproxy: Raynes: gotcha, thanks for the quick feedback

21:17 Raynes: If 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:17 brainproxy: looks like cgrand has something new-ish cooking w/ enliven?

21:17 though looks like enlive has been updated more recently than enliven

21:34 gfredericks: this 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:34 anybody know if that's *supposed* to happen?

21:35 * gfredericks can't figure out how this thing ever worked in the first place

21:38 jeremyheiler: gfredericks: the readme seems to show the repl profile as an example

21:38 of putting your stuff in a diff profile, not as if the repl profile is already there

21:39 gfredericks: jeremyheiler: it does it internally too

21:39 jeremyheiler: hmm

21:39 gfredericks: if I use the plugin in the basic fashion, it does nothing for `lein repl` but does for `lein with-profile +repl repl`

21:39 jeremyheiler: oh i see

21:40 gfredericks: independently I can't figure out how it expects to work as a middleware alongside the builtin pr-str middleware

21:40 right now I'm actually seeing the incorrect behavior of having both of them running at once

21:41 either 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:41 I also saw it work correctly a few weeks back but have no idea how to reproduce that

21:44 oh nevermind I see what it does

21:44 it's right after the "Here's where things get ugly" comment :)

21:46 jeremyheiler: heh, i was just looking at that part

21:47 still, it expliclitly alters the repl profile

21:47 gfredericks: sure, my original question is whether I should expect the repl profile to be active for the repl command

21:48 jeremyheiler: ah

21:49 arrdem: AFAIK it is

21:49 cider does `lein repl :user` tho..

21:49 gfredericks: yeah?

21:49 well still I'm not using cider in this instance

21:50 arrdem: just a thought

21:50 jeremyheiler: i dont' think repl is a built in profile, if that's what you mean

21:56 ok, it is there. so... why isn't it active then? hmm

21:56 gfredericks: what's there?

21:56 in the repl task?

21:57 jeremyheiler: yeah

21:57 https://github.com/technomancy/leiningen/blob/master/src/leiningen/repl.clj#L285

21:57 gfredericks: I'm getting the same behavior on another machine

21:57 jeremyheiler: i treid it and got the same too

21:58 gfredericks: phew

21:59 well I think I have to declare defeat right there for the evening and pick up being defeated some other day

21:59 jeremyheiler: heh.

22:00 gfredericks: jeremyheiler: thanks for poking around

22:00 jeremyheiler: it was fun

22:05 cfleming: gfredericks 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:09 jeremyheiler: heh! i like it conceptually, tho

22:10 cfleming: jeremyheiler: Sure, in theory it's quite simple, but you know what they say about theory and practise

22:11 pdk: is it that they say to spell practice with a c

22:12 jeremyheiler: cfleming: yeah, you get things like !important :-P

22:13 cfleming: pdk: They could start with that, yes

22:34 technomancy: gfredericks: :repl not getting loaded might be a 2.5.0 bug

22:53 danielcompton: amalloy: flatland/useful doesn't accept github issues. Should I put one on amalloy/useful?

22:54 amalloy: danielcompton: yeah, i suppose so. i wish flatland were still the primary, but then my user profile looks like i never do anything

22:55 danielcompton: amalloy: because 'popular repositories' only shows ones you own?

22:55 arrdem: amalloy: I think they fixed that... I'm totally getting credit for shit done on the grimoire group

22:55 danielcompton: amalloy: you would get to 'contribute' to your own repo :)

22:58 cddr: If 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:59 arrdem: cddr: waiting for threads to exit usually

23:03 devn: ,shutdown-agents

23:03 clojurebot: #<core$shutdown_agents clojure.core$shutdown_agents@182cbe9>

23:03 devn: ,(shutdown-agents)

23:03 clojurebot: #<AccessControlException java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread)>

23:04 devn: ,(doc shutdown-agents)

23:04 clojurebot: "([]); Initiates a shutdown of the thread pools that back the agent system. Running actions will complete, but no new actions will be accepted"

23:06 cddr: Interesting. Thanks!

23:12 justin_smith: arrdem: wait, he was asking why the Shutdown caused it to exit sooner, not why it would hang and not shut down...

23:15 cddr: It 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:16 justin_smith: oh, OK, I misunderstood the discussion, clearly

23:18 cddr: Nah I'm just bad at IRC.

23:18 caar: damn how is this not taken

23:21 justin_smith: you would think some crusty old lisper would have taken that one

23:22 arrdem: that's what I was expecting...

23:23 although having more than two c[ad]*r in one channel would probably be silly

23:24 justin_smith: talk to the caaar because the cadar ain't listenin honey

23:25 actually that didn't make any sense at all, apologies

23:30 zanes: Why 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:30 I didn’t refer ‘update’.

23:30 Why is it mad?

23:31 arrdem: zanes: plumbing is defining plumbing.core/update, which shadows clojure.core/update in the namespace plumbing.core

23:31 justin_smith: you automatically refer clojure.core

23:31 arrdem: zanes: it's just a warning. you're ok

23:31 justin_smith: you can use (:refer-clojure :exclude [update]) in your ns decl to fix this

23:31 zanes: Oh! So it’s Prismatic’s fault?

23:31 arrdem: zanes: yep

23:32 zanes: They didn’t :refer-clojure :exclude [update]?

23:32 I see.

23:32 That’s irritating.

23:32 arrdem: zanes: bingo

23:32 zanes: see if there's a ticket open :P

23:32 justin_smith: oh, they would need to do the :exclude

23:32 update is a recent function right?

23:32 (doc update)

23:32 clojurebot: "([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:32 zanes: I guess this is what I get for using the 1.7.0 beta.

23:32 arrdem: justin_smith: yeah

23:32 justin_smith: it could be newer than prismatic

23:32 arrdem: justin_smith: it's new in 1.7

23:32 zanes: Yeah.

23:32 I bet they’re still on 1.6.x.

23:32 jeremyheiler: oh nice, finally getting update!

23:32 zanes: Never mind. My anger is misplaced.

23:33 arrdem: &(:added (meta #'clojure.cure/update))

23:33 lazybot: java.lang.RuntimeException: Unable to resolve var: clojure.cure/update in this context

23:33 zanes: clojure.cure sounds nice.

23:33 * arrdem mutters darkly

23:33 arrdem: &(:added (meta #'clojure.core/update))

23:33 lazybot: java.lang.RuntimeException: Unable to resolve var: clojure.core/update in this context

23:33 dbasch: but it’s not in 1.6

23:33 arrdem: &*clojure-version*

23:33 zanes: I bet lazybot isn’t on 1.7.

23:33 lazybot: ⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}

23:33 jeremyheiler: ,*clojure-version*

23:33 clojurebot: {:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}

23:33 justin_smith: clojure.cure/boys-don't-cry

23:33 arrdem: oh god lazybot's on 1.4 lol

23:34 jeremyheiler: ,(:added (meta #'clojure.core/update))

23:34 clojurebot: "1.7"

23:34 cddr: keep em coming justin_smith

23:34 devn: ,(:added (meta #'clojure.core/random-sample))

23:34 clojurebot: "1.7"

23:34 justin_smith: cddr: I try

23:35 dbasch: still no take-all and remove-all

23:35 devn: ,(:doc (meta #'clojure.core/update))

23:35 clojurebot: "'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:35 devn: ,(:arglist (meta #'clojure.core/update))

23:35 clojurebot: nil

23:35 devn: ,(keys (meta #'clojure.core/update))b

23:35 clojurebot: (:ns :name :added :file :static ...)

23:35 devn: ,(sort (keys (meta #'clojure.core/update)))

23:35 clojurebot: (:added :arglists :column :doc :file ...)

23:35 devn: ,(:arglists (meta #'clojure.core/update))

23:35 clojurebot: ([m k f] [m k f x] [m k f x y] [m k f x y ...] [m k f x y ...])

23:36 jeremyheiler: wait, the last two are the same?

23:36 aconbere: hey, 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:36 do I need to load the goog library?

23:36 jeremyheiler: oh, i bet it's just clojurebot cutting it off

23:36 devn: jeremyheiler: yeah

23:37 ,*print-length*

23:37 clojurebot: 5

23:37 jeremyheiler: cool

23:37 devn: ,(binding [*print-length* 10] (take 10 (range 100)))

23:37 clojurebot: (0 1 2 3 4 ...)

23:37 devn: :(

23:37 jeremyheiler: heh

23:37 dbasch: aconbere: are you compiling in dev or prod mode?

23:37 devn: ,(set! *print-length* 10)

23:37 clojurebot: 10

23:37 devn: ,(binding [*print-length* 10] (take 10 (range 100)))

23:37 clojurebot: (0 1 2 3 4 ...)

23:37 aconbere: dbasch: that's a hard question to answer :P

23:38 dbasch: which set of options do you consider dev and prod?

23:38 (I'm trying to compile currently with the set of options they call "release")

23:38 dbasch: aconbere: so release is probably what used to be prod

23:38 aconbere: makes sense

23:38 https://gist.github.com/aconbere/0e07d63293638ea654fd

23:39 dbasch: The last time that happened to me it had something to do with advanced optimizations

23:39 it worked fine with compiling in dev

23:41 aconbere: does it work with optimizations whitespace?

23:42 aconbere: let me try!

23:42 I tried :optimizations :none

23:42 and it didn't help

23:43 devn: ,(do (set! *print-length* 10) (take 10 (range 10)))

23:43 clojurebot: (0 1 2 3 4 5 6 7 8 9)

23:43 TEttinger: ,(do (set! *print-length* 10) (range))

23:43 clojurebot: (0 1 2 3 4 5 6 7 8 9 ...)

23:44 TEttinger: ,(do (set! *print-length* 20) (range))

23:44 clojurebot: (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...)

23:45 arrdem: oh just hurry up and hit Freenode's message limit

23:45 TEttinger: fine

23:45 ,(do (set! *print-length* 1000) (range))

23:45 clojurebot: (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:46 TEttinger: huh, no ) at the end

23:46 ,(do (set! *print-length* 1000) (range 1000 2000))

23:46 clojurebot: (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:47 dbasch: that’s numberwang

23:47 devn: :D

23:48 justin_smith: let's rotate the board...

23:48 (channel rotates, revealing a scala usergroup, and continues to rotate, bringing us back to normal)

23:48 devn: ,(do (set! *print-length* 1000) (interpose \s (map char (range))))

23:48 clojurebot: (\

23:49 kenrestivo: bot torture!

23:49 aconbere: omg

23:49 dbasch: I'm dumb, I was accidentally building my dev build >_<

23:50 devn: botsnack

23:50 TEttinger: ,(do (set! *print-length* 1000) (interpose \space (map char (range 160 256))))

23:50 clojurebot: (\  \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:50 devn: !botsnack

23:50 ,botsnack

23:50 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: botsnack in this context, compiling:(NO_SOURCE_PATH:0:0)>

23:50 devn: :(

23:50 justin_smith: ~botsnack

23:50 clojurebot: Thanks, but I prefer chocolate

23:50 dbasch: ~chocolate

23:50 clojurebot: actually I decided I prefer botsnacks after all.

23:50 devn: :(

23:50 TEttinger: ,(do (set! *print-length* 1000) (map str (interpose \space (map char (range 160 256)))))

23:50 clojurebot: (" " " " "¡" " " "¢" " " "£" " " "¤" " " "¥" " " "¦" " " "§" " " "¨" " " "©" " " "ª" " " "«" " " "¬" " " "­" " " "®" " " "¯" " " "°" " " "±" " " "²" " " "³" " " "´" " " "µ" " " "¶" " " "·" " " "¸" " " "¹" " " "º" " " "»" " " "¼" " " "½" " " "¾" " " "¿" " " "À" " " "Á" " " "Â" " " "Ã" " " "Ä" " " "Å" " " "Æ" " " "Ç" " " "È" " " "É" " " "Ê" " " "Ë" " " "Ì" " " "Í" " " "Î" "

23:50 justin_smith: $botsnack

23:50 lazybot: justin_smith: Thanks! Om nom nom!!

23:50 arrdem: $botsmack

23:51 devn: TEttinger: what im looking for is the simplest way to return the max length of message

23:51 including ...

23:51 TEttinger: on freenode?

23:51 irctc: wow, don't know that we have $botsnack ...

23:51 devn: TEttinger: yeah

23:51 irctc: $botsnack

23:51 lazybot: irctc: Thanks! Om nom nom!!

23:51 justin_smith: ,(map int "☃")

23:51 clojurebot: (9731)

23:51 devn: :D

23:51 TEttinger: devn, it gets complicated with unicode

23:51 justin_smith: ,(char 9731)

23:51 clojurebot: \☃

23:51 devn: ,(map int "☣")

23:51 clojurebot: (9763)

23:52 justin_smith: very nice

23:52 devn: TEttinger: indeed :D

23:52 TEttinger: im betting it can be fit into a single message though

23:52 (unicode invariants that is)

23:52 justin_smith: (map int "🐩") ; poodle

23:52 ,(map int "🐩") ; poodle

23:52 clojurebot: (55357 56361)

23:53 TEttinger: ,(apply str (repeat 256 "-☃"))

23:53 clojurebot: "-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃-☃

23:53 devn: ,(map int "𐤄")

23:53 clojurebot: (55298 56580)

23:53 TEttinger: ,(apply str (repeat 256 "-a"))

23:53 clojurebot: "-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:54 devn: ,(map int "𝇙")

23:54 clojurebot: (55348 56793)

23:55 devn: ,(map int "𐆠")

23:55 clojurebot: (55296 56736)

23:55 devn: hm

23:56 ,(map int "𐆛")

23:56 clojurebot: (55296 56731)

23:56 devn: ,(map int "�")

23:56 clojurebot: (65533)

23:57 * devn walks away

23:59 zanes: I think I just wrote the transducer version of condp.

23:59 I can’t tell if this was a good idea or not.

Logging service provided by n01se.net