#clojure logs

2015-02-09

00:38julianlevistonAt the AST level, does FP build substantially different patterns of form than OOP?
00:41justin_smithjulianleviston: you will see more explicit state passing and less mutation, which shows up even at the AST level
00:42julianlevistonjustin_smith: erm… factoring mutation out.
00:42julianlevistonjustin_smith: in other words, assuming immutability is used in both.
00:43justin_smithjulianleviston: then you will see more passing of opaque structures (and invocation via messages / methods) and less threading of data through first class data processing functions
00:44justin_smitherr, I reversed that, but I hope it's clear enough
00:46julianlevistonisn’t a method just a function?
00:46justin_smithjulianleviston: no, not in java (or thanks to the jvm, clojure)
00:46julianlevistonjustin_smith: but your main point about immutability holds true - it’s very rare to program OOP with immutable structures.
00:46justin_smithmethods are not first class
00:46justin_smiththey can't be function arguments
00:46julianlevistonjustin_smith: at the AST level, I mean...
00:47julianlevistondoesn’t a method/message call reify down to a function call?
00:47julianlevistonI guess I’d have to look into the JVM. Yeah, nevermind. I don’t really care enough yet to know.
00:47justin_smithjulianleviston: still, they are not top level - obj.meth() in strict oo should compile to (send-message obj meth)
00:48justin_smiththough I guess that looks almost first class huh? but the thing is "meth" is something totally different, based on what obj you send it to
00:48julianlevistondynamic dispatch
00:48justin_smithsure
00:49julianlevistonMakes me wonder how systems like Intentional Programming are even vaguely possible… are they just using tricks? I guess until (if?) it’s open sourced, we won’t really know.
00:54julianlevistonjustin_smith: and I wonder, therefore, if idiomatic stateful mutable OOP code could somehow be machine transformed into idiomatic immutable FP code if one had captured the intent clearly enough.
00:55justin_smithisn't that part of what haskell is for? translating pure code into side effecting code at compile time, because the monads and the invarients ensure that things will work
00:57julianlevistonor at least rather… that if one had captured the intention as source (not *quite* AST, really, but AST around intention, not state transformation or declaration of functional relationship)… that one could machine generate other syntactic and idiomatic forms. I guess this is largely what the other half of SEXPRS were supposed to be… whatever they were called again. I can’t rememeber. Been a while since I last rea
00:57julianlevistonJM’s paper.
00:57julianlevistonjustin_smith: I don’t know. I didn’t get that deeply into haskell (yet?)
00:57justin_smithjulianleviston: the other kind were m-expressions
00:58julianlevistonah yeah right.
00:58julianlevistonTho… they were still functional in nature if IIRC.
00:59justin_smithyeah. And ml (the ancestor of haskell) started out pretty similar to mexprs (and was at first implemented in lisp)
00:59justin_smithso we are basically the neanderthals that homo-haskellus somehow never wiped out
01:00julianlevistonhaha :)
03:13slipsetin clj-tagsoup, when parsing a document you're given a hiccup structure
03:14slipsetthis structure is basically a vector containing a keyword describing the tag [:html {} [:body ...]]
03:14slipsetthis leads me to two questions.
03:14slipset1) what's the idiomatic way to pick out a element down a path, if the vector were a map, I'd use get-in
03:15slipsetI could of course use get-in here as well, but it would take the form of (get-in html [0 1 4 3]) which is not that readable
03:16slipset2) The other question, what's the rationale behind letting the hiccup structure be presented a vector and not a map?
03:16TEttingerdoes hiccup provide something for this?
03:16TEttingermaps can't have duplicate keys
03:16slipset(inc TEttinger)
03:16lazybot⇒ 40
03:17TEttingerthanks
03:18slipsetdoesn't seem like hiccup has this in it's api.
03:18julianlevistonalso MapEntry order isn’t guaranteed, is it?
03:18slipsetjulianleviston: I guess it could have been an ordered map?
03:19julianlevistonslick: I guess they thought it’d be obvious to someone who knew Clojure data structures, perhaps?
03:19julianlevistonoops.
03:19julianleviston-> slipset
03:20TEttingeryeah, I'm not sure what the best way is either here. maybe a zipper
03:21julianlevistonthis is one of those problems that isn’t as trivial as one might assume at the beginning
03:26julianlevistonslipset: this thing I just found could be quite helpful: http://codereview.stackexchange.com/questions/19066/clojure-find-specific-element-in-html-tree
03:27julianlevistonslipset: you might have already seen it, but it’s specifically about finding specific named elemets (link in their case) within tagsoup output.
03:28julianlevistonsomething like that should prolly be PR’d into tag soup
03:34slipsetjulianleviston: thanks, and I agree it should probably be in tagsoup
03:35slipsetTEttinger: i guess it kinda smells like zipper. I've carefully avoided getting into zippers (no pun intended) but this might just be the time :)
03:40julianlevistonslipset: the only trouble is zippers don’t provide random access… they presuppose a structural awareness. Guess I’m not sure what you’re trying to accomplish, but it’s the equivalent of choosing imperative programming over declarative programming… one is much easier to reason about
03:40julianlevistonslipset: zippers are quite good when you know the structure won’t change is what I’m getting at.
03:43amalloyslipset: convert hiccup style vectors (which are absolutely awful to consume, what sadist gave you one of those) to data.xml-style maps of lists, with sexp-as-element from clojure.data.xml. at least then you could use xml-zip or something on the result
03:44julianlevistonamalloy: tagsoup gave it to him… he’s pasing html
03:44julianlevistonparsing*
03:50slipsetamalloy:will look into that, thanks!
03:50slipset(inc amalloy)
03:50lazybot⇒ 224
03:51julianlevistonThere’s a hidden pain when converting html to xml. Hopefully you’re aware of that. HTML parsing is *hard*.
03:51slipsetjulianleviston:hard? I thought you could just throw a regex at it?
03:52julianlevistonslipset: no.
03:52julianlevistonslipset: are you just trolling?
03:52slipsetjulianleviston:yes http://stackoverflow.com/a/1732454/9422
03:53julianlevistonslipset: damn you… you had me going LOL :)
03:53julianlevistonslipset: soz :)
03:53slipset:)
03:53julianlevistonthat’s one of my favourite pages on stack overflow, I think.
04:13michaelr`'lein cljx once' here first tries to load the code which requires the cljxed namespace (before preproccesing) and fails.. anyone has an idea of what I could possibly be doing wrong?
04:14julianlevistonmichaelr`: dependencies and targets are especially important to get right. Also, lein clean can often be your friend when building cljx projects
04:16michaelr`thanks
04:16michaelr`I found the little fucker..
04:16michaelr`;)
04:17michaelr`It's the component reloaded stuff in user.clj
04:17michaelr`Hits me all the time. How pepole are working with this stuff?
04:17michaelr`damn
04:18julianlevistonmichaelr`: oh yeah, I didn’t ever get a good state with that stuff either. Had lots of problems with it. I’m currently not doing component stuff… I’ll have to address it again in another month or so tho…
04:19julianlevistonI couldn’t work out a nice way to do ongoing dev without restart pain… and yet so many clojurists seem to apparently work in that way with a live REPL…
04:19michaelr`yes, the workflow works great for me actually. just this issue with the 'user' namespace
04:20julianlevistonmichaelr`: you should definitely make a youtube screencast and then show me :) I’m super keen to see it in action.
04:20julianlevistonmichaelr`: if you have the time/inclination.
04:20michaelr`i could give up on user.clj of course and load the workflow stuff from a different namespace..
04:20jaenI'm currently trying the reloaded component workflow and it's all nice until something fails to parse. Then I have to restart the repl from scratch : | I'm not sure if I'm doing something wrong, but that's somewhat annoying
04:22michaelr`julianleviston: nothing too much exciting actually, just when I make some changes in code which are not reloaded automatically with wrap-reload or manually loading the namespace in the repl I type (reset) in the repl and get everything fresh and ready in one sec or less..
04:23michaelr`jaen: are you using reloaded.repl ?
04:27jaenmichaelr`: whatever it is modular generator outputs. Didn't know about reloaded.repl, but checked the code and it's basically doing the same, excep lacking `disable-reload!`. Let me see if it makes a difference.
04:38jaenmichaelr`: That's how it behaves and my dev.clj - https://gist.github.com/jaen/4b010b31bfce994549e9 - it seems to do what reloaded.repl is doing and yet if I hace a syntax error I'm stuck. So it's interesting you don't get such behaviour; I'll try using reloaded.repl as is instead of what modular generated and see if it helps.
06:13acron^morning all
06:18noncomacron^: good morning
06:20kaplanHi
06:20kaplanI'm a beginner in programming, cna learning Clojure still be useful for me?
06:21acron^kaplan: of course! clojure is for everyone
06:22kaplanacron^, Thanks, I'm using the book 'Programming Clojure, Second Edition" and the book says Clojure is aimed at expereinced programmers
06:23acron^Well, I'd disagree with that in broad terms. That book may well make some assumptions about your programming experience, however
06:23acron^I've not read it
06:27vijaykiranacron^: you can also try http://www.braveclojure.com and other online resources too
06:28acron^kaplan: ^
06:29kaplanNah, it uses Emacs
06:29kaplanI'm more of a Vim person
06:30profilkaplan: I use vim and read through braveclojure, just skip the chapter about emacs
06:31kaplanprofil, ah, thanks
06:35vijaykiranacron^: sorry - misread the id.
06:35vijaykirankaplan: or use spacemacs :P
06:40profilor lighttable?
06:42acron^i use lighttable
06:43kaplanprofil, acron^ , I used lighttable a year ago but couldn't figure anything out
06:43acron^it's gotten a lot better since
06:43kaplanMaybe it can be a good candidate for my ByteSize tutorials program
06:44kaplanMy objective learning Clojure is to make a small MOOC platform where you can upload small tutorials and maybe sell them for something like $5
06:45profilI tried to switch to emacs but its too hard.. tried lighttable, but didnt feel right
06:55acron^emacs and vim scare me.,...
06:55kaplanacron^, which OS do you use?
06:56toadquick stupid question for anyone that has worked with light table
06:56acron^windows mostly
06:56acron^then ubuntu
06:56uris77I'm trying out ring + friend on my first clojure project. I started out without using friend, and my app booted up fine. As soon as I added friend I get this exception when I try to start the app No such var: clojure.core.cache/through . Can't figure out how to fix that.
06:56toadi am able to connect to a remote leiningen repl
06:57toadbut i can't view the repl in light table. i can't enter commands like in instarepl
06:57kaplanacron^, can you help me a bit to set it up on windows
06:57acron^kaplan: lighttable? of course, it's easy, just download the zip :)
06:58kaplanacron^, how to link it to clojure and all?
06:58kaplanacron^, I get an error saying java not found
06:58acron^interesting
06:58acron^do you have the latest JDK >
06:59acron^http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
07:01toadhelp... someone...
07:02toadi have connected to a remote lein repl in lighttable but can't for the life of me figure out where i enter commands... i can see the connection is live and i can use the repl from the terminal. the question is: how do i use the repl from inside light table???
07:03acron^if you then start an instarepl, it should ask you which connection to resolve with
07:04toadah, thanks, let me try
07:05toadacron^ looks like that did the trick. thanks again
07:05acron^:)
07:31toadok, so now i'm trying to connect leiningen to a local maven repository by adding this to project.clj -> :repositories ["local" "/home/my-name/Desktop/asdf/my-stuff/maven"] however lein deps throws an exception... i'm certain this line is the problem, because if i remove it there is no error. any ideas?
07:43vijaykirantoad: what do you mean by local maven repo ?
07:43toadvijaykiran http://stackoverflow.com/a/9917149 i'm trying to add a local jar as a dependency on my project
07:44tcrayford____toad: what error do you get
07:44toadvijaykiran actually i should use {} instead of [], now the exception goes away, but i still can't make lein deps work: it tries to interpret the path as an online resource, not as a local folder
07:45tcrayford____toad: did you copy the exact thing from that? It uses a java.io.file constructor
07:45toadi've also tried "file:/home..." etc
07:45toadi tried that and it doesn't work
07:46vijaykirancan you gist your exception ?
07:46toadi've solved the exception part. i was using a vector while a map was expected
07:46toadnow i only get a message from lein deps that it couldn't file the online resource
07:47tcrayford____toad: what happened when you tried the java.io.File constructor?
07:47toadsame thing. sec...
07:48toadRetrieving jlink/jlink/1.0.0/jlink-1.0.0.pom from local Could not transfer artifact jlink:jlink:pom:1.0.0 from/to local (file:/home/my-name/Desktop/asdf/my-stuff/maven/): no supported algorithms found This could be due to a typo in :dependencies or network issues. If you are behind a proxy, try setting the 'http_proxy' environment variable.
07:48toadtcrayford____
07:49toadso, that java.io.File stuff expands to file:/home/my-name/Desktop/asdf/my-stuff/maven/
07:49tcrayford____ah
07:49tcrayford____yeah, no idea here after that. Try asking in #leiningen?
07:49toadk thx anyway
07:50tcrayford____though there are some other answers in that stackoverflow that might help after the first one
07:50tcrayford____e.g. https://github.com/kumarshantanu/lein-localrepo
07:50toadi guess i'll check those out too
07:50toadthanx
09:06michaelr`how should I deal with a stackoverflow in the cljs compiler?
09:07michaelr`something with the namespace somewhere:
09:07michaelr` at cljs.analyzer$macro_autoload_ns_QMARK_.invoke(analyzer.clj:1237)
09:07michaelr` at cljs.analyzer$desugar_ns_specs$to_macro_specs__20592$fn__20595.invoke(analyzer.clj:1268)
09:13michaelr`looks like cyclic ns definitions
09:16dnolenmichaelr`: which aren't supported
09:19dnolenmichaelr`: http://dev.clojure.org/jira/browse/CLJS-1023, but it's a regression w/ regard to error reporting for sure http://dev.clojure.org/jira/browse/CLJS-1023
09:19dnolenoops sorry for linking to the issue twice
09:21acron^hey david
09:23dnolenacron^: hello
09:34tickingtrying to teach somebody new on the team how to get clojurescript up and running makes me never want to touch it again...
09:36tickinghas anybody found a reliable workflow that doesn't generate/requrie 200 lines of boilerplate lein config and gives a straightforward route from lein new to a running cljs repl?
09:38Glenjaminlein new mies works pretty well for me
09:38Glenjaminor figwheel if you want browser reloading
09:40tickingGlenjamin: yeah but mies comes with weird build scripts, and figwheel comes with a giant project.clj
09:41Glenjaminthis was what i ended up with last time i did something
09:41Glenjaminhttps://github.com/defshef/defshef12/blob/master/project.clj
09:41dnolenticking: you don't need any of the build scripts that come w/ mies, those are optional if you care to understand them.
09:42tickingGlenjamin: yeah this is what mine look a like most of the time too, but if you're new to cljs your head will just go boom ;)
09:43Glenjamini found that nothing was particularly complex once i read the docs - but when i used that config for a beginner workshop i just said "download this, run lein dev, start coding"
09:44Glenjaminthen they get the hang of how to use it before looking into how it works
09:45dnolenticking: heh, the complexity of cljsbuild info is not qualitatively different from anything else JS asset related I've used before.
09:48michaelr`dnolen: yes thanks, I got used to the improved error reporting in clj ;)
09:48tickingdnolen: yeah I know but getting a repl running is still a huge pain point
09:48dnolenmichaelr`: yeah just a regression
09:49tickingbeing able to start a cljs nrepl directly would be a lot nicer than having to bootstrap it from a clojure repl for example
09:50dnolenticking: that isn't a ClojureScript problem. That's a 3rd party CLJS nREPL problem.
09:50michaelr`ticking: figwheel does that in latest versions (SNAPSHOTS)
09:50Glenjaminhaving ./script/repl "just work" in mies is awesome
09:50tickingdnolen: yeah I'm quite happy with clojurescript, just not with the toolchain surrounding it
09:51dnolenticking: granted recently there's been some churn around CLJS nREPL since we were fixing general CLJS REPLs brokenesss
09:51tickingmichaelr`: yeah but figwheel also adds live reloading which can't be turned off afaik
09:51tickingdnolen: yeah much apreciated btw thanks a lot :D
09:52michaelr`ticking: i think you can in latest versions
09:52tickingmichaelr`: hrm interesting :)
09:52michaelr`ticking: but ohmpf live reloading is super cool ;)
09:53michaelr`my f5 thanks me a lot
09:53tickingmichaelr`: yeah but also super opaque :D
09:54michaelr`what do you mean by opaque?
09:55tickingmichaelr`: it's nice when it works but boy does it break when it breaks
09:55kaplanAnybody uses Lighttable here?
09:57tickingdnolen: I think the new repl stuff you implemented makes a really nice repl workflow possible. One could have a repl build target that just generates a :output-to file with minimal repl bootstrapping code and then starts an nrepl.
09:57michaelr`ticking: i've started a new project a week ago and *everything* is breaking around me like it's world war III, but eventually things should stabilize - once you learn where the mines are you stop steping on them
09:58michaelr`i thought of using a horse training analogy, but I've never trained horses so..
09:58tickingmichaelr`: yeah no ;) I like my projects deterministic :D, where I know exactly what code got reloaded, not a js diff foo thing.
10:03dnolenticking: definitely, we're getting there. there's not much more new coming to REPLs other than proper handling of termination.
10:04AWizzArdI have a 10 gigabyte input stream (with-open [in (io/reader file)] …)
10:04AWizzArdI want to process lines (doseq [line (line-seq in)] …)
10:04AWizzArdBut I want to do it in batches. How can I achieve that in a memory efficient way?
10:05AWizzArd(doseq [p (partition-all 5 (line-seq))] …) won’t do the trick, as p is a pointer to the head.
10:05AWizzArdSo, the memory consumption would grow.
10:06stuartsierraAWizzArd: in that example, p is a pointer to each batch.
10:07ticking_dnolen: btw I don't think breaking all the repls out there was a bad thing :D, it forced people to look at how to run a cljs repl without the billion onion shells of tooling around it
10:07AWizzArdstuartsierra: yes true.
10:08AWizzArdstuartsierra: I need to try something quickly.
10:08dnolenticking_: yes, it's really not that hard nor that magical :)
10:08ticking_dnolen: yeah no magick is goot :D
10:09ticking_s/t/d
10:23AWizzArdstuartsierra: Seems to be working. The funny thing is that I tried something similar a few days ago, and for some reason it didn’t work.
10:27stuartsierraIf your batch size was very large you could run out of memory on a single batch I suppose
11:41kaplanHi! I'm a beginner to programming, can anyone explain Atoms and Reference Types in simple language?
11:43johannkaplan: if you had to take your best shot at what a reference type was what would you say? its easier to explain if i can work with your intuitions instead of talk at you :)
11:44kaplanjohann, absolutely no idea
11:45justin_smithkaplan: values cannot change. Atoms and other Reference types (atoms, vars, refs, agents etc.) can have different contents over time.
11:45sm0keis there an efficient way to look up in map of regex keys for matching string?
11:45kaplanjustin_smith, hmmn so, what exactly is an atom?
11:45sm0kefiltering is only way i can think of
11:46Glenjaminsm0ke: you can compile them into a Trie
11:46Glenjaminbut that's non-trivial
11:46Glenjaminessentially every regex is a FSM, and FSMs compose
11:46sm0kehurmm sounds complex
11:46Glenjaminlibraries may already exist
11:46hyPiRionsm0ke: what are you trying to do in the first place?
11:47justin_smithkaplan: http://clojure.org/atoms I think this is the best writeup on atoms specifically
11:47justin_smithsee also clojure.org/refs clojure.org/vars clojure.org/agents
11:47sm0kehyPiRion: so given a map like {#".*" 1 #"a.*" 2} i want to get submap which matches string "abc" for e.g.
11:47sm0kesomething like select-keys
11:48Glenjaminkaplan: the first 15 minutes of the talk "Are we there yet?" has a good overview of the value/reference separation
11:48sm0keor even just any matching key-value should be fine
11:48justin_smithkaplan: also, there is a youtube vid by rich hickey (author of clojure) on "identity, state, and time" which is helpful
11:49hyPiRionsm0ke: Any matching key value? Well, you could go full FSM and do https://github.com/ztellman/automat, but I'd just walk the map first. It's easier, and if perf is a problem, you can then consider using that.
11:50Glenjaminjustin_smith: do you know which talk that is?
11:50justin_smithGlenjamin: trying to find it
11:50sm0kewow ztellman make really strange libraries
11:50Glenjamini wrote a blog post on that recently, and could only find are we there yet which talked about that stuff
11:50Glenjaminwhich is on infoq
11:51justin_smithGlenjamin: value of values?
11:51Glenjamincould be
11:51sm0kehyPiRion: i dont see how that can be used here
11:51martinklepschwhat's the easiest way to make my -main fn blocking? (future -main) ?
11:51Glenjaminhaven't watched that recently
11:52justin_smithGlenjamin: it's the one where he talks about "place oriented programming"
11:52Glenjamintomorrow night we're doing "Rich Hickey movie night" at the local FP group, so might watch it there
11:52sm0kefacinating code though
11:52Glenjaminplace oriented might be from simple made easy?
11:52hyPiRionsm0ke: So regexes are FSMs, so you can just "or" them together.
11:52Glenjaminoh, value of values looks like the right one
11:52sm0kehyPiRion: would it be really that fast using automat?
11:53justin_smithkaplan: value of values https://www.youtube.com/watch?v=-6BsiVyC1kM
11:53sm0kehurmm i will just filter map for now and will have a look at automat later as you suggested
11:53sm0kethanks hyPiRion
11:54hyPiRionsm0ke: it'd be linear to the size of your input, whereas iterating over every regex will be linear* to the amount of regexes you have
11:54hyPiRionidk about constant factors. Might be faster, might not.
11:54Glenjaminregexes are also linear on input, no?
11:54hyPiRionGlenjamin: yeah, so max(|input|, |regexes|) is more technically correct
11:55hyPiRiondangit, I don't
11:55sm0kehyPiRion: yes true filter would be propotional to key space
11:55justin_smithkaplan: also, this is a good writeup on values / identity / state in clojure http://clojure.org/state
11:55hyPiRion|regexes|*|input| worst case.
11:56sm0kehyPiRion: but how does that automata works ? is it based on that string matching algo
11:56sm0kei dont remember the name
11:56kaplanthanks justin_smith
11:56sm0keKMP
11:56hyPiRionsm0ke: it's just FSMs (finite state machines)
11:56justin_smithkaplan: and feel free to ask here about any questions you have about that material
11:57hyPiRionsm0ke: regexes are based upon FSMs, and although they are a superset, you can most likely model all reasonable regexes as a FSM
12:03doritostainshow can I add an item to a collection that is nested inside a map? (assoc-in res [:rows label] item) replaces the collection. Do I have to first pull out the collection with get-in, conj the new item and then assoc it back in?
12:05sm0kedoritostains: update-in should do that i guess
12:06sm0ke,(update-in {:a {:b []}} [:a :b] conj 1)
12:06clojurebot{:a {:b [1]}}
12:06doritostainsdoh! thank you! sm0ke
12:07sm0ke:) heh there is always a function for something in clojure
12:13sm0keusng automat i am able to figure out the fsm (a/compile (a/or #"a.*" "foo" #"b.*"))
12:14sm0kebut how do i use it
12:14sm0kelike equality for strings and matches for regex
12:14sm0kebtw (view..) is awesome!
12:56sdegutisWhat's the most popular React.JS wrapper for ClojureScript right now?
12:58dnolensdegutis: probably Reagent & Om
12:59sdegutisdnolen: which do you prefer?
12:59dnolensdegutis: I don't use Reagent.
12:59sdegutisdnolen: is there something about its design you don't like?
13:00dnolensdegutis: not really, but I prefer single store model over a multiple store one.
13:00sdegutisdnolen: ah, so you mean just to store the root node in an object graph, and let every sub-component have access to a specific node in this graph, rather than owning their own root nodes?
13:01dnolensdegutis: that's part of it yeah, but in general I dislike state being held in multiple locations for React based apps
13:01dnolensdegutis: unavoidable for something of course, but preferable to minimized
13:01seangrov`sdegutis: I strongly agree with dnolen
13:02sdegutisdnolen: or maybe I misunderstood you
13:02seangrov`sdegutis: And I'd even go a bit further than him on some of the points :)
13:03sdegutisdnolen: your philosophy seems compatible with my use-case, as I'm writing a budget app whose state is a large object graph with a single top-level node; so if Om works better for this than Reagent, I may very well go with Om
13:04sdegutisseangrov`: oh?
13:06seangrov`sdegutis: Yeah, I don't think you want a big graph of state. Really you want a datomic-like store, queries for components (rather than state directly), and the "illusion" of local state that's acutally mapped back to a datomic/datascript-entity
13:07sdegutisThis is what I have right now using Reagent, but I'm really unhappy with it: https://github.com/sdegutis/simplebudget/blob/master/client.cljs
13:07sdegutisI have a single global state, and each subcomponent has a "path" (like an x-path) to update that state via update-in.
13:08seangrov`sdegutis: Sounds pretty similar to the CircleCI frontend
13:08sdegutisThis solution it feels quite a bit unwieldly.
13:10sdegutisAnother solution I was thinking of was to give every sub-node a UUID string as an identifier, and to have a single function which knows how to traverse my graph entirely to find the node matching a given UUID, and then just do (graph-with-updated-node some-uuid attr-key new-value)
13:11sdegutis(That's horrible pseudo-code but you get the idea. It would be used in conjunction with swap!)
13:12seangrov`sdegutis: What about using DataScript instead?
13:13seangrov`Each component sends a parameterized signal on an event, and that's handled somewhere else that transacts! into the db with some insertion, and rerender
13:16sdegutisseangrov`: I haven't seen this before.
13:16sdegutisseangrov`: it sounds like a very nice concept, in the sense that you have more-or-less a database.
13:16seangrov`sdegutis: It has a learning curve, but it's great on the other side
13:17sdegutisseangrov`: that said, the "path" into a Clojure data tree is very similar to a set of "relationship" restraints in a database update.
13:18sdegutisseangrov`: and actually I have a hard time thinking that the advanced query functionality (1) can play nicely with React's efficient state-diffing, and (2) is useful for a simple case like a budgeting app
13:19seangrov`sdegutis: Fair enough, yeah
13:20sdegutisI just have a large (JSON) tree, which is read-only 99% of the time, except when you want to update a specific field (e.g. on an expense), or add or delete items (e.g. create a new expense), etc.
13:20sdegutisThat said, I do have some "relationship" things which might make sense here.
13:20seangrov`sdegutis: In that case, the path is presumably a function of a few inputs
13:20sdegutise.g., an expense has a relationship to another field, i.e. a funding source (e.g. bank or credit, &c.)
13:21seangrov`Instead of building up the paths in your components, derive them in your update fn (or a helper fn)
13:23sdegutisseangrov`: but the sub-components still need to know the path to whatever they represent, so that they can give this information to the updater function
13:24sdegutisseangrov`: viz., passing some data with the exact same purpose as the [update-in]-friendly path is still essential even using DataScript
13:25sdegutisMy goal here today is to use as many Latin abbreviations as possible.
13:26sdegutisBoth in quantity and variety.
13:37m1dnight_Is it possible to modify what lein clean does? I would like it to remove temporary files from emacs
13:37sdegutism1dnight_: why not just have emacs store them somewhere deep within ~/.emacs.d/ instead?
13:38sdegutism1dnight_: that's what I do
13:38m1dnight_hmmm, good point
13:38m1dnight_didnt think of that, thanks for the hint :)
13:42m1dnight_yeah, that works great, thanks! :)
13:44sdegutis:)
13:55sdegutisCortex seems to take the same approach as Om: https://github.com/mquan/cortex/
14:21hiredman_http://stackoverflow.com/questions/12412038/in-clojure-are-lazy-seqs-always-chunked/12412553#12412553 I was trying to explain chunked seqs to someone and came across this, which is a perfect storm of terriblness, and yet it has a green check mark next to, which I can only assume means it was thought to be good?
14:23tbaldridgehiredman_: what the....
14:24tbaldridgethat's the worst SO post I've seen in a long time
14:25hiredman_no, look, there is no saving anything, burn it all down
14:26justin_smithmaybe he meant agent instead of atom?
14:27justin_smithbecause yeah, an atom will in no way ensure things are not re-evaluated
14:27hiredman_(also look what chunked seqs have wrought)
14:28hyPiRion,((fn namespaced/fact [n] (if (zero? n) 1 (* n (fact (dec n))))) 10)
14:28clojurebot3628800
14:28hyPiRion,((fn fact [namespaced/n] (if (zero? n) 1 (* n (fact (dec n))))) 10)
14:28clojurebot#<CompilerException java.lang.RuntimeException: Can't use qualified name as parameter: namespaced/n, compiling:(NO_SOURCE_PATH:0:0)>
14:28amalloyit seems i have upvoted the question but none of the answers. that's unusual for me: i usually upvote answers and forget to upvote questions
14:29hyPiRionShould the first error out? I can't see any reason why you'd like to have namespaced fns
14:30amalloyhyPiRion: i think it's basically the same as namespace prefixes on symtols in a reify form
14:30justin_smithdo tell?
14:30amalloywell like, they get ignored
14:31justin_smithoh, OK
14:31amalloybecause otherwise macros like `(reify Foo (bar [x#] ...)) would be tedious
14:31justin_smithahh, right
14:31amalloy`(reify ~'Foo (~'bar [x#] ...))
14:33hyPiRionamalloy: I get the reifies and such, but not fns. `(fn fact [n#] (if (zero? n#) 1 (* n# (fact (dec n#))))) will still error out
14:34hyPiRiondo they share code?
14:34amalloywell, in that they both involve calls to clojure.core/name
14:35amalloylike, iirc the code for (fn x ...) is like "create a local variable called (name x)"
14:35amalloywhich does the same thing whether or not x is namespaced
14:36hyPiRion,(macroexpand-1 `(fn a [] (+ 1 2)))
14:36clojurebot(fn* sandbox/a ([] (clojure.core/+ 1 2)))
14:44hyPiRionwell, that gave me no answer. *shrug*
14:45hyPiRionOnly thing is that Compiler.java seemingly ignores the ns
14:46TimMcTons of things do that.
14:46TimMc"I want to get from Symbol to String, so I will call clojure.core/name (or equivalent.)"
14:47amalloyright
14:48hyPiRionoh well
14:58sdegutishi can you see this
14:58sdegutismy whole mac is crashing except my irc client
14:58sdegutisall thanks to chrome mega-crashing (not kidding)
14:58justin_smithsdegutis: hello, sorry to hear about the crashes
14:59sdegutis:)
14:59sdegutisim holding out that chrome might finally force-quit like i told it to (twice), and might not have to reboot
14:59noonianin my experience you should reboot :P
14:59sdegutisoh sweet, other apps are still working
15:00sdegutisi just cant cmd-tab to them or click the dock icon to focus them
15:00sdegutisbut if i click their windows, all is well :)
15:00justin_smithwat, apps in use other than chrome?
15:00sdegutisfirefox ;)
15:00sdegutisalso emacs and terminal
15:00sdegutis(im writing a web app!)
15:01arrdemhttp://www.catb.org/jargon/html/koans.html#id3141171
15:01justin_smitharrdem: that one is awesome
15:02sdegutisarrdem: I can't click your link because I get the popup "The application “Google Chrome.app” is not open anymore."
15:02sdegutiswhich.. is so just, like.. what!?
15:02sdegutishuh??
15:03sdegutisalso, `ps aux` now freezes too
15:03sdegutisso cool
15:04TimMcOnce you've closed basically all your programs, why not just reboot?
15:04justin_smithTimMc: it's the principle of the thing, surely
15:04TimMcEven browsers can restart and preserve session state these days.
15:04TimMcThe only thing I don't like doing is setting up all my terminal windows again.
15:05TimMcWhat sdegutis is describing kind of sounds like what happens sometimes on Linux when you upgrade the kernel and libc out from under all your programs. :-P
15:05crash_ep_TimMc just do all your work in a Xen instance
15:06justin_smithTimMc: yeah, been there, done that :)
15:06TimMccrash_ep_: I recently sat down and figured out how to script gnome-terminal and now everything is a lot happier.
15:06justin_smithTimMc: you can insert new ram without a reboot on linux, as long as your hardware supports it, but libc versions will still fuck you up hard
15:06TimMcdon't I know it
15:07justin_smithit's the only manditory reboot thing I really know of
15:07TimMcEven a kernel upgrade is fine as long as you don't need to hibernate.
15:07TimMcUpgrading a browser without restarting it is a pretty bad idea too, though.
15:08TimMc("Why am I getting blank dialog boxes?")
15:08justin_smithTimMc: right, but at least on Linux "app singletons" are not enforced on an OS type level, so restarting to a new app version is never hard
15:09justin_smith(in my experience at least)
15:09TimMcApp singletons?
15:09justin_smithapps where opening a new instance always connects to a running instance
15:09justin_smithwhere it tries to prevent multiple actual instances from occuring
15:09justin_smithvery much the mac paradigm, and some linux apps try to hack that behavior
15:10vasoh man, your discussion reminds me of when someone ran a command in a shell but forgot what it was, needed to preserve the program somehow before exiting it... spent some time hacking away and found the command still written out someplace in RAM. was an awesome article, maybe i can find it xD
15:10justin_smithvas: you can do amazing things with /proc
15:10justin_smith/proc/self/... iirc
15:10vaswhat does /proc mean or stand for?
15:10tickingvas: coredump and then spin it up everytime you need it :D, emacs generates its lisp image that way iirc
15:11justin_smithvas: it is the virtual system device that treats properties of running programs on a linux machine as generic resources
15:11vasticking: haha that is a brilliant approach.. you mean like just load it into ram every time :D?
15:11justin_smithvas: can be used to read arbitrary memory as if it were a file, or a commands env vars, etc.
15:11tickingyeah
15:12justin_smithticking: the core dump thing works as long as the thing dumped is smart enough to re-open any resources that have gone stale
15:12tickingtrue
15:12vasjustin_smith: wow that's awesome. <3 linux
15:12justin_smithmy first big "aha" was using gdb to rescue my girlfriend's homework that was in a locked up openoffice instance
15:12vasi noticed some emacs keybindings work in zsh and i was like yay!!!
15:12arrdemjustin_smith: well played sir!
15:12vasyou ol' charmer, you
15:13justin_smithjust killing the program would have lost her work, so I used the gdb debugger to jump the openoffice out of the bad dialog loop it was in back to normal operation
15:13tickingplot twist, his gf used that trick afterwards to blackmail him with porn
15:13justin_smithhaha
15:14vaswhat-a-twist.png
15:14tbaldridgeOO doesn't do incremental backups or something?
15:14TimMcjustin_smith: Ha, nice job.
15:15justin_smithTimMc: it was mostly having the confidence to do it - it was just a question of connect, show stack, go up a few stack frames, run
15:15justin_smithtbaldridge: this was ages ago
15:15justin_smithtbaldridge: I am sure it does now
15:16justin_smithtbaldridge: in fact, I could be misremembering - it was some word-processing app, maybe something pre-openoffice (but post-wordperfect to be sure)
15:29tickingdnolen: btw after seeing you recent tweets I wonder how you integrate cljs into cursive :D do you start an external repl or did you manage to cook up some config magic from within intellij?
15:30dnolenticking: I haven't dug deep into using Cursive for application dev with ClojureScript. But I'm very happy with Cursive for Clojure dev on work projects and on ClojureScript *compiler* work
15:32tickingdnolen: ah yeah, its debugger and static analysis is pretty unbeatable for clojure work :D
15:32dnolenyep
15:32AeroNotixWhat does it use for analysis?
15:33AeroNotixCould that be exported as a standalone joint?
15:33tickingAeroNotix: I'm not sure since it's closed source
15:33AeroNotixticking: shame :(
15:33justin_smithAeroNotix: you can ask cfleming - he tends to be very helpful
15:34AeroNotixjustin_smith: closed source isn't something I'd like to use, if I could help it.
15:34justin_smithI think it uses some combo of eastwood, stuff that is built into intellij idea, and a custom macro expander
15:34AeroNotixfor my editor, at least.
15:34justin_smithAeroNotix: fair enough
15:34tickingAeroNotix: yeah but when the choice is between something that works and something that barely works it's pretty convincing :D
15:35AeroNotixticking: depends what you need
15:35AeroNotixwhich is what defines "works"
15:36tickingcursive is the only environment I've seen so far that has a working debugger :)
15:36AeroNotixFor clojure?
15:36tickingyeah
15:36AeroNotixI rarely properly need debuggers.
15:36tickingtrust me, that is something you only say when you haven't used one in a while ;P
15:36AeroNotixThey're neat to use, but I often find that literally things with print statements and reading through the code.
15:36AeroNotixliterally => littering
15:37tickingbut I agree it being open source could increase the chance of getting cljs support earlier than later, but on the other hand things might not have gotten that far at all
15:37AeroNotixI use SLDB quite a lot
15:37AeroNotixwhich is pretty phenomenal
15:37tickingAeroNotix: yeah ... no :D, print statements won't help with a bug that only occurs in one of many thousand iterations :D
15:37AeroNotixticking: which is where the reading comes into it
15:38AeroNotixactually, to be honest, reading+print statements+pair programming is how I manage without a debugger.
15:38tickingyeah the classical lisp debuggers are awesome
16:28dnolen,(let [x :foo {a x} {:foo 1}] a)
16:28clojurebot1
16:28dnolenlearn something new everyday
16:29hyPiRion ,(macroexpand-1 '(let [x :foo {a x} {:foo 1}] a))
16:29clojurebot(let* [x :foo map__52 {:foo 1} map__52 ...] a)
16:29hyPiRionwell gurr, that completely destroyed the point.
16:34martinklepschI'm looking for something that takes a jar, analyses dependencies builds up a suitable classpath and runs the jar — anyone aware of such tool?
16:43emil0rmartinklepsch: not sure if such a tool exists, but take a look at https://github.com/Raynes/bultitude , https://github.com/clojure/tools.namespace and https://github.com/technomancy/leiningen for a deep dive into libraries that does at least parts of what you're asking about
16:44stuartsierramartinklepsch: Jar files themselves do not necessarily declare dependencies. That metadata lives in a pom.xml file (Maven) or project.clj (Leiningen)
16:46martinklepschstuartsierra: right, though jars usually contain pom.xml files rihgt?
16:47stuartsierramartinklepsch: If they were generated by a Maven-aware tool, then usually yes.
16:49stuartsierraThe "lein-try" plugin will do more or less what you want for anything published in a Maven repository.
16:54vasAnyone here play with monger? I can get a DBObject back and a cursor, but i'm not sure how to iterate over to get it to tell me what's in the Db...
17:00justin_smithvas: (mc/find-maps db coll)
17:00justin_smith(monger.collection/find-maps)
17:00justin_smithvas: http://clojuremongodb.info/articles/querying.html many more docs here
17:01vasjustin_smith: yeah I get the map back, still figuring out how to play with it
17:01justin_smithvas: that one gives you a seq of maps, not a cursor
17:02vasokay, cool. so what's the difference between a cursor and map seq? the cursor comes back at 0, ...so there's a way to increase and iterate over the result (?) whereas a seq of maps is just each collection result in a row like ducks?
17:02justin_smithvas: I think so, yeah
17:02justin_smithusing a cursor is likely more efficient when you have more data
17:03vasjustin_smith: cool cool. that makes sense. i am not worried about efficiency in the least until everything at least functions xD
17:04vasthe idea of maps and filters is still very fresh to me. any particular resources that you think might help?
17:05justin_smithmaps as in hash-maps or as in mapping over a collection?
17:06vashash-maps would be clojure native and collections meaning internal mongo representation? i guess i was thinking hash-maps in particular. short of someone bonking me over the head and inducing insight into destructuring syntax
17:07justin_smithwell, destructuring syntax is just sugar - there is always a way to do the same thing without destructuring, destructuring is just more concise
17:07justin_smithI think some of the exercises on 4clojure can be pretty helpful with hash-maps and such
17:08vasah cool. i will have to check them out.
17:08vasokay, say one wanted to return All the documents in a collection with monger...
17:08justin_smiththat's what monger.collection/find-maps does as far as I can tell
17:09vasAha. beautiful.
17:09vashonestly it's kinda crazy how joyful i am programming in clojure
17:10vaseven though i only understand it about 4/100ths of the way so far
17:10vasor maybe it was the punch at that party rich hosted... :P
17:11vasQuestion. I'm opening a new DB connection on every POST. is it better to open up one db connection before I start the jetty server and just hitch a ride on that?
17:13justin_smithvas: it's better to use a connection pool, if the api supports it
17:13justin_smithand ideally enough connections so that any parallel queries can be run effectively
17:14vasjustin_smith: so a connection pool sorta acts as a black box for db connections?
17:15justin_smithvas: yes, they are frequently used with jdbc
17:15vasVery cool.
17:15crash_epdoesn't the JDBC driver manage its own connection pool?
17:16crash_ep(usually?)
17:16justin_smithnot at all
17:16vasalright, in returning my database results I get a clojure.lang.LazySeq@###### ... how can I use this meaningfully?
17:16sdegutisIs it bad practice to use an if-let to give a more semantically meaningfully name to an expression that would otherwise just be used in an if expression, even though this name wouldn't be used at all within the body of the true-clause's expression?
17:16crash_epi must be getting JDBC drivers mixed up with application servers…
17:17justin_smithvas: a lazy seq is just a lazily realized list. You can map over it, get an element with nth, etc.
17:17amalloyvas: don't call (str ...) or (println ...) or anything from that family on seqs, it's just not very useful
17:17amalloyprn, pr-str, stuff like that all print seqs usefully
17:18sdegutisamalloy, vas: I use pr-str all the time. Especially in ClojureScript.
17:18amalloysdegutis: it would look weird to me
17:19vasoo yay news! (println x) and (str x) are a different family than (prn x), (pr-str x) ... briefly may i ask what the families are? or i can just google it i suppose.
17:21justin_smith(doc pr-str)
17:21clojurebot"([& xs]); pr to a string, returning it"
17:21justin_smith(doc pr)
17:21clojurebot"([] [x] [x & more]); Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s), separated by spaces if there is more than one. By default, pr and prn print in a way that objects can be read by the reader"
17:21noonianprintln prints human readable representation (print and println are in the same family). The pr family of functions prints representations that are readable by clojure into data structures.
17:22justin_smiththat last sentence in the doc
17:22vasyou guys are the best.
17:23{blake}OK, guys, I'm getting flack from deployment over the JDBC deployment. Is there any way to get to MSSQL with just lein, and no maven fiddling?
17:23hiredman_jdbc deployment?
17:24justin_smith{blake}: because of the fact that mssql is not available via maven?
17:24{blake}justin_smith: Yessir.
17:25justin_smith{blake}: microsoft refuse to make it available in that manner. You could put it in your own private repo via that wagon lib.
17:25justin_smithor make it part of an uberjar
17:25AeroNotixDo people really just throw builds over the wall to a deployment team?
17:25{blake}justin_smith: Oh, uber--well, crap he wants to build the uberwar.
17:25justin_smithAeroNotix: more likely a CI server like jenkins I'd imagine
17:25{blake}But if I put the jdbc driver in the directory uberwar might bundle it up anyway?
17:25justin_smithAeroNotix: they expect to be able to check out your source and auto-compile
17:25lunkAeroNotix: sometimes on fire, with the documentation as fuel
17:25AeroNotixjustin_smith: same difference, you write it, you deploy it
17:26hiredman_{blake}: you are deploying to some kind of app container, correct?
17:26justin_smithAeroNotix: with CI the server wants to check out your git repo and build
17:26AeroNotixjustin_smith: that's a reasonable assumption. Clone repo -> make -> voila
17:26justin_smithAeroNotix: so any deps have to be available
17:26hiredman_{blake}: you don't want to bundle classes provided by the app container in the jar/war/etc you are deploying
17:26justin_smithAeroNotix: then we have mssql, which you can't get via maven, thus problems
17:26AeroNotixjustin_smith: check in the jar to the repo :)
17:26AeroNotixtyranny is as tyranny does
17:27justin_smithAeroNotix: that is one approach
17:27{blake}hiredman_: Making an uberwar to use with WildFly
17:28vaslunk: lol
17:28hiredman_{blake}: likely are are including classes that wildfly provides in your uberwar
17:29hiredman_changing how you include them isn't going to change how that potential breaks things
17:32{blake}hiredman_: Wait, what has that to do with WildFly? Does WildFly have JDBC built int?
17:32{blake}er in?
17:33hiredman_{blake}: hard to tell, your initial question didn't make much sense, so I am just guessing
17:33{blake}I thought I could maybe just drop the JDBC into the project root.
17:34{blake}hiredman_: In order to use the MS JDBC driver, I had to muck with Maven to get it to point to a local directory.
17:34{blake}hiredman_: My deployment guy won't do that.
17:34hiredman_{blake}: good for him
17:35{blake}hiredman_: So I'm trying to figure out if there's another way to get the JDBC driver in there that doesn't require that.
17:35{blake}We have an Archiva server, but that's too new, too.
17:35justin_smith{blake}: this is the "wagon" lib I was mentioning https://github.com/technomancy/s3-wagon-private
17:35justin_smithtoo new?
17:36{blake}justin_smith: Yeah, in order to use something in production, a bunch of people have to be educated on it.
17:36{blake}justin_smith: We just set this up last week. Nobody really knows about it. So they won't deploy with it.
17:37justin_smith{blake}: s3-wagon-private allows lein to find things on s3
17:37{blake}justin_smith: So, wagon lets us use S3 as a repo? That--he might go for that. He's big on Amazon.
17:37justin_smith{blake}: right, and all the config goes in your lein config
17:38justin_smithno system level setup (beside setting up the s3 repo of course)
17:38hiredman_{blake}: if what the guy is doing is deployments he should just be getting the war somehow, not caring about how the war is built
17:41hiredman_(unless where ever you are does "deployments" by checking out code from git and doing a build, which is terrible so things will be terrible for you)
17:41{blake}hiredman_: Yes. That. It is. We know. It's all tied up in security and government audits and all kinds of arbitrary crap.
17:41jcrossley3{blake}: there are a few alternatives listed here: http://stackoverflow.com/questions/2404426/leiningen-how-to-add-dependencies-for-local-jars
17:42{blake}jcrossley3: Thanks!
17:43{blake}It takes two weeks to code something and six months to deploy. =(
17:49{blake}I cant really just put the jar in "/lib" can I? I thought I tried that first.
17:53rhg135oops
17:55sritchieDomKM: hey man, around?
17:55sritchieDomKM: had a Q about silk.
17:55sritchieDomKM: We’re using it in a new site that’s gonna launch in a week or two, and I’ve taken your stuff on server / client side rendering pretty far
17:56sritchieDomKM: tackling the last unknown, which is authorization in a Silk / websocket world
17:57justin_smith{blake}: you would need to have the jar itself in the classpath
17:57justin_smith{blake}: having the jar in a dir in the classpath isn't enough
17:58{blake}justin_smith: OK, that fits with what I learned. There'd have to be some thing in project.clj, right?
18:01DomKMsritchie: Hey, happy to hear you're using Silk :)
18:01sritchieyeah, thanks for it, and for omelette
18:01DomKMmy pleasure
18:01sritchieDomKM: I extended omelette with a pubsub pattern for talking to and fro the server
18:01sritchieand some macros and multimethods to make page state and nav declarations easier
18:02sritchieDomKM: so, here’s my Q
18:02sritchiefollowing omelette, if you know a route’s not authenticated you can navigate to it immediately, then ask the server for more data and replace whatever loading screens you have
18:02sritchieif a route has some authorization function attached, I want to have the server deal with that exclusively, so I need to defer the client nav -
18:03sritchiewhich seems to require some way of adding metadata to a rotue
18:03sritchieroute*
18:03sritchie“:protected?” or something. Sort of a query param that’s baked into the route.
18:03sritchieDomKM: have you thought about how to deal with stuff like this?
18:04sritchieDomKM: Another feature I’d love to contribute would be something like Compojure’s “context”, so I could nest a bunch of routes under something like “/api” without having to repeat...
18:04sritchiebut the auth is the important thing for now :)
18:05DomKMsritchie: I hear you, context would be great. Hold off on a PR for that until the next major version. I'm rewriting it in terms of finite state machines instead of regexes; should be wicked fast.
18:06sritchienice
18:06xnullflying spaghetti monsters are always better than regexes
18:07sritchieDomKM: what do you think of adding a slot for metadata to the route records?
18:08DomKMsritchie: I haven't thought about the auth problem much since Silk is fairly minimal now. It's basically just URL <-> params. Could you have a map of route names -> protected status and look up the route there after matching?
18:08sritchieyeah, I’d just rather not have a bunch of maps with duplicate keys
18:08DomKMxnull: indeed ;)
18:09xnullramen, brother
18:09sritchiebut sure, I can do that. Or I can keep my own routing table with both, and process the silk routes out of it...
18:09sritchieDomKM: rather than protected status I’d want to use a function of route and user session on server side,
18:09sritchieand probably just a boolean on client side
18:10sritchieI can hack something like that up w/o changing silk
18:13DomKMsritchie: Yeah I hear you; I'd rather avoid the duplicate routes as well. I've received some other comments about attaching metadata to routes before so I'll have to put some thought into this
18:13DomKMsritchie: Open to suggestions, as well :)
19:10vasSo i've been able to get my database to play nicely so far ^.^ thanks for all the help you guys. I have a question as this develops, and it is probably simple for a seasoned clojurian... I've been able to extract each document as such: [:_id #<ObjectId 54d92ab79c521eb276553f17>][:msg_content "Bird flyin' high, you know how I feel."] ... how can I programatically just take :msg_content from this
19:10vasmeant to hit delete but i hit send
19:10vasfigured it out. clojure is so awesome
19:10vas( (messages) :msg_content)
19:27killfillhi, whats the normal way to add a dependency to lein?.. just edit the project.clj file by hand, find out the dep-tag in its github repo and write it down?
19:28{blake}killfill: That's what I do.
19:29killfilli guess forcing you to write down exactly the version you want, is a good thing.. :P (instead of i.e. 'latest')
19:29{blake}killfill: There have been some debates on that. I kind of like it.
19:30{blake}killfill: Other times, I'm more "Why do I have to care what the version is?"
19:30{blake}killfill: In my limited experience, it's helped with dependency clashes, tho'.
19:31killfillyah. would be nice to 'install lates version' and make it write the latest exact available version tho :)
19:32{blake}killfill: That would be convenient. Though, honestly, in most cases, the version number is staring right at you when you type in the lib name.
19:35AeroNotixthere are lein plugins for updating things.
19:35AeroNotixlein-ancient, for example.
19:35killfillah sure. i mean in a way to bypass the 'open browser, search lib, get latest tag name, copy, paste' thing.. its just a dummy little detail anyway.. just ignore me.. :P
19:36{blake}killfill: Well, when I'm doing the lib-hunt thing, I'm almost always looking at my options first. There's no way I'm not in github to begin with.
19:37{blake}killfill: If I can remember the name (to where I don't have to go to github), I probably know the version, too. =P
19:37killfill:)
19:39killfilllein-ancient looks nice
19:42vasany suggestions on how I can apply two enlive-html/emit* transforms to the same page?
19:43dnolenClojureScript 0.0-2814 released, Node.js v 0.12 support, Nashorn REPL, built in directory watching, unified source mapping, async testing and more
20:10justin_smithvas: what specifically are you trying to do?
20:11justin_smithvas: emit* doesn't transform anything - do you want to emit two transformations from the same source data?
20:13vasjustin_smith: yes. i've got two different chunks of the page. the static html just has one instance of each div that will be cloned, then using enlive selectors and cloning i get a nice string vector back. so i can get two of these vectors back... i think i figured it out, but it's still wonky. basically (apply str (eh/emit* ___)) needs to happen twice, once for each transformed content vector, so i was thinking about grouping them both und
20:13vaser a momma (str (first transform with emit) (second transform with emit))
20:16justin_smiththat's just (apply str (transform with emit))
20:19vasjustin_smith: cool. awesome, i am getting a better feel for vectors of strings vs strings... feels nice
20:22vasone strange thing though, is that if i apply a single transform (first chunk i wanna clone or second chunk i wanna clone) the original information gets wiped out (behavior i like) but, if i do both transforms as (str (apply str (first emit result) (second emit result))) it keeps the original divs in the html output...
20:26tvanhensWhat could cause the following error? "Attempting to call unbound fn: #'msg.core/serialize-bidi-route clojure.lang.Var$Unbound.throwArity (Var.java:43)" I'm using data_readers.clj to define the following map {bidi/route msg.core/serialize-bidi-route} and the function msg.core/serialize-bidi-route is defined in that namespace and has been evaluated.
20:27TEttingertvanhens: it looks like you're calling it with the wrong number of arguments
20:27TEttingeris this in a -> or ->> type of form?
20:28vasyeah $Unbound.throwArity ... probably # arguments
20:28amalloytvanhens: you need to require the namespace your reader is in
20:29tvanhensamalloy: like (:require data-readers) ?
20:29amalloytvanhens: msg.core
20:29tvanhensthe number of arguments appears to be right
20:29amalloyi don't think it's an arity issue at all
20:29tvanhensthe coresponding function takes one argument and thats what I'm passing in
20:30tvanhensstill geting the same error even when I require in msg.core
20:31tvanhens(require '[msg.core])
20:31tvanhens=> nil
20:31tvanhens{:hello #bidi/route {:hello :world}}
20:31tvanhensIllegalStateException Attempting to call unbound fn: #'msg.core/serialize-bidi-route clojure.lang.Var$Unbound.throwArity (Var.java:43)
20:31tvanhensRuntimeException Unmatched delimiter: } clojure.lang.Util.runtimeException (Util.java:221)
20:32amalloyokay, and what happens when you evaluate this? msg.core/serialize-bidi-route
20:33tvanhensworks as expected
20:34amalloyoh hm, is the issue coming from nrepl trying to read your form? i don't remember how nrepl handles data readers
20:34tvanhensit was working fine about an hour ago as well. But I tried reverting to previous commits and none of the previous commits that used to work work anymore
20:34tvanhensonly thing thats changed is I upgraded cursive
20:34tvanhensbut its not working in command line lein repl either anymore
20:36tvanhensso strange
20:38tvanhensworks when I bind data_readers.clj to anything clojure.core
20:41tvanhensany ideas?
20:54justin_smithtvanhens: do you get the same error if you run lein check (which will load and compile all your files)? that could help narrow down which part of the problem is nrepl or cursive specific
20:54tvanhensone sec trying
20:56tvanhenslein check appears to be fine
20:57justin_smithtvanhens: I wonder if it might have anything to do with the fancy macro expander in cursive? (this is a total wild guess)
20:57tvanhenscould be. Ugh I really need to stop updating cursive eagerly
20:58tvanhensI can't think of anything else that changed
20:58tvanhensits so strang though that it wont work in lein repl now either
20:58justin_smithoh wait, so it breaks in lein repl, totally outside cursive?
20:59tvanhensyeah
21:00tvanhensand it works if I map it to any clojure.core function
21:56cflemingtvanhens: Did you get that sorted out?
21:57tvanhensnah I decided to work around it for now until I have more time to debug it. But open to try suggestions if you got any
22:13SegFaultAXIs lein-module fairly stable at this point?
22:14justin_smithSegFaultAX: not lein-modules?
22:14SegFaultAXYea that one.
22:16justin_smithI have no idea, just making sure you were talking about the one I thought
22:56Shayanjmhas anyone done anything with the instagram API and geolocation data?
23:25gzmaskCan I eliminate the risk of Stackoverflow by using "recur" in corecursion ?
23:26TEttingergzmask: you're probably after trampoline
23:26TEttingerhttp://clojuredocs.org/clojure.core/trampoline
23:26gzmaskThanks, I will look that up
23:29TEttingerhttp://jakemccrary.com/blog/2010/12/06/trampolining-through-mutual-recursion/ seems like the best walkthrough I can fined, gzmask
23:29kirFor Clojure newbies : If you know the basic Clojure Syntax and are looking for a logical exposition of lisp-style declarative programming : http://htdp.org/2003-09-26/Book/
23:30kirDon't mind that it starts some what slowly and that it's Scheme code; it translates easily to Clojure
23:30gzmaskawesome, thanks!