#clojure logs

2012-10-02

00:49FrozenlockOh wow. Going back to seesaw after a couple months of clojurescript... NOW I understand the CSS-style selectors!
01:23jasonleafhi, has seq-utils in clojure contribute been deprecated in 1.4?
01:23xeqi~contrib
01:23clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
01:27jasonleafthanks, but seq-utils is not among the modules listed in the page
02:55mpanI seem to misunderstand here, but: how do I get back the whole tree (no zip metadata) from a zipper?
02:55mpanzip/node doesn't seem to do what I thought
02:56SgeoHow easy/difficult would it be to add my own protocol to Aleph?
02:56SgeoErm, well, make a library that allows Aleph to use my protocol
02:57mpanwait, does zip/root return the tree at the root or a zipper wrapping the tree at the root?
03:00gtuckerkelloggSomething is clearly wrong here, but I am feeling foolishly stumped. https://www.refheap.com/paste/5426
03:02amalloygtuckerkellogg: you're not using the same (rand) for each test
03:07gtuckerkelloggamalloy: but I'm not within each call to weighted-idx, either
03:07mpanin case anyone else was wondering, my main issue was a logic error, but, to clarify: root returns a bare tree (loses the zipper wrapper) and node returns a bare node (same)
03:08gtuckerkellogg(map (fn [x] (codachrom.core/weighted-idx [1 1 1])) (range 300)) should 300 weighted draws of the index
03:08gtuckerkellogger, "give" 300 weighted draws
03:09mpanwondering for future reference, though: how do you get the zipper at the root from a zipper short of constructing a new one?
03:09gtuckerkelloggbut yet, you are right. If i move the rand to the let bindings, it behaves as it should
03:23SgeoWith Ring, would it make sense to return a body that's an InputStream and make an input stream such that reading from it blocks until I have some data
03:23Sgeo?
03:27wingyjezz light table is the shit
03:27wingycloud9ide moved the ide to the cloud .. light table creates a whole new dev env
03:33amalloybtw gtuckerkellogg, i think your definition of cprobs is just (reductions + probs)
03:33amalloy&(let [probs [1/4 1/2 1/4]] (reductions + probs))
03:33lazybot⇒ (1/4 3/4 1N)
03:34gtuckerkelloggoohhh, I hadn't seen reductions before
03:34gtuckerkelloggthanks amalloy
03:35amalloygtuckerkellogg: because that's implementing a sensible algorithm instead of a nonsense one
03:36amalloyyou don't say "pick a number. was it less than 1/4? okay, now pick another number. is it less than 3/4?"
03:36amalloyyou pick a single number and step through the pdf
03:37amalloyi had an implementation of this around somewhere, but i can't find it anymore
03:53AmarylHi! I can't really understand how "apply" works... They give this example in "Clojure Programming": (apply hash-map [:a 5 :b 6]) ;= {:a 5, :b 6} Does this mean that apply does some sort of "concat" with results?
03:57Sgeo,(hash-map :a 5 :b 6)
03:57clojurebot{:a 5, :b 6}
03:57Sgeoapply is basically a way of taking a concrete list, and expanding it out into arguments to be given to a function
03:58Sgeo,(letfn [(f [a b c] {:a a :b b :c c})] (f 1 2 3))
03:58clojurebot{:a 1, :b 2, :c 3}
03:58Sgeo,(letfn [(f [a b c] {:a a :b b :c c})] (apply f [1 2 3]))
03:58clojurebot{:a 1, :b 2, :c 3}
04:01wingyisnt this outdated info http://www.brainonfire.net/files/seqs-and-colls/main.html
04:01wingya string should be a coll?
04:01amalloywingy: it's an article about clojure, on the web. odds are, yes it's outdated
04:01Sgeo,(coll? "Hello")
04:01clojurebotfalse
04:02amalloybut that table looks good to me
04:02amalloyand unlikely to change anytime soon
04:02amalloyi think TimMc wrote that one?
04:02wingyok
04:09Amarylhaa ok Sgeo ! I didn't realized that "hash-map" was basically variadic! I just read about "map" and "reduce", and I was expecting something more complicated with "apply"... :)
04:14mpanhow can I use clojure.zip zippers to splice subtrees together?
04:14mpanthe particular operation I'm trying to do is swap two subtrees of different trees
04:15mpanI want to use replace, I think? but where do I get just the subtree from the other side?
04:19SgeoIs Redis a good idea if I'm mostly just interested in the pub/sub stuff?
04:21mpenetDepends on your requirements, but yes, it is quite good at that. Easy to use, easy to setup/maintain
04:21kralnamaste
04:21mpenetSgeo: also check 0mq
04:22kral0mq is really nice
04:22SgeoUm
04:22SgeoThis looks like it might be a bit overkill
04:22SgeoThen again, Redis probably is too
04:26mpanhm, there's clojure.zip/remove, but I kind of need the opposite of that
04:39mpanin case anyone was wondering about the same thing about the zippers: I can't find any mention of this explicitly documented, but it seems (??) that the first elem in a zipper is the subtree at its current location (can anyone confirm this is generally true?)
04:49SgeoHmm, is http://www.clojure-toolbox.com/ old?
04:50mpenetyes
04:51AustinYunhm, the lein-ring auto-refresh the browser window feature thingy isn't working; probably XMonad's fault though
04:51weavejesterAustinYun: It's unlikely to be the fault of your window manager… what version of Ring/Lein-Ring are you using?
05:05AustinYunring 1.1.6, lein-ring 0.7.5
05:05AustinYunseriously though, weird stuff like that seems to happen because of XMonad
05:05weavejesterAustinYun: Really? All wrap-refresh does is inject some JS into the page
05:06weavejesterAustinYun: The content-type needs to be text/html though.
05:06weavejesterAustinYun: And the page needs a <head> element
05:06AustinYunok, that's probably it then
06:31wingysimple, not easy!
07:23mindbender1what's the poor man's alternative to domina
07:25mpenetjayq and related libs is a good alternative
07:25mpenetare*
07:25mpenetif you know jquery the learning curve is almost non existant
07:27mindbender1mpenet: i really don't that's why I have been on the run.. but thanks for mentioning it
07:30wingyhow do you add doctype using hiccup?
07:35wingyi should probably use noir instead of compojure directly
07:36weavejesterwingy: There are functions in hiccup.page for adding doctypes
07:37mpenetwingy: the html* functions add it for you also
07:38mpenetwell same thing :) just realized they are in hiccup.page
07:38wingyok
07:38wingy(:use hiccup.page)
07:39wingy(GET "/" [] (html5 layout))
07:39wingyseems to work
07:39wingythx
07:45wingyhaving a layout wrapping a body was simple as i imagined
07:45wingy(GET "/" [] (html5 layout body))
07:45wingyno need for middleware
08:51pandeirohow can i create and define a var in in ns bar from ns foo?
08:51pandeiro,(doc intern)
08:51clojurebot"([ns name] [ns name val]); Finds or creates a var named by the symbol name in the namespace ns (which can be a symbol or a namespace), setting its root binding to val if supplied. The namespace must exist. The var will adopt any metadata from the name symbol. Returns the var."
08:53cemerickpandeiro: might want to look at the immigrate utility from contrib
08:54cemerickcrude, but does the job. Could extract out a more subtle operation.
08:56TimMcwingy: A string is seq-able, but isn't itself a collection.
08:57TimMcand that table is automatically generated using Clojure 1.3.
08:58pandeirocemerick: i'm just writing a app.repl ns to automate all the junk i have to do when i need to re-launch, intern seems fine for that purpose, but i will bookmark immigrate, thanks
08:59pandeirocemerick: btw still yet to debug why my mail attachment inputstreams won't work with clutch/put-attachment
08:59wingyTimMc: i c
08:59wingyTimMc: does seq? means seqable or sequence?
09:01gfredericks,(seq? [])
09:01clojurebotfalse
09:01gfredericksit means something that implements the ISeq interface I believe
09:01wingybut does one say its then a sequence or a seqable
09:02gfredericksI don't know if the word "sequence" is very strictly defined around here
09:03gfredericksa vector is not a seq, but it is seqable and is also sequential
09:04pandeirocemerick: i was poking around clutch too and looking at lazy-view-seq to try to understand how that works... am i right that it 'slurps' the entire view (per query parameters) into memory first, then turns it into a lazy-seq? so it uses heap space as if it were greedy?
09:04wingythen seq? has to mean sequence?
09:04wingysince vector is returning false
09:04cemerickpandeiro: it shouldn't, no
09:05pandeirocemerick: ok let me go back and try to understand it better
09:05cemerickif it does, it's a bug
09:06wingyhow does one have a attribute with no value in hiccup
09:06pandeirojust to be clear, eg i have a million doc db, i call all-documents, those docs are not in memory from that moment?
09:06wingy[:a {:href "/account_types" :data-prefetch} did give me an error Map literal must contain an even number of forms
09:07pandeirob/c i was imagining you would need some clever (and magic) use of 'limit=' under the covers to do what lazy-view-seq does
09:07gfrederickswhy does lein keep running to the internet every other day when I haven't changed my project.clj?
09:07pandeirogfredericks: boredom?
09:08gfredericksit is frustrating behavior when on a slow internet connection
09:08cemerickgfredericks: you have SNAPSHOT dependencies (direct or transitively)
09:08cemerickYou can run lein in offline mode to avoid such checks.
09:08cemerickIn theory, anyway? :-P
09:09gfrederickscemerick: ah that's probably true; thanks
09:09wingy[:a {:href "/account_types" :data-prefetch true} worked
09:11cemerickpandeiro: `changes` uses lazy-view-seq; otherwise, you need to use lazy-view-seq explicitly
09:11pandeirocemerick: ahhh
09:11cemerickoh, hah, I should read my own lib's code
09:11pandeirohadn't realized that
09:12cemerickNevermind, all views are lazy, and lazy-view-seq is used implicitly all the time :-P
09:12cemerickThere's no slurping going on
09:12cemerickNotice the use of read-lines
09:14pandeirocemerick: ah right so it gets the inputstream
09:15pandeirocemerick: so there's not as much need to use limit= with large datasets, since clutch is doing that, would you agree?
09:15cemerickpandeiro: I wouldn't say that. Who knows what optimizations are being done server-side for small- or large-limit GETs
09:16pandeirook i see
09:16gfrederickslein deps :tree shows no snapshots, though my project was itself a snapshot
09:16cemerickthat may be enough…?
09:17gfredericksokeedokes
09:20wingyim trying to make a template with dynamic vars
09:20wingyhttps://www.refheap.com/paste/5429
09:20wingyi want the title to be "The best app" but it shows "App" which is the root binding
09:20wingywhat have i done wrong?
09:21gfrederickswingy: layout is only defined once
09:21gfredericksyou'd have to make it a function that you call each time
09:21wingyokay
09:22wingygfredericks: wohoo thx
09:25gfredericks~woohoo
09:25clojurebotHuh?
09:25wingygfredericks: but isn't that going against FP? perhaps I want to pass the locals to the layout function instead?
09:25wingythan having it relying on global variables
09:25gfrederickswingy: sure, dynamic variables are not a pure-functional technique
09:25clojurebotCool story bro.
09:26wingyok
09:26gfrederickswe have them for convenience because clojure is not haskell; use with care
09:26wingycool
09:26wingysimpler to test if functions are pure
09:26gfredericksabsolutely
09:29gfrederickserror handling in cljs: can I throw and catch arbitrary objects (like maps)?
09:33gfredericksI think so
09:38Cheironhi, for a clojure project created with lein. how to know that lib.jar is needed by dependency y ? the lib folder is full of tens of jars and not sure how to check
09:39gfredericksCheiron: with lein 2 you can `lein deps :tree`
09:40gfredericksotherwise if you have maven installed you can `lein pom && mvn dependency:tree`
09:40gfredericksdeps :tree might work with lein 1 as well; worth a try
09:40gfredericksI didn't quite understand your question so I hope that answers it
09:41casionanyone here used ocaml extensively? I'm curious what a clojure user thinks of ocaml
09:42Cheirongfredericks: i'm getting SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8] and need to know why
09:43gfredericksCheiron: well the dependency tree should help that
09:43Sgeo(Working in a group, I'm Lead Builder but others are expected to contribute)
09:43casionSgeo: I know 3 other people here doing similar
09:43gfredericksSgeo: but they won't end up contributing so it doesn't matter
09:43casionone of which is doing it in a group for a java class
09:45Sgeohmm
09:47TimMcSgeo: Do any of the others know Clojure? How about Java?
09:48TimMcand other FP langs?
09:48SgeoNone of the others know Clojure. They probably know Java, but I haven't asked. I don't think they know other FP languages, but haven't asked. Wait, does Javascript count as an FP language, because if so, then probably.
09:53unic0rni guess it mostly depends on what kind of programmers they are. clojure isn't that complicated after all. knowing java api helps though.
09:54Cheironi'm having slf4j error because many libs are using different logging libs, what should i do? :/
09:54wingysimple, not easy!
09:54wingynot node.js!
09:54wingyclojure!
09:55wingywhats funny is where i needed libs i need only clojure now
09:57kyptinHey folks, I'm having trouble with the *file* binding. Seems to work when I run a file (using "lein exec") but not when I run a test (with "lein test"). Has anybody had issues with this before?
09:58kyptinI'm having a devil of a time searching the web about this because I can't get Google to match literal asterisks.
10:01wingyhow do i tell hiccup to not compress the output?
10:01kyptinAlternatively, is there a way to access the project's root directory from within code?
10:02kyptin(Or can I depend on the working directory always being the project's root?)
10:03chouserkyptin: *file* is probably only set to something useful during compile time
10:05chouserhm, and you want the project's root? Will this only ever be run by lein in the source directory, or do you want the path to your project's jar when it's being used as a lib?
10:06kyptinchouser: Thanks for your help. I'm currently only using this with lein, but I may want to do a jar later. Something that works for lein only would still be helpful for now, though.
10:06pandeirowhy can my repl get (source io/file) but (io/as-file) returns Source not found ?
10:07pandeiro(source io/as-file) that is
10:07kyptinchouser: I may be missing something, but I think I'm OK with *file* only being set during compile time--but wouldn't that mean I should get some value for *file*, instead of just "NO_SOURCE_PATH"?
10:07chouserwell, lein run will cd to your project's root, so you could use cwd for that. not sure what to do in the jar case.
10:07kyptinOK, well, that's good to know that that should be a dependable feature. Thanks!
10:08chouserI'm not actually sure it's possible for a .clj or .class file to know what path it was loaded from.
10:10chouserIf you look at *file* from inside a function that's being run at run time, it will have no useful value. You could try saving its value from inside a macro instead.
10:10kyptinchouser: Hmm, interesting idea, about the macro. I will try that!
10:12chouserpandeiro: as-file is a protocol function, so doesn't have a single definition the way io/file does.
10:13kyptinchouser: Brilliant! Still not sure *why* it worked, but the macro idea did it.
10:13kyptinFor reference, here's the macro: (defmacro get-file [] (let [f# *file*] `(str ~f#)))
10:13kyptinThanks very much!
10:15chouserkyptin: it works because that macro is run at compile time, when the compiler is still working on your file and therefore has set *file* appropriately. And your macro returns a string which is essentially substituted into the code as just that string, so that at runtime that string can be used.
10:15jcromartiewhere are protocols preferred over multimethods?
10:15chousermaybe that explanation didn't help after all. :-/
10:15jcromartieare multimethods basically outdated?
10:15wingyjcromartie: not last time i checked
10:15chouserjcromartie: when performance matters enough to warrant the loss of flexibility provided by protocols.
10:16jcromartieah
10:16wingymultimethods are more powerful than protocols
10:19the-kennyBut slower
10:19kyptinchouser: I get the macro part, and that macros are expanded at compile time. I think the thing I don't understand is why *file* wouldn't be resolved in a function. Is there not a compilation step for a file full of regular functions?
10:21chousersure, but regular functions aren't run then. So you reg fn is compiled along with its reference to *file*, but the value of *file* isn't used until later. When the reg fn is called, the value of *file* is fetched but usually compilation is all done by then and there's no useful value left.
10:23kyptinOh. Right. That makes sense. Thanks!
10:23chouserah good, np.
10:23kyptinI'm still surprised that there's no useful value left, but I'm content now that I have my macro workaround.
10:24chouserwell, you wouldn't want the value of *file* to be changed every time a fn from one file called a fn from a different file, right? That'd be substantial overhead for a simple fn call
10:28kyptinAh! Indeed, that would be a lot of overhead! Now I think I understand. Thanks for your patient explanations. :-)
10:29casionthorbjornDX: ##(map (fn [x] (let [n (last x)] [(dec n) n])) (partition-all 2 (range 5))
10:30casionthorbjornDX: for some reason I just thought of that regarding your question last night
10:30kyptinchouser: BTW, I think it would be useful to capture this knowledge on StackOverflow. Would you like me to send you a link after I write up the question? If you write up what you explained here, I'll accept your answer.
10:33ssedanoHi, I know this is a subjective question. But to work with vim, is it better vimclojure + ng, slimv + swank, slimv + ritz, or vimclojure + (slimv + [] for repl)?
10:34wingyhow do you guys handle localization in clojure (using compojure/hiccup)?
10:35the-kennywingy: We read .po via jgettext into a gigantular clojure map, mapping locales to maps mapping namespace-prefixed keywords to strings
10:35the-kennyPretty simple but enough for our use case
10:37wingythe-kenny: im not familiar with .po files .. what are the benfits of using .po files and using yaml
10:37wingyor even regular clojure data types
10:38the-kennywingy: I'd have used normal Clojure Maps. But management wanted some "standard" file format
10:38wingyokay
10:38wingywell sounds simple .. ill try with regular maps
10:40djanatynis there any way to get a list of all currently doing-stuff agents?
10:41djanatynI just realized that my threads never die and my agents are off on missions they will never return from
10:46kyptindjanatyn: Dunno about agents, but I'm using futures and saving a reference to each future in the master thread, so that I can later call `future-cancel` on it if I need to.
10:46djanatynthat's a great idea! thank you.
10:48dgrnbrgDoes anyone have experience with seesaw/swing's canvas? I keep trying to draw to the canvas, but I can't get anything to paint. I'm sure it's something I'd forgetting to do--I am putting the canvas in a border panel in a frame, if that helps
10:48wingyno probs having translation files as maps
10:51duck1123.war huh. good god y'all. What is it good for?
10:51Sgeoeww xml :(
10:51nDuffSgeo: Roughly, a zip-based format specific to web applications, which an appropriate container (Tomcat, Jetty, etc) can automate deploying.
10:51the-kennyMostly like a jar
10:51the-kennyIf you want to generate one from a ring application, use the excellent lein-ring plugin :)
10:52kyptindjanatyn: you're welcome.
10:53wingywe devs are the managers, the engineers and the sellers
10:54chouserkyptin: sure, if you'd like
10:55chouserssedano: emacs+evil+paredit+(slime or nrepl)
10:55dustingetz.war is kind of like .exe for java web applications. its a standardized format for deploying to an application server (which is basically a http server with some fancy features). there's some XML because it was standardized ten years ago, but its mostly all hidden, its not painful in practice or anything and some tools generate it for you
10:55dustingetzjava -> jam, including clojure, scala etc
10:55dustingetzjvm*
10:56dustingetzduck 1123 ^
10:56dustingetzduck1123 ^
10:56kyptinchouser: http://stackoverflow.com/questions/12692698/file-variable-not-working
10:57wingydo you guys agree that the power will lie in the devs tomorrow?
10:58casionwingy: I think you want #programming
11:00ssedanochouser: thanks for the reply, but I really feel confortable with vim.
11:01chouserssedano: me too. evil has a very large percentage of vim bindings and colon-commands available. Much more than earlier attempts like viper.
11:01sspoonercemerick - would you be interested in pulling in a patch to move bandalore to the newest version of the aws-java-sdk?
11:01djanatynThis is str5ange.
11:01djanatynI'm using quil, and I have a function to draw an agent.
11:01ssedanothanks chouser!
11:02djanatyn(draw-blob blob1) (draw-blob blob2) does what I want to do.
11:02cemericksspooner: I just committed a change to that effect this morning; the new release is pending a maven central sync.
11:02djanatyn(map draw-blob [blob1 blob2]) doesn't.
11:02djanatynin fact, when I map the draw, neither of the blobs get rendered.
11:02sspoonercemerick: perfect, thank you
11:03cemerickWatch the twitters for an announcement of when it's available for use. :-)
11:03djanatynWhy would that be the case?
11:03djanatynshouldn't (map fn [foo bar baz]) always be equivalent to (fn foo) (fn bar) (fn baz)?
11:05kyptindjanatyn: More like (list (fn foo) (fn bar) (fn baz)).
11:06scriptordjanatyn: because map is lazy
11:06djanatynohhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
11:06scriptorit won't evaluate immediately
11:07scriptoryou'll probably want doseq
11:07djanatynis there a strict version of map that returns nil and is only used for side effects?
11:07djanatyndo I want doseq or dotimes?
11:07djanatynoh, I totally misunderstood what dotimes does
11:08scriptor(doseq [blob [blob1 blob2]] (draw-blob blob)) should be what you need
11:08djanatyn:D
11:08djanatynit rendered all the blobs for the first time
11:11redline6561Hi. Will leiningen automatically load any JARs in the lib/ folder?
11:13duck1123redline6561: you really are better off installing any jars you need into a repo if they're not already in one
11:13redline6561I do not have legal rights to do so.
11:13duck1123there are ways to make loose jars work, but they're usually more hassle then they're worth
11:14nDuffredline6561: Not even in your local ~/.m2/ repo under your home directory?
11:14chouserkyptin: answered.
11:14redline6561I haven't tried putting it there. I was under the impression that I could put loose jars in lib/ and "lein repl" would ensure they were on the classpath.
11:15nDuffredline6561: ...so, there are Maven commands to automate populating ~/.m2 -- populating it by hand isn't so much the Right Thing -- but yar, that impression isn't accurate for lein2
11:15nDuff(intentionally so, to encourage reproducible builds)
11:15redline6561Drat!
11:15redline6561Thanks nDuff.
11:18kyptinchouser: accepted; thanks again!
11:59DrDaveI have what looks like a Clojure bug: Equal objects that behave differently as arguments
11:59DrDaveWhere can I paste the code?
12:00babilenDrDave: Could you paste an example to http://refheap.com please?
12:01DrDavebabilen: Thanks, https://www.refheap.com/paste/5440
12:02nDuffDrDave: It'd be interested if you provided enough to reproduce.
12:02nDufferr, interesting
12:03DrDavenDuff: If you like, but it's a lot
12:03nDuffDrDave: ...can't generate a minimal reproducer?
12:04babilenDrDave: You might still want to paste a maximally minimal example ;) -- That way we can play with it.
12:04nDuffDrDave: ...generally speaking, having a trimmed-down reproducer is fairly essential to being able to file a ticket against Clojure upstream, if it does turn out to be an actual bug.
12:05DrDavebabilen, nDuff: I'll just paste all. I'm in a time crunch. Feel free to ignore.
12:11jcromartieDrDave: the suspense is killing me
12:12DrDavebabilen, nDuff, jcromartie: OK trimmed as much as possible, https://www.refheap.com/paste/5441
12:13nDuffgraci.
12:13jmlis there something like a map-values function built-in to clojure? Something that takes a function and applies them to all the values of a map, e.g. (defn map-values [f m] (into {} (map (fn [[k v]] [k (f v)]) m)))
12:15DrDavenDuff: I don't have equal?, but xxx and yyy are not identical?.
12:15chouserDrDave: how are xxx and yyy created?
12:15jcromartieDrDave: yeah xxx and yyy are the curios bits
12:16DrDave(def xxx (eliminate-all-implications '(not (not p))))
12:17DrDave(def yyy '(not (not p)))
12:17jcromartieoh I see
12:17jcromartieI reproduced it by using a quoted list for xxx and cons to create yyy
12:18jcromartiethe problem is "list?"
12:18Sgeo,(list? (cons 1 '(2 3))
12:18clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
12:18Sgeo,(list? (cons 1 '(2 3)))
12:19clojurebotfalse
12:19jcromartieor, convert the result of apply-at-all-levels to a list, instead of the lazy seq returned by cons
12:19jcromartieor don't use list?
12:20DrDaveShould I use seq? ?
12:21jcromartieI'm not sure what's best: use a broader predicate, or be consistent with returning lists when generating code
12:21DrDavejcromartie: I did not know that about cons.
12:21jcromartieyeah, it's lazy :)
12:21chousercons isn't lazy
12:21DrDaveWhat is the simplest fix?
12:22chouserwill sequential? work here?
12:22jcromartieer, right, sorry it's not lazy it just returns a seq that's not a list
12:22jcromartie,(type (cons 1 nil))
12:22clojurebotclojure.lang.PersistentList
12:22jcromartiewut
12:22Sgeo,(list? (cons 1 nil))
12:22clojurebottrue
12:23jcromartie,(type (cons 1 '(2 3)))
12:23clojurebotclojure.lang.Cons
12:23chousernil is special
12:23jcromartiethere we go
12:23chouser:-)
12:24jcromartieDrDave: I guess the simplest fix is seq? instead of list?
12:24Sgeo,(seq? {})
12:24clojurebotfalse
12:24SgeoHmm, are there any lazy maps?
12:25FrozenlockHow does one use the wildcard for java import in clojure? (import 'java.awt.event.*) throws an error.
12:25jcromartieDrDave: actually, since you only use cons in one place, you can replace it with (apply list (cons …)) and that's only one chaneg
12:25jcromartiebut you still have brittle code, say, if you feed it another kind of seq from somewhere else
12:26jcromartieso, simple vs robust? your choice
12:26DrDaveThanks, using seq? throughout instead of list? solves the problem
12:26DrDaveMany thanks from a Clojure newbie!
12:26TimMc&(map (juxt sequential? associative?) [(cons 1 nil) (cons 1 '(2 3)) [4 5] {6 7} #{8}])
12:26lazybot⇒ ([true false] [true false] [true true] [false true] [false false])
12:28TimMcWhat you really want is #(and (sequential? %) (not (associative? %))) I guess.
12:28TimMc(defn listy? ...)
12:29Sgeo,(sequential? {})
12:29clojurebotfalse
12:29SgeoOh, the not associative for vectors?
12:30Sgeo,((juxt sequential? associative?) [])
12:30clojurebot[true true]
12:33djanatynwhen creating records, is there a way to manually specify each value, instead of just putting them in order?
12:33djanatynI'm using hashes and I'm starting to wonder whether using records would be a better idea
12:34nDuffdjanatyn: map->YourRecordClass
12:34djanatynoh, cool.
12:35SgeonDuff, where is that documented?
12:35wingyis get-in best for accessing nested keys?
12:35wingyin a map
12:36chouserwingy: yep
12:36wingycool
12:36SgeoOh, I see it in the examples
12:36Sgeofor defrecord
12:41SgeoCan someone please explain to me why -> is used with Seesaw?
12:41SgeoWouldn
12:41SgeoWouldn't it make more sense for (pack! some-frame) to return nil and not the frame since it
12:41Sgeosince it's side-effecting?
12:43joegallo_Sgeo that just sounds like a difference of opinion. It seems to me like the author decided to use the method chaining type approach of having all nil return types instead be "this" so that you could chain with ->.
12:43joegallo_if you don't like that, you can use doto and pretend that the author didn't do that.
12:46thorbjornDXcasion: that works too :) (re: your partition-all fn)
12:50wingyi have a file in my app folder /app/sv-SE.clj .. and in my main file i added (:use app.sv-SE) … however it cannot find that file
12:50wingyit says it cannot find it on class path or the init file
12:50wingyany clue how to make it work?
12:51nDuffwingy: for one, your filename should have underscores where the namespace has dashes.
12:52nDuff(silly, yes, but well, it's Java)
12:52wingyi c
12:52wingyyeah you could see that on the error message
12:52wingythx
12:53mmitchellanyone know of a good java/clojure library for adding a buffer to a bounding box?
12:53casionthorbjornDX: I was just sitting here and it came to me, somewhat odd :)
13:00SgeoIf I want to have a mutable reference to a map which itself contains mutable references, would refs probably be best for that?
13:01chouseryes
13:01chouserall refs
13:02chouseror, with some care, refs and agents. But do not include atoms unless you actually mean to be asking for pain.
13:05wingyif there is a choice would you have clojure not running on jvm but on its own like node.js?
13:05chouseryou can compile cljs to js and run it on node.js
13:06casionhow does node.js run on its own?
13:06wingyc
13:07nDuffwingy: Was that meant to be an answer?
13:07nDuffwingy: node.js runs on v8. V8 is written in C, sure, but so is the JVM.
13:08SgeoAlthough, I assume that V8 is small enough that it can just be shipped with the application in question usually?
13:08nDuffwingy: Point being, V8 does a lot of runtime optimizations... just as does the JVM.
13:08SgeoThe JVM tends to need to be installed
13:08nDuffSgeo: *shrug*. I've seen apps bundle it.
13:08Sgeoo.O
13:08nDuff(mostly insane ones -- see Oracle for an example -- but still).
13:08casionSgeo: that doesn't change how it's "running on its own"
13:08wingyv8 is fast .. jvm is slow as hell to startup
13:08nDuffwingy: Sure, but that's a matter of design priorities.
13:09casionassuming it is… I still don't get how that makes sense
13:09nDuffwingy: ...the JVM was designed for throughput foremost. V8 was designed for interactive use.
13:09wingyyepp
13:09SgeoBut wouldn't Applets work better with a faster startuo time?
13:09nDuffwingy: ...frankly, for a lot of things Clojure is used for, the focus on throughput makes sense.
13:09SgeoSo why wasn't startup time a priority back when people believed that applets mattered?
13:09nDuffSgeo: Because the JVM sucked back then.
13:09wingynDuff: throughput meaning like server things?
13:09casionSgeo: afaik, it was
13:10nDuffSgeo: ...these days they're actually good at the things they want to be.
13:10casionit was significantly worse 'back then'
13:10casionand from my reading of history the main impetus to reduce startup time was the applet producing communities
13:10nDuffwingy: Sure. Though, granted, the Erlang runtime still kicks the JVM's butt on some subsets of that.
13:13scriptorsomeone did make a lisp similar to clojure running on the erlang vm a bit back
13:14redline6561Interesting. I would have expected lein repl to require all namespaces under src/ for my project.
13:14wingyjoxa
13:14redline6561Is there a way to get such behavior and/or why are my expectations wrong?
13:15wingyok good to know .. seems that jvm is a good choice
13:16nDuffwingy: ...the ecosystem is also a very, very big part of that. The universe is littered with good languages that are useless in the real world because there aren't libraries available for them.
13:16wingyyeah
13:16kirindaveModulo the need for an ecosystem
13:16kirindaveYou don't see people complaining about forth's lack of a json parser, for example. :)
13:17wingythats why node.js was a huge success .. the ecosystem was huge on frontend and it was doable on backend
13:17wingyalso for other reasons
13:17kirindaveIt "was" a huge success?
13:17wingyis
13:17kirindaveIt is a "huge success?"
13:17wingyHUGE
13:17kirindave#define "huge success" "shared delusion."
13:17wingyin popularity
13:18kirindaveYes. I suppose.
13:18kirindaveSadly.
13:18wingynah
13:18wingypromotes JS .. makes the browsers faster .. cheer up
13:18SgeoCPS in JS has to be written manually :(
13:19kirindaveJavascript is easily the most frustrating, awkward, poorly defined language we have at our disposal. It's also frightfully difficult.
13:19wingyi think cljs was influenced by node.js/coffeescript
13:19technomancyheh
13:20wingywhen you have 10 days to make a lang for your boss .. you get JS
13:20kirindavetechnomancy: Did you see that conversation Nathan Marz and Ben Black had about intuition? I'm still trying to figure out why it worries me.
13:20technomancyI don't think so?
13:21kirindavetechnomancy: Backtrack in convo from http://twitter.com/b6n/status/252993377694535680 if you care to
13:25casionit would seem that clojurescript existed before coffeescript or node.js
13:25technomancykirindave: well, abstractions are appealing, I guess.
13:26technomancyyou don't want to have to think about lower layers, and sometimes you can even get away without doing so.
13:26technomancybut usually once you realize you do have to understand them it's too late
13:27kirindavetechnomancy: I just think this is a great example of the same sort of thinking that underlies the "I'm not an apple fanboy" phenomenon.
13:27kirindaveOr the "I am just trying to get shit done" phenomenon.
13:28kirindaveIn which anything beyond what _I_ want to do is unreasonable, but what I already know I want to do is perfectly justified. ;)
13:28kirindave(cannot believe I am mentioning a Gruber meme)
13:28dgrnbrgtechnomancy: I sometimes find that when I'm working on a plugin, if I try to (update-in project [:dependencies] conj [my-lib "0.0.1"]) in the task, the lib isn't downloaded/included in the path, but if I do the same thing just before eval-in-project, it adds the extra dependency. Is there something I'm missing w/ the way lein uses the project map that causes it to be reset if I add the dependency "too early"?
13:28technomancyhttp://wondermark.com/333/
13:29kirindavetechnomancy: Damn.
13:29kirindaveAmazong.
13:30technomancydgrnbrg: yeah, it's an unfortunate side-effect of not being able to un-apply profiles
13:31technomancyif you express your dependency in terms of adding a profile it should be preserved
13:31dgrnbrgtechnomancy: I have a plugin that apply-tasks to another plugin, that apply-tasks to a final plugin
13:32dgrnbrgso I could add a new profile to the project, and then add that to the active profiles for the project, and then it should carry through?
13:33dgrnbrgor should I just require that the plugin's runtime injected dependency must be specified in addition to the plugin?
13:33dgrnbrg(which I don't like)
13:38dgrnbrgtechnomancy: is it possible for a plugin to create a new profile for itself in order to ensure the dependencies it adds to the project stick around?
13:38technomancydgrnbrg: yeah, that would be the way to do it
13:42dgrnbrgtechnomancy: so i'll need to add my dependencies to a newly gensymed profile, then i'll use set-profiles to add the new profile, and then I can pass along that project map to the subtasks?
13:43jcromartiemmitchell: what do you mean by "buffer" and "bounding box"
13:44mmitchelljcromartie: sorry yeah, should've added more context there. I'm talking about geo-spatial objects. I think the open-source "JTS" library will do exactly what I'm looking for.
13:44jcromartiecool
14:05aaelonyI'd like to key a sorted set of keys. (into #{} (keys {:a 1 :b 2 :c 3})) gives me a set #{:a :c :b}, and (sorted-set-by <) gives me #{}, but when I try to combine the two i get a cast exception. (into (sorted-set-by <) (keys {:a 1 :b 2 :c 3})) ClassCastException clojure.lang.Keyword cannot be cast to java.lang.Number clojure.lang.Numbers.lt (Numbers.java:219) Any way around this?
14:06ohpauleezaaelony: You can just use (sorted-set), no?
14:06ohpauleezI'm drawing a blank, maybe someone can job my memory - I have a vector ["a" "b" "c" "d"], I want to know the next element after a given element (say "b"); nil if at the end of the list
14:06aaelonyohpauleez: acutally I'd like sorted-set-by with a "<"
14:07amalloy&(second (drop-while (complement #{"b"}) ["a" "b" "c" "d"]))?
14:07lazybot⇒ "c"
14:07ohpauleeznvm on my question - nthrest gives me what I need
14:07ohpauleezamalloy: Ahh that's nice too
14:07aaelonyit's more clear here: https://www.refheap.com/paste/5443
14:10callenI really wish more projects were documented like this: http://sqlkorma.com/docs
14:10aaelonyseems odd
14:12scriptornot really a fan of the color scheme
14:12callennDuff: why?
14:12nDuff...for one thing, there are a ton of macros, so not everything works everywhere
14:12nDuffand the docs don't cover which things are what.
14:13nDuffalso, it's very, very hard to extend for database-specific syntax
14:13nDuffif you want to add a clause into a programatically-generated statement, it often can't be done, and you have to provide the whole thing yourself.
14:15nDuffcallen: anyhow, after spending many, many hours fighting korma, I gave up and wrote my own, and am much happier with it.
14:15dustingetznDuff: github link?
14:16nDuffdustingetz: Unreleased. Implements only as much as I personally need and nothing more, so it probably wouldn't be useful to anyone else.
14:17dustingetzits quite useful to see what things other people find useful, would love to see it if you ever reconsider
14:18callennDuff: what do you prefer?
14:18callennDuff: the one you wrote?
14:19nDuffHaven't looked at the other public ones.
14:19callenthat's odd. writing your own before having looked at alternatives, and then still not releasing it?
14:19nDuffIf there's something with no macros that's easier to extend for custom syntax, that might be sane.
14:19callennDuff: are you a Forth programmer?
14:19nDuffHeh.
14:19callennDuff: clearly you know what I'm referring to, even if you aren't.
14:19ToBeReplacedI'm working through the enlive-tutorial at https://github.com/swannodette/enlive-tutorial and got stuck on this line:
14:19ToBeReplaced(def *link-sel* [[:.content (nth-of-type 1)] :> first-child])
14:20ToBeReplacedI think the syntax is confusing me; could someone explain what it is saying?
14:20callenI still find the Clojurian insistence on mixing frontend with code galling.
14:20nDuffcallen: If I'm going to release something, I'm going to know the competitive field and have it be something actually worth using.
14:20callennDuff: http://clojureql.org/examples.html this is, along with clojure.sql itself, the other main contender.
14:21nDuffcallen: ...if I want to get something working for my immediate case RIGHT BLOODY NOW, and I can do that with less time spent than learning another 3rd-party library, well, of _course_ I'm going to do that.
14:21nDuffcallen: *nod*; I use clojure.sql
14:21dustingetzcallen: i think they take after the ruby community, there's a lot of ui/mt code mixed together. i think its due to the nature of html
14:21nDuff(err, "learning another 3rd-party library" including, of course, learning it well enough to extend it)
14:21callenI don't find it that difficult to learn to use other peoples' libraries, even ones with documentation written by psychotics.
14:21dustingetzif you can write an ajax single page app, no problems separating ui and mt
14:21nDuffcallen: Using libraries is one thing. Extending them is sometimes another.
14:22callendustingetz: I usually take a hybrid approach.
14:22ro_stso i know i can destructure maps in fn args when i know the key names
14:22dustingetzbut if you want to pretender, or if you want to write a html app instead of single page ajax app, you don't have much of a choice but to complect your concerns
14:22ro_stbut how do i get a map of all the keys passed to the fn?
14:22callendustingetz: simple/plain per-page templates, but each template is an AJAX app of sorts.
14:22dustingetzprerender*
14:22dustingetztwitter talks about this, they had a single page app for a while with nice and clean code, it didn't work out because performance sucked on older browsers
14:22ro_stfn [& {:keys [*]}] sort of thing
14:22dustingetzthey want to control performance thus they prerender
14:23nDuffcallen: ...libraries can be easy enough to get started with, but then become difficult once one is committed (and trying to do difficult things).
14:23callenokay, re: complect -> http://i.imgur.com/hB7r9.png
14:23ohpauleezamalloy: Thank you for earlier, I like that much better than what I came up with
14:23callennDuff: what were you trying to do with your SQL exactly?
14:23dustingetzhahaha nice link
14:23dustingetzcallen
14:23callendustingetz: it makes me twitch everytime a Clojure user uses that word.
14:23dustingetzwhy?
14:23clojurebothttp://clojure.org/rationale
14:24callendustingetz: it has more connection to plaiting and weaving than complexity.
14:24callendustingetz: I took Latin and know the word from that origin.
14:24dustingetzhalf of clojure's value is it provides a common vocabulary to talk about how to solve problems
14:24ro_stohpauleez: :-) do you know how to gather all the k/v args passed to an fn into a map?
14:24callendustingetz: that's called a cult. Scientology has their own vocabulary too.
14:24dustingetzsees and all that stuff covabulary as a computer language, as well as spoken language
14:24callendustingetz: stop misusing words just because our glorious leader decided to experiment in a presentation.
14:24dustingetzwtf, spellcheck
14:25nDuffcallen: Using syntax that wasn't supported. INSERT OR REPLACE, BETWEEN ? AND ?, ? IN (?, ?, ...), etc.
14:25ro_stsomeone appears to be short on conjugals.
14:25nDuffcallen: ...ON DUPLICATE KEY UPDATE...
14:25callennDuff: why not add that functionality to the library?
14:25nDuffcallen: ...building the queries by piping them through mutators (which didn't work at all, on account of being macros)...
14:26ohpauleezro_st: (apply hash-map args)
14:26zerokarmaleftcallen: ejackson has the best tongue-in-cheek usage of complect in his core.logic euroclojure talk
14:26ro_stnice! thanks
14:26callennDuff: the hell were you trying to do?
14:26ohpauleezro_st: welcome
14:26callennDuff: what necessitates this sort of query grammar?
14:26FrozenlockUsing Noir (or compojure I suppose), is there a way to conserve the POST uri in the address bar? I would like the user to be able to copy the address and send it to friends. As it is, the POST uri shown is the same as the GET one (no variable=value stuff). Should I use a redirect after the POST instead?
14:26ro_stobvious, now that you mention it, of course :-)
14:27callenFrozenlock: is this something you've done before in another web framework?
14:27nDuffcallen: I could go into the details, but... why do you care? They're legitimate constructs, and any query builder worth its salt should support them, period.
14:27Frozenlockcallen: No.
14:27FrozenlockYou could call me a web virgin :)
14:27callenFrozenlock: what leads you to believe this is specific to Noir?
14:27callenoh, a web virgin. How apropos to what I'm talking about.
14:27nDuff...or, if they aren't supported, there should be an easy way to _make_ them supported.
14:27callenFrozenlock: have you read up on how POST works?
14:27ro_stFrozenlock: that's not possible. only GET queries are possible from a web browser address bar
14:28callenro_st: shut the hell up, I'm trying to teach him something useful.
14:28nDuffClojure has lots of ways to make that possible -- heck, protocols are as perfect a thing I could imagine for the purpose
14:28callenFrozenlock: POST methods in HTTP are supposed to modify things.
14:28clojurebotdakrone maintains clj-http
14:28nDuff...but Korma, of course, doesn't use them.
14:28callenFrozenlock: friends shouldn't be linking each other URIs that modify things.
14:28callenFrozenlock: they should be linking each other content that is a GET
14:28ro_stcallen: i'll consider it :p
14:28callenFrozenlock: other verbiage, such as POST, PUT, PATCH etc are wrapped up in mutation and aren't designed for sharing. Intentionally so.
14:28callenFrozenlock: comprende?
14:29nDuffcallen: ...if Korma supported protocol-based extension, I probably _would_ have extended it, rather than setting off alone.
14:29FrozenlockAwww. I was sure to have seen variable=value in some URI. Can a form be used with a GET method?
14:29callenFrozenlock: variable=value in the URI is GET
14:29FrozenlockYes, what I wanted was simply impossible.
14:29callenFrozenlock: that's not the point, I'm trying to explain why what you want is wrongheaded.
14:29nDuffcallen: ...but its design wasn't built to be readily extensible, and building something new was the lighter-weight approach than fixing it.
14:29callennDuff: that's fair.
14:30technomancyc.j.jdbc isn't really even the right base abstraction to build on unfortunately
14:30callentechnomancy: pretty sure he built on clojure.sql, not jdbc directly.
14:30callentechnomancy: unless you mean to conflate the two.
14:31technomancywhat's clojure.sql?
14:32Frozenlockcallen: Simply PUT, I was using POST wrongly. I didn't intend to modify things. Rather just give the user some option on where to go next. For example, choose a date and press the button.
14:38FrozenlockIndeed the GET gives me the variable=value in the URI. This solves my problem, thank you very much :)
14:39bruceadamsFrozenlock: cool! please be careful that the GET with parameters will behave well for someone that it is sent to.
14:40Frozenlockbruceadams: You mean not dependant uppon session information or something like that?
14:40bruceadamsFrozenlock: exactly
14:57technomancythat's a neat trick: Wrong number of args (-1) passed to: conf$prefix
14:57technomancyhow does one pass a negative number of args?
14:58casionoverflow?
15:02hiredmantechnomancy: macros
15:02technomancyhiredman: yeah, the call is inside an unquote, but prefix isn't a macro itself.
15:03hiredmanI imagine someone put in a "patch" to fix the arity exceptions to them by subtracting the implicit args or something
15:05mefestoanyone familiar with clojurewerkz/welle?
15:06mefestoi'm attempting to use the :if-none-modified option when storing a json doc but its not working for me
15:11amalloytechnomancy: i haven't seen that one for like a year, but i remember it happening before. i can never figure out how to reproduce it
15:12amalloydefinitely macro-related, but maybe the problem doesn't exist anymore on 1.4 or something
15:52josteinkso
15:52josteinkafter a small break from the world of clojure, Im trying to do some stuff again
15:53josteinkIm currently doing emacs24 + lein2 + nrepl
15:53josteinkis that the current recommended setup for productive work, or has that been obsoleted as well? :P
15:53SegFaultAX|workOr vim + vimclojure + lein2 :)
15:53xeqithat is the current recommended emacs setup
15:56josteinkSegFaultAX|work: me and vim dont get along too well :P
15:56josteinkxeqi: thanks
15:57josteinkclojure needs a site dedicated to keeping up to date on what is the recommended setup
15:57josteinkseriously though: lots of obsolete docs out there
16:01technomancythe official docs are up to date
16:01technomancyit's just that for some reason everyone feels compelled to create their own unofficial unmaintained write-ups =\
16:02duck11231it's because the out of date docs are what they find first. After they decide that those docs suck, they decide to publish their own and the cycle continues
16:03ivanis there a way to gently stab people who use :use? I mean this mysterious (copy ...) in gloss/io.clj is horrible
16:04nightfly_Is there no centralized Clojure wiki like CL's cliki?
16:04technomancyheh, "gently stab"
16:04juhu_chapatechnomancy: which are the official docs?
16:05SegFaultAX|worktechnomancy: The clojure.org docs are pretty bad.
16:05technomancynightfly_: not really, just dev.clojure.org, which you can't contribute to without signing paperwork
16:06pandeirowhy is (:require ... :refer [...]) better than (:use ... :only [...]) ?
16:06technomancySegFaultAX|work: oh yeah, totally agreed. I meant for Emacs integration.
16:06technomancyjuhu_chapa: I meant https://github.com/technomancy/swank-clojure
16:06SegFaultAX|workOh, I'll hush then.
16:06Raynespandeiro: Because the former is more consistent, since require can do everything use can do.
16:07RaynesUnless you're trying to be backwards compatible with Clojure 1.3
16:07pandeiroso it's for semantic purity?
16:07pandeiroahh it's only 1.4+?
16:08juhu_chapatechnomancy: :O
16:08devthkeep forgetting, what's a good way to turn [1 2] and [\a \b] into [[1 \a] [2 \b]]?
16:09amalloy ~zip
16:09amalloywhat the hell, clojurebot
16:09ivandon't use aleph perf with lamina perf. lamina perf is a total rewrite.
16:10duck11231I use both together just fine
16:10devthamalloy: ty
16:10raekdevth: (map vector xs ys)
16:11devthraek: ah, nice
16:11ivanduck11231: did you try starting an HTTP server? gloss/io.clj uses `copy` and lamina perf doesn't have it
16:11ivanoh, maybe I need gloss 0.2.2 branch
16:12nightfly_technomancy: That's too bad
16:12SegFaultAX|work,(map vector [1 2] [\a \b])
16:12clojurebot([1 \a] [2 \b])
16:12SegFaultAX|workdevth: ^
16:12devthSegFaultAX|work: cool thanks
16:13SegFaultAX|workdevth: Zip isn't really a thing in Clojure because map is variadic.
16:13duck11231ivan: yeah, I'd check your deps. sounds like you have an old version in there somewhere
16:13kencauseyHello, I just updated my checkout of emacs from git and built it and now starter-kit-2.0.3/starter-kit-misc.el is choking because of (void-variable hippie-expand-try-functions-list)
16:14devthSegFaultAX|work: makes sense. trying to get better at determining the right fn for the job.
16:17brainproxyin my project.clj I have `:resource-paths ["mydir" "resources"]`
16:17brainproxyw/ the idea that clojure.java.io/resource would then be able to find things under mydir/
16:18brainproxybut i guess that's not how it works
16:18RaynesThat's exactly how it works.
16:18raekbrainproxy: if you have a file in mydir/foo/bar.txt you should be able to access it via (io/resource "foo/bar.txt")
16:18hiredmanresoure-paths are "roots"
16:18brainproxyahhhh
16:18brainproxythanks
16:19brainproxythat clears it up :)
16:20sprocQuestion: Why a NPE here? http://pastebin.com/1ySJdVtb
16:20nDuffsproc: In the future, would you mind using gist.github.com or refheap? pastebin.com is full of ads.
16:20sprocErr, not an NPE, a ClassNotFoundException
16:20sprocSure.
16:21sprochttps://gist.github.com/3823021
16:21nDuffsproc: You need a require
16:21emezeskesproc: You have not :use-d or :require-d or loaded clojure.java.shell
16:24sprocThanks, working now.
16:27sprocAnyone used this "sh" function to run a piped command?
16:27kencauseyI've worked around my above problem for now by modifying starter-kit-misc.el to check whether or not hippie-expand-try-functions-list is bound and if not set it to an empty list
16:28nDuffsproc: For anything even remotely interesting, I typically end up using conch.
16:30nDuffsproc: that said -- setting up pipelines is a shell operation; you can run (sh "sh" "-c" "foo | bar") if you want to launch a shell and have it do the work, though there are very compelling reasons to consider that bad practice.
16:31nDuff...short summary: The JVM doesn't provide very good tools for doing that kind of thing.
16:32Apage43I only learned recently that you can'
16:32Apage43t even change the current working directory
16:37technomancyI'm actually coming around on that one
16:37technomancyseen too many pieces of Ruby code that makes bad assumptions about the current directory
16:43hiredmanin this talk he references arguments about the exit code of the jvm, and if such a thing is meaningful http://www.infoq.com/presentations/Towards-a-Universal-VM
16:43hiredmanstill funny
16:44technomancy"if it's outside the JVM, then by definition it doesn't matter. I don't see why this isn't obvious." - JVM engineers
16:45hiredmantechnomancy: to be fair they seem to have done well with that attitude
16:46technomancyyes, but the same attitude killed smalltalk
16:47wingyhow do you smash multiple strings together?
16:47cemericktechnomancy: I think the JVM is past that at this point :-)
16:47nDuffwingy: (str "foo" "bar") is one way.
16:47cemerickwingy: That thing at CERN should be able to do it.
16:48nDuffwingy: (format "Reading %s, got %s" "foo" "bar") is another.
16:48wingyCERN?
16:48wingynDuff: thx
16:48hiredmantechnomancy: that attitude correlates with the death of smalltalk
16:48cemerickwingy: They smash all sorts of things over there.
16:49technomancyhiredman: sure, I mean there were a host of causes of death
16:50cemerickThere's a rev of jrocket that sat right on top of hypervisors IIRC…at that point, who cares what's outside of the JVM?
16:50cemerickPresumably, that's the endgame.
16:50scriptorwingy: European Center for Nuclear Research, CERN
16:50scriptor:p
16:50wingy:)
16:51wingy(str) will do
16:57Raynescemerick: Congrats on properly namespacing your libs, dude! Must be a big win for you. I can't express how happy I am for you, man.
16:57cemerickwha?
16:57Raynes;)
17:00Raynescemerick: I was referring to the halloway tweet.
17:00technomancyRaynes: it shows commitment. that you're not interested in handing it off to another maintainer down the road. =)
17:00Raynestechnomancy: Whereas you and I are all but throwing projects at other people (including each other)?
17:01brehaut~rimshot
17:01clojurebotBadum, *tish*
17:01cemerickoh, that
17:01cemerickanother dead horse on both sides :-P
17:04callenI don't really want to ask in an actual database channel because they have more religious fervor than a chapel, but if I'm generally growing tired of MongoDB for various reasons, but still want schema-free, what are my choices?
17:05cemerickcallen: the faithful are everywhere ;-)
17:05callenI hate CouchDB with a fiery passion, Riak is poorly documented. The best options seem to be Cassandra, HBase, maybe Redis.
17:05brehautpostgresql
17:05cemerickbrehaut: hey-o!
17:05callenbrehaut: I said schemafree, and if you say hstore, I will stone you with a boulder.
17:06technomancycallen: 9.2 has json types
17:06cemerickcallen: dude, you've got more fervor than all of #mongo put together
17:06callentechnomancy: I'm familiar with postgresql, I'm not doing that.
17:06callentechnomancy: I use PGSQL when I want a SQL database. Using a hammer for everything is a bad idea.
17:06nickmbaileycassandra could perhaps be an option if you are having scaling problems with mongo, no one runs a single node cassandra server
17:06nickmbaileysame for hbase really
17:06technomancyeven when other options are HBase, Casandra, and Redis?
17:07callennickmbailey: that's kinda the point.
17:07callennickmbailey: I'm wobbly on Redis because I don't have happy-feels about Sentinel's master election.
17:07technomancyhbase brings a ton of hadoop ecosystem goop into the picture
17:07callenHBase and Cassandra have a lot of attached drama from various angles. I hate maintaining hadoop clusters.
17:07callenand Cassandra is pretty heavy-duty.
17:07nickmbaileyjust making sure you weren't trying to replace your single node mongo install with cassandra or hbase
17:07hiredmanthere is always datomic
17:07nickmbailey:)
17:08callenhiredman: I don't use databases that belong to other people.
17:08callenand I can fake a triplet-store in most things. Also, Cassandra's timestamping and truth-merging works on the same principle, albeit without ever really exposing it.
17:08technomancypretty sure hiredman isn't serious
17:08hiredman*shrug*
17:09hiredmanI find datomic's architecture very compelling
17:09emezeskecallen: You could always write your own db
17:09ivanI'm sure Datomic can make you something that runs on your dozen postgres instances
17:10callenemezeske: not exactly a time-saving maneuver, but I do have a pretty good idea of what an ideal database for the sorts I do would be.
17:10callenemezeske: it'd end up looking similar to the DataStax stuff.
17:10technomancysupposedly riak has gotten a lot more accessible recently
17:10callentechnomancy: I really despise them for making master-to-master replication enterprise-only.
17:10hiredmanvery bad
17:10callentechnomancy: I had a bad experience with it more recently than that.
17:11technomancyaccessible, reliable, oss: pick any two?
17:11callenseemingly.
17:11callenRiak isn't too far from what I want, but there are a few critical issues
17:12callenfirst off, the per node performance is awful beyond my ability to articulate. Second off, its map-reduce is equally as useless as MongoDB's, third, the damned master-master/cross-cluster being enterprise-only.
17:12jcromartie_is there a HOF that reverses argument order?
17:12cemerickall databases are owned by someone in the end
17:12lpvbflip?
17:12callenthe problem with half-assed map-reduce is that if they pretend aggregations are a solved problem, they absolve themselves of ever really solving the problem.
17:12Raynescemerick: I'm putting that in the bible for this new religion I'm creating.
17:13callen10gen is starting to wake up to this, but Basho is unlikely to do so anytime soon because they're too busying hiring technical writers.
17:13technomancy"Just write a map/reduce function in erlang."
17:13hiredman(still funny)
17:13cemerickRaynes: will you be advertising in Popular Mechanics?
17:14callenI'm half-tempted to use ElasticSearch as a first-order datastore
17:15calleneven though doing so is nuts.
17:15mpanI'm getting a divide by zero, but I've checked and the denominator isn't = 0
17:15mpanor is = not the correct condition?
17:15hiredman,(= 0 0.0)
17:15clojurebotfalse
17:15mpaner, what should I use then?
17:15callenis there a standard predicate for zero-ness?
17:15mpanand ouch
17:16hiredman,(zero? 0.0)
17:16clojurebottrue
17:16hiredman,(zero? 0)
17:16clojurebottrue
17:16mpanthanks
17:16callenthere's your answer.
17:16callen,botsnack
17:16clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: botsnack in this context, compiling:(NO_SOURCE_PATH:0)>
17:16callenhrm.
17:16callenthe bot deserves better.
17:16technomancythe bot is a thankless wretch
17:16technomancy~botsnack
17:16clojurebotThanks! Can I have chocolate next time
17:16wunkiis there a way to figure out the filesize of a file which is uploaded and received through a stream?
17:16technomancyhm; I guess not entirely thankless
17:17TimMccallen: Try ~
17:17TimMcnvm
17:17callenhas anyone here ever used ElasticSearch? it's pretty great.
17:17brehauttechnomancy: http://farm2.staticflickr.com/1185/1367663969_5aae77760f.jpg
17:18technomancycallen: it really is
17:18callentechnomancy: we use it a lot at my company, it replaced a custom NumPy algorithm.
17:19callentechnomancy: it's sooooooo fast
17:19callenI just wish it was slightly better at durability, then I'd use it for everything :P
17:20callendurability isn't part of cap theorem
17:20callenI'm not talking about the fact that ES is AP
17:20callenI'm talking about the fact that it's very lackadaisical about wiping out indices and not being very careful about filesystem and protocol level merges.
17:21callenit's presumed to be a secondary point of contact for information.
17:45ToBeReplacedwhat is the canonical way to make trailing slashes 302 to the uri without it using ring and/or compojure?
17:46ToBeReplacedi see there was a function for it in compojure that seems to have been dropped; maybe the reason why it was dropped would be helpful?
17:52emezeskeToBeReplaced: Why do you need such a thing? /curiosity
17:53ToBeReplacedmaybe i don't... i'm trying to step into webdev and google suggested it was standard practice to redirect one to the other
17:54ToBeReplacedat this point, i'm just walking through the clojure/ring/compojure/enlive/clojureql tool chain and picking small problems to see how to go about solving them
17:54ToBeReplacedwould you recommend another direction?
17:55emezeskeI've never heard of that as a standard practice, but that doesn't really mean anything
17:56wingyyou think datomic can be used as a session store?
17:56wingyor is redis a better fit
17:56cemerickToBeReplaced: /foo and /foo/ are completely distinct URIs; any redirection from one to the other is a service-specific convention
17:57emezeskeToBeReplaced: If you're just looking for an exercise, you could always make a little blog engine or shopping cart or something
17:58ToBeReplacedcemerick: right; so i'll contend that for my dummy case, joe-user browsing to site/login or site/login/ should be redirected to one of the two (lets say site/login), instead of receiving a 404 on one of them
17:59cemerickToBeReplaced: I would personally handle such situations on a case-by-case basis
17:59ToBeReplacedi could add: (compojure.core/GET "/login/" [] (ring.util.response/redirect "/login"))
18:00ToBeReplacedinteresting; okay... i'll go case by case for now until i understand better
18:00ToBeReplacedthanks to both of you
18:01emezeskeToBeReplaced: If you insist on doing it, that would be a typical implementation.
18:02amalloyhttps://github.com/4clojure/4clojure/blob/develop/src/foreclojure/ring.clj#L33 is also a not-crazy approach
18:02emezeskeToBeReplaced: (With the caveat that in production you'd probably handle that in your web server config, e.g. nginx.conf)
18:04ToBeReplacedamalloy: cool
18:07ToBeReplacedemezeske: thanks for that; being new in the web space means that i'm biting off more than i need to in some places and less than i need to in others
18:07cemerickemezeske: I've been hearing from more and more people that have stopped bothering with nginx, etc. given what CDNs give you these days.
18:08emezeskeToBeReplaced: Sure. I'm very opinionated, so take whatever I say with a wheelbarrow of salt, though.
18:09emezeskecemerick: Yeah, CDNs take care of the static serving stuff nicely.
18:09emezeskecemerick: I'd have a hard time exposing jetty or whatever directly, though
18:09cemerickThere was an nginx loyalist in here a few days ago that was arguing otherwise. I'll add you to the tally. :-)
18:10emezeskeI just see things like the slow loris attack and think that having a hardened layer between the outside and the inside is good
18:10brehautwait. peopel are loyal to a _web server_‽
18:10brehauttahts like being loyal to dirt
18:10brehautuseful yes, but its everywhere
18:10RaynesDon't be dissing my soil.
18:11cemerickbrehaut: go talk to the hordes that have been buying food with apache sysadmin work for ~20 years :-P
18:11brehautcemerick: well yeah, apache has job security ;)
18:12brehautanyone with 800 lines of mod_rewrite goop isnt going to get the sack any time soon
18:13emezeskecemerick: Another advantage to something like nginx is that you can write your app such that it's oblivious to things like way-too-big POST data, etc, and enforce that at the webserver level
18:13emezeskecemerick: So the web server sort of acts like the gatekeeper and sanitizes things
18:14djanatynwow! a multi-threaded, graphical program I wrote in clojure on windows works on my linux without any changes. That's really cool :)
18:14mpenetnginx has some nice tricks in its sleeve, like using it for failover between 2 jetty instances when doing deploys
18:14mpenetapache can probably do it, but nginx makes it way too simple
18:14emezeskempenet: Aye, and trivial no-downtime configuration updates
18:15mpenetemezeske: yup
18:17mpenetlots of people also use it to apply caching to some REST ressouce/service (I think lanyard caches solr queries using nginx for instance), I am not too familiar with solr, maybe it is has that built
18:17mpenetin
18:18mpenetAgain, it just makes it easy. It is probably not the best solution for that kind of thing though
18:18emezeskeI guess realistically, most people should just deploy to something like Heroku and let them take care of the gritty details of the web server config... :)
18:20cemerickIndeed. I can't imagine I'm ever going to touch an nginx config file.
18:21hiredmanI end up having to touch them everyonce and a while because nginx is fronting our jenkins and archiva at work
18:21hiredmanand will decide to not let you deploy jars over a certain size sometimes
18:21mpenetHeroku is fine up to a point imho, when it gets too complex it seems to become quite costly
18:22technomancynginx was such a breath of fresh air after apache config that my memories with it were uniformly positive
18:22technomancy(course that was in front of ruby mongrels c. 2008)
18:22emezesketechnomancy: Oh hell yeah. nginx config is actually quite nice IMHO
18:22mpenetxml'ish config files :/
18:23cemerickthe only one I never got to know was lighttpd
18:23cemerickah, lighty, pylons, and kid :-P
18:24mpenetcemerick: kid the template language?
18:25mpenetcemerick: am I not the only person on earth who touched this thing back then
18:31cemerickmpenet: yup, I enjoyed it quite a lot
18:31cemerickThen it was abandoned for Genshi or whatever... :-|
18:32mpenetfor mako I think
18:33cemerickyeah, whatever it was
18:34mpenetI used to like it at the early days of TurboGears, I was just so used to xslt. But now... it feels so "complected" :)
18:35cemerickI never went in for TG. Pylons + WSGI all the way. :-)
18:36djanatynhow many agents with threads is okay?
18:36djanatynIn the thing I'm working on now, I'm making 100 agents and giving them all a task. is...is that okay?
18:37hiredmanagents do not map 1:1 to threads
18:37hiredmanagent actions are run on threads from two different thread pools depending on how the actions are dispatched
18:37djanatynOh, hmm. Does that mean using (Thread/sleep) doesn't guarantee that an agent will pause for that amount of time?
18:39hiredmandjanatyn: it will
18:39technomancyit'll also clog the thread pool
18:40djanatynwhat does clogging the thread pool mean?
18:41hiredmandjanatyn: http://clojure.org/agents
18:44doomlorddoes clojure have anything like the haskell "where" construct (i figure that might look odd in prefix form)
18:49amalloy&(->> (+ x 1) (let [x 5]))
18:49lazybot⇒ 6
18:49amalloybut no, nobody uses that
18:50emezeskeamalloy: You are sinister.
18:50emezeskedoomlord: It would be trivial to write a defn-like macro that gave you a where clause. O_o
18:50amalloywhy would it be defn-like?
18:50hiredmanbut don't, please
18:51emezeskeamalloy: I think in Haskell that the where clause is part of the function definition syntax (but don't quote me on that)
18:51emezeskeamalloy: I.e. it's not simply an expression that you can put anywhere you want
18:51hiredmanI think it is part of the pattern matching syntax, which happens to be part of how you definie functions?
18:52emezeskehiredman: I think that's probably right
18:52amalloyyes, i think hiredman's got it there
19:08awestholm1Quick newbie question: I've got a macro to generate a korma query, and would like to be able to stick a wrapper around it to basically add some logic to the end of the generated code. Having a bit of trouble with that. Two questions: a) One approach is to collect the extra query bits as arguments to the macro and expand them into the code, but I don't see anything about conditional expansion inside
19:08awestholm1of a syntax quote - am I missing something? b) Is there a way to flat out wrap a macro? i.e., grab the generated code and splice my additional code into it, then execute it? Are there other, better options for solving this problem?
19:11emezeske,`(1 2 3 ~(if true 4 5) 5)
19:11clojurebot(1 2 3 4 5)
19:12emezeske,(let [x true] `(1 2 3 ~(if x 4 5) 5))
19:12clojurebot(1 2 3 4 5)
19:13emezeskeOr maybe
19:13emezeske,(let [x true y [4 5 6]] `(1 2 3 ~@(if x y []) 5))
19:13clojurebot(1 2 3 4 5 ...)
19:13awestholm1emezeske: facepalm simple. Thanks!
19:13emezeskeawestholm1: ^ helpful at all?
19:13emezeskeSweet.
19:23awestholm1emezeske: Actually, spoke too soon. That get's me halfway there, but I really only want to unquote if true... otherwise I have a nil there that won't work in the expansion. Any ideas? tried `(1 2 3 ~(when false 'not here))
19:23awestholm1but that evaluates to (1 2 3 nil)
19:23gfredericks,`(1 2 3 ~@(when false '[not] []))
19:23clojurebot(1 2 3)
19:24awestholm1gfredericks: Perfect. Thanks!
19:24gfredericksnp
19:31SgeoIs it reasonable to run MySQL or Postgres in-memory?
19:31SgeoIf permanent storage is unlikely to be necessary?
19:32emezeskeThere just has to be a better IRC channel for that question.
20:01callennDuff: another question, what is it you wanted to do that couldn't be done with raw and exec-raw? I find it unlikely that you needed the full generality of composing the verbiage.
20:01callennDuff: the full generality and multiple composition layers are what made SQLAlchemy so horrible. Why would you want that for Clojure?
20:09FrozenlockIs there a way in compojure/noir to make a github-like directory path? For example, if the current URI is my-website.com/abc/project/id, I would like to have links to: <abc> / <abc/project> / <abc/project/id>.
20:11cemerickFrozenlock: you mean breadcrumbs? Lots of ways to do them, but all out of scope for compojure and noir.
20:11cemerickwell, definitely out of scope for compojure; maybe noir has something baked in for them…?
20:12FrozenlockOhhh that's the term! I might have a better in my searches then :)
20:13amalloy&(rest (reductions conj [] '(abc project id)))
20:13lazybot⇒ ([abc] [abc project] [abc project id])
20:14Sgeo&(reductions conj [] '(abc project id))
20:14lazybot⇒ ([] [abc] [abc project] [abc project id])
20:14amalloycombine with your function to create a link from a list of things, and tada?
20:15FrozenlockIndeed. I suppose getting the current URI is trivial; so simply separate the string at '/' and that's it.
20:16FrozenlockThanks for the reductions function btw, I wasn't aware of it.
20:16emezeskeFrozenlock: Well, presumably project and id are already passed as arguments to your route handler?
20:16emezeskeFrozenlock: E.g. with a route like "abc/:project/:id"
20:16FrozenlockYes
20:17emezeskeSo you don't need to parse the URI yourself
20:21FrozenlockI'm not sure I follow... In this case I would need to call the function and send it the argument myself? ---> (make-breadcrumbs project id). A function without arguments would be sexier (make-breadcrumbs)
20:21SgeoHow often is :as req or similar used in the [] things in Compojure's GET/POST/etc macros?
20:21SgeoIs there another way, besides :as blah to access things such as session data?
20:23gfrederickshow do you access session data using :as blah?
20:24Sgeo(:session blah) I think?
20:24gfredericksand your route looks like (GET "foo" {:as blah} ...)?
20:25SgeoHypothetically, like (GET "foo" [id foo bar :as blah] ...)
20:25gfredericksoh right
20:25gfredericksyou can probably throw session in there
20:25gfredericks[id foo bar session]
20:27thorbjornDX##((fn group-by-2 [s] (if (even? (count s)) (partition 2 s) (conj (partition 2 (rest s)) (seq [(first s) (second s)])))) (range 13)
20:27thorbjornDX,((fn group-by-2 [s] (if (even? (count s)) (partition 2 s) (conj (partition 2 (rest s)) (seq [(first s) (second s)])))) (range 13)
20:27clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
20:27thorbjornDX,((fn group-by-2 [s] (if (even? (count s)) (partition 2 s) (conj (partition 2 (rest s)) (seq [(first s) (second s)])))) (range 13)) ;whoops
20:27clojurebot((0 1) (1 2) (3 4) (5 6) (7 8) ...)
20:28thorbjornDXcasion: I actually don't care if the "duplicated" element is at the back or the front, and this method works for generic sequences (not just range)
20:29gfredericksthat is a weird function
20:30thorbjornDXgfredericks: yep, it's basically a way of doing partition-all, but always returning groups of two elements (in this case it reuses the second element)
20:30gfredericks(seq [(first s) (second s)]) could be (take 2 s)
20:31thorbjornDXgfredericks: good catch, thanks
20:31thorbjornDXgfredericks: yeah, the (seq [vec]) felt a bit awkward
20:31gfredericksthorbjornDX: you probably could have left it as a vector without much trouble
20:31hiredmanor called list
20:32thorbjornDXgfredericks: can you use 'apply on a vector?
20:32gfrederickssure
20:32thorbjornDXhiredman: hah, I always overlook simple things like that
20:32gfredericks,(apply + [1 2 3 4 5])
20:32clojurebot15
20:33thorbjornDX,(apply str {:a 'b :c 'd})
20:33clojurebot"[:a b][:c d]"
20:41amalloy(seq [(first s) (second s)]) isn't the same as (take 2 s) if s is empty
20:42gfrederickswell s can't be empty in his code; but it could have 1 element
20:42gfredericks(def TAKE [n coll] (map #(nth coll %) (range n)))
20:42amalloyi haven't really been following along
20:48thorbjornDXI can constrain s to be two or more long (which actually makes sense in my application)
20:52emezeskegfredericks: Wonderful, huh?
20:52gfredericksemezeske: yo
20:52gfrederickswoah wow
20:52emezeskehaha
20:52gfredericksemezeske: I have a cljsbuild usage question
20:52emezeskeShoot.
20:53gfredericksI have two build configs, once for source and one for test
20:53gfredericksso the source paths are "src-cljs" and "test-cljs" respectively
20:53gfredericksworks fine generally, except for the manner in which recompiles are triggered in watching mode
20:53gfredericksspecifically if I update a source file, only the source build gets triggered
20:53gfrederickseven though it obviously effects the test build
20:53emezeskeAh, yeah, that is not good
20:54gfredericksokay so I'm not just using it wrong?
20:54emezeskeNo, that's a shortcoming.
20:54emezeskeI've been thinking about how to handle that (and other related) problems
20:54gfredericksno problem whatsoever, just checking
20:54emezeskeThere's some discussion on this issue: https://github.com/emezeske/lein-cljsbuild/issues/119
20:54gfredericksemezeske: thanks, as well as for the library in general :)
20:55emezeskeTL;DR: I want to build a dependency tree and watch all of it for changes.
20:55emezeskegfredericks: Glad it's useful.
21:26lazybot⇒ =
21:36cjfriszgfredericks: That one's gonna take me a second to grok
21:37gfrederickscjfrisz: ##(read-string "[=~]")
21:37lazybotjava.lang.RuntimeException: Unmatched delimiter: ]
21:38gfrederickscjfrisz: the ~ has special syntactic meaning, so it won't parse them within a symbol
21:38gfredericksthough it conceivably could
21:39devn##(read-string "#=~")
21:39lazybotjava.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.
21:43cemerickis clojure.browser.dom just a sample? There's console logging all over it, but maybe that was accidentally left in at some point for debugging purposes?
21:44emezeskecemerick: I don't think anyone ever uses that
21:44emezeskecemerick: It's so incomplete
21:45cemerickhum
21:45cemerickhelluva canonical ns…
21:46cemerickemezeske: don't be so cynical ;-)
21:47emezeskeHaha, I kid, I kid. But it is a bit awkward to have something so half-baked in there
21:47emezeskeI guess maybe it's good for simple little demos?
21:48gfredericksI'm using the chrome debugger on my cljs. It is quite a time.
21:48gfredericksin case anybody was wondering.
21:49gfredericksan interesting way to learn about cljs internals
21:51cemerick"quite a time"?
21:51gfredericksyeah; lots of careful reading through variable names like cljs.core.first.call(...)
21:51gfrederickshave to distinguish those from the important function calls
21:52cemerickinteresting: a file containing a namespace like foo-bar can be named foo-bar.cljs
21:52gfredericksyeah; I bet it just reads all the *.cljs files
21:53emezeskecemerick: Most of the time.
21:53gfredericksyou could probably name the file anything :P
21:53cemerickgfredericks: no way :-P
21:53emezeskecemerick: Under some circumstances your file might be loaded via a (resource), in which case that will break.
21:53cemerickemezeske: most?
21:53emezeskeI forget the exact circumstances.
21:53cemerickSurely it checks both, then?
21:54emezeskeAlso, that would break distribution of that code as a JAR (which may or may not bother you)
21:56cemerickhuh, foo_bar.cljs works for me, but foo-bar.cljs doesn't…?
21:56gfrederickscemerick: isn't that the opposite of what you initially claimed?
21:57emezeskeClojureScript is still very JVM-ey, it load lots of stuff as Java resources, etc
21:57cemerickgfredericks: yeah, that was just based on noticing the dom-helpers.cljs file in the twitterbuzz sample
21:57gfredericksah ha
21:58emezeskeI think the hyphen will definitely work if the source file is in the source path passed to cljs.closure/build
21:58emezeskeAnd only *might* work otherwise
21:58emezeskeSame thing with just throwing all the source files in a toplevel directory (instead of making the dir structure match the ns structure like with Java)
21:59cemerickOK, hypens just don't work, at least from the REPL
21:59cemerickI'll bet the twitterbuzz stuff is just old enough to have benefited from early slop in the naming requirements.
22:02gfrederickscljs.core.pr_str(more) // "(nil)"
22:02gfrederickscljs.core.count(more) // 0
22:02gfredericksthis is exciting!
22:07cemerickearly days
22:07FrozenlockIs there many cljs app in the wild?
22:08cemerickInteresting, goog.dom.query appears to be a straight rip of dojo's $$
22:08cemerickdocs and all, even
22:10scottjcemerick: rip off? it's a port and it acknowledges it
22:10brehautman dojo. is that thing still around?
22:10gfrederickscljs.core.count and cljs.core.bounded_count disagree
22:10cemerickscottj: rip *of*, not rip off
22:11cemerickwasn't saying anything derogatory
22:11scottjcemerick: sorry, misread
22:11cemerickbrehaut: in your cljs apps, yup ;-)
22:15gfredericksemezeske: how do I check what version of cljs I'm using?
22:18scottjgfredericks: in code or one-time? for latter, "ls lib/clojurescript*" maybe?
22:19gfrederickswell I don't think lein2 uses /lib, and since cljsbuild is a plugin I don't think that applies anyhow
22:20cemerickgfredericks: you could use something like configleaf to drop the runtime/build-time project.clj file into one of your source-paths, and pick up version numbers from there
22:21cemerickI think there was discussion recently about adding a *cljs-version* var though.
22:21cemericker, not-var. Whatever they're called. :-(
22:21gfrederickscemerick: well then; I guess I'll look for easier solutions first :) thanks
22:21gfredericksconfig property?
22:25gfredericksman I am seeing some weird stuff
22:26gfredericksanybody know where cljs.core/cons is defined?
22:27gfredericksoh nevermine it's declared and defined later
22:28gfredericksseq should always return nil when empty, right?
22:41jimdueyFor anyone interested in parallel core.logic.
22:41jimdueyhttp://www.clojure.net/2012/10/02/More-core.logic/
22:52jcromartiehow can I call a constructor using a class value
22:53jcromartie,(let [x String] (new x))
22:53clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: x, compiling:(NO_SOURCE_PATH:0)>
22:53amalloyjcromartie: reflection
22:55jcromartiethanks
22:55amalloyclojure.lang.Reflector will help a little; clojure.reflect might have some helper but i dunno
23:03SgeoHow feasible is long polling with default Ring stuff?
23:19casionanyone know offhand what the canonical version of enlive is?
23:22xeqicasion: https://clojars.org/enlive
23:23casionxeqi: thanks
23:32SgeoWould I just use Aleph if I want to do that sort of thing?
23:51jcrzaIs there a more recent version of the clojure box.. thing available?
23:51jcrzaI'm a python/java noob and I want to get started with clojure
23:51technomancypretty sure clojurebox is abandoned
23:52jcrza=(
23:54technomancyjust grab leiningen, clojure-mode, emacs 24, and if you want to get fancy, nrepl.el
23:55technomancyclojurebox just mashes up old versions of those anyways
23:55casionemacs live is pretty good
23:56jcrzaAre there any windows IDEs you'd recommend?
23:56casionyou still need to install clojure and leiningen
23:56jcrzaI borked my linux partition.. haven't bothered to fix it
23:56technomancycasion: not really
23:56technomancyI mean, not clojure
23:56SgeoIs it reasonable to use gensym in runtime? For example, with add-watch?