#clojure logs

2013-11-23

10:51wakeupHi
10:51wakeupI am evaluating clojurescript, but I get this exception ony first run: Caused by: java.lang.RuntimeException: Unable to resolve var: reader/*alias-map* in this context
10:52wakeup(Run using lein cljsbuild once)
10:52wakeupAny ideas?
10:58emaphiswakeup: this may answer your question: https://groups.google.com/forum/#!topic/clojurescript/0F8lErJ0PPM
11:05wakeupemaphis: thanls, how do I update tools.reader?
11:07wakeupIt's not in my dependencies or anything.
11:09coventryAre the slides for Rich Hickey's core.async talk at Strange Loop available anywhere? The InfoQ presentation of his slides breaks for me at about 5 min 50 s.
11:15dnolenwakeup: what version of CLJS?
11:15dnolenwakeup: you must specify a version, and I recommend cljsbuild 1.0.0
11:53fakedrak`hello
11:56fakedrak`I think I have reddit.clj in ~/.m2 (in the sense that I did `lein install && mvn install' in my local custom copy of the project and the directory /home/fakedrake/.m2/repository/reddit/clj/reddit.clj/0.4.1/ now exists)
11:57fakedrak`and in another project that requires reddit.clj i have it in :dependencies
11:58fakedrak`but i get " Could not locate reddit/clj/core__init.class " when i run `lein test'
11:58fakedrak`any ideas?
11:58justin_smithdoes your dependency clause match the project pom?
11:59fakedrak`how do I check that?
11:59justin_smithwhat does your dependency look like?
12:00fakedrak`[reddit.clj "0.4.1"]
12:00fakedrak`hmm maybe I should make it 0.4.1-fakedrake
12:00justin_smithand is there a jar file in that m2 dir?
12:00fakedrak`yes
12:01coventryCheck that the jar is listed in in "lein classpath".
12:01justin_smithif you changed the version string, yeah, match the version string
12:01fakedrak`reddit.clj-0.4.1.jar in the above directory
12:01fakedrak`aha waith
12:02fakedrak`yes it is!
12:02fakedrak`(lein classpath, nice)
12:02wakeuprequest.onload = function () {...} in javascript can be exptressed how in clojurescipt?
12:02wakeupOh set!, my bad
12:09fakedrak`is there a standard clojure function that will return its single argument? namely i want (identity-fn x) => x
12:10justin_smithindentity
12:10justin_smitherr identity
12:10justin_smithyou almost had it
12:10justin_smith,(identity 'x)
12:10clojurebotx
12:12justin_smithfakedrak`: out of curiosity, what was the issue with your dependency?
12:13fakedrak`justin_smith: thanx! the usecase is this (some-fn :key1 :key2 :key3 identity)
12:13fakedrak`where if all else fails just give back what I provided
12:13fakedrak`ah sry wrong problem:P
12:14fakedrak`justin_smith: I have no idea what I did with the dep
12:14justin_smithit just started working?
12:14fakedrak`i just changed 1.4.6 to 1.4.6-fakedrake on both sides
12:14fakedrak`and it worked
12:14fakedrak`:P
12:14fakedrak`glad it did and it is cleaner this way but I have no clue why it didnt work before
12:15justin_smithI assume it is a fork you are using, and that's why you aren't just using the original?
12:15justin_smithyou can set up a clojars account and push your jar there also
12:17gfrederickswhen making a command-line tool, it is fun to have a *dry-run?* var, add ^:side-effect metadata to my functions, and then use robert.hooke to dynamically patch all the vars in the ns to check *dry-run?*
12:18gfredericksno it isn't.
12:18justin_smithfirst class parameterized namespaces would be nice
12:19justin_smithcall some namespace-constructor and get a paramaterized (configured) version of each function in the namespace
12:19justin_smithas a replacement for globals, some extra arg needed by every single function, etc.
12:19gfredericksHRM.
12:20justin_smithit could be done with an object or a clojure that returns functions
12:20gfredericks(def my-db-ns (partial clojure.java.jdbc my-db-config))
12:20justin_smithright
12:20justin_smiththe object / closure version is not as clean as just making a new ns though
12:22justin_smithbut maybe that idea is flawed
12:23justin_smithI mean what if some lib you are using needs a config - does it have its own config, and how do you force it to load a different config? does it chain? is that a clean design?
12:23justin_smithI would have to think over all the implications
12:23justin_smiththis could all be done without rewriting clojure though
12:26wakeup/ #j clojurescript
12:38gfredericksjustin_smith: I'm not sure I understand that question
12:38justin_smithif one wanted the configuration to be re-entrant
12:38justin_smithand if a configured namespace then wanted to configure another
12:38justin_smiththe sticky details
12:39coventryjustin_smith: Sounds like a stealth invasion of a big ball of mutable state to me. :-)
12:39coventrys/of/by/
12:39justin_smithright
12:40justin_smiththe point is to have a clean way to manage it, maybe the current system is fine for that
13:04gfredericksthank goodness wolfram is releasing that new PL or programming would keep being difficult
13:05justin_smithso is it mathematica with some extra syntax or what?
13:06bbloomi think it's literally just mathematica.
13:10gfrederickspresumably I don't need to know what it is exactly because it's just that easy
13:10justin_smithjust watch, it will rip off a bunch of stuff from haskell, then sue the haskell people for patent infringement
13:11justin_smithhttp://vserver1.cscs.lsa.umich.edu/~crshalizi/reviews/wolfram/
13:25silasdavisI have some json files in my project's resources folder
13:25silasdaviswhen I use AOT compilation they get copied to target/classes and target/test-classes
13:25silasdaviswhich causes duplications when I load using carica/resources
13:26silasdavisis there any way I can avoid this
13:26silasdaviscan someone explain why these files are copied/how I am misusing the resources folder?
13:28gfredericksI know leiningen lets you config a test resources directory...I wonder if that would prevent target/test-classes from getting /resources?
13:49cYmenI think Joy of Clojure is not a good book. I'm not sure we should recommend it to anyone.
13:50mysamdogWhat's wrong with it?
13:50cYmenTo be fair I'm only 2/3, through.
13:50emaphisOk, I'm a noob, what is a good book.
13:50cYmenemaphis: I don't know. I started with Joy of Clojure.
13:50cYmenI am a noob as well.
13:50mysamdoghttp://www.amazon.com/gp/product/1449394701?ie=UTF8&tag=httpcemericom-20&linkCode=shr&camp=213733&creative=393185&creativeASIN=1449394701&ref_=cm_sw_r_tw_dp_jCHKnb0966XJY
13:50justin_smithcYmen: what don't you like about it?
13:51mysamdogIt's called Clojure Programming, and it's great
13:51cYmenjustin_smith: Explanations of almost all matters are just terrible. You either already know how that stuff works or have to figure it out using online resources.
13:51emaphisI always like OReilly books
13:52cYmenAnd there are things, like their A* implementation, that I think is neither good nor in any way helpful learning clojure.
13:52emaphisI've heard Joy of Clojure isn't supposed to be the first book you read.
13:53cYmenAnd I just read half a chapter about prototype based inheritance and now I'm not even sure if that is a best practice or just something semi-clojure-related the authors wanted to talk about.
13:54cYmenemaphis: I have heard that as well but don't think it is good as a second book either.
13:54cYmenIt's not like it explains any complicated parts in more detail or whatever.
13:55scottjcYmen: I can't stand JoC either, but there are tons of people who love it, so it makes sense for each person to just recommend whatever book they like and not tell others what to recommend.
13:55cYmenThe usual disclaimers about, character, background and tastes apply of course...
13:56cYmenscottj: Yeah, but I think recommendations on IRC are reproductive.
13:57cYmenSomebody recommends it because somebody else recommended it and so on...
13:57coventrycYmen: Joy of Clojure is not a good book to learn the basics of clojure from.
13:57cYmenSo I just wanted to complain about it to put my opinion of it out there. :)
13:57justin_smithI don't recommend books I don't read, and I doubt many other people are doing that either
13:57cYmencoventry: Well, what would you think is it good for learning?
13:57coventryI thought they said something to that effect in the introduction.
13:58coventryClojure Programming. http://clojurebook.com
13:58justin_smithhttp://joyofclojure.com/foreword/ the caveats here are very clear
13:58justin_smith"it may not be an ideal first book on Clojure either. The authors assume you’re fearless and, importantly, equipped with a search engine"
13:59cYmenYes, well imho they might as well have written "this book is crap but it has a reference list in the back and provides ideas what to search for online"
14:00cYmenThat's not a reason to buy a book. And a disclaimer that it is crap doesn't make it less crappy.
14:00justin_smithit's not crap. It's just not an introductory text.
14:00cYmenSorry, that was exaggerated.
14:00cYmenIt is not a terrible book at all.
14:01coventryCrappy for your purposes. It's understandable that you're frustrated, but you could have avoided the trouble by reading the frontispiece to understand the book's purpose.
14:02cYmenI'm not frustrated by the difficulty.
14:02cYmenI'm frustrated by the failure of this book to make difficult things more accessible.
14:03gfredericksRaynes: ping
14:04gfredericksis it wakeup time in california yet
14:04arrdemgfredericks: should be... it's 11:06 there unless I can't math
14:04justin_smithdepends how late you were drinking and how much you drank and what shift you work. :)
14:04cYmen:)
14:04arrdemsometimes I think that #clojure is its own timezone...
14:05gfredericksRaynes: I am using conch and (ls "." {:seq true}) hangs; when I C-c it interrupts with something in j.u.c.locks...tryRelease
14:07gfredericks(ls ".") works just fine of course
14:07gfredericksstacktrace has LinkedBlockingQueue.take
14:09justin_smithsomehow, even when your work day is 11 pm to 7 am, people still get judgey if you drink at 9 am
14:12gfredericksis there any way to start a repl when my project.clj has :aot and :main even if my project won't compile?
14:20coventrygfredericks: Does "java -cp `lein classpath` clojure.main" work?
14:24gfrederickshmm...probably
14:25coventryYeah, it's handy.
14:48{[^-^]}Rich said clojurescript is clojure's scripting story but I can't find anything about how to shell script with it
14:50coventry{[^-^]}: Have you seen https://github.com/alandipert/gherkin ?
15:19biggbear.(clojure.pprint/cl-format nil "~63,'0b" (bit-shift-left (bit-set 0 62) 1))
15:20biggbear,(clojure.pprint/cl-format nil "~63,'0b" (bit-shift-left (bit-set 0 62) 1))
15:20clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.pprint>
15:20arrdembiggbear: throw a use in there and it'll work.. clojurebot is weird about the sandbox and uses. they timeout and unload after a while.
15:21biggbearis this a bug or what? im getting "ArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow (Numbers.java:1388)"
15:22arrdem,(do (require 'clojure.pprint) (clojure.pprint/cl-format nil "~63,'0b" (bit-shift-left (bit-set 0 62) 1)))
15:22clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.pprint>
15:22arrdem,(require 'clojure.pprint)
15:22clojurebotnil
15:23gunscoventry: Wow, so gherkin isn't a joke? A quick scan shows that the authors are actually competent at bash
15:23gunsthat's exciting if they're really going to write a lisp core in just bash
15:23arrdem,(#'clojure.pprint/cl-format nil "~b" 64)
15:23clojurebot"1000000"
15:23biggbeararrdem that works
15:24arrdem,(#'clojure.pprint/cl-format nil "~63,'0b" (bit-shift-left (bit-set 0 62) 1))
15:24clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
15:24biggbeararrdem: i find pprint fails printing the zero negative
15:28arrdembiggbear: reduces to #(#'clojure.pprint/cl-format nil "~b" (bit-set 0 63))
15:29arrdembiggbear: but can confirm that (~0)<<63 breaks cl-fmt
15:29arrdembiggbear: care to open a jira ticket?
15:31coventryguns: I think he's serious, but having a laugh at the same time. :-)
15:42gunscoventry: I'll keep an eyeball on it then. Thanks for the heads up
15:53biggbeararrdem: yes a jira ticket would be fine.
16:18kristofSince the youtube channel hasn't updated, I take it there's no way to watch clojure-conj stuff, yet?
16:19cYmenIs #(apply hash-set (filter even? %)) idiomatic?
16:21cYmenMy problem here was that filter returns a seq not another set...
16:21`cbpi don't see any loop/recur so i dont see why not
16:22`cbpbut you may wanna use set
16:22`cbpinstead of hash-set
16:22cYmenoh, that exists and doesn't need the apply. Sweet. :)
17:01Raynesgfredericks: I'll look into that.
17:01gfredericksRaynes: easy workaround was splitting lines myself
17:16cYmenIs there something like (let [v (map :k) :or 17] ...)?
17:17BronsacYmen: (let [{v :k :or {v 17}} map] ..)
17:18bbloomalso:
17:18bbloom(let [v (map :k 17)] ...)
17:18bbloomyou may want to avoid using the word "map" for a local, since it will shadow clojure.core/map
17:18cYmenYeah, I didn't use it just wanted to hint at what it is.
17:18cYmenThanks! :)
17:19Raynesgfredericks: Yeah, but obviously that shouldn't happen :P
17:20Raynesgfredericks: When you use :seq true, it uses a queue under the hood to keep constantly reading from the process.
17:20Raynesgfredericks: Otherwise if you applied a timeout and the timeout occurred before you read from the lazy seq, the process would be dead and its output prior to being killed out be inaccessible.
17:21bbloomcYmen: you may want to read http://clojure.org/special_forms#Special Forms--Binding Forms (Destructuring)
17:21bbloomsorry that link has spaces in it, you need to copy paste :-/
17:21bbloomand:
17:21bbloom(doc get)
17:21clojurebot"([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
17:22cYmenbbloom: Actually had that link open already just couldn't find the relevant parts. :)
17:22bbloomwhich is the fully nil-safe version of lookup (the same operation as :keywords and maps as functions)
17:23gfredericksRaynes: that use case implies you want all the output that occurred before the timeout?
17:23gfredericks(just making sure I understand)
17:24Raynesgfredericks: Yes.
17:25gfredericksRaynes: I'm happy to make a ticket if that's the goodest idea
17:25Raynesgfredericks: yiss plz
17:27gfredericksRaynes: also am I crazy or does conch take options in a combo of kv-varargs and final options map?
17:33Raynesgfredericks: Meaning it allows both?
17:33RaynesOr some options can only be passed one way?
17:35Raynesgfredericks: I'm trying to remember if I wanted to support both for some reason.
17:35RaynesUsually I'm just an options map at the end sort of guy.
17:36alsowhere does the mangling of clojure(script) names to java(script) names happen? i'd like to map "a->b" to "a__GT_b" at runtime.
17:37Raynesgfredericks: How big is the directory you're lsing?
17:38hiredmanalso: in advanced mode the google closure compiler does further munging along other optimizations
17:39alsoyeah, so without advanced mode, or when exporting the defs
17:40gfredericksRaynes: 10 files?
17:40Raynesgfredericks: Interesting. i can't reproduce it myself. :o
17:41RaynesWhat version of conch is this that you're using?
17:41hiredmanrelying on those names means you or anyone downstream of you cannot use advanced mode
17:44hiredmanby that I mean don't do it, think of the children
17:44alsohiredman: yes, this is for a library where some namespaces will be exported for use in javascript
17:44gfredericksRaynes: 0.5.2
17:45Raynesgfredericks: Give 0.6.0 a shot?
17:45Raynesgfredericks: https://clojars.org/me.raynes/conch
17:45alsohiredman: anyway, it looks like it's here: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2686-L2711
17:46gfredericksRaynes: I will totesally do that
17:56gfredericksRaynes: oh man that worked I a am a really bad open source problem reporter
17:58dnolenalso: does ^:export not solve your problem?
18:02gfredericksdnolen: special characters are still munged
18:04dnolenalso: oh, you *want* munge facilities at runtime
18:05alsodnolen: that's half of it. i'd then like to do something like goog.getObjectByName, but on a name like 'ns.a->b' instead of 'ns.a__GT_b'
18:07dnolenalso: right, sounds like you're on your way then.
18:11hiredmanif you are building javascript interface I would use set! or aset to build an interface object and have the compiler emit the code in a function literal
18:12hiredmanwhich there is some cljsbuild option for
18:17hiredmanso you get something like function () {Foo["external"] = ...}()
18:17alsohiredman: thanks, that seems like it might be a more sane way to do this
18:17Raynesgfredericks: Hahaha, well, happy to hear I don't have a bug there in any case :P
18:19hiredmanand you can still use advanced mode that way
18:20abaranoskydoes anyone know how to express tuple types in core.typed? ex. ["Bob" 21]
18:20hiredmanabaranosky: there is a Vector type
18:21cYmenHow do I call a function recursively with variable argument count?
18:22nopromptcYmen: like with recur?
18:22abaranoskyhiredman: the example I found here (https://github.com/clojure/core.typed/wiki/Types#vectors) seems to assume a vector with every element having the same type though
18:22cYmenWell, (recur a b rest) doesn't work. How do I fix it? :)
18:23nopromptcYmen: hmm... sounds a bit fishy.
18:23abaranoskycYmen: make it take non-varargs to avoid the apply call at every recursion step
18:23noprompt^^^
18:23hiredmanabaranosky: look further down the page
18:23abaranoskyand iyou really want the varargs, wrap the call in a no-varargs version a "convenience" fn
18:23noonianyeah, can use an inner loop form that takes the explicit collection of args so the top level function has the same interface
18:23abaranoskyhiredman: thanks
18:24abaranoskyhiredman: nice. Got it, thanks
18:24cYmenabaranosky: You can use apply with recur?
18:24nopromptcYmen: no.
18:24abaranoskycYmen: probably not.. check the repl :) I never do it.
18:25cYmenhrhr
18:25noprompti mean afaik you can't and if you're doing that it's probably a good sign you're problem hasn't been broken down far enough.
18:26dpritchettanyone successfully connecting to heroku postgres (remotely) via a jdbc URL and org.clojure/java.jdbc "0.3.0-beta1" ?
18:26nopromptcYmen: it sounds to me like you should go the route abaranosky is getting at. use a helper function.
18:27abaranoskygist forthcoming
18:28dpritchettWith a jdbc URL of the form
18:28dpritchett"jdbc:postgresql://host.amazonaws.com:5432/dbname?user=user&password=pass&ssl=true" I get rejected because it doesn't like the username 'daniel' which happens to be my local username on OSX and is definitely not the username in the jdbc URL
18:30abaranoskycYmen: looking at my gist... I'd probably use a loop/recur and not a helper fn.. I'll show you what I mean
18:34alsodpritchett: have you tried it as user:password@host ?
18:34dpritchettYeah, when I tried that it gave me a "role name_of_db does not exist" error from postgres
18:34dpritchettanother time I got a pg_hba does not love you error
18:34dpritchetti'm trying the 0.2.3 jdbc lib now, maybe it'll help
18:35dpritchetti should've kept all my failing test cases rather than updating it in place, my bad
18:36abaranoskycYmen: https://gist.github.com/AlexBaranosky/7621419
18:37cYmenabaranosky: thanks :)
18:37dpritchettwith postgres://user:pass@host:port/dbname?ssl=true i get
18:37dpritchettPSQLException FATAL: no pg_hba.conf entry for host "99.3.164.209", user "x" database: "y" SSL off
18:39bitemyappabaranosky: you missed out on the type theory meetup, it was a ton of fun.
18:39abaranoskybitemyapp: I wanted to go too :(
18:39bitemyappabaranosky: come to the next one! :)
18:40bitemyappshould happen in a week or three.
18:40alsodpritchett: i'd try moving the parameters out of the url
18:40dpritchettYeah, I'm trying to build a hash to please http://clojure.github.io/java.jdbc/#clojure.java.jdbc/get-connection now
18:41abaranoskybitemyapp: nice
18:42alsodpritchett: is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/JDBC_Examples#PostgreSQL close?
18:42dpritchettI'll try it, thanks
18:44bitemyappabaranosky: Consolation prize! - Check this out http://ncatlab.org
18:45abaranoskychecking out... what is it?
18:45bitemyappabaranosky: awesome wiki resource for category theory and how it ties into type theory, set theory, philosophy, and comp sci :)
18:46abaranoskybitemyapp: nice
18:52nopromptbitemyapp: this wiki is pretty rad.
18:53coventrybitemyapp: https://github.com/coventry/troncle/blob/master/src/troncle/traces.clj#L101 (C-c t V to toggle tracing, t/sa to set a tracing-output predicate which takes the arguments.)
18:53nopromptbitemyapp: i was beginning to get into abstract algebra a couple years ago before working sort of got in the way of all that. at the time this would have been very useful.
18:54bitemyappnoprompt: I am very happy with this wiki.
18:54bitemyappIt makes 1000x more sense than anything on wikipedia.
18:54bitemyappit's also a good example of why I love wikis.
18:54bitemyappcoventry: oooohhhh pretty *_*
18:55nopromptbitemyapp: i had a math professor who had a ton of great (old) books on abstract algebra and from what i remember they were far easier to comprehend then the shit they peddle in classrooms today.
18:55noprompttextbooks have seriously gone down hill.
18:55coventryI'm finding troncle useful for developing troncle, at this point.
18:56nopromptbitemyapp: wikipedia usually doesn't help much if you're trying to *understand* something. it's good to find a bearing though for which directions you need to head tho.
18:57bitemyappnoprompt: why even bother trying to explain anything then? why not just have a list of sources and possibly related nouns? :P
18:57bitemyappcoventry: that's a good place to be in :)
18:57nopromptgod i wish i still had the PDF scans of those books. they were *awesome*.
18:58nopromptseriously if you have the money and can shell out for the older abstract algebra books they're worth it.
18:59nopromptbitemyapp: i think i missed something.
18:59bitemyappnoprompt: ?
19:00nopromptbitemyapp: by the way i'm still bleeding. just decided to say fuck it and incrementally rewrite this horses shit in cljs.
19:00bitemyappit's good to try to understand the code
19:00bitemyappbut sometimes it's better to rewrite.
19:02noprompt90% of the time i'd definitely agree and as it stands now i have an understanding of what the code is doing at a high level. but it's such a mess.
19:03noprompti'm talking about methods on objects that manipulate state in other objects and side effect at the same time *everywhere*.
19:04nopromptchildren directly mutating their parent and then doing something to some global state.
19:05bitemyapp :|
19:05bitemyappnoprompt: was the code obfuscated on *purpose*?
19:06nopromptbitemyapp: honestly, i have no idea. it was written by two people one not much better than the other.
19:06nopromptit appears to me as the programmer had good intentions but didn't understand the consequences of making certain design decisions.
19:07bitemyappnoprompt: and probably wasn't remotely aware of the alternatives.
19:08nopromptbitemyapp: probably not. i was under the impression that OOP JS was considered a bad idea but i guess i don't know as much about the JS community as i thought.
19:09nopromptand by OOP i'm talking about the imitation class based stuff with inheritance etc.
19:09abaranoskynoprompt: JS is a bad idea :P
19:09nopromptis there a name for that?
19:09nopromptabaranosky: haha yeah.
19:09abaranoskyCLJS is a good idea :)
19:09nopromptabaranosky: this is also true.
19:12nopromptwell time to whip up some bacon!
19:13{[^-^]}how do I get aroun this?
19:14{[^-^]}http://dev.clojure.org/jira/browse/CLJ-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel
19:15{[^-^]},(reduce + (subvec (into (vector-of :long) (range 100)) 0 10))
19:15clojurebot#<ClassCastException java.lang.ClassCastException: clojure.core.Vec cannot be cast to clojure.lang.PersistentVector>
19:17coventryAre you concerned with performance? The obvious thing to do is wrap it in a (vec).
19:17coventry,(reduce + (vec (subvec (into (vector-of :long) (range 100)) 0 10)))
19:17clojurebot45
19:19{[^-^]}I'm sorta worried about performance
19:19{[^-^]}but I guess it will be fixed in a future revision of clojure so I should worry about it now right
19:19{[^-^]}?
19:19{[^-^]}shouldn't*
19:25coventryI wouldn't unless it shows up as a hotspot in profiling.
19:25abaranoskyis there a CIDER irc channel?
19:26{[^-^]}umm, the idiomatic way to do a loop to do something N times is to reduce over (range N) right?
19:26abaranoskydoseq
19:26coventryIt really depends.
19:26{[^-^]}is that just as performant as a loop?
19:27{[^-^]}well I don't need side-effects
19:27abaranosky{[^-^]}: yes
19:27{[^-^]}and I thought doseq is for side-effects
19:27abaranoskyit is implemented as a loop
19:27hiredmandotimes
19:27abaranosky{[^-^]}: what you asked is how to *do* something n times... that means side effects
19:27coventry(doc for)
19:27clojurebot"([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr ...], :while test, :when te
19:28abaranoskyfor is just sugar over map/filter/etc
19:28abaranoskyI'd recommend getting more compfortable with those first and ignoring 'for'
19:29coventryReduce is for when you want to compute some accumulation over the iterations.
19:29{[^-^]}well not *do* but compute something using a counter
19:29{[^-^]}and accumulator
19:30abaranosky{[^-^]}: it heavily depends on what you are doing... Most of the time reduce is not needed
19:30abaranoskybut.... I can't tell you without looking at the actual requirements
19:33{[^-^]}I don't think doseq is what I need since I need the result of the last computation
19:33abaranoskyyes definiately not doseq
19:34coventry{[^-^]}: What are you trying to do?
19:34{[^-^]}so I asked if reduce was idiomatic here and if it's as perfomant as a manual loop?
19:34abaranoskyyou need either: map, reduce, loop
19:35coventryThat's like asking whether "dude" is idiomatic. It depends on the context, dude.
19:35abaranosky{[^-^]}: yeah dude
19:38cYmenWhat is the most convenient way to trace a loop/recur?
19:40coventrycYmen: Troncle! https://github.com/coventry/troncle
19:41bitemyappsomeday I will understand how NHL Hockey '94 for the Genesis is still fun today.
19:43cYmenWhere is the documentation for clojure.tools.trace anyway?
19:44coventryhttps://github.com/timvisher/what-does-tools-trace-do/blob/master/src/what_does_tools_trace_do/core.clj
19:44cYmencoventry: I want to try that but I just don't feel like installing and figuring out something new right now.
19:45coventrycYmen: Sure.
20:15justin_smithto do something i times I think the canonical thing is dotimes
20:16justin_smithnever mind, specified needing a result
20:23{[^-^]}what's faster, ((partial bit-or 0) 1) or (#(bit-or 0 %) 1) ?
20:24justin_smithcriterium would tell you
20:24justin_smiththough it is very likely the latter
20:25bitemyapp{[^-^]}: my guess is the latter, but use criterium.
20:28justin_smithhttp://sprunge.us/bJfd the latter is much much faster
20:28justin_smith~20x faster
20:28clojurebotNo entiendo
20:29{[^-^]}I guess I won't ever be using partial then
20:30justin_smithsometimes the syntactic convenience outweighs the performance penalty
20:31Bronsayeah, partial is implemented in terms of apply, it will always be slower than #()
21:09bprdid the set of compiler options change in cljs 0.0-2060? I'm getting a strange AssertionError from this project.clj: https://www.refheap.com/21201
21:09bprThe error is pasted in the link above
21:11bprI see that "* CLJS-683: :source-map-path compiler option to simplify web server
21:11bpr integration" is listed in the enhancements for 0.0-2060. Given that, is my project.clj incorrect for the new version of cljs?
21:12bitemyapp`cbp: watching a tourney?
21:13`cbpbitemyapp: yeah kinda, also making dinner
21:19dnolenbpr: try 2080
21:21dnolenbpr: note you need to set an :output-dir and it must be in the same directory as :output-to
21:22dnolenbpr: :output-dir "resources/public/js/out" should do the trick for you
21:27bpris this new requirement in support of source maps?
21:28dnolenbpr: yep
21:28dnolenbpr: otherwise calculating relative URL is a PITA
21:29bprdnolen: gotcha. thanks!
23:23wei__does lobos support adding fields to an existing table (ALTER) in Postgres?
23:23SegFaultAXJust in case anyone was wondering, the new Mario 3d world is /amazing/ :)
23:26bitemyappSegFaultAX: another one? yeesh.
23:26bitemyappwei__: I prefer migratus, in case that's any help to you.
23:27wei__bitemyapp: ok, will check it out. running into some limitations of lobos pretty early on
23:27SegFaultAXbitemyapp: Hmm?
23:38swarthyI've been reading a lot about deploying clojure web apps. Everyone always tells you 'how' but makes little in the way of recommendations. If I'm deploying a small compojure based CRUD app < 100 users and I may run additional apps on the server? Should I uberjar?
23:38swarthyWith nginx in front?
23:39jared314swarthy: with jetty?
23:39swarthyThat is what I see people talking about? I'm mostly curious what the best way to accomplish a web app deploy is with the fewest struggles.
23:39swarthyAlso I'm less than familiar with JVM stack at present.
23:40swarthybut happy to learn
23:50bitemyappSegFaultAX: there have been at least two or three mario 3d worlds.
23:52swarthyYeah Nintendo has always been weird. With hardware as their focus they change the consoles, but keep the same game or 99% of the story from iteration to iteration.
23:52swarthyNever been my thing.
23:53justin_smithswarthy: nginx and varnish in front are good, but if you are really looking at 100 users total (and not at a given time), they may not be needed
23:53justin_smithalso, using uberwar and putting the app in a tomcat container can have advantages
23:53justin_smithin terms of convenient systematic restart / autodeploy kind of stuff
23:54bitemyappswarthy: I really like classic games and emulators, including the original Super Mario World for SNES, but there's just not enough variety or refinement of the gameplay.
23:54bitemyappswarthy: Super Meat Boy was a better platformer
23:54swarthybitemyapp: yes SMB was good, made playing games in the room with your friends telling you how bad you are great again.
23:54swarthyjustin_smith: So do you typically uberjar at Instrument?
23:55justin_smithuberwar
23:55justin_smithif not that, I would uberjar
23:55justin_smithlein in production is asking for a disaster
23:55swarthyjustin_smith: Well uberwar gets dropped into a Java server container yes? I know nothing about that yet.
23:55technomancy(inc uberjar)
23:55lazybot⇒ 1
23:55justin_smithie. use lein to build, but don't even have it installed on the prod server
23:56technomancyswarthy: uberwars are for people who already have a big investment in the JVM
23:56justin_smithswarthy: that's what I was saying about tomcat, uberwar makes it easy to just use the existing tomcat functionality, and just drop your thing into it
23:56swarthyOkay, so as a former UNIX \ scripting language dev. I want to deploy my new clojure stuff, so uberjar will suffice? No reason it will come back to bite me?
23:57justin_smithnope
23:57justin_smithjust java -jar for a ring app
23:57technomancyright, you want nginx just to avoid running jetty on port 80
23:57justin_smithyou may want to set up a service abstraction for convenient shutdown / restart / redeploy
23:57technomancybut keep it simple with a run-jetty call in your uberjar's -main
23:58justin_smithbut as a *nix person you probably know how to do that (register a pid, make an init script, etc.)
23:58brainproxyis there a way in clojure mode to get the nice highlighthing for (def... ...) if the def... has a dash in it?
23:58swarthyIs there a reason not to expose Jetty directly that I should know about?
23:58brainproxyi.e. clojure mode in emacs
23:58swarthybut I'm happy to use nginx
23:58swarthyjust curious
23:58justin_smithit is probably more fragile than nginx, but at a small scale it should be fine
23:59justin_smithalso probably more fragile than tomcat, at that
23:59technomancyswarthy: don't run your app as root
23:59justin_smithyeah, that is hopefully a given in the unix world
23:59justin_smithbut I guess there are people that foolish