2012-11-17
| 00:00 | TimMc | I don't know if that's the case. |
| 00:00 | mholmqvist | amalloy: yes I had to bind *print-dup* |
| 00:00 | TimMc | mholmqvist: For clarity, what happens if you pr-str the record with *print-dup* false? |
| 00:00 | mholmqvist | TimMc: I get "#MyRecord{:timestamp #<DateTime 2012-11-17T04:47:14.25}" |
| 00:01 | TimMc | (What happened to the ">"?) |
| 00:01 | TimMc | amalloy: ^ that's not usable |
| 00:02 | amalloy | mholmqvist: what's *clojure-version*? |
| 00:02 | mholmqvist | TimMc: the > should be there. :) |
| 00:02 | amalloy | TimMc: i misunderstood what he was saying. it sounded like he fixed it by *nod* using print-dup |
| 00:03 | mholmqvist | amalloy: {:major 1, :minor 4, :incremental 0, :qualifier nil} |
| 00:03 | amalloy | i thought one of 1.4's "big features" was that jodatime things were supposed to print as #inst literals? |
| 00:03 | TimMc | Yeah, that's bugging me. |
| 00:05 | mholmqvist | amalloy: well, doesn't look like it... |
| 00:05 | mholmqvist | thanks anyway guys |
| 00:05 | TimMc | mholmqvist: Check if #inst reader literals read properly in your environment. |
| 00:05 | mholmqvist | at least got it working using the rubbish |
| 00:05 | mholmqvist | TimMc: yeah regular dates seem to work fine |
| 00:06 | mholmqvist | I get #inst |
| 00:06 | TimMc | Oh, interesting. |
| 00:06 | amalloy | but i bet they read as Date objects, not as jodatime objects |
| 00:06 | mholmqvist | amalloy: exactly |
| 00:07 | amalloy | so clojure.core thinks you don't have joda on your classpath |
| 00:08 | mholmqvist | amalloy: hmm. do I need to set that up someway special for this? |
| 00:09 | mholmqvist | i mean it IS on the classpath |
| 00:11 | mholmqvist | gotta go, but thanks for now! |
| 00:11 | mholmqvist | at least I get move forward now... |
| 00:14 | amalloy | maybe rich decided not to auto-detect jodatime after all? i can't see it in the source anywhere |
| 01:13 | Sgeo | ,(map identity {:a 1 :b 2}) |
| 01:13 | clojurebot | ([:a 1] [:b 2]) |
| 01:14 | Sgeo | Blah, if I wanted a hash-map from that I could just throw that into (into {}) I guess |
| 01:15 | arrdem | incanter is off of contrib, amirite? |
| 01:16 | arrdem | yep. |
| 01:18 | amalloy | Sgeo: (map identity x) is the same as (sequence x) |
| 01:19 | Sgeo | amalloy, I just wanted to see that the result would look like what I was expecting. I wanted a function that would take a function that would (take a key and value and return a new value) and take that and make that the "new" value for that key |
| 01:19 | Sgeo | I think what I want could be described as |
| 01:19 | Sgeo | (comp (partial into {}) map) |
| 01:20 | amalloy | yeah. i love into/for, peronally; i don't use into/map nearly as much |
| 01:56 | alex_baranosky | anyone used VoltDB from Clojure? (or from Java or any other language for that matter?) |
| 04:13 | Sgeo | Is reduce a thing to avoid writing except when needed in favor of other functions, the way recursion is, or is it fully acceptable and idiomatic to use it where, in an imperative language, I might use a loop? |
| 04:13 | Sgeo | Because one of the things I want to do, I could only think of in imperative terms until I remembered reduce, but still trying to mentally work out if there's a better way |
| 04:17 | thorwil | Sgeo: if reduce makes for a concise solution, use it |
| 04:20 | Sgeo | assoc-in |
| 07:36 | Licenser | asd |
| 07:36 | Licenser | oops |
| 09:32 | Sgeo | ,`(.foobar) |
| 09:32 | clojurebot | (.foobar) |
| 09:32 | Sgeo | I guess I should smile at that |
| 09:32 | Sgeo | ,`(baz .foobar) |
| 09:32 | clojurebot | (sandbox/baz .foobar) |
| 09:32 | Sgeo | hrm. |
| 09:52 | tufflax | What does ANN mean on the mailing list? |
| 09:52 | tufflax | or google group, whatever :p |
| 09:52 | tmciver | announcement |
| 09:53 | xeqi | Announcement |
| 09:53 | tufflax | ah, ok. thanks |
| 11:10 | ForSpareParts | I'm using localrepo for a couple of dependencies, and my project checks for them online every time it starts. Can I prevent that? |
| 11:12 | xeqi | ForSpareParts: are they looking for a .pom? |
| 11:12 | ForSpareParts | Let me check. |
| 11:28 | ForSpareParts | xeqi, it looks like it's looking for a pom, yeah. In addition to some Maven metadata. |
| 11:29 | ForSpareParts | Sorry for disappearing, I've been on the train and my connection is spotty. |
| 11:29 | xeqi | I don't think localrepo makes a pom, if you add one it should stop going out to look for it |
| 11:29 | xeqi | np, the conj wifi isn't perfect either |
| 11:30 | xeqi | ForSpareParts: ^ + also make sure you didn't add them as a -SNAPSHOT version |
| 11:32 | ForSpareParts | xeqi, where would I put it? In the repo? |
| 11:34 | xeqi | yeah, same file name as the .jar, just .pom instead |
| 11:34 | xeqi | it should look something like http://www.sonatype.com/books/mvnex-book/reference/simple-project-sect-pom.html |
| 11:34 | xeqi | but without the dependencies section |
| 11:35 | xeqi | and with the right data based on group, artifactname, etc |
| 11:38 | ForSpareParts | Thanks! |
| 12:52 | jodaro | hrm |
| 13:54 | solussd | if I have a datastructure like this: {:a {:id 3 :b {:c {:id 8} :id 6}}}, what would be the beist way to get the keypath to the map containing :id => 8 (e.g. [:a :b :c])? |
| 13:55 | uvtc | ,(get-in {:a {:id 3 :b {:c {:id 8} :id 6}}} [:a :b :c :id]) |
| 13:55 | clojurebot | 8 |
| 13:55 | ChongLi | I don't think that's what he's looking for |
| 13:55 | uvtc | Oh, whoops. |
| 13:56 | ChongLi | I think he wants a function that, given 8, searches the tree for {:id 8} |
| 13:56 | ChongLi | or something |
| 13:56 | solussd | yeah, I know how to get the value after I know the keypath, I want to do the reverse. :) |
| 13:57 | metellus | $findfn {:a {:id 3 :b {:c {:id 8} :id 6}}} 8 [:a :b :c] |
| 13:57 | metellus | I doubt that will find anything |
| 13:57 | lazybot | [] |
| 13:58 | ChongLi | $findfn {:a {:id 3 :b {:c {:id 8} :id 6}}} 8 [:a :b :c :id] |
| 13:58 | lazybot | [] |
| 13:58 | ChongLi | hmm |
| 13:59 | solussd | wow, findfn is crazy |
| 13:59 | uvtc | solussd: maybe something involving `clojure.walk`. |
| 14:00 | solussd | uvtc: yeah, but that just seems too meta for this problem. :) |
| 14:02 | solussd | .. and I cant think of a way to do it without side effects along the way (e.g. keeping track of where I am in an atom or something each step along the way) |
| 14:02 | ChongLi | you're talking about back-tracking |
| 14:02 | solussd | there we go |
| 14:02 | metellus | recursively search and build the path as you come back out |
| 14:03 | ChongLi | I think doing some stream stuff might work |
| 14:03 | ChongLi | how about transforming the tree into a lazy seq of pairs |
| 14:03 | ChongLi | the pairs being keypaths and values |
| 14:03 | ChongLi | and then finding the first value, returning its corresponding keypath |
| 14:03 | solussd | that would work, then when I find it (in a loop) I can see where I've come from |
| 14:05 | solussd | except, of course, it can have "branches": {:a {:id 3 :b {:id 4} :c {:id 5 :d {:id 6 :e {:id 7} :f {:id 8}}}}} |
| 14:06 | ChongLi | sure, but the contents of any tree can be represented in a linear structure |
| 14:10 | TimMc | You want breadth-first or depth-first? |
| 14:10 | ChongLi | what is easier? |
| 14:11 | ChongLi | I don't think it matters in this case, but I don't know if his trees will be wide or dep |
| 14:11 | ChongLi | deep |
| 14:14 | solussd | they're more likely to be wide |
| 14:15 | Luyt | http://wiki.theory.org/YourLanguageSucks , but not Clojure ;-) |
| 14:18 | uvtc | Raynes: refheap down? |
| 14:24 | Raynes | uvtc: Really? Of all the god awful times. |
| 14:24 | Raynes | It's not like I'm in a hospital with my mom or anything. |
| 14:28 | Raynes | Ugh. If this keeps happening, I'm going to have to add some real logging. I can't get heroku logs far enough back to find out what happened |
| 14:28 | Raynes | I don't think... |
| 14:28 | Raynes | technomancy: Is there a way to snatch Heroku logs from `heroku logs` and download them for like the last day? |
| 14:29 | solussd | Raynes: try the -n option for up to 1500 lines of logs |
| 14:29 | ekoontz | Rayes best wishes to your mom |
| 14:29 | Raynes | That might do the trick. |
| 14:29 | ekoontz | sorry Raynes |
| 14:29 | solussd | e.g. heroku logs -n 1500 |
| 14:29 | Raynes | ekoontz: Thanks. Latest news was relatively good. |
| 14:29 | Raynes | Hence my ability to stand here and type without shaking too hard to type. ;) |
| 14:30 | jacobsen | Hi all, can anyone suggest the best (most idiomatic, preferably) way to intercept single keystrokes on the command line (i.e., rather than reading whole lines) in a clojure app? |
| 14:30 | Raynes | You're going to want to use .read instead of read-line or .readLine |
| 14:33 | jacobsen | Thanks Raynes - and good luck w/ your mom. |
| 14:33 | Raynes | Thanks. |
| 14:33 | Raynes | uvtc: Should be back up or coming back up. |
| 14:35 | ambrosebs | Raynes: glad to hear |
| 14:37 | uvtc | Raynes: yup, tnaks |
| 14:37 | uvtc | thanks |
| 14:59 | Sgeo | Is there a version of clojure.set/project that doesn't deal with relations in general but just associatives? I mean, I could do it myself by putting the argument into a vector and calling first on the result, or something, but I think there should be a simpler way |
| 15:03 | Sgeo | Oh, select-keys is in clojure.core |
| 16:23 | firefux | Hi, are the books of Clojure for someone new to functional programming? |
| 16:26 | solussd | Clojure Programming (Orielly) is a good place to start if you're familar with more mainstream languages |
| 16:26 | ChongLi | solussd: did you solve your problem? |
| 16:27 | solussd | ChongLi: just getting back to it.. going the seq route, but haven't figured it out yet. |
| 16:27 | firefux | solussd: I'll check it out |
| 16:27 | ChongLi | it's pretty complex |
| 16:27 | ChongLi | tree recursion always confuses me |
| 16:28 | solussd | me too. :) |
| 16:28 | solussd | maybe a zipper is the way to go |
| 16:28 | ChongLi | a zipper is for navigating a structure |
| 16:28 | ChongLi | one step at a time |
| 16:28 | ChongLi | and then making edits |
| 16:29 | ChongLi | for example, a GUI application for browsing and editing a DOM tree |
| 16:30 | ChongLi | it has stuff like "up, down, left, right" |
| 16:30 | ChongLi | for doing that |
| 16:31 | ChongLi | so it'd be more suitable for the backtracking approach |
| 16:35 | mpenet | Does anyone know what is the equivalent of clojure.lang.Sequential in cljs? To be used with extend-protocol, it seems I can only do it the other way around (using extend-type and cljs.core.ISequential) ? |
| 16:35 | alexyk | how, from a running nrepl, can I learn the port used? |
| 16:36 | ChongLi | check the buffer *Process List* |
| 16:36 | ChongLi | ? |
| 16:36 | ChongLi | or do you mean at the repl? |
| 16:37 | alexyk | yep |
| 16:37 | solussd | ChongLi: yeah, I used a zipper effectively in production a couple of times.. :) pretty cool, I think |
| 16:38 | Hodapp | Hrmph. What's a typical stack depth that will make things explode? |
| 16:38 | Hodapp | I'm deciding whether to use a trampoline and make up my own sort of stack for just what I need, or just recurse directly. |
| 16:43 | TimMc | ,((fn r [x] (when (< x 2000) (r (inc x)))) 0) |
| 16:43 | clojurebot | nil |
| 16:43 | TimMc | ,((fn r [x] (when (< x 20000) (r (inc x)))) 0) |
| 16:43 | clojurebot | #<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError> |
| 16:43 | TimMc | ,((fn r [x] (when (< x 10000) (r (inc x)))) 0) |
| 16:43 | clojurebot | nil |
| 16:43 | TimMc | ,((fn r [x] (when (< x 16000) (r (inc x)))) 0) |
| 16:43 | clojurebot | #<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError> |
| 16:44 | TimMc | Hodapp: Somewhere around 13k in this case? |
| 16:44 | Hodapp | alrighty |
| 16:45 | TimMc | Same range on my server laptop -- 10k - 16k. |
| 16:45 | TimMc | I suppose it depends on how your JVM is started, though. |
| 16:48 | TimMc | ,((fn r [x _ _ _ _] (when (< x 10000) (r (inc x) 0 0 0 0))) 0 0 0 0 0) |
| 16:48 | clojurebot | #<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError> |
| 16:48 | TimMc | ,((fn r [x _ _ _ _] (when (< x 8000) (r (inc x) 0 0 0 0))) 0 0 0 0 0) |
| 16:48 | clojurebot | #<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError> |
| 16:48 | TimMc | ,((fn r [x _ _ _ _] (when (< x 5000) (r (inc x) 0 0 0 0))) 0 0 0 0 0) |
| 16:48 | clojurebot | nil |
| 16:48 | TimMc | Hodapp: ^ Depends on how big your stack frames are too. :-) |
| 16:50 | Hodapp | TimMc: ah, yes, true too :) |
| 16:59 | clizzin | anyone here have experience with crossover clojure/clojurescript code using lein-cljsbuild? |
| 17:11 | abp | hell-o |
| 17:12 | zodiak | heaven-o |
| 17:13 | abp | Is there any way to bind qualified symbols in a macro? |
| 17:22 | TimMc | Bind? |
| 17:24 | TimMc | Can you give an example of input and output? |
| 17:32 | yedi | are there any sites similar to disclojure? |
| 17:33 | yedi | anyone know of any* |
| 17:35 | Urthwhyte | there's the weekly http://reborg.tumblr.com/post/35055123582/clojure-weekly-nov-5-2012 newsletter |
| 17:37 | yedi | sweet |
| 17:40 | ChongLi | hmm |
| 17:40 | ChongLi | if I edit 2 different files (in 2 separate instances of emacs) and use nrepl-jack-in on both |
| 17:40 | ChongLi | one of them has colorized stacktraces whereas the other does not |
| 17:40 | ChongLi | I can't figure out why! |
| 17:42 | Urthwhyte | yedi: you might also try fogus' blog and following the #clojure tag on Twitter. I find lots of interesting things through there |
| 17:44 | yedi | word, good looks |
| 17:44 | ChongLi | anyone have any ideas? |
| 17:47 | ChongLi | ahhh, hmm |
| 17:48 | ChongLi | if I move the file out of its project directory and just edit it on its own |
| 17:48 | ChongLi | it works |
| 17:48 | ChongLi | so it must be an old version of one of the deps or something |
| 17:49 | Mr_Bond | anyone running Clojure on raspberryPi ? |
| 17:49 | abp | TimMc: Sorry, didn't recognize the timeout or whatever that was. I think I know how to do what I want. I can replace all occurences of a qualified symbol with a gensym. |
| 17:49 | abp | TimMc: Will show when done |
| 17:50 | ChongLi | hmm, it's not the clojure version |
| 18:08 | yedi | Any sufficiently complicated Clojure (or Lisp) program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Haskell. |
| 18:08 | yedi | - some guy on the internet |
| 18:08 | Hodapp | yedi: Have you seen the origin of that quote? |
| 18:08 | yedi | don't believe so |
| 18:09 | Hodapp | https://en.wikipedia.org/wiki/Greenspun's_tenth_rule |
| 18:09 | amalloy | hah. repeating the derivative in a lisp room without knowing the original is nicely ironic |
| 18:11 | yedi | i wanted you guys to help me understand what the guy who said that was getting at |
| 18:20 | seangrove | Hey all, with clojurescript, when compiling and runnig it in the browser with no optimizations (just whitespace), it seems to run fine. |
| 18:20 | seangrove | But with even with simple optimizations turned on, I get "Namespace "goog.debug.Error" already declared." |
| 18:21 | seangrove | Looking at the generated Javascript, it looks like the goog.debug.Error namesapce is actually provided 3 times, with big repeating sections |
| 18:21 | seangrove | Anyway, wondering if anyone's come across this and knows what I've mixed up to get repeating javascript |
| 18:22 | abp | Hodapp: yedi: http://s-expressions.com/ |
| 18:22 | abp | second post "Any sufficiently complicated Clojure (or Lisp) program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Haskell." |
| 18:23 | cmeiklejohn | seangrove: can you gist your project.clj? |
| 18:24 | seangrove | cmeiklejohn: Definitely, one moment... |
| 18:24 | seangrove | https://gist.github.com/0c462cf39fce5b6e970c |
| 18:24 | seangrove | I've just tried it with advanced optimizations and it seems to work locally, pushing it to production to test |
| 18:25 | seangrove | Wondering if for every namespace I require some library all the dependencies get included all over again |
| 18:26 | alexyk | anybody using La Clojure? |
| 18:27 | abp | alexyk: Eclipse isn't pretty but counterclockwise (the clojure plugin) is worth it. |
| 18:27 | Hodapp | Counterclockwise is way too buggy for me. |
| 18:27 | amalloy | if you don't already love eclipse, why would you choose ccw over emacs? |
| 18:27 | alexyk | abp: couldn't care less about Eclipse, am using IDEA for Scala very well. La Clojure seems fine, just don't know how to look up definitions by names |
| 18:28 | alexyk | tried Sublime Text and Aquamacs too |
| 18:28 | Hodapp | amalloy: I learned Emacs just because I wanted to use it for Clojure stuff. I haven't been disappointed. |
| 18:28 | amalloy | me too |
| 18:28 | abp | alexyk: So use Eclipse with counterclockwise and use it's proper autocompletion with docs etc. |
| 18:28 | Hodapp | this is after knowing and trying to use Eclipse and Vim. |
| 18:29 | alexyk | nice thing about nrepl is that I hope to be able to work from several different IDEs against the same JVM if I want to |
| 18:29 | abp | Hodapp: amalloy I will, but not now. Busy writing libs... :o Bad reason? |
| 18:29 | Hodapp | CCW just gave me all sorts of idiotic issues... the latest one was not worth it to try to diagnose, like the REPL giving me a NullPointerException for no reason that I could not find any information about. |
| 18:29 | amalloy | how dare you, abp? being productive instead of fiddling with productivity settings? |
| 18:30 | abp | Hodapp: amalloy The setup is good now, not much to do, probably using paredit commands more. |
| 18:33 | abp | amalloy: Main productivity is in my head anyways. Working on 30 lines of code for some hours now. I want something like prismatics graph. But with some custom tweaks, too. |
| 18:33 | Hodapp | I need to learn paredit. |
| 18:33 | Hodapp | the extent of my current knowledge is that I'm vaguely aware something called paredit exists. |
| 18:34 | abp | amalloy: First time writing macros after one and a half year of clojure. |
| 18:34 | abp | Hodapp: I used some of it's commands but no muscle memory built. :( |
| 18:35 | Foxboron | New to Clojure, spent the whole day debugging a lambda, then i saw i had a set of () too much ._. |
| 18:35 | TimMc | Parentheses overkill is a pretty common mistake for beginners. |
| 18:36 | TimMc | Foxboron: Did you have "((" anywhere in your code? |
| 18:36 | Foxboron | TimMc, no. Its was a set of paranthesises around the whole expression i did not see. |
| 18:36 | abp | Visual recognition accustomizing to ((((((())))))) |
| 18:36 | TimMc | Consecutive open parens are rare in beginner and intermediate functional programming. |
| 18:38 | Foxboron | But its fun really. |
| 18:38 | abp | Foxboron: Before it becomes pure joy, yes. |
| 18:39 | Urthwhyte | Hodapp: It only takes about ~20-30 minutes to learn the basics and it's a huge productivity boost |
| 18:39 | Hodapp | Urthwhyte: Is it just a mode in Emacs? |
| 18:39 | Urthwhyte | I use the vim plugin, can't speak to emacs |
| 18:40 | Urthwhyte | but it is much better supported there, I'm sure someone else in the channel can advise |
| 18:50 | Hodapp | Urthwhyte: just got it installed in a couple minutes; not understanding if I'm seeing all its features, but I can see how it might be useful |
| 18:51 | Urthwhyte | I would just do the emacs equivalent of `:help paredit` and print out the keybind section |
| 18:51 | Hodapp | I am looking at the mode help right now |
| 18:51 | Hodapp | that's the root of the 'not understanding if I'm seeing' etc. |
| 18:52 | Urthwhyte | ahh |
| 18:52 | Urthwhyte | It's relatively simple, keeps parens balanced automagically |
| 18:52 | Hodapp | oh, nevermind, somehow I missed like 9 pages of documentation |
| 18:52 | Urthwhyte | only remotely complex stuff is probably slurping and barfing |
| 18:52 | Hodapp | must have hit Ctrl Meta Shift End mouse-3 V by mistake instead of C-V, I do that all the time |
| 18:53 | Urthwhyte | hah |
| 18:53 | Urthwhyte | This is why I stick to modal editors ;) |
| 18:53 | Hodapp | <troll>vim has two modes, 'beep' and 'break everything'</troll> |
| 18:54 | Urthwhyte | http://www.gnu.org/fun/jokes/ed-msg.html |
| 18:55 | Hodapp | -rwxr-xr-x 1 root 5.89824e37 Oct 22 1990 /usr/bin/emacs |
| 18:55 | Hodapp | bahahahahaha |
| 18:55 | Hodapp | -rwxr-xr-x 1 root 24 Oct 29 1929 /bin/ed |
| 18:55 | Hodapp | 1929, that's a good touch :) |
| 18:59 | Hodapp | I really shouldn't knock 'ed'. I've never used it. |
| 18:59 | Urthwhyte | I have...once |
| 18:59 | Urthwhyte | It was not a pleasant experience |
| 19:00 | Hodapp | you just need to learn to use it! |
| 19:01 | Urthwhyte | One editor is enough for me |
| 19:01 | Hodapp | At work, I use: Emacs, Visual Studio *gag*, Eclipse, MATLAB's editor, vim, and sometimes notepad/notepad++ |
| 19:02 | Foxboron | I use Sublime Text 2 |
| 19:02 | Foxboron | and Light Table sometimes for the repl ^^ |
| 19:02 | Hodapp | I should poke around at Light Table soon |
| 19:02 | Urthwhyte | I use vim exclusively, Eclipse@Google put me off ever using an IDE again |
| 19:02 | Foxboron | Hodapp, its actually quite fun for basic stuff :) |
| 19:03 | mattmoss | I position the disk platter according to the incoming gamma rays so that those rays flip the correct bits on the platter. |
| 19:03 | Hodapp | Foxboron: 'fun' is surprisingly underestimated for a lot of programming tasks |
| 19:03 | uvtc | jEdit recently got good Clojure support. See http://clojure-doc.org/articles/ecosystem/development_tools.html . |
| 19:03 | Foxboron | Hodapp, indeed. and watching how the variables evolve with the reple with blocks of code is quite interesting. |
| 19:03 | Hodapp | I was messing with Lively Kernel the other day - an implementation of the Morphic graphics model that Self and Smalltalk used for a GUI that you can do live-editing, live-inspection, live-everything on |
| 19:04 | Hodapp | that was actually kind of fun. |
| 19:04 | Foxboron | I just pray the end version of Light Table is great and got as great support for other languages |
| 19:04 | TimMc | Hodapp: paredit is more than just keeping parens balanced -- it's a decent implementation of "structural editing". You move entire forms around. |
| 19:04 | TimMc | Hodapp: paredit-convolute-sexp is my favorite <3 |
| 19:05 | Hodapp | sounds kinky. |
| 19:05 | TimMc | Very. |
| 19:05 | eis | Foxboron, how do you like Sublime Text? can you compare it to anything? I've been using emacs, but I can't say I'm quite happy |
| 19:05 | Hodapp | M-x happy-mode |
| 19:05 | Hodapp | geez |
| 19:05 | TimMc | Hodapp: If you have (let [x 5] (if foo x y)) and want to put the if around the let, that command lets you do it. |
| 19:06 | Urthwhyte | eis: It's a better Textmate with some very nice packages |
| 19:06 | eis | Hodapp, that would be real nice! I'd bind that to every key combination right away |
| 19:07 | Foxboron | eis, ummmm. I can't really compared it to anything as i am mostly a windows person and havent been that emerged with vim/emacs |
| 19:07 | Foxboron | I do however feel Sublime is a viable option for VIM users who want some GUI |
| 19:07 | Foxboron | as all keybinds are available in Sublime. |
| 19:08 | eis | Urthwhyte, I've seen people writing plugins, looks like it's quite extensible. Do you think it can be comparable to Emacs, in like power-ness? |
| 19:08 | Urthwhyte | Foxboron: The problem is it doesn't implement word objects quite properly IME |
| 19:08 | Urthwhyte | I had the same problem when trying viper mode in emacs; the subtle differences tripped me up |
| 19:09 | Urthwhyte | eis: I can't really speak to that one way or another since I'm not familiar at all with the extensions API. I use a completely stock copy and only pull it out when pairing with someone who doesn't know vi basics |
| 19:12 | eis | Urthwhyte, oh, it's been like that for me. Some time ago I read a post by a guy who I'd say is a quite advanced emacs user (like, his .emacs is huge, and he's written a lot of elisp code), and he wrote that he's considering a switch to Sublime |
| 19:12 | Hodapp | snazzy, I can wipe out an entire expression with one C-k! |
| 19:13 | Foxboron | eis, really. Just try Sublime Text 2 |
| 19:13 | Urthwhyte | eis: I tend to keep a simple config for sake of portability. I was for a time really deep into customising my tooling and writing tons of automation and realised it wasn't really helping me as a developer, just a distraction from learning. |
| 19:13 | Foxboron | Get the Package manager, and check some plugins. If you are dependant on multiple views, Origami is your friends. SublimeREPL for REPL etc |
| 19:14 | eis | Foxboron, oh yeah, I've seen those. I tried to code in Scala with ENSIME and some Sublime plugin, but that didn't work out too well. What do you use for Clojure in Sublime? |
| 19:15 | Foxboron | eis, the standar Clojure support is actually kinda poor. |
| 19:15 | ivan | Emacs is worth using for org-mode for me |
| 19:15 | ivan | have you tried using #emacs to get happier about Emacs? |
| 19:15 | Foxboron | You got SublimeREPL to get a REPL up and running, and you can use it to evaluate stuff |
| 19:15 | eis | Urthwhyte, spot on! Sadly, unconfigure Emacs isn't much of an editor, at least for a novice like me |
| 19:15 | Foxboron | but more then that, its poor :P |
| 19:15 | Urthwhyte | Not really fair to compare tooling for clojure and scala :P |
| 19:16 | Urthwhyte | Scala is much closer to the Java school in terms of package naming and methods |
| 19:17 | eis | ivan, I'm kinda new to IRC. I might try the #emacs channel, despite the fear of being ridiculed by gurus :D |
| 19:18 | Hodapp | It took me a couple hours to earn two ignores in #emacs |
| 19:18 | ivan | there are also a bunch of screencasts on youtube that have shown me the things I wanted |
| 19:18 | antares_ | eis: have no fear, IRC is full of nice people, not just dicks |
| 19:19 | Hodapp | well, I don't know how many ignores I earned, but I know that two people were vocal about it |
| 19:19 | Urthwhyte | ++antares_ |
| 19:19 | eis | yeah, there's the emacsrocks.com IIRC, it's quite an awesome screencast |
| 19:19 | Hodapp | I've never had a single issue here though |
| 19:20 | Urthwhyte | This channel is great; has answered my queries time and time again |
| 19:20 | Urthwhyte | nicely, even |
| 19:20 | Hodapp | in #c++ on the other hand my experience has always been that to get my question answered I first have to spend 10 minutes smacking around the first asshole who tries to tell me my question just ain't worthy and I'm a dumbass for asking it... and then the channel pays attention. |
| 19:21 | eis | haha, wow. glad that I don't code in c++ :D |
| 19:21 | Urthwhyte | ##java is the worst by far IME |
| 19:22 | Hodapp | Urthwhyte: I fear you're right. I've spent some time there. |
| 19:22 | Hodapp | Urthwhyte: In both channels I've had all sorts of issues with them just not even wanting to give me the time of day until I had produced an almighty "test case". |
| 19:22 | Hodapp | as if conceptual knowledge is just something that is impossible |
| 19:23 | Hodapp | Urthwhyte: what sort of lovely issues have you had? |
| 19:26 | Urthwhyte | Just rudeness and a sense they were reluctant to answer questions. Not worth getting into specifics of it really. Editor wars are more fun than IRC channel pissing matches ;) |
| 19:26 | Hodapp | :P |
| 19:27 | Hodapp | Sounds about right. I just got really sick of the bunch of curmudgeony dicks that were there, and I've never seen anything close to that here |
| 19:28 | Hodapp | but since we're actually having an editor war |
| 19:28 | Hodapp | vim sucks. |
| 19:29 | Urthwhyte | It's too bad emacs doesn't have a decent text editor |
| 19:29 | Urthwhyte | it's a decent OS |
| 19:30 | Hodapp | I once was banned from a channel for saying that. |
| 19:32 | Urthwhyte | well, I have an actual Clojure question: https://gist.github.com/dd6d904fa86b9697c518 is there a more idiomatic way to write this? |
| 19:33 | Foxboron | wait |
| 19:33 | Foxboron | you guys complain about #c++ and ##java |
| 19:33 | Foxboron | seen #python? |
| 19:33 | Foxboron | where everyone believes THEY are right |
| 19:33 | Foxboron | and if you do anything even remotly "magic" or hacky, they flame you |
| 19:33 | Foxboron | and if you come and give them a comment, they flame you along with your hackey script. |
| 19:33 | Foxboron | its madness |
| 19:37 | Urthwhyte | It seems a huge mess to me atm. String interpolation would help a bit but the nested doruns and huge anonymous function could do with improvement |
| 19:48 | solussd | Urthwhyte: check out doseq, for one |
| 19:49 | Urthwhyte | ,(doc doseq) |
| 19:49 | clojurebot | "([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil." |
| 19:56 | solussd | Urthwhyte: marginally better I think: https://www.refheap.com/paste/0955ce736403a66c4a8754564 |
| 19:56 | solussd | at least not forcing maps and holding on to the heads of the produced seqs |
| 19:57 | abp | Urthwhyte: https://gist.github.com/4102158 |
| 19:58 | Urthwhyte | ah, that is much better. I've been somewhat consciously avoiding for and doseq due to a lack of comfort with them |
| 19:58 | solussd | or do what abp suggested and make it one write. :D |
| 19:58 | Urthwhyte | but it really does make everything much clearer; overreliance on map is a holdover from Ruby habits |
| 19:59 | Frozenlock | I see that that lein Noir (plugin) is deprecated. Is there something to replace it? |
| 20:01 | abp | Urthwhyte: Comfort comes with experience. Be patient and try things out. doseq etc. is rarely needed. |
| 20:01 | Bergle_1 | lol, i see so many refernces to cool libs and tools.... sooo much to learn. |
| 20:01 | abp | Bergle_1: :o way to long... |
| 20:02 | Bergle_1 | bought Pragmatic programm Programming CLojure last week - about 1/2 way into it :) |
| 20:02 | abp | Bergle_1: I've survived around 4 years of java and can't take much more. |
| 20:02 | Bergle_1 | ive been in .net / sql server / cold fusion / js land ;) heh |
| 20:03 | Bergle_1 | pre java 1.0 :") |
| 20:03 | Urthwhyte | Ruby/Python with a very brief stint in Java-land |
| 20:03 | Urthwhyte | but my career has yet to really begin, so not a fair comparison |
| 20:03 | abp | Bergle_1: Then read Clojure Programming, The Joy of Clojure and ClojureScript: Up and running too. :D |
| 20:03 | Bergle_1 | finish this book first, then play some more, come with a project to muck with. |
| 20:03 | Foxboron | Like, i am a fulltime basher of Java, yet i learn Clojure |
| 20:03 | Foxboron | hmmm |
| 20:04 | Bergle_1 | im pretty happy with the Programming Clojure book, |
| 20:04 | Bergle_1 | so far. :) |
| 20:04 | Urthwhyte | Joy of Clojure is next on my reading list (I've just finished with Programming Clojure) |
| 20:04 | Bergle_1 | only one swear point wher ei chased my tail for an hour or so cause he didnt explain what a specific construct was - but found it online :) |
| 20:04 | abp | Bergle_1: I've spent to much time reading and trying libs, now all those things are in my head and i want to unify them. |
| 20:04 | Bergle_1 | howd you find Programming Clojure Urthwhyte ? its one of the better books ive read on a languages so far. |
| 20:05 | Urthwhyte | a coworker's recommendation |
| 20:05 | Bergle_1 | ive also been toying with lighttable :) lol i kicked some $ to it bakc on kickstarted - cause it looked so cool just to encourag edev, its only alpha but its a neat toy at moment. :) |
| 20:06 | abp | Urthwhyte: Does my code work for you? :) |
| 20:06 | abp | Bergle_1: Funded too, waiting to write plugins. |
| 20:07 | Bergle_1 | ive played with smalltalk on on off over the years and its a wonerful environment :) |
| 20:07 | Bergle_1 | just never did anything serious with it. |
| 20:08 | abp | Bergle_1: Ah ok, that was some time ago? |
| 20:09 | Bergle_1 | smalltalk with squeak hmm 5 years |
| 20:09 | Urthwhyte | abp: Needs a second map across the questions hash, since questions is a nested col |
| 20:11 | Urthwhyte | solussd: worked well |
| 20:11 | solussd | did you try abp's approach? it's much cleaner / more functional |
| 20:13 | Urthwhyte | I'm fixing it up right now |
| 20:13 | Urthwhyte | just trying to rewrite my partition func first |
| 20:14 | abp | Urthwhyte: Yeah thought something like that ;) |
| 20:14 | abp | Urthwhyte: Little challenge for you now. |
| 20:16 | solussd | ChongLi: In case you're interested, here's how I solved my problem (it's lazy, in a good way): https://www.refheap.com/paste/b3e00d3aa3a5b7c7791dbfa30 |
| 20:25 | abp | Finding labrary names is tough but a little imagination applied and neat things appear: clevejate |
| 20:25 | abp | Does that sound good? I'm no native english speaker. German, actually. |
| 20:28 | solussd | abp: i like it |
| 20:32 | abp | a |
| 20:32 | abp | It's elevate + clj = clevejate |
| 20:33 | brainproxy | is there a 'not' form for checking that an exception is not thrown? |
| 20:33 | brainproxy | (is (not (thrown-with-msg ...))) doesn't work |
| 20:35 | uvtc | abp: I think there has been a recent rule instituted severely restricting Clojure pun names. :) |
| 20:42 | ChongLi | solussd: nice |
| 20:42 | solussd | :D |
| 20:43 | ChongLi | quite a long function name |
| 20:43 | ChongLi | haha |
| 20:43 | ChongLi | why not just use namespaces? |
| 20:43 | solussd | yeah, I'm an objective-c developer by day! |
| 20:44 | solussd | oh I am, it's in the <something>.models.group namespace (and groups have org_hierarchies) |
| 20:44 | solussd | (objective-c doesn't have namespaces, in case that didnt make sense as a joke) |
| 20:44 | ChongLi | haha |
| 20:49 | abp | uvtc: Problem is, it's not puny. I want to elevate programming in clojure into a mainly declarative and occassionaly funtional sphere. |
| 20:50 | abp | Then every sort of tooling like datomic queries and core.logic applies to your program like to your data. |
| 20:53 | TimMc | I've started using biological taxonomic names for projects. |
| 20:53 | TimMc | Bookmarking tool -> Chelydra (after the snapping turtle genus) |
| 20:54 | Foxboron | Writing Python for over a year, Started with Clojure yesterday, and now i forget to add :'s D: |
| 20:54 | TimMc | (the tool does not exist yet, so don't bother searching for it :-P) |
| 20:55 | abp | TimMc: That's true for my lib too. Just a github organziation. |
| 20:56 | Foxboron | hm |
| 20:56 | abp | TimMc: But biological taxonomies is a good idea. Will try mixing purpose of my lib with those. :) |
| 20:56 | Foxboron | Achive max geekynes, type equations as project names. |
| 20:57 | abp | Wow! First big task done. Now I think I'm at least not totally stupid. :D |
| 21:00 | TimMc | abp: technomancy generally uses literary references -- e.g. "Leiningen Versus the Ants" |
| 21:04 | abp | TimMc: Oh, I didn't know that. Everything that is on peoples minds end up as their library names. I want revolutions! Clojure, ClojureScript and Datomic lead the way. :D But really, Datomic is a name by the central concept, datoms. My central concept is elevating programming from functional into declarative style. |
| 21:05 | abp | Has *everyone* seen http://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.html and https://github.com/strangeloop/strangeloop2012/blob/master/slides/sessions/Wolfe-Graph.pdf?raw=true and understood the implications? That's huge. |
| 21:06 | abp | Still waiting for the recording of the presentation at strangeloop 2012 though. |
| 21:07 | abp | And the open source version of graph. So much so that I start writing everything I need by myself. I did exactly that for Java, but fixed on swing-properties, thousands of lines of javassist compiler extensions and jgrapht management. Thats all vanishing now into pure functional awesomeness. |
| 21:11 | uvtc | TimMc: Oooh, good idea (re. naming). |
| 21:11 | abp | It's going to get modules for cljs (history, localstorage, rpc, ajac, websockets, dom), ring ((reversable) routes, view-rendering), swing (declarative binding through graph nodes), datomic (event-sourcing, writing, reading) etc. |
| 21:11 | abp | It's realy only about bridging into graph nodes at some point. |
| 21:13 | abp | Control flow and state are always drawable as graphs. Timing of functions can be written into the graph at nodes, besides their results. |
| 21:14 | abp | And graphs can be stored in datomic. |
| 21:15 | abp | So you write data, to process data, to present data, to export data. Abstract all the things. Now imagine I've got crazy hear and |
| 21:16 | abp | 'am standing on the stage at the conj. :( |
| 21:16 | abp | *crazy hear -> crazy hair |
| 21:29 | wingy_ | ibdknox: if you are there .. (require 'myapp.server :reload-all) doesn't seem to reload the namespace |
| 21:29 | wingy_ | in Light Table |
| 21:30 | TimMc | abp: Have you seen scgilardi's kiln library? |
| 21:31 | TimMc | Also, a couple of folks at the last Boston Clojure Meetup got me hooked on "Engineering a Safer World", which in part discusses the kinds of complex problems you can get in big dependency graphs. |
| 21:32 | TimMc | Basically, all the components can be working as designed and the system can still fail -- so you'll need really good ways of debugging module graphs. |
| 21:34 | wingy_ | hm im using (require 'myapp.server :reload-all) from the lein repl but with no effects |
| 21:34 | wingy_ | how do i reload the code i have made? |
| 21:40 | TimMc | wingy_: Perhaps code-reloading is not sufficient for your needs, then. |
| 21:40 | TimMc | Is the server still running all this time? |
| 21:40 | wingy_ | it is .. cause i reloaded that one file and it works |
| 21:41 | wingy_ | the server file requires all other files, reload that one doesn't work |
| 21:41 | wingy_ | which is weird since :reload-all should re-require all files that one requires |
| 21:41 | wingy_ | TimMc: yes |
| 21:42 | abp | TimMc: Will investigate on kiln. For debugging visualization of every state and flow seems enough. |
| 21:43 | abp | TimMc: scgilardi has no kiln |
| 21:43 | abp | Has he? ;) |
| 21:45 | TimMc | abp: Oops, it's not on his account: https://github.com/straszheimjeffrey/The-Kiln |
| 21:46 | TimMc | He gave a presentation about it some months ago. |
| 21:47 | robink | What's currently the best Clojure HTTP client library? |
| 21:47 | robink | clj-http? |
| 21:47 | clojurebot | dakrone maintains clj-http |
| 21:49 | abp | TimMc: Oh, yeah, I've seen that. But looks much to cluttered and read arkward things about it. :/ |
| 21:50 | TimMc | OK. I'm just starting to read about Prismatic's Graph, thanks to your link. |
| 21:52 | abp | TimMc: Sure, no problem, I think it's very relevant for programming. My graph-lib is coming along great. I'm putting together graphs, in terms of (compile your-graph) |
| 21:53 | abp | TimMc: Oh, more like (compile your-fnk-map) |
| 21:53 | TimMc | I wrote my own little graph thing once upon a time for a GUI that had annoying computational dependencies between events, state, and display. |
| 21:53 | TimMc | I think everyone eventually writes such a thing. :-D |
| 21:55 | TimMc | https://github.com/timmc/cascade |
| 21:55 | abp | TimMc: To bad nothing get's flexible and enjoyable enough to become widely adopted. |
| 21:56 | TimMc | Yeah, it's hard to imagine something that's generic enough. |
| 21:57 | abp | TimMc: Looks quite nice at a first glance. |
| 21:58 | TimMc | Mine is useful for (I hope!) efficient recomputation of intermediate state as inputs change over time. |
| 21:58 | abp | TimMc: For me it's much work to implement now. ;) But it's my first day working on it. |
| 21:58 | TimMc | I'd be hard-pressed to merge that with something like The Kiln, which is functional. |
| 21:58 | abp | TimMc: Yea, I call that iterative graph updates. |
| 21:59 | abp | TimMc: Yours is not functional? |
| 21:59 | TimMc | No, it is entirely based on side-effects. |
| 21:59 | abp | TimMc: Oh, yeah, you mentioned state. |
| 22:00 | TimMc | The API looks functional (you get a new cascade object back), but each node is supposed to mutate stuff externally. |
| 22:01 | abp | TimMc: But some state will always be there. When I unify Clojure and ClojureScript into one graph it can depend on server side storage, session cookie, other cookies, localstorage, history, dom, rpc etc. |
| 22:01 | TimMc | Ah, sure. |
| 22:03 | abp | TimMc: I've thought about reducing state to what already is stateful, but between that, theres always one coherent state. Even when employing side-effects. You can't write when there is nothing to write. |
| 22:04 | TimMc | Didn't follow that. |
| 22:05 | abp | TimMc: user-typed -> do-calculations = result, coherent state, pause, next thing happens. Async result -> do-calculations = result, coherent state, pause, ... |
| 22:07 | TimMc | I understood that even less -- what do you mean by coherent state? |
| 22:08 | abp | TimMc: Point at a time were nothing happens, everything is done. You have everything the graph produces in any way in a single map. That's a coherent state. |
| 22:09 | abp | TimMc: not? |
| 22:09 | abp | TimMc: Even datomic uses one atom to snapshot these. :D |
| 22:10 | TimMc | Ah, I see. |
| 22:10 | TimMc | You don't always get that in distributed systems, though. |
| 22:10 | abp | TimMc: Sure? |
| 22:11 | TimMc | I don't know enough about datomic, I guess. |
| 22:12 | abp | TimMc: I've only seen "Writing Datomic in Clojure" http://www.infoq.com/presentations/Datomic (and the other talks on it) |
| 22:13 | bbloom | abp: TimMc: have you seen adobe's adam and eve? |
| 22:14 | bbloom | http://stlab.adobe.com/group__asl__overview.html |
| 22:14 | bbloom | in particular the property model is interesting |
| 22:15 | TimMc | I will check those out tomorrow, thanks! |
| 22:15 | bbloom | this paper too http://dl.acm.org/citation.cfm?id=1449927 |
| 22:15 | abp | bbloom: Yeehaw, more inspiration! |
| 22:15 | abp | bbloom: I think reactive programming is overrated. :x |
| 22:16 | bbloom | i wouldn't call this "reactive" |
| 22:16 | bbloom | in short, they define inputs, variables, constraints, and outputs |
| 22:16 | abp | bbloom: That's good, haven't looked into it. |
| 22:16 | yedi | so I have a list of strings formatted like this "<value> <key>". How can I make a map that contains a matching of keys to the list of corresponding values from that list of strings? |
| 22:16 | abp | bbloom: That's the way. |
| 22:16 | bbloom | inputs are initial values, constraints relate the variables, the variables are bound to the UI, and then outputs form the "command" in the adobe photoshop command history sense |
| 22:17 | bbloom | undo/redo style |
| 22:17 | bbloom | in also plays nice with that event sourced view of the world |
| 22:18 | bbloom | there is local state for a form, which is 1-to-1 data bound, but the global document state is always event sourced |
| 22:18 | bbloom | unfortunately, command models for applications have a high investment cost. most applications don't necessarily need complex undo/redo from step 1 |
| 22:18 | bbloom | so the model demos poorly |
| 22:18 | bbloom | but i think it's a really strong approach for larger systems |
| 22:19 | bbloom | yedi: you have a space separated list? |
| 22:19 | yedi | it's a list of strings |
| 22:19 | bbloom | yedi: ah, alternating key, value, key, value, ... |
| 22:19 | bbloom | ? |
| 22:20 | bbloom | &(apply hash-map [:x 1 :y 2 :z 3]) |
| 22:20 | lazybot | ⇒ {:z 3, :y 2, :x 1} |
| 22:20 | yedi | it's not one entire string tho |
| 22:20 | bbloom | yedi: that what you need? |
| 22:21 | abp | bbloom: Will have a look, at least it doesn't exist in clojure now. |
| 22:21 | yedi | its like ["val1 key1" "val2 key2" "val3 key1"] => {"key1": ["val1" "val2"], "key2": ["val2"]} |
| 22:22 | bbloom | yedi: ah, you want a "multi-map" |
| 22:23 | bbloom | do you want the values ordered? or do you want sets? ie {"key1": #{"val1" "val2}... |
| 22:23 | yedi | sets would be fine |
| 22:23 | solussd | yedi: &(into {} (map #(clojure.string/split % #"\s") ["key value" "key2 value2"])) |
| 22:23 | solussd | ,(into {} (map #(clojure.string/split % #"\s") ["key value" "key2 value2"])) |
| 22:23 | clojurebot | {"key" "value", "key2" "value2"} |
| 22:23 | solussd | there we go |
| 22:24 | bbloom | solussd: that won't produce a multiset, that will clobber values |
| 22:24 | bbloom | er multimap |
| 22:24 | solussd | ooh |
| 22:24 | solussd | reduce using update-in |
| 22:25 | bbloom | yup |
| 22:27 | bbloom | yedi: start by getting a list of key value pairs |
| 22:27 | bbloom | break the problem down into steps |
| 22:28 | bbloom | &(->> ["val1 key1" "val2 key2" "val3 key1"] (map #(string/split % #" "))) |
| 22:28 | lazybot | java.lang.RuntimeException: No such namespace: string |
| 22:28 | bbloom | &(->> ["val1 key1" "val2 key2" "val3 key1"] (map #(clojure.string/split % #" "))) |
| 22:28 | lazybot | ⇒ (["val1" "key1"] ["val2" "key2"] ["val3" "key1"]) |
| 22:28 | bbloom | so that gets you val key |
| 22:29 | bbloom | &(->> ["val1 key1" "val2 key2" "val3 key1"] (map #(reverse (string/split % #" ")))) |
| 22:29 | lazybot | java.lang.RuntimeException: No such namespace: string |
| 22:29 | bbloom | &(->> ["val1 key1" "val2 key2" "val3 key1"] (map #(reverse (clojure.string/split % #" ")))) |
| 22:29 | lazybot | ⇒ (("key1" "val1") ("key2" "val2") ("key1" "val3")) |
| 22:29 | solussd | yedi: (reduce (fn [m [k v]] (update-in m [k] #(conj % v))) {} (map #(clojure.string/split % #"\s") ["key value" "key2 value2" "key2 anothervalue2"])) |
| 22:29 | solussd | ,(reduce (fn [m [k v]] (update-in m [k] #(conj % v))) {} (map #(clojure.string/split % #"\s") ["key value" "key2 value2" "key2 anothervalue2"])) |
| 22:29 | bbloom | that gets you key/val |
| 22:29 | clojurebot | {"key2" ("anothervalue2" "value2"), "key" ("value")} |
| 22:29 | bbloom | then do what solussd is saying :-) |
| 22:29 | bbloom | i recommend using multiple steps with lets or ->> for clarity |
| 22:29 | solussd | sorry, just jumped out of the repl and pasted. :D |
| 22:40 | Sgeo | I'm very much missing the nice documentation that static typing naturally provides |
| 22:40 | Sgeo | Writing out the types of stuff in English is annoying |
| 22:41 | abp | Sgeo: Have you tried/read about typed clojure? |
| 22:41 | Sgeo | Heard about it |
| 22:44 | yedi | hey thanks guys, now i can look at this and try to understand what each part is doing |
| 22:44 | yedi | so when i come up against something similar later, i know whwat to do =D |
| 22:50 | bbloom | yedi: so are you familiar with sets? |
| 22:50 | bbloom | &(conj #{1 2 3} 3 4 5) |
| 22:50 | lazybot | ⇒ #{1 2 3 4 5} |
| 22:52 | bbloom | there is also a clojure.set namespace: |
| 22:52 | bbloom | &(clojure.set/union #{1 2 3} #{3 4 5}) |
| 22:52 | lazybot | ⇒ #{1 2 3 4 5} |
| 22:52 | bbloom | there's a bunch of different approaches |
| 22:52 | bbloom | to problems like yours |
| 22:52 | bbloom | but the key thing is: break it down into steps! |
| 22:52 | bbloom | simplify the problem as you go |
| 23:04 | nightfly_ | Why would you have january be month 0 in a date library and leave everything else normal... |
| 23:05 | amalloy | nightfly_: C set the precedent for date representations |
| 23:12 | nightfly_ | amalloy: Didn't realize this was such a pendemic thing. Mystery solved at least. |
| 23:34 | Sgeo | How many libraries have functions that disallow certain arguments, where those arguments might make sense but the creator of the function decided not to support it because s/he couldn't imagine why anyone would pass those arguments in? |
| 23:34 | Sgeo | (Example: partial) |
| 23:34 | Sgeo | ,(partial identity) |
| 23:34 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$partial> |
| 23:35 | dakrone | ,((partial map inc) [1 2 3]) |
| 23:35 | clojurebot | (2 3 4) |
| 23:35 | dakrone | Sgeo: ^ |
| 23:35 | ivan | I think Sgeo knows how to use partial |
| 23:36 | dakrone | ah, I'm sorry, I mistook the "(Example: partial)" as desiring an example for it |
| 23:36 | Sgeo | (partial identity) might not be useful to write directly, but when a macro emits code, it shouldn't be forced to check out many arguments will be passed to partial, if there's a sensible but useless-seeming result. |
| 23:37 | ivan | yeah, I've run into another one of those in core |
| 23:37 | dakrone | too much conj, not enough sleep |
| 23:37 | Sgeo | ivan, which? |
| 23:37 | abp | dakrone: Be happy. :) |
| 23:38 | amalloy | Sgeo: there's a bug report for that in jira somewhere, and i think maybe there's a plan to change it? not sure about that |
| 23:38 | ivan | maybe I wanted (assoc {}) to work |
| 23:38 | Sgeo | amalloy, yeah, I think I heard that too |
| 23:39 | ivan | or perhaps (conj {}) |
| 23:39 | Sgeo | ,(conj [] 1 2 3) |
| 23:39 | clojurebot | [1 2 3] |
| 23:42 | amalloy | but why would you ever (conj {})? (apply conj m vs) should really just be (into m vs) |
| 23:44 | ivan | ah, right |