#clojure logs

2012-09-29

01:41mpantechnomancy: I seem to have stumbled upon a picture of you wearing keyboard pants
01:41mpanthat's pretty impressive
03:00kralnamaste
03:01ThorZaINtedwispkral, do you play StarCraft?
03:02kralMcChousuke: ehmmm... no. :)
03:06mpanWhat's the recommended way to encapsulate concurrent access to something mutable? e.g. instance of java.util.Random
03:08augustlmpan: locks afaik
03:09mpanlike, the ones java has?
03:09mpanand use them through interop?
03:13Apage43you may find locking useful; http://clojuredocs.org/clojure_core/clojure.core/locking
03:15Apage43that is, if the caller actually needs the result. If you just need a thing to have stuff happen to it, but don't synchronously need an answer, and you want to serialize those requests, an agent wraps that up nicely
03:30ChongLiking in the north!
07:28mindbender1,(type {"set of members in #clojure})
07:28clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>
07:28mindbender1,(type {"set of members in #clojure"})
07:28clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Map literal must contain an even number of forms>
07:28mindbender1,(type #{"set of members in #clojure"})
07:28clojurebotclojure.lang.PersistentHashSet
09:58benny__is there any special magic involved when parsing xml with clojure data.xml? parsing the HN feed at http://news.ycombinator.com/rss just fails with aclaim that </link> is wrongly positioned
09:58benny__its perfectly parsable with domdocument in php though for example
10:10casionbenny__: I have been messing with clojure.data.xml all morning and most of last evening, and it seems to choke on a lot of stuff
10:10casionclojure.xml seems to parse most anything fine, clojure.xml/emit is a bit odd though
10:10benny__casion, that sucks :( any alternative? there seems to be something clojure.xml/clojure.zip and clojure.zip-filter
10:10casionbenny__: that's what I'm using
10:11benny__is there a good introduction for cloojure.xml? i cant make sense out of clojuredocs.org - very unhelpful imho:(
10:11casionclojure.xml/parse, clojure.zip/xml-zip, then clojure.data.zip.xml/xml-> to navigate
10:12casionbenny__: yeah, I had the same problem, foks here just sorted me out yesterday… maybe I can help you
10:14casionhow I'm doing things right now is something like (def xml-zipper (clojure.zip/xml-zip (clojure.xml/parse some-input-stream))), then (clojure.data.zip.xml/xml-> xml-zipper :Sometag :someothertag (clojure.data.zip.xml/attr :attrname))
10:15benny__will check it out, thanks
10:15casionhttps://github.com/clojure/data.zip/ is the relevant info for clojure.data.zip
10:15casionand note, you don't have to navigate the root elemet when using xml->, that tripped me up and it seems to have been a stumbling block for some other people as well
10:15clojurebotmin people is 5
10:16benny__what dependencies do i need in the project.clj?
10:16casionjust [org.clojure/data.zip "0.1.1"]
10:16casionand whatever else is needed for the rest of your project
10:18casionI really don't get why clojure.data.xml won't parse some things, if I try stax directly most of them are parsed fine
10:18casionbut it stilll fails on others that clojure.xml/parse works with
10:24benny__i cant seem to find a single rss feed that can be parsed
10:24benny__hn, cnn, spiegel.de, all throw errors
10:25casiongive me a feed, I'll try one
10:25benny__http://rss.cnn.com/rss/edition.rss
10:26benny__my sample code is http://pastie.org/4860703
10:26benny__printing the xml, not sure it shows everything, maybe i dont read the full xml stream
10:27benny__a feed def would be, (def feed {:id 1 :topic "http://rss.cnn.com/rss/edition.rss&quot;})
10:28benny__i didnt think that xml parsing would be such a hard, when picking this for my "learn clojure" journey :p
10:30benny__ah that waas it, (http/await resp) required
10:30casionworks fine for me here
10:30benny__i use the async http client and just stuff only a small percentage of the xml string into the parser
10:30casionbut I just did (clojure.xml/parse (.openStream (java.net.URL. "http://rss.cnn.com/rss/edition.rss&quot;)))
10:30benny__stupid :)
10:33benny__ok now it looks good
10:33benny__casion, thanks for listending and trying :)
10:33casionsure :)
10:37benny__its really annoying that the api changed so much, and you only find outdated examples on google :(
10:37casionI completely agree
10:37casionI'm going to write a blog post on how I dealt with this stuff once I feel I have a proper handle
10:37casionon it
10:38casionI have reading it down pretty well I think, but right now I'm struggling with writing valid xml now
10:41benny__what are you using to print xml?
10:41benny__prxml is deprecated?
10:42casionno clue yet
10:42casionI've yet to find something that works correctly
10:42casionclojure.xml/emit sort of works… sometimes
10:46benny__ah it renders, ole :)
10:46benny__maybe thats enough for me
11:20dlitvakhey guys, i have a noobish question
11:20dlitvakim creating a pet project for learning clojure... and i have something i want to refactor but i dont know how
11:21dlitvaki'm creating a little templating engine and i have something like the following
11:21dlitvak(tag "p" "some content" (list {:name "class" :value "foo"}))
11:22dlitvakwhich renders to: "<p class='foo'>some content</p>
11:22dlitvak"
11:22dlitvakthat works good
11:22dlitvakbut... i want to be able to change the attribute list to something like...
11:23dlitvak(tag "p" "some content" {:class "foo"})
11:23dlitvakthe following gist is the code im using for rendering
11:24dlitvakhttps://gist.github.com/bd3b8fe4bc3bfe905268
11:27dlitvakhow can i get the key-value pair?
11:27edlothiol,(map (fn [[k v]] (str k "=" v)) {:class "foo" :id "bar"})
11:27clojurebot(":class=foo" ":id=bar")
11:27dlitvakawesome!
11:27dlitvakthx
11:28sunkencityrylehIf I use binding to bind some value in a function that then calls a bunch of other functions, is that binding on the stack or in the thread?
11:29sunkencityrylehhm, it's per thread I see now
11:49djanatynI've been reading on lisp, and I really liked the first section on closures
11:50djanatynin common lisp, we can do this, because of lexical binding: (let ((x 0)) (defun counter () x) (defun tick () (incf x)))
11:50djanatynthen we could get the value with (coutner) and increase the value with (tick). they hada their own tiny little shared state
11:51djanatynI tried to do this is clojure: (let [x (atom 0)] (defn counter [] x) (defn tick [] (swap! x #(+ % 1))))
11:51djanatynbut it looks like I can't call (counter) or (tick) outside of that let binding.
11:52chouserworks for me
11:52djanatyn:O
11:52djanatynd'oh -_-
11:52djanatynin my REPL, I wasn't in the right namespace ;)
11:52chouserah :-)
11:52djanatynanyway, cool! I'm learning stuff from "On Lisp" that I can use when I'm writing clojure
11:53chouserbtw, clojure has a fn named inc that you can use instead of #(+ % 1)
11:53djanatynis there anything I should keep in mind about differences between common lisp's scope and clojure's scope?
11:53djanatynoh, thank you.
11:53chouserI love "on lisp", and especially it's treatment of macros carries over pretty well
11:56casionchouser: since you seem to have written clojure.data.zip, how would you suggest rendering/writing the xml zipper after mutating it
11:59casionclojure.xml/emit seems to be not printing character entities correctly (e.g. &quot is printing as "), and clojure.data.xml seems to choke on most xml
12:10chouserdjanatyn: the main difference of course is on lisp makes no attempt to avoid mutation
12:13octagonhi, i have a record type in cljs, say Foo. if x is an instance of Foo, is it generally correct to test for this by doing (= (type x) my-ns/Foo)
12:13chousercasion: that's the main weakness with data.zip
12:14chouserYou can only update one of the results. If you update more than one, you'd have to merge them somehow -- probably not worth it.
12:14casionchouser: any suggestions on dealing with it? clojure.data.xml isn't throwing exceptions on most everything I try to emit :(
12:15casionwith data that clojure.xml/emit returns fine, other than the aforementioned issue
12:19chouserI don't think I understand
12:19chouseryou've got input data that clojure.xml/emit accpets, but you haven't yet figured out any way to get data.xml to use it?
12:20casionchouser: yes
12:20TimMcaaahhhhhhh wtf
12:20TimMcClearly I don't understand Swing threads.
12:20chouserTimMc: the main thing to understand is that There can be only one. :-P
12:22TimMcchouser: Yeah, and I'm calling (SwingUtilities/invokeLater #(...)) from another thread, but it's just calling it right away!
12:22TimMchttps://gist.github.com/3804489
12:22chousercasion: data.xml has changed quite a bit since I last touched it. Looks like there are actual docs now.
12:23TimMcI suppose it is possible that the "Game loop" thread has called this fn before the AWT exists or has anything else on it...
12:25chousercasion: ignore what I said about mutation. I was thinking of a different lib (data.zip/xml)
12:25casionchouser: that comment was useful, since I'm running into an issue there too :|
12:26chousercasion: you're mimicking the examples at https://github.com/clojure/data.xml ?
12:26casionchouser: yes I am
12:26chouserAnd you're getting NPEs
12:27chouserheh, yeah, almost none of my code is left in there. Probably just the part that's breaking for you.
12:28casionthe direct examples there work, but when I start working with my own xml that clojure.xml parses and emits fine, data.xml starts giving XMLStreamExceptions
12:28chouserthe emit side is just a wrapper around XMLStreamWriter.
12:28chousercasion: I can probably look at a stack trace, if you have one, before I have to go.
12:29casionI don't have one at the moment
12:29casionbut you've given me some insight
12:29casionthank you
12:31unic0rni'm just learning when it comes to clojure, but i want to code a photo processing tool in it, and the question is, what should i be aware of when it comes to number crunching performance? which data structure will be the best for such thing, java arrays?
12:33casionunic0rn: you want to write it yourself? ImageJ is a very good library for such things
12:33unic0rncasion: yes, i want to write it myself.
12:34unic0rncustom thing entirely. local contrast enhancement, with my own tweaks.
12:35casionyou'll be working with byte[] almost entirely, and in my experience it's best to stay there
12:38sexpGirlWouldn't a Java wrapper around "the real thing" like ImageMagick or GraphicsMagick be better than the "pure Java" ImageJ? (GraphicsMagick is a fork of ImageMagick and is used by sites like Flickr so...)
12:40casionI found ij very easy to use from clojure
12:40octagonis there a way in cljs to have a type that can implement protocols, is immutable like defrecord, but does not provide a persistent map implementation?
12:41sexpGirlcasion: looks convenient indeed seen that it's 100% Java (not external deps)... The wrappers around ImageMagick / GraphicsMagick are good too but you're "stuck" with the fact that it's non-native so you need to install non Java stuff ; (
12:41octagoni am wanting to create a record but provide my own implementation of ICounted, for instance
12:41casiononly issue was occasionally having to deal with type promotion
12:42casionwhich seems to be unavoidable when using java a/v libs from clojure :(
12:42casionunchecked-int everywhere!
13:16bonegaSo what is everybody using for painting in Clojurescript? Just plain gclosure?
13:19prokiiIs anyone using the clojurescript one method for web development?
13:27gfredericksbonega: painting like canvas, not SVG?
13:29jonasencemerick: Where's the best place to ask questions about sjacket? I assume cgrand is the only one who really know how it's suppposed to work.. but he's not on IRC. Maybe the clojure-tools mailing list?
13:31cemerickjonasen: Yeah, he's on there.
13:32cemerickjonasen: BTW, I've since discovered that it's possible to get cljx to emit the metadata associated with the munged forms, which includes line numbers. Unfortunately, that line number metadata is squashed by the reader :-x
13:33cemerickWorking on a patch to Clojure now that will fix that, but 50/50 shot of it getting in probably.
13:34xeqiI'll take the under
13:36bonegagfredericks: canvas
13:37gfredericksI used one of the cljs libs for a bit; it was somewhat raw but better than gclosure maybe
13:37gfredericksI switched to SVG before too long because that's what I really needed anyhow
13:38jonasencemerick: Which issue is that? JIRA link? I ran into http://dev.clojure.org/jira/browse/CLJ-916 while working on kibit which will be fixed in 1.5
13:39cemerickjonasen: I haven't filed the ticket yet. In short:
13:39cemerick,(meta (read (clojure.lang.LineNumberingPushbackReader. (java.io.StringReader. "^{:line 66} ()"))))
13:39clojurebot{:line 1}
13:40cemerickvs.
13:40cemerick,(meta (read (java.io.PushbackReader. (java.io.StringReader. "^{:line 66} ()"))))
13:40clojurebot{:line 66}
13:41bonegagfredericks: ok, thanks
13:42bonegaThinking of doing it as html instead of fighting with gclosure canvas
14:06TimMcreiddraper, alex_baranosky,: I now have a working crosscram GUI! The board size, choice of bot, and who goes first are all hardcoded, but it's a start.
14:06reiddraperTimMc: ah, very cool
14:07reiddraperneed to start playing with that again
14:07TimMcIt's the gui-demo branch.
14:07TimMcI *may* rebase/squash that branch, so definitely don't build off of it. :-P
14:13casionjust when I thought I had this xml thing licked… writing it seems to be another day of IRC log searching
14:16ibdknoxis there a newer implementation of datalog available somewhere? I know datomic has one, but I assume that can't be used in isolation
14:18jonasenibdknox: It can be used in-memory without the transactor running
14:19ibdknoxjonasen: is it pretty lightweight that way?
14:22jonasenibdknox: I believe there are quite a lot of dependencies.. but it's been lightweight enough for me to have a lot of fun with it
14:22ibdknoxjonasen: what have you been doing? :)
14:23jonasenibdknox: but I haven't used it for anything serious.
14:23jonasenibdknox: https://github.com/jonase/scape
14:23ibdknoxhaha, that's also what I want to do with it ;)
14:25jonasenibdknox: heh.. it works pretty well and I think there are a lot of interesting things you can still do with it
14:29octagoni'm looking at https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L184 what does #_(-entry-at ...) mean?
14:29Bronsait is ignored
14:30Sgeo__,#_(blah blah blah)
14:30clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
14:30Bronsa,#_foo (+ 1 2)
14:30Sgeo__,#_(blah)(+ 1 1)
14:30clojurebot3
14:30clojurebot2
14:30Bronsadang.
14:30octagonBronsa: thanks, so that's there just as a comment?
14:30Bronsayeah
14:30SegFaultAXoctagon: Check it http://clojure.org/reader
14:30Bronsaprobably something that was needed in the early days of clojurescript and got commented out
14:31octagonah ok, so it isn't important, then, af far as implementing the protocol goes
14:31octagon*as
14:31octagonthanks!
14:31SegFaultAXoctagon: That page has a list of the different reader macros (like form commenting #_)
14:32octagonSegFaultAX: ah ok i see now. i read that page but i must have missed it
14:33casionis there any other way to read/write XML other than clojure.xml/clojure.data.xml ?
14:34TimMccasion: Sure, you can serialize it yourself. :-)
14:34casionthat sounds awful :(
14:35TimMcThe Java core libs provide some APIs as well.
14:37michaelr525hello
15:39UrthwhyteWorking with the REPL in your text editor is the greatest thing ever. So nice going back to interactive coding
16:01octagondoes clojure have anything similar to scheme's define-values? like here: http://docs.racket-lang.org/reference/define.html#(form._((quote._~23~25kernel)._define-values))
16:03TimMcreiddraper: Any objection to bumping crosscram to 1.4? I'm getting pissed off by RuntimeException-wrapping.
16:04reiddraperTimMc: np
16:07ivanhow do I add a monospace/code block in a comment in JIRA?
16:07ivanI swear JIRA is designed to make me look like an idiot with its lying documentation
16:19jcromartieI took a Java REST API and rewrote it in Clojure to be 1/10 the LoC and 100X faster.
16:19jcromartieBut they don't want me to use it because it would make somebody look bad.
16:19jcromartieand by "100X faster" I mean 100X more request/sec
16:20octagonjcromartie: you should use it anyway. you know they want it
16:21jcromartieI don't know they want it. It's a big enterprisey Gov't contractor on the other end, and they *want* to waste time, space, and money.
16:21ivannow you just need a Clojure program to replace politics
16:21jcromartielike, they've explicitly told me they want to use more time than necessary, more code than necessary, make mistakes, etc.
16:21octagonjcromartie: you should charge extra for that!
16:22octagonit's like an option you'd have that costs extra
16:22jcromartiewhat's "that"?
16:22octagon"i can guarantee worse running time for a small fee"
16:22jcromartiehah hah
16:23octagonyou could have your REST thing mining bitcoins while it works
16:23jcromartiehah
16:23octagonanother bonus for you
16:23jcromartienow that's a good use of public resources
16:24octagonor it could be folding proteins or something
16:25Urthwhytejcromartie: time for (.sleep Time)
16:26Urthwhyteif I'm using clojure string's split func, can I just pass it a char to split on or must it be a regex
16:26ivanhow about a macro that inserts sleeps everywhere?
16:27ivandefslowfn
16:31octagonor just (dotimes [n 100] (process request))
16:31jcromartie(defn enterprisey [n f] (fn [& args] (Thread/sleep n) (apply f args)))
16:31octagonit could be a ring middleware or whatever
16:31jcromartieoh yeah!
16:31octagondotimes has the added benefit of making the machine work harder
16:32octagonso you'd be spending more money on power and cooling
16:32octagonactually i recommend mining bitcoins and then deleting them automatically when you get one
16:32ivanrunning it 100 times increases reliability in the face of three cosmic rays hitting your bits at the same time
16:33jcromartie(defn wrap-enterprise [handler] (fn [req] (dorun (map str (range 10e8))) (handler req)))
16:33octagonthrowing away bitcoins is a luxury the government systems need to have installed for sure
16:33jcromartiethat's too long of course
16:33jcromartie10e5 is enough
16:33jcromartie,(time (dorun (map str (range 10e5))))
16:33clojurebot"Elapsed time: 567.37274 msecs"
16:33jcromartiedepends on the server I suppose
16:34jcromartieconsidering my requests take like 4ms
16:34jcromartie:P
16:34octagonyou could compute something really difficult and add it to the response headers
16:34jcromartiehah
16:34jcromartiehow about a bitcoin
16:34jcromartie:P
16:35octagondude that's it
16:35mpana full bitcoin?
16:35octagonyou need to do this
16:35mpanhow much computation does that cost these days?
16:35octagonevery so many requests, a bitcoin is returned with the response
16:35octagonthat's great
16:35jcromartie24 hours
16:35mpanperhaps use a fractional bitcoin
16:36jcromartieoh yah, good idea
16:36octagonit's like the 100th customer at the car dealership gets a t shirt
16:36jcromartie"this API returns money"
16:36jcromartieX-Money: ...
16:36octagonundocumented, of course
16:36mpanit's a bit hard to "return a bitcoin", though
16:36octagonX-Alimony: 0x8723...
16:36mpanat best, you could make a wallet with just that amount and send out the private key
16:37mpanBUT that doesn't stop the service operator from spending it first
16:38jcromartieyeah a new wallet would be the way to go
16:38jcromartieor, let users specify their wallet
16:38jcromartieand just put money into it
16:39mpanor actually, just specifically say: we're giving you this wallet; move the funds out within X days or we're reclaiming it
16:39mpanthat prevents some waste
16:40octagonmpan: he doesn't want to prevent waste hahaha
16:40octagonthe more waste the better
16:40octagonthis is luxury govt computing here
16:41mpanwait, I came in after the backstory
16:41mpanwhat did I miss?
16:41octagona mechanism to slow down a clojure program that replaces a java program and is 100x faster
16:42octagonadded bonus for wasting resources
16:43mpanwait, why?
16:43mpanadded bonus for parameterizability, right?
16:45jcromartiempan: I improved a Java API by rewriting it in Clojure using 1/10 the code, and it was 100X faster
16:45jcromartiempan: but they don't want it
16:46jcromartiempan: they would rather have more code, and spend more time
16:46mpanwhy?
16:46clojurebotWhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
16:47mpanI mean, more time/code isn't the root cause, is it?
16:47TimMcclojurebot: lexical scope is <reply>out of scope, out of mind
16:47clojurebotRoger.
16:47mpanclojurebot: do you have like a command for your maintainer(s) to masquerade as you?
16:47clojurebotparedit commands is http://mumble.net/~campbell/emacs/paredit.html
17:05UrthwhyteAnyone with time to laugh at some horrible code? (and perhaps help a bit)
17:07Urthwhytehttps://gist.github.com/8ec57d16837b2f326874
17:10UrthwhyteMy mistake, that last one was private: https://gist.github.com/3805186
17:11mpanhm, just curious why you aren't using regular expressions if you're sure about the structure of it
17:12mpanas in, matching the whole string and pulling out captured groups
17:14UrthwhyteMostly as I'm rather poorly porting it over from Python, so doing foo, bar = s[0:2], s[3:] was easier than /(w){2}(\d){4}/
17:15UrthwhyteJust seemed easier at the time, it was a script I wrote in ~45 minutes, figured it would be a good first "real" clojure project
17:16algernonUrthwhyte: the problem is, that -> turns the parse-url call into (parse-url ShowUrl url), which is not what you want. (that is, -> doesn't do what you think it would)
17:16UrthwhyteUsing macros you don't fully understand is usually a recipe for disaster
17:16antoineBinto (parse-url rec url)
17:26Urthwhytealgernon: is there an alternative I can use - it's very unintuitive to me that -> would expand into that. I had expected it to execute the second arguments before applying? (my terminology is almost certainly all wrong) it to the record type
17:27Urthwhyteoh I see
17:27mpanwhy are you using -> when you have nothing to chain?
17:27mpanit's usually for when you have multiple forms you want to thread a result through
17:28UrthwhyteLargely cargo culting my way through here based off what I've read so far in Programming clojure. I've now checked the API docs and seen that -> feeds each expression as the first argument of the next
17:28UrthwhyteWhich makes sense
17:44ivanhttp://blog.fogus.me/2012/09/29/adventures-in-tearing/
18:14Apage43Is there something around that would be useful for reading/printing numbers with SI prefixes?
18:14Apage43er
18:14Apage43suffixes
18:14Apage43rather
18:34ohpauleezdnolen: I found another bug related to my hashbang adventures yesterday (http://dev.clojure.org/jira/browse/CLJS-385) - I'll have a ticket and a patch sometime this weekend
19:18gjcourtcan anyone recommend a good resource for learning about agent error recovery
19:20gjcourtspecifically, say i use (send-off a (fn [a f] (doto a (.upload f)))) and a fails, is there an idiomatic clojure solution?
19:20gjcourtfor retrying that upload
19:29UrthwhyteSo I solved the problem I was having earlier
19:29UrthwhyteRecords API wasn't stable from 1.2->1.4, and I had the wrong one specified in my project.clj
20:07nightfly_34
20:07gfredericks,(rand-int 100)
20:07clojurebot51
20:40cjfriszToo quiet in here
20:40cjfriszWhat's up, folks?
20:41alex_baranoskywhat's up
20:52mpanbit of a weird question, but: how much control does oracle have over java as an ecosystem? how much does that affect clojure as a language? how likely is it to have something dramatic happen down the line?
20:53cjfriszmpan: Interesting question which I'm probably not qualified to fully answer
20:54cjfriszFrom my experience, Oracle makes at least a half-hearted attempt to support languages targeting the JVM
20:55cjfriszThey seem to be slow about doing things to *help* those languages, but they seem at least somewhat interested in not stifling them
20:55mpanwhat if they decide they want money down the line, like with android?
20:55SegFaultAXmpan: Money for what? Usage of the JVM?
20:55Raynesmpan: If they do that, then everybody is screwed.
20:55Raynesmpan: Not just Clojure.
20:56dlitvakyou always have OpenJDK
20:56RaynesWhat if Rich Hickey decided he wanted to charge for parentheses?
20:56SegFaultAXmpan: Oracle has no rights to Clojure itself.
20:56dlitvakas java has an open standard for the JVM
20:56dlitvakRaynes: while clojure is under Eclipse Public License... that cant happen
20:57SegFaultAXWhoosh.
20:58mpanok thanks
20:58Raynesdlitvak: http://en.wikipedia.org/wiki/Humor
20:58xeqioh, does the epl have a non-commercial clause?
20:58dlitvaklol
21:07SegFaultAXI wonder how hard it would be to make something like Grape (Ruby) in Clojure... or if someone already has?
21:28duck1123SegFaultAX: I have this. https://github.com/duck1123/ciste not quite the same
21:29duck1123I need to write better documentation
21:29cjfriszduck1123: Amen
21:30cjfriszduck1123: Although it's hard to find someone without that problem
21:30cjfriszI used to have good documentation. Then I continued writing code.
21:30duck1123I sit down and try every now and then, but I find I'd rather actually be using it
21:31cjfriszYeah, I've got a project that I've been intending to take an evening to just go through and update the documentation/audit the code
21:31cjfriszBut it's so much more fun to add more functionality
21:32duck1123I've been meaning to create a write-up on how to create an app with ciste, then I have a demo app I never finished
21:57cjfriszSometimes I realize that things are legal Clojure syntax and it makes me sad
21:57cjfrisz,(fn)
21:57clojurebot#<sandbox$eval27$fn__28 sandbox$eval27$fn__28@4e78d10d>
21:57gfredericks,((fn))
21:57clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox$eval55$fn>
21:57gfredericks,((fn) :foo)
21:57clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval83$fn>
21:58gfredericksit's a function with no arities :)
21:58cjfriszgfredericks: Exactly!
21:58cjfriszgfredericks: What the hell does that mean??
21:58lazybotcjfrisz: What are you, crazy? Of course not!
21:58gfrederickscjfrisz: it means you can't call it :P
21:58cjfriszThen why is it legal syntax??
21:58lazybotcjfrisz: What are you, crazy? Of course not!
21:59gfrederickscjfrisz: because there isn't a check against it
21:59cjfriszI know...
21:59gfredericks,(macroexpand '(fn))
21:59clojurebot(fn*)
21:59cjfriszSo if one were to write a source-to-source compiler in Clojure, (s)he would have to handle that case
22:00gfredericksfor some value of 'have to'
22:00cjfriszWell, what's the point of writing a source-to-source compiler that rejects legal source code?
22:01gfredericksto have a source-to-source compiler that accepts all useful code?
22:01cjfriszJust because the original compiler lets you do something stupid doesn't mean you should stop someone from doing it
22:01gfredericksI'm just saying you don't have to
22:02gfredericksa transpiler would be useful even if it doesn't handle pathological cases
22:02xeqi,(seq (.getPublicMethods (class (fn))))
22:02clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: getPublicMethods for class java.lang.Class>
22:02xeqi,(seq (.getDeclaredMethods (class (fn))))
22:02cjfriszYeah...
22:02clojurebotnil
22:02cjfriszI see your point, but it conflicts with my sensibilities
22:02cjfriszNot saying that you're wrong; I think your opinion is quite valid
22:03gfrederickscjfrisz: wanna see a cool bug in the reader?
22:03cjfriszgfredericks: Uh, yes. Of course
22:03gfredericks,(#(+ %1 %2 #_ %3) 1 2)
22:03clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox$eval196$fn>
22:03cjfriszOh weird
22:05cjfriszThat got weirder when I macroexpanded it
22:05gfredericksit just adds an extra arg no?
22:05cjfrisz,(macroexpand '(#(+ %1 %2 #_ %3) 1 2))
22:05clojurebot((fn* [p1__224# p2__225# p3__226#] (+ p1__224# p2__225#)) 1 2)
22:05gfrederickscjfrisz: you could get basically the same thing with read-string
22:05xeqi,(#(#_%&) 1 2 3)
22:05clojurebot()
22:06cjfriszgfredericks: yikes
22:07cjfriszThat seems like a ghost story that you tell to your kids about the dangers of using that anonymous fn syntax irresponsibly
22:07gfredericksha
22:08cjfriszAnd then...the argument was gone!!
22:08gfredericksNOOOOO
22:10gfrederickscjfrisz: write me a clojure-syntax wrapper for haskell
22:13cjfriszgfredericks: hmmm...
22:13cjfriszI don't know why I'm the one to do that, particularly because I don't think I ever successfully wrote a Haskell app
22:14cjfriszI always got fed up with the type-checker and ended up writing it in Scheme
22:14gfredericksI thought it would be fun to use metadata syntax for type annotations, but that won't work for strings and numbers and such
22:15dnolencjfrisz: heh
22:15gfredericksthough maybe those things get explicitely annotated infrequently enough that it could be a separate thing
22:22dnolencjfrisz: so it sounds like some interesting things are happening to Chez ...
22:23cjfriszdnolen: Oh?
22:25dnolencjfrisz: well it sounds like Chez is now a Cisco product?
22:26duck1123could you run clojure on haskell? (wise is a different question)
22:27cjfriszdnolen: Hmm...I don't know. You'd have to ask Kent Dybvig about that.
22:28xeqiduck1123: as in build an interpreter in haskell?
22:28dnolencjfrisz: ah ... yeah this impression is based on Rainer Joswig tweet and some mailing list posts I've seen.
22:29dnolencjfrisz: been hoping that someone will finally put the super high performance free Scheme, related - Dan & Will said that Aziz has resurfaced
22:29duck1123basically. like java, javascript, .net, python, etc.
22:30dnolencjfrisz: well inexpensive, if not free is what I meant by the above as far as Chez.
22:30cjfriszdnolen: right
22:30duck1123I assume haskell let's you shoot yourself in the foot if you really try hard enough
22:30cjfriszdnolen: I had heard that they got ahold of Aziz again in the Spring
22:32cjfriszdnolen: I'm curious, do you have links for what you heard about Chez?
22:32dnolencjfrisz: http://groups.google.com/forum/#!msg/comp.lang.scheme/4AlItE5baRg/Ono4F3ipY_oJ
22:35cjfriszdnolen: Hmm...well I think Kent is the only one managing scheme.com, so that must have come from him
22:36dnolencjfrisz: I'm assuming that's your day job these days - hacking on Chez.
22:37gfredericksduck1123: I'm not sure why being able to shoot yourself in the foot is even a requirement
22:38gfredericksyou would probably have to implement everything within the IO monad I guess? :/
22:38cjfriszdnolen: I'm actually working on the CSO Advanced Development team
22:38cjfriszdnolen: It's an arm of the part of Cisco responsible for acquiring other companies
22:39cjfriszdnolen: We do speculative programming to assess the utility of other people's software and how to integrate it into our products
22:39cjfriszdnolen: Though I'm not yet allowed to speak on the specifics of what I'm working on
22:40dnolencjfrisz: but I'm assuming all Scheme :) Is there a decent sized team at Cisco doing Scheme work?
22:41cjfriszdnolen: it kills me, but I can't really say what we're doing right now
22:41dnolencjfrisz: no worries
22:41cjfriszdnolen: someday I will excitedly tell you all about it
22:43dnolencjfrisz: haha. You and all the people doing really cool stuff w/ core.logic that won't blog about ;)
22:43cjfriszdnolen: I've got a couple ctco blog posts I need to write
22:43muhooi'm glad you guys are using clojure for Important Stuff. me, i was jonesing for an excuse to use clojure, so i had to do this: http://restivo.org/zombies
22:43cjfriszdnolen: If that's any consolation
22:45dnolencjfrisz: looking forward to that! Still hoping we might be able to convince you to do ctco over the CLJS AST once it's sorted.
22:45cjfriszdnolen: I'd be happy to!
22:45cjfriszdnolen: it may be after Conj because I've got a lot of work on ctco I want to get done
22:46cjfriszdnolen: Plus I'd like to have a little stand-alone compiler for TCO in Clojure that takes care of some whole-program analysis that the ctco macro can't cut
22:49dnolencjfrisz: seeing an approach to whole-program analysis definitely interests me. pondering optimized miniKanren compilation more and more these days ...
22:49cjfriszdnolen: I'm not even sure that what I have in mind is going to make a whole lot of difference
22:49cjfriszdnolen: but it's a journey probably worth making
22:55mpan&(type (fn))
22:55lazybot⇒ sandbox7657$eval34390$fn__34391
22:56cjfriszWait, was there more discussion of zero-arity fn expressions when I wasn't paying attention
22:56cjfrisz?
22:57cjfriszI probably should have asked this ages ago, but what's the difference between clojurebot and lazybot?
22:57cjfrisz,(type (fn))
22:57clojurebotsandbox$eval27$fn__28
22:58xeqicjfrisz: https://github.com/hiredman/clojurebot and https://github.com/flatland/lazybot
22:59cjfriszxeqi: Thank you much
23:19Raynescjfrisz: lazybot is a totally different project.
23:19RaynesIt does more things than clojurebot and overlaps in some places like evaluation, but even the evaluation is entirely different, using a sandbox library that I and amalloy_ developed.
23:19RaynesThough xeqi keeps breaking it.
23:19cjfriszHehehe
23:19RaynesBecause he is clever and such.
23:20cjfriszYeah, I saw that from the github page for lazybot
23:20cjfriszVery cool stuff
23:36cjfriszAck...I'm very tempted to break my 80-character column rule
23:36cjfriszHelp me be strong
23:37xeqisurely thats more like a guideline
23:38cjfriszxeqi: You're being the little devil on my left shoulder :-P
23:38cjfriszI just have to remember that someday I will be working on a screen with less real estate and be very mad at myself
23:49mpanwhat screen will you use that has little width?
23:49mpanor are you one of those ssh over smartphone folks?
23:50cjfriszmpan: I did a lot of coding on a netbook
23:50cjfriszThough I don't anymore
23:50cjfriszI upgraded to a big-boy 27" widescreen :-)
23:50cjfriszThough I'm thinking of picking up a 14" laptop soon to do work on the go
23:50mpaneven a netbook has >120 cols?
23:53cjfriszmpan: 90% or more of the time I have my emacs buffer split vertically
23:53mpanah
23:53mpanthat explains it
23:53cjfriszmpan: Indeed
23:54cjfriszI think I could reliable do 72 characters before things got bad
23:54cjfriszSome idiosyncrasies of Clojure syntax forced me to up that limit to 80 characters
23:55mpanhow good is emacs at knowing how far to indent?
23:56cjfriszGenerally quite good
23:56cjfriszAnd if it doesn't something I don't like I learned the incantation to poke the indent function to do what I want
23:56cjfrisz*does something I don't like
23:57mpanthat second part sounds hard, though
23:57cjfriszEh, it's not too bad
23:58mpanalso, is the rebind-capslock-to-control thing real?