#clojure logs

2011-11-13

00:00technomancyI am probably not going to be measuring perf so much that I'd notice, but I appreciate having it available
00:00dakronecool, well lemme know how it works regardless :)
00:00dakroneand lemme know how I can hely with the JAVA_OPTS lein thing
00:00dakrone*help
00:01leo2007technomancy: do you know if fuzzy completion works in slime?
00:02technomancyleo2007: people have gotten it working, but I don't know the details
00:04technomancydakrone: it's just the smarter quote-aware space string split in (System/getenv "JVM_OPTS") on line 94 of compile.clj
00:04dakronetechnomancy: I'll take a look
00:07technomancysweet
02:26lozhi
02:26lozit is possible to run clojure programs on android platform?
02:28zmsloz: if clojure been ported to dalvik as well, i guess.
02:30lozzms: any progress in porting?
02:32zmsloz: this is all i'm aware of http://www.deepbluelambda.org/programming/clojure/clojure-for-android-source-published
02:36lozzms: cool, sounds assure)
03:24mdeboardWeird question, but is the guy I was bickering with about the functional nature of list comprehensions in python the other day in here?
04:55_ulisesI know this is awfully specific, but is anybody running emacs inside iTerm2/Terminal.app?
04:55_ulisesI'm having trouble mapping C-up/down arrow for history support in slime
07:39zmscan someone please take a look at http://pastie.org/2856453
08:13_uliseszms: what's with it?
08:35kzarOh I see how to do it.. just looked at how with-connection works, ovbious really! Sorry
08:42zms_ulises: the dorun part throws a null pointer exception and i've been unable to figure out the source
08:43_uliseszms: line 15, you have ((println...))
08:44_uliseszms: println returns nil, if you try to eval that as a fn you're likely to get a NPE
08:44_ulises</wild_guess>
08:44zms_ulises: testing..
09:01zms_ulises: you're right. the NPE goes away if i remove this statement. but the purpose of the statement was to show if it's actually doing what it should (check if files can fit into available space). that is broken too..
09:02_uliseszms: you're trying to modify m with assoc. assoc returns a new map and then it gets discarded :)
09:02_ulisesif that's what you mean by "that's broken too"
09:02zms_ulises: i'm not sure if the idea of updating the existing list of maps and use that in next iteration sensible at all. coming from imperative mindset i can't seem to think of a way to do it. :-(
09:03zms_ulises: ouch. i tried using update-in but that also didn't seem to make sense.
09:03_uliseszms: that's because, as you said, you're writing imperative for loops
09:05zms_ulises: it's been mind-bending wrapping my head around this. it's fun but frustrating as hell too. :)
09:05_uliseszms: let me see if I can cook up something quick that does what you want; then we can walk through it together
09:06zms_ulises: i'll be ever grateful.
09:10Vinzentanyway, why i can't write something like (def foo) (fact (inc foo) => 2 (provided foo => 1))?
09:11Vinzentor maybe (fact .x. => 1 (provided .x. => 1))
09:21_uliseszms: nearly there
09:25zms_ulises: wonderful!
09:31_uliseszms: http://pastie.org/2856836
09:31_uliseszms: there are a few nasty bits such as (comp not (some predicate...)))
09:32_ulisesbut the general flow of the algorithm is to recurse while trying to fit files into mount points; each recursion loop takes the first file and sees if it fits in any mount point, if so it adds it to the list of files that do fit somewhere, updates the mount point's free space and recurses using the updated list of mount points and files
09:33_ulisesI'm sure the code is *not* as clear as it could be
09:33_ulisesI also added the option of tagging each file that fits somewhere with the path where you'd have to place it
09:34Borkdude_ulises: did you see the thing about the encoding variable yesterday?
09:35Borkdude_ulises: it solved my slime error
09:38zms_ulises: thanks a lot! it'll take me some time to digest this and get back.
09:41_ulisesBorkdude: I tried it today and it solved mine too :)
09:41_uliseszms: cool, enjoy :)
10:19zms_ulises: there's so many new things (for me) in what you wrote (into, partial, conj, comp, ..) and all introduced in a context/problem space that i understand. :) it'll probably be a while before i can come back to discuss the code. thanks again for your time.
10:20_uliseszms: no worries. Please keep in mind that that is definitely not the best code to learn from :)
10:24zms_ulises: hehe. still it's an order of magnitude beyond my current level so it's a gift and a lesson to me.
10:24_uliseszms: cool then, glad to be of assistance :)
10:42Vinzenthere is _ulises' code with some minor modifications: http://pastie.org/2857122, wdyt?
11:00zmsVinzent: it does produce the same results. i see the differences are in the let bindings. i can't say which one is better or simpler yet. there's more new functions here (group by, concat, ...) and like i said above, i'm still reconfiguring my brain to think in clojure. thank you for the code. i am learning from both of them.
11:21Vinzentzms, i've also tried to avoid multiplie passes through the collections (when sorting and around the cons call), although it's not much perfomance boost with collections of such size :) anyway, i think it's interesting to try to find different approaches to the problem
11:21Vinzentso _ulises made a good exercise for both of us :)
11:30jakeskikhi
11:31zmsVinzent: indeed. :)
11:32Vinzenthello jakeskik
11:32jakeskikis there something like difference for vectors?
11:33jakeskikor haskell \\ operator?
11:33jakeskikso that (difference [1 1 1 2 3] [1 2]) would result [1 1 3]
11:34Vinzentyou can convert one vector into the set and then (remove ...)
11:35Vinzentbut that will return [3] for ypur example
11:36jakeskikyap, I need to keep the duplicates (except the one which was processed)
11:38jakeskikI'm finding my way around core libraries and trying to craft a decent solution for KataPotter: http://codingdojo.org/cgi-bin/wiki.pl?KataPotter
11:42Vinzentthen it's possible either to use reduce with accumulator, or partition
11:50jakeskikVinzent: thanks, i'll check patitioning. I played a bit with reduce too, but it seemed to lead quite complex solution. I'd like to do something like this: https://gist.github.com/1362307
11:52jakeskikof course, the remove call on the last line doesn't do the trick and I should do the recursion with recur instead of calling the function.
12:05Vinzentjakeskik, sorry for the delay. here is a possible implementation: http://pastie.org/2857437 My proposal about partition was wrong, it'd help only if you want to remove the whole second-vector occurences
12:05Vinzentlet me read your links
12:10zeek123Anyone willing to look at three versions of 10 lines of code? I'm loading an file entire into a list and partitioning the list into a list of pairs. Two versions don't work and one works verrrrry slowly. Thanks.
12:16fliebelzeek123: You did not actually post the 10 lines.
12:16zeek123Indeed. I wanted to make sure it was appropriate to do so.
12:16zeek123Here they come...
12:17TimMczeek123: pastebin, of course
12:17zeek123that was my next q, thanks
12:18TimMc~paste
12:18clojurebotpaste is http://gist.github.com/
12:19zeek123https://gist.github.com/1362348
12:19fliebelDo files and sockets actually override Object.finalize?
12:21zeek123TimMc: I'm getting OutOfMemoryErrors if I remove the doalls. But with the doalls, it doesn't seem to terminate, but it might eventually. If I use my group-by-twos instead of partition, then back to OutOfMemoryErrors. I want to make sure I understand what lazy sequences do before I actually try to do something real.
12:21TimMcDo you really need the whole file in memory at once?
12:22TimMcCan you process it as a stream instead?
12:22zeek123Ideally I want to do numerical processing on ~1.5GB files with Incanter, so I guess ultimately I won't be able to keep everything in mem at once.
12:23zeek123My ultimate goal is an n^2 algorithm. I will need to keep scanning back to the beginning of the file... Are streams still a good fit?
12:26TimMczeek123: The thing about lazy seqs is this: Although they delay computation of the seq until it is needed, they keep the results around as long as you hold onto the head of the seq.
12:26zeek123I was formulating a question about that... is there a way to do this that generates what I need from a function? I know there's a classic newbie mistake in here somewhere.
12:27TimMcIt really depends on what you want to do.
12:27zeek123hmm
12:28zeek123I found a bunch of blog posts about this topic, but nothing that was immediately enlightening. Any general principles or reading, or should I go back to my original problem and do some more thinking?
12:28TimMcseqs wrapped around file streams are great if you are doing stream processing -- as you keep calling (next) on the seq, the lines or chars that you have read into the seq (lazily) are garbage-collected.
12:29zeek123TimMc: That makes sense. You keep rebinding to a new head, right?
12:29TimMcyeah
12:29TimMcIn the general case, seqs are just linked lists with some potentially clever stuff in the tail.
12:30zeek123Because they're lazy they're faster but they take up more mem, right?
12:30zeek123Or at least they accumulate a lot of not-yet-run code.
12:30TimMcI don't know how much more memory they take up. Less, if you don't realize the entire tail while holding onto the head.
12:31zeek123Makes sense; especially if the seq is infinite.
12:31TimMcright
12:31zeek123So maybe I should be thinking harder about what I can throw away and when. And how to get it back on-the-fly if I need it again.
12:31TimMcYou can keep walking (range) as long as you like as long as you don't keep a reference to the head.
12:31duck1123was there a clojure library wrapping java.security.* I remember seeing something, but I can't find it again
12:32TimMczeek123: Yep. What are you writing?
12:32duck1123trying to avoid re-inventing the cryptographic wheel
12:33TimMcduck1123: java.security is just easy enough to use that I haven't bothered looking for a wrapper.
12:33duck1123zeek123: as long as you make sure not to hold the head of any long lazy seqs, the JVM should be pretty good at GC-ing those discarded objects
12:33zeek123TimMc: It's a compression algorithm from a 2011 paper that uses previous "contexts." You need to be able to search through everything causal to the symbol you're trying to encode. I have it mostly working in Matlab, but I'm trying to break my dependence on Matlab, etc.
12:33TimMcduck1123: The problem here is a quadratic algorithm that maybe requires all the data at once.
12:33leo2007how to get java doc in clojure repl?
12:33duck1123TimMc: not sure if that was sarcastic or not...
12:33zeek123(Thanks, duck1123.)
12:34leo2007duck1123: do you use ac-slime?
12:35TimMcduck1123: j.s.MessageDigest isn't so bad!
12:35zeek123TimMc: I've never had to do this before, but maybe I should leave the file I'm encoding on disk and do random access as needed.
12:35duck1123leo2007: No, I only use the default of what is loaded with the emacs starter kit
12:36TimMczeek123: Is there any way you can build up a table of extracted data?
12:36duck1123TimMc: I'm doing RSA encrytion and verification. (implementing the salmon protocol) and it's a bit of a pain
12:37TimMchrm
12:37TimMcduck1123: So, not just running some bytes through MD5?
12:37duck1123no, a bit more complicated than that
12:39TimMczeek123: "symbols" are any byte sequence?
12:39zeek123TimMc: The "contexts" heavily overlap, like a sliding window, and they can't really be boiled down into a table. I think what I'll do is have one stream of the file for encoding, and I'll have to restream the entire file for each symbol that I want to encode.
12:40TimMceep
12:40zeek123TimMc: Symbols are 16 bits of any arbitrary byte sequence.
12:40zeek123I don't see another way to do it. :)
12:41zeek123In matlab I can get the entire file into memory and then have multiple iterators off of it.
12:41fliebelHas anyone written something to access fields and enums nicely in Clojure? bean coms close, but that's not "it"
12:41zeek123but I am still making many, many passes over the file.
12:42TimMczeek123: I'm sure there's a way to load the whole file into memory in Clojure, too -- you'd just want to use something other than a lazy seq to iterate over it.
12:43TimMcThere's probably an existing seq impl that will do what you want here/
12:43zeek123TimMc: re loading whole file into memory; yes! that would be fantastic. seq implementation: what should i be googling?
12:44zeek123how can i not fill up the JVM heap? how do i know how much it's giving me?
12:45TimMcWell, you may need to tell the JVM to use a big heap. There are some switches like -Xmx2G you can pass it for various aspects of its memory footprint.
12:46zeek123TimMc: got it
12:47TimMczeek123: What sort of access do you need to the data? Aligned words?
12:47zeek123TimMc: yes, the file will always be an even number of bytes
12:47zeek123and my "symbols" are 16 bits
12:49TimMcSo some kind of random-access collection of ints
12:49TimMcor bytes, I guess
12:49zeek123TimMc: makes sense. ideas for idiomatic clojure?
12:50TimMcNot sure yet.
12:50TimMcIf you read the whole thing in, the JVM might not be happy with the size of the byte[] required.
12:51duck1123Okay, the good news is I can sign and verify with freshly generated keys, so this hasn't been a complete loss. Now to just figure out where the example sig I have fails.
12:52TimMcThere are utilities around that can manage large buffers of (primitive) bytes; that's what you'd want to use. You can probably roll a quick function to slurp a file into one of these.
12:53TimMcduck-streams did this kind of thing, but it no longer quite exists.
12:53duck1123Would a simple byte array input stream work for you? It's easy enough to get that from a file
12:53TimMcduck1123: For a 1+ GB file?
12:53duck1123most went to c.java.io
12:54TimMcthere are limits to the *length* of arrays in Java
12:54TimMczeek123: Oh! Could you maybe memory-map a file?
12:54zeek123TimMc: duck1123: It's not even so much the size of the file, it's any time i start doing interesting things with it that the memory usage explodes.
12:55zeek123TimMc: that's a great idea. more transparent to me.
12:55TimMcjava.nio I think has utils for that
12:55duck1123isn't there a lazy input stream for stuff like that? I don't know as much about java io as I should
12:56zeek123TimMc: I will have a look at that, and I will make sure to lose my head, as it were. That will hopefully get me a lot farther.
12:56TimMcduck1123: I really don't think that will work here -- this algorithm needs random access.
12:57duck1123nvm then
12:57zeek123TimMc: In any case, you don't think I'll be adding epicycles on top of epicycles? Clojure is a reasonable language for this? It's been a real pleasure to work with so far. I'm hoping to stick with it.
12:58TimMczeek123: Nothing wrong with using Java libs. That's why Clojure targets the JVm, after all.
12:59TimMcI think Clojure is a fine language for this. You'll just need to be careful about which tools you use, just as in Java.
12:59TimMc(e.g. for this project you wouldn't use an ArrayList<Byte>.)
13:00zeek123TimMc: right, thanks. i think I'm spoiled by matlab, but half the point of this is to get out of the matlab ghetto.
13:00TimMchaha
13:00zeek123matlab is, after all, dedicated to this kind of problem
13:00TimMcyup
13:01zeek123and i want to be working with a general language so while i'm doing this stuff i'll be building skills that i can use for my own projects.
13:01zeek123anyway, thanks for much for kicking this around with me. i'll have a look at what we've chatted about.
13:01zeek123thanks for the ideas duck1123.
13:01zeek123afk for now
13:02TimMczeek123: I'll leave you a link as soon as I can find it.
13:03zeek123TimMc: i'll keep an eye on the log
13:04TimMczeek123: Here is a post by dnolen with an example of high-efficiency Clojure: http://dosync.posterous.com/lispers-know-the-value-of-everything-and-the
13:06zeek123TimMc: link is excellent. much food for thought. afk for real this time.
13:55fliebeldrewr: Why is javax.activation excluded?
14:05fliebelCan we have clojure in clojure already? If java.lang where all protocols, life would be easy, in certain areas.
14:05dbushenkohow to override JFrame.paint() with clojure?
14:09TimMcdbushenko: proxy
14:09dbushenkoTimMc, have a look: (proxy [JFrame] [] (paint [graphics] (println "Hello, World!")))
14:10dbushenkoit doesn't work. could you tell my why?
14:10fliebel&(source into)
14:10lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
14:10TimMcdbushenko: $source into
14:10TimMcack
14:10TimMc$source into
14:10lazybotinto is http://is.gd/7toqQd
14:10TimMcfliebel: ^
14:10fliebel(use 'clojure.repl)
14:11fliebel&(use 'clojure.repl)
14:11lazybot⇒ nil
14:11fliebel&(source into)
14:11lazybot⇒ Source not found nil
14:11TimMcdbushenko: I've done it here: https://github.com/timmc/CS4300-hw6/blob/master/src/hw6/core.clj#L25
14:11fliebelok, what I wanted to say, is that it does some weird stuff for transients.
14:11dbushenkoTimMc, thanks!
14:12fliebelif it is a transient, convert it to a transient, conj, and return a persustent.
14:12TimMcdbushenko: Mine is doing some other stuff, but the basic are there.
14:13dbushenkoLooks like your code is similar to mine..
14:15TimMcdbushenko: Does the window at least come up?
14:15TimMc,(ancestors (class (transient [])))
14:15dbushenkoyeah, but the paint function isn't called
14:15clojurebot#{clojure.lang.ILookup clojure.lang.ITransientCollection java.util.concurrent.Callable clojure.lang.AFn java.lang.Runnable ...}
14:15gfredericks,(.run (transient []))
14:15clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: TransientVector>
14:16TimMc&(instance? clojure.lang.IEditableCollection (transient []))
14:16lazybot⇒ false
14:16TimMc&(instance? clojure.lang.IEditableCollection [])
14:16lazybot⇒ true
14:16TimMcfliebel: That's neat.
14:16gfredericksO_o
14:16gfredericksTimMc: what does it mean?
14:16TimMcgfredericks: Take a look at into's source.
14:17gfredericksso "Editable" means "transientable"?
14:17TimMcApparently.
14:17fliebelTimMc: wait, what... a persistent collection extends clojure.lang.IEditableCollection?
14:17TimMcYeah. :-)
14:17TimMcIt's not a great name.
14:18fliebelah, I though all transients where editable, which is why I was confused.
14:18gfredericks,(transient (transient []))
14:18clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector$TransientVector cannot be cast to clojure.lang.IEditableCollection>
14:18TimMcfliebel: It's more that they are Editablable :-P
14:18TimMcAnd I wonder... ##(into (transient []) [1 2 3])
14:18lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector$TransientVector cannot be cast to clojure.lang.IPersistentCollection
14:18TimMcAnd I wonder... ##(class (into (transient []) [1 2 3]))
14:18lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector$TransientVector cannot be cast to clojure.lang.IPersistentCollection
14:19TimMcOK, so you can't use into with transients. Not a big surprise, you have a limited set of operators.
14:20TimMcQuestion for the channel: Is it proper to say that "seqs are collections", or is it more correct to say that "seqs happen to be implemented using a collection (list)"?
14:21dbushenkoTimMc, I've found what was wrong. I should have invoke that with SwingUtilities/invokeLater
14:21gfredericksTimMc: I would question the second part, if I didn't think you knew more than me.
14:21TimMcdbushenko: Aha! Which should you have run with that?
14:22TimMcthe launch of the JFrame?
14:22dbushenkoTime: (proxy [JFrame] [] (paint [graphics] (SwingUtilities/invokeLater (proxy [Runnable] [] (run [] (draw-graph @win))))))
14:22dbushenkothat code works for me
14:22TimMchmmm
14:22TimMcI don't know if that's correct.
14:23dbushenkowhy? did I have to run the JFrame with invokeLater?
14:23TimMcI think the Graphics object may only be safely used in the dynamic scope of paint().
14:23TimMcI think so. Look at the last line of my example.
14:23TimMcSwing is weird about threads.
14:24dbushenkoTimMc, hopefully I don't use it in this function.
14:24TimMcgfredericks: Lazy seqs use Cons cells, which is what lists are, so coll? and seq? both return true for (range).
14:24dbushenkodraw-graph fetches the graphics object and then draws on it
14:25TimMcdbushenko: I believe that Swing paints on the event loop thread.
14:25dbushenkoTimMc, how to call on the event loop?
14:25TimMcBy the way, (proxy [Runnable] [] (run [] ...)) is just #(...)
14:26dbushenkoreally?????
14:26dbushenko:-D
14:26dbushenkogreat!
14:26TimMcYeah, check this out:
14:26TimMc&(ancestors (class #(* % %)))
14:26lazybot⇒ #{clojure.lang.AFunction clojure.lang.Fn clojure.lang.IMeta clojure.lang.IObj clojure.lang.IFn java.util.concurrent.Callable java.lang.Object java.lang.Runnable java.util.Comparator clojure.lang.AFn java.io.Serializable}
14:26TimMcSee the Callable and Runnable in there? :-)
14:27TimMcand Comparator as well
14:27dbushenkosuper!
14:27TimMcSo, back to Swing -- I think you want to launch the JFrame using invokeLater, and not use invokeLater in the paint method.
14:27dbushenkoyeah, that really works
14:28dbushenkohmm... let me try
14:28TimMcI could be wrong, but that's what I seem to recall.
14:28dbushenkoTimMc, you were right, it works
14:29TimMcyay!
14:30TimMcI recommend reading up briefly on Swing threading. I think there are some other weird things to be aware of, but I havne't used it in a bit.
14:30fliebelWhat would be the best way to convert a Clojure map to any subclass of java.util.Map? Now I just reduce the one into the other.
14:30dbushenkoyeah, swing and threading is a weird thing
14:31TimMc&(java.util.HashMap. {:a 1, :b 2})
14:31lazybot⇒ #<HashMap {:b=2, :a=1}>
14:31TimMc&(.get (java.util.HashMap. {:a 1, :b 2}) :a)
14:31lazybot⇒ 1
14:32TimMcfliebel: ^ The Java Collection classes usually have a (Collection) constructor.
14:32fliebelTimMc: Not this one (Properties)
14:32TimMcAh.
14:32TimMc*any* subclass?
14:33fliebeloh, I can call putAll
14:33TimMcnice!
14:44BorkdudeHmm, I'm puzzled by an enlive example. I get lazyseqs instead of
14:44Borkdudestrings in my output.
14:46fliebeluser=> (field-map javax.mail.Folder) {:holds_messages 1, :holds_folders 2, :read_only 1, :read_write 2}
14:49raekBorkdude: ring accepts lazy seqs of strings as response bodies
14:50raekusing a lazy seq allows the body to be generated lazilly
14:50TimMcThat's great!
14:50Borkduderaek: I got this now https://gist.github.com/1362567
14:50Borkduderaek: I was trying to imitate and example from enlive on github
14:51Borkduderaek: I expected the tablebody to be filled by
14:51Borkdude*** <tr><td>names</td></tr> things
14:51raekis username a node tree?
14:52Borkduderaek: they are just strings.. not good?
14:52raekclojure.lang.LazySeq@... means that you gave something that expected a string something else (a seq)
14:52brehautBorkdude: transformations are functions from node to node; you are returning a seq rather than a node (map with :tag :attrs :contents)
14:53raeksorry, my first comment does not apply in this case
14:53raek(thought you mean something else)
14:53raek"A transformation is a function that returns either a node or collection of node."
14:53Borkduderaek: I checked with (swank.core/break) that username in the for
14:53Borkdude loop is a string
14:54Borkdudebrehaut: aha...
14:54raekBorkdude: also, have you considered clone-for
14:54brehautBorkdude: you might want to look at clone-for in enlive
14:54raek?
14:54Borkdudejust trying to imitate this one: https://github.com/cgrand/enlive/blob/master/examples/net/cgrand/enlive_html/examples.clj
14:55TimMcI have found the enlive tutorials difficult to read and apply to my work.
14:55TimMcI just wnat to shove some data into some HTML, dammit! :-)
14:55Borkdudehaha
14:55BorkdudeI am touching it for the very first time now
14:56brehautTimMc: my problem was that they cover all the conceptual stuff pretty quickly, and then dive into examples. i never grasped the conceptual stuff to i had bet my head against my own problems
14:56TimMcBorkdude: I'm working with it right now, let me show you my code so far.
14:56Borkdudebrehaut: why clone-for if the example should work with for?
14:56Borkdudeand why the heck is my table body disappearing
14:57brehautBorkdude: im curious about that too; i wonder how old that example is; enlive changed dramatically over its life
14:57TimMcBorkdude: Here's where the pertinent stuff is in my case: https://github.com/timmc/seqs-and-colls/blob/master/src/seqs/core.clj#L40
14:57Borkdudebrehaut: I am using version 1.0.0 from clojars!
14:57brehautBorkdude: but what version is that example using! ;)
14:58raekmy guess is that something adds one extra layer of seqs
14:59Borkdudebrehaut: good question. let me just explain what I'm trying to
14:59Borkdudedo => insert <tr><td> ... </td></tr> 's with names filled in on the dots
14:59raekand maybe enlive checks whether each element of the outer seq is a map (a node), and if it isn't calls 'str' on it
14:59Borkdudenow show me the most appropriate way in enlive ;)
15:00raekBorkdude: clone-for
15:00Borkduderaek: I guess that one is not in 1.0.0
15:00TimMcBorkdude: I run clone-for over the :tr in here and then clone-for over the :td 's: https://github.com/timmc/seqs-and-colls/blob/master/src/seqs/html/table.html
15:00brehautBorkdude: as raek suggests, thats the usecase for clone-for
15:01raekBorkdude: example: https://github.com/raek/lcug-guestbook/blob/master/src/se/raek/lcug/guestbook/view.clj
15:01TimMcbrehaut: I often prefer to have a working example first, and then drill down into how it actually works.
15:03brehautTimMc: likewise
15:04Borkdudeok, clone-for... what enlive version should I use from clojars then?
15:04TimMcI'm using 1.0.0.
15:05TimMc[enlive "1.0.0"]
15:05Borkdudehmm ok, lemme see
15:05Borkdudeoopz, forgot to prefix it
15:08tensorpuddingi genuinely ignored the docs for enlive, they just confused me
15:08tensorpuddingand just looked at the code of the example in the wiki that has a form that they clone
15:09Borkdudehmm, I now get two tablebodies with tr/td/name in it
15:09Borkdudewith the two names I listed though
15:12Borkdudeah, got it
15:15Borkdudeworks: https://gist.github.com/1362567
15:15Borkdudetnx guys!
15:23TimMcyay
15:29Borkdudewhich transformation to use to remove smth from the html?
15:29Borkdudesubstitute?
15:29brehautBorkdude: substitute with a nil result
15:29brehauts/result/value/
15:30brehautor perhaps content with nil depending what your selector is
15:30TimMcBorkdude: (fn [nodes] (when-not (hungry?) nodes))
15:30TimMcsomething like that
15:31Borkdudetimmc: I have added an id to the table
15:31Borkdudeand when the user first comes to the page, I don't want to show
15:31Borkdudethe table
15:33BorkdudeTimMc: so smth like this: (deftemplate welcome-page "index.html"
15:33Borkdude[] [:table#names] ...)
15:34BorkdudeI'm trying to understand how it works by looking at the tests...
15:34Borkdudehttps://github.com/cgrand/enlive/blob/master/test/net/cgrand/enlive_html/test.clj
15:34Borkdudebut that doesn't help me very much with substitute
15:34TimMcThat [] can take a boolean called first-view? and then you can have [table#stuff] (fn [tbl] (when (not first-view?) tbl))
15:35tensorpuddingyes, templates are functions
15:35tensorpuddingyou can specify them with arguments that you pass
15:36Borkdudeeh, how many lines of code can I paste without being kicked out?
15:36Borkdude4 too much?
15:36brehautyou wont get kicked, but its not good form
15:36tensorpuddingjust use a pastebin, or gist, or ideone
15:36gfrederickseverybody will glare at you
15:36gfredericksusing the unicode glare character
15:36TimMcಠ_ಠ
15:37Borkdudeok, like this? https://gist.github.com/1362634
15:37Borkdudegfredericks: that is a very cool character
15:37TimMcIt is U+0CA0
15:37brehaut💩
15:37TimMctwice, with an underscore
15:38tensorpuddingnice astral plane characters
15:38gfredericksironically, it takes four lines to print it
15:38Borkdudetnxs a lot, these characters will come in handy
15:38TimMcbrehaut: All I got from you was U+FFFD
15:38brehautTimMc: huh. it was supposed to be the unicode pile of poo
15:38Borkdudebtw, my example doesn't work. why not?
15:38brehauti blame colloquay
15:39TimMcI blame my fucked-up server.
15:39brehautBorkdude: you dont need to pass a fun to substitute; just pass nil
15:39TimMcBorkdude: Did you see my example at :29? I didn't use substitute.
15:40brehautalternatively instead of subsitute you oculd use (constantly nil)
15:40Borkdudebrehaut: ah that works
15:40TimMcBorkdude: Whatever expression you put in has to evaluate to a function. That function will be called with the matched list of nodes.
15:41TimMcThe result of the function should be a string or a seq.
15:46Borkdudemy emacs crashed...
15:46BorkdudeTimMc: what did you say? I missed it
15:47TimMcBorkdude: Whatever expression you put in has to evaluate to a function. That function will be called with the matched list of nodes. / The result of the function should be a string or a seq.
15:47Borkdudeso putting in nil... why does it work?
15:48TimMcBorkdude: You're not putting in nil, you're putting in a function that, when called, gives nil.
15:49BorkdudeTimMc: I mean this: [:table#names]
15:49Borkdude (enlive/substitute nil)
15:49Borkdudelike brehaut suggested, it works
15:49brehautBorkdude: do you understand that all the core transformations (eg, content, substitute etc) are actually returning functions ?
15:49TimMcBorkdude: enlive/substitute returns a function
15:49TimMcbrehaut: That was the key to my understanding what enlive was doing.
15:50brehautBorkdude: content frinstance is approximately (fn [new-content] (fn [node] (assoc node :content new-content)))
15:51brehautBorkdude: substitute is probably (fn [new-nodes] (fn [_] new-nodes))
15:51TimMcit actually uses constantly :-)
15:51Borkdudeso, substitute something returns (fn [new-content] (fn [matched-node] ...replace something in the matched-node])?
15:51TimMc(constantly (flatten-nodes-coll values))
15:51brehautTimMc: i figured ;) but for the purposes of simplifying whats happening
15:51BorkdudeTimMc: I saw that, but I still don't understand it quite
15:52TimMc((enlive/substitute "hello")) => '("hello")
15:52brehaut,(map (constantly :foo) (range 1 10))
15:52clojurebot(:foo :foo :foo :foo :foo ...)
15:52Borkdudeah wait, I thought substitute would substitute something inside the matched node
15:52TimMcBorkdude: A template is not an html tree -- it is a tree of *functions* for transforming an html tree.
15:52brehautBorkdude: thats content
15:53Borkdudebut it substitutes the entire node
15:54TimMcbrehaut: I think they should deftemplate first, but not be released from class until they see snippets, etc.
15:54Borkdudeok, so substitute returns a function that always evaluates to the substitution
15:54TimMcyup
15:54Borkdudeand what is that function applied to, the matched node?
15:54TimMcYes, but it ignores the node.
15:55TimMc(nodes)
15:55Borkdudeso each function is applied to the matched node
15:55brehautBorkdude: yes exactly.
15:55Borkdudeand that series of applications results in new html
15:55TimMcbrehaut: This is something I am not clear on, actually -- does [:table :tr]'s matcher get all the :tr's, or just the first, or is it called once for each?
15:55Borkdudeso why do I need snippets?
15:56brehautTimMc: it should match all the :trs inside :tables inside the current context node
15:56TimMcSo the function gets a collection.
15:57brehautBorkdude: snippets are like templates that return nodes instead of a seq of strings
15:57churibis there an "unintern" in clojure?
15:58brehautTimMc: i think it depends _where_ that selector is used; if you use it with select then i think it gets a collection; if you use it with at (which is implicit in templates and snippets) then you get single node
15:58TimMcOK.
15:58raekchurib: ns-unmap?
15:58churibraek: sounds good - thanks!
15:59Borkdudebrehaut: why was content a nested function?
15:59Borkdudebrehaut: like (fn [new-content] (fn [node] ...))
15:59Borkdudewhat is new-content?
15:59brehautBorkdude: all the standard transforms are nested function
16:00brehautBorkdude: the transformations are only ever passed a node (or node set for a selection range)
16:00churibraek: how do i get the current namespace?
16:01brehautBorkdude: but you probably want additional data in that transformation (such as the new content to insert); the inner function closes over outer functions locals. new-content is whatever the new content of the node is (ie, it replaces :content in the node map)
16:01TimMc,*ns*
16:01clojurebot#<Namespace sandbox>
16:01churibTimMc: thanks :)
16:02TimMcchurib: There might be a better way...
16:02brehautBorkdude: constantly returns a function too - a function that ignores its arguments and returns the same thing constantly
16:02Borkdudebrehaut: er, the outer function gets "usernames" in my example then?
16:02sritchiehey all -- is the clojure 1.4 snapshot available on maven?
16:03sritchiefor dev
16:03Borkdudebrehaut: I know that, but constantly doesn't return a nested function
16:03churibTimMc: I used it only in the repl to get rid of an typo
16:03churib(symbol)
16:03brehaut(source constantly)
16:03TimMcAh, OK.
16:03brehautBorkdude: i need a link to the code you are talking about
16:03Borkdudebrehaut: ok, wait
16:04Borkdudebrehaut: https://gist.github.com/1362567
16:04Borkdudebrehaut: if clone-for returns a nested function
16:04brehautBorkdude: so are you refering to the argument to content ?
16:05Borkdudebrehaut: then what would an application to it look like?
16:05brehautBorkdude: https://github.com/cgrand/enlive/blob/master/src/net/cgrand/enlive_html.clj#L658-661
16:06brehautBorkdude: clone-for is a special case here; it uses a macro to generate the function rather than creating it through closuring
16:06brehautBorkdude: but it still creates a function from node -> nodes
16:06Borkdudebrehaut: ah, that's why I was confused
16:07Borkdudebrehaut: but also constantly isn't nested right? I get node -> nodes, but not new-content -> node -> nodes like you suggested (I think)
16:07Borkdudenew-content -> (node -> nodes) I mean
16:08Borkdudebrb
16:09brehautBorkdude: i dont understand what you mean about constantly not being nested
16:10brehautconstantly is defined as (defn constantly [x] (fn [& args] x))
16:21Borkdudebrehaut: yes, so constantly doesn't return a nested function, but just a function that returns x
16:22brehautBorkdude: i think we may have different notions of what a 'nested function' is
16:22Borkdudebrehaut: my notion is: a function that returns a function
16:23brehautBorkdude: thats _exactly_ what constantly is
16:23Borkdudebrehaut: yes, but it doesn't _return_ a nested function
16:23TimMcuh...
16:24TimMc,(let [return-value (constantly 17)] (fn? return-value))
16:24clojurebottrue
16:24brehautBorkdude: lets use more precise terminology then. constantly returns an anonymous function that is within the lexical scope of the invocation constantly that returned, closing over constantly's argument
16:24brehautBorkdude: thats the same as enlive's content and substitute
16:25brehautalso i fail at english
16:25BorkdudeTimMc: you are just checking if the return-value is a function, not if it is a function that will return a function
16:25Borkdudebrehaut: I'm just trying to understand
16:26TimMcOh, it most certainly isn't. That's true.
16:26brehautBorkdude: lets start with the basics. do you know what lexical scope is?
16:26Borkdudebrehaut: yes
16:26brehautBorkdude: and you understand that the inner function is closing over the containing functions lexical variables ?
16:27Borkdudebrehaut: (constantly 3) returns a function of varargs that closes over the value 3
16:27Borkdudebrehaut: right?
16:27brehautright
16:28brehautnow; can you tell me why you think thathttps://github.com/cgrand/enlive/blob/master/src/net/cgrand/enlive_html.clj#L598-601 is a different construction to constantly?
16:30Borkdudebrehaut: I think we can agree on "a transformation _is_ a function of --args-- that _returns_ a function of a node that closes over the --args--", right?
16:30brehautyes
16:30Borkdudebrehaut: ok
16:31Borkdudebrehaut: then I think I'm starting to understand it ;-)
16:31brehautBorkdude: phew :)
16:37Borkdudebrehaut: some Haskell-ish notation would be helpful here maybe
16:37Borkdudebrehaut: in the code itself
16:37brehautBorkdude: it wouldnt hurt.
16:39brehautdata HTMLNode = Nil | HTMLText String | HTMLNode String (Map String String) [HTMLNode]
16:39brehautcontent :: HTMLNode -> HTMLNode -> HTMLNode
16:39brehaut;)
16:40brehautsubstitute :: HTMLNode -> HTMLNode -> HTMLNode
16:40brehautnot really all that clarifying is it ;P
16:41churibis there a way to get all symbols of an namespace?
16:43brehaut&(keys (ns-map 'clojure.core)) ;; churib
16:43lazybotjava.lang.SecurityException: You tripped the alarm! ns-map is bad!
16:43brehauthah. well, try that in your own repl churib
16:43Borkdudebrehaut: hmm... that brings us to, what would it look like for clone-for? ;)
16:43brehautBorkdude: my template haskell is weak ;)
16:44churibbrehaut: thanks!
16:45djanatynhow feasible would it be to write a game in 48 hours, and then distribute it publically with clojure?
16:46djanatynI'm thinking of entering a 48 hour game-making competition - I did it last time with python and pygame
16:46brehautdjanatyn: distribution would be trivial; lein uberjar would create a self contained jar file that you could run
16:46djanatynthe competition is in 33 days - would it be possible?
16:46djanatynyeah, I saw lein had some really cool distribution things when I was playing with it.
16:46djanatynbut how is the library situation for making games?
16:47djanatynI'm not really interested in learning clojure to make games, but I think this might be a cool opportunity to force myself to write some real clojure code
16:47brehautdjanatyn: i dont know if there is anything that is analogous to pygame
16:47brehautpartly because pygame is all over the place wrt what it provides
16:47djanatynmy friend tomoj linked me this: https://github.com/jvillste/clojure-lwjgl
16:48djanatyni've never used lwjgl before, not really sure what it is
16:48djanatynI've used SDL with perl and python with pygame
16:48tomojhttps://github.com/ztellman/penumbra
16:48tomojthen wrap whatever else from lwjgl you want
16:50tomojmaybe that clojure-lwjgl library is good, no docs it seems. at least inspiration
16:53tomojhttps://github.com/ztellman/penumbra/blob/master/test/example/game/asteroids.clj
16:59Borkdudebrehaut: how would you go about removing all things from the html that have class="welcome"
16:59Borkdudebrehaut: I have [:.welcome] (enlive/substitute nil)
16:59Borkdudebrehaut: but it only removes one
17:00brehautBorkdude: (enlive/transform doc [:.welcome] (enlive/subsitute nil))
17:01brehautBorkdude: i probably wouldnt use an at form to do it (or a snippet or template which have implicit ats)
17:05Borkdudebrehaut: how would I use this inside a deftemplate?
17:06brehautBorkdude: i dont think you would
17:06Borkdudebrehaut: so deftemplate kind of presumes that every selector,transform pair is only applied once?
17:07brehauti think so?
17:07brehautive never tried to do anything super fancy with deftemplates
17:08Borkdudebrehaut: maybe I should just make a second html file... but I'm too lazy ;-)
17:08brehautlol
17:08brehauthow about you just use a html-resource, an at, a transform and an emit*
17:08brehautrather than the special case that template wraps up for you
17:10Borkdudebrehaut: ok, let me check that out, tnx
17:10brehaut(deftemplate name "my.html" [args] atstuff…) is roughly (defn name [args] (at (html-resource "my.html") atstuff…))
17:10BorkdudePerfect!
17:10brehautBorkdude: although it caches the html-resource
17:19daakuwhat's the right way to deal with destructuring in macros defining functions? let should do the trick, but i'm wondering if that's the idiomatic way. this gist should explain better: https://gist.github.com/f2e1c00a93826b40dd34
17:19Borkdudebrehaut: ah wait, deftemplate worked ok, but I just made a mistake in the html
17:19Borkdudebrehaut: two class attributes... oopz
17:20brehautah lol :)
17:32ohpauleezfinally home after the conj- I can feel my brain coming back together
17:32BorkdudeI guess this is working then finally with some Enlive templates :) http://whosnotfollowingme.herokuapp.com/
17:34dnolenohpauleez: was lots of fun.
17:34Borkdudebrehaut, TimMc : tnx for helping, learned a lot today
17:34brehautBorkdude: no problem
17:36jimdueyohpauleez: me too. It was a blast.
17:37ohpauleezdnolen: jimduey: Totally. One of the most fun, educational, and inspiring trips I've had in awhile. I'm reading through a new stack of papers as we speak
17:48djanatynpenumbra is pretty great
17:54ohpauleezdjanatyn: What are you using it for? Or just playing around with it
17:54djanatynohpauleez: Well, I haven't used it yet at all. I cloned the git repo, not really sure how to work with it.
17:55djanatynI've been learning common lisp, and I really like lisp and want to start using it. There's a 48 hour game-making competition coming up in a little bit over a month, and I figured that maybe the library situation would be better with clojure.
17:55djanatynI'm not really sure how to do distribution with common lisp, either.
17:56djanatynIt seems like most people advocate bundling a common lisp interpreter *with* your program, but I'm not sure how to do that either
17:56djanatyna quicklisp is a little intimidating for me, at least.
17:56djanatyns/a/and
17:58ohpauleezahh, gotcha - well, welcome to Clojure! There's been some great success making games in Clojure
17:58djanatynawesome :)
17:59djanatyni'm really interesting in functional programming, too
17:59djanatynhowever, the only thing i've ever written in a vaguely functional style was a little haskell script
18:00djanatynI can grok lisp a lot easier than haskell, and it looks like clojure's distribution is super easy with lein (I've had distribution issues in the past), so I'm excited
18:05zerokarmaleftwhen using cljs-watch, is bootstrap.js the only thing that needs to be pulled in?
18:06dnolenzerokarmaleft: what do you mean?
18:07zerokarmaleftdnolen: from within an html file
18:08djanatyndoes clojure sepreate pure and non-pure functions in the same way as haskell?
18:08brehaut djanatyn: no
18:08brehautdjanatyn: if by 'the same way' you mean via the type system
18:08dnolenzerokarmaleft: you don't need to include bootstrap.js, just whatever output file you specified.
18:10bhenryi want the overtone presentation video asap! (i never use "asap," but this time it's deserving)
18:11djanatynhmm, weird.
18:11djanatynso clojure doesn't have, like, an IO type?
18:11dnolendjanatyn: no, it has reference types. we have statement management, we just don't rely a type system for such things.
18:11dnolener state management
18:14zerokarmaleftdnolen: i'm just running cljs-watch with no args, so the default output is bootstrap.js
18:15TimMcdjanatyn: This is a good read: http://www.clojure.org/state
18:15dnolenzerokarmaleft: ok, then yes that should work.
18:15zerokarmalefti'm able to get an inferior-lisp repl connected to the browser fine that way, i just seem to be missing dom functions
18:15dnolenzerokarmaleft: did you switch into your namespace? you need to eval your ns form to do that.
18:15zerokarmaleftyes
18:16dnolenzerokarmaleft: so dom/getElement is not working?
18:16zerokarmaleftfor instance, append and get-element work, but not much else
18:16dnolenzerokarmaleft: oh are you trying to use cljs dom namespace? not the google one?
18:17dnolenI wouldn't do that. I think cljs dom is half-baked at this point.
18:19zerokarmaleftdnolen: ah ok, that's it then!
19:30gfredericksI just used the {:strs ...} destructuring form for the first time.
19:30gfredericksin case any of you were wondering.
19:33klauerngfredericks: I'm new to clojure, what is that?
19:33klauernI know sort of what destructuring is, but only on a var-args defn kind of way
19:33Raynesgfredericks: Not sure I'm familiar with that there non-existent form.
19:34gfredericks,(let [{:strs [foo bar]} {"foo" 734, "bar" [1 2 3]}] [foo bar])
19:34clojurebot[734 [1 2 3]]
19:34gfredericksRaynes: did I misdescribe something?
19:34RaynesOh, cool!
19:35gfredericksRaynes: also :syms
19:35RaynesYou have to write blog posts about this.
19:35gfredericksone for :strs and one for :syms?
19:35klauernthese kinds of things seem kind of magical to me
19:36klauernWhere do you pull up the docs for that kind of thing?
19:36gfredericksklauern: :keys is the one most people are familiar with, and it seems a bit cryptic until you've written (let [{foo :foo, bar :bar} m] ...) a million times
19:37klauernYeah, part of it is that is seems fairly non-obvious that you'll get some sort of modified result because of a :symbol being there
19:37gfredericksklauern: http://clojure.org/special_forms#Special Forms--(let [bindings* ] exprs*)
19:38klauernah, got it
19:38klauernwell, I'm off to read something for a bit ;)
19:38gfredericksklauern: have fun
19:39gfredericksklauern: I was trying to link to the section on let, in case the whitespace in that link mucked things up
19:39klauernah, yeah, %20 would work to hack around those spaces
19:39gfredericksshould be easy enough to find it manually
19:40klauernhttp://clojure.org/special_forms#Special Forms--(let%20[bindings*%20]%20exprs*)
19:40klauernhttp://clojure.org/special_forms#Special%20Forms--(let%20[bindings*%20]%20exprs*)
19:40klauernwhoops
19:42klauernSomething that I was confused for a while in Clojure was that the terminology used seemed academic. For instance, alot of the time I was thinking "why aren't they just calling that a method", but then I realized that Clojure (and I suppose Lisps in general) have alot of nuance in behavior, so method wouldn't work in some cases, etc.
19:42klauernNow I'm starting to get a handle on the language a bit better, but it's tricky trying to learn something that has such depth to it compared to OO/Imperative languages
19:44gfredericksklauern: my impression is that "method" is an OO word referring specifically to a "function on an object"
19:44gfredericksprobably it's used more loosely than that most of the time though :/
19:45klauernWell, in general I see things like 'lexical binding' and then get confused for a second since it's not easily transferrable to other languages I work with.
19:45klauernbinding in particular
19:45klauerndestructuring is neat and something that opens up a nice world of flexibility
19:45klauernI'm not even up to learning protocols and multimethods, so it's still a fun ride ahead for me
19:46pnicholsonHey, I'm trying to play with overtone and am getting "CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: File"
19:46gfredericksdo you need to import it?
19:47gfredericksklauern: it is fun stuff.
19:47pnicholsonI don't think so… https://github.com/overtone/overtone/blob/master/src/overtone/helpers/file.clj#L151 is the line is failing on
19:48klauernI like the organic nature to it. "Growing a language" and all that
19:49gfrederickspnicholson: I don't see File imported at the top, so I'm not sure why that would be expected to work. Does the library have tests you can run?
19:49gfredericksklauern: have you seen rich's Simple Made Easy talk?
19:50pnicholsongfredericks: file is part of the io package right?
19:50gfrederickspnicholson: java.io.File is a java class, and those have to be imported separately from clojure namespaces
19:51gfredericksI would expect adding an (:import java.io.File) to the ns declaration at the top of that file would make the error go away
19:51klauerngfredericks: That is a good video. He mentions that one slide should be used as a reference for something, but that slide is full of concepts that I'm not even familiar with to know what they are, so I'm trudging along with a book or two and some minor pet projects to get a feel for the language
19:52pnicholsongfredericks: hmm….this stuff was demoed at the conj yesterday
19:52zerokarmaleftdnolen: have you posted your slides anywhere yet?
19:52gfrederickspnicholson: yeah, it sounds like a popular lib, so I'm weirded out a bit
19:52dnolenzerokarmaleft: not yet, I'll try to get them added to the conj slide repo soon.
19:53zerokarmaleftcool
21:01alexbaranoskyI'm far enough into installing emacs to realize I suck at it
21:01alexbaranoskyI've clone Sam Aaron's emacs files
21:02alexbaranoskyI stuck them in the .emacs.d folder
21:03alexbaranoskyI couldn't tell for sure if I had done it right so I tried to do something simple (to my mind) which was install a color theme
21:04alexbaranoskyI put the color theme .el file into .emacs.d/config/ and tried to do M-x color-theme-tango, to which Emacs replied [No match]... What does no match mean exactly, and have I done something utterly wrong?
21:05alexbaranoskyis Emacs somehow not finding the file?
21:08brehautalexbaranosky: im not an expert or anything, but have you done a (require …) for the theme.el?
21:21alexbaranoskybrehaut: in the color-theme-tango.el file?
21:22brehautin your init.el ?
21:22alexbaranoskyI'm still learning the whole Emacs ecosystems, so I'm probably missing something obvious
21:22alexbaranoskylet me check
21:31alexbaranoskybrehaut: seems to be working if I add: (require 'color-theme)
21:31alexbaranosky (color-theme-initialize)
21:31alexbaranosky (color-theme-robin-hood) to the .emacs file
21:31alexbaranoskyhowever, the theme doesn't look like I thought it was supposed to
21:31alexbaranoskyI think I hear themes work differently between GUI emacs and terminal Emacs
21:35duck1123alexbaranosky: they do look a little different depending on the settings of your terminal
21:36duck1123usually you just have to try them all till you find one that works for you
21:37alexbaranoskydo most folks use the GUI Emacs or the terminal version?
21:37amalloyor modify one you almost-like
21:37alexbaranoskyI'm fond of that ;)
21:38duck1123I'd say that most use the gui if they have it available
21:38alexbaranoskyamalloy: I used 'macro-do` yesterday
21:38alexbaranoskyamalloy: and `juxt`. Thought you'd be proud
21:39amalloy*chuckle*
21:40amalloymacro-do is one i try to avoid using - it's tempting to use macros when in fact functions are sufficient
21:41alexbaranoskyI almost never write macros
21:43amalloyalexbaranosky: out of curiosity do you have a link handy for your use of macro-do?
21:45alexbaranoskyyes. I was cleaning up some Midje code, replacing a few (map (fn []...)) spots with (for [] and ran into a spot where we're generating 10 checkers, let me show you the link
21:46alexbaranoskyLast lines of: https://github.com/marick/Midje/blob/master/src/midje/checkers/collection.clj
21:49amalloyi see. yes, it's hard to avoid when the underlying form you want to generate is a macro
21:49amalloybtw, you can link to a specific line on github by clicking the line number in the left margin
21:50alexbaranoskythx
21:51alexbaranoskyhmmm, my dark background theme (tango) comes out with a white background... weird
21:52amalloyalexbaranosky: i use tty-dark, if you want to give that a try
21:55alexbaranoskylet me show you my `juxt`spot: https://github.com/marick/Midje/blob/master/src/midje/ideas/metaconstants.clj#L23
21:58alexbaranoskyamalloy: (I'm clearly failing badly at the color theme setup... I have to go back to square one. Don't think it was really working when I thought it was)
22:26daakuany vim users know if there's a way do something along the lines of set lispwords+=def* (which doesnt work) to make anything starting with def a lispword?
23:15daakui remember running into some debugging macro that logged a form and returned it, anyone know what its called?
23:16daakufound it: spy
23:57klauernWhen documenting a (defn), is there a preferred format, much like Ruby's RDoc, or Java's Javadoc format?