#clojure logs

2011-11-20

00:14slyphonso, with the modularized contrib, is there somewhere still to read the docs for each module?
00:21devnwhere'd try/catch go?
00:23brehautit disappeared?
00:23devnit's not in core
00:23amalloy&(java.util.Date. 0)
00:23lazybot⇒ #<Date Wed Dec 31 16:00:00 PST 1969>
00:24brehautits a special form isnt it?
00:24devnyes
00:24brehautso it wont be in core?
00:24devnwhat do you mean?
00:24devnif is a special form.
00:24brehaut,try
00:25clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: try in this context, compiling:(NO_SOURCE_PATH:0)>
00:25brehaut,(try (/ 1 0) (catch Exception e e))
00:25clojurebotbrehaut: excusez-moi
00:25brehaut,(try (/ 1 0) (catch Exception e :exception-caught))
00:25clojurebotbrehaut: Pardon?
00:25brehautfail
00:26brehauti didnt think if was in core either? arent all the special forms implemented magically in the compiler?
00:27amalloybrehaut: righto
00:27amalloythough a fair number of the "special forms" are actually macros in core, wrapping around the real special forms
00:28amalloyalso, the bots won't let you catch exceptions, because they send you a timeout exception if you take too long
00:28devnbah, my bad -- I don't know how that happened
00:28brehautoh yeah i forgot about that
00:28devnFor some reason I was blowing up on calling try
00:28devnIt seems to be working fine now
00:31amalloytechnomancy: i realized something nice just now. in just 300 million years, oracle will have to finally fix/remove j.u.Date due to integer overflow
00:32devnread-string is awfully forgiving
00:32devn,(read-string "(+ 1 1))))")
00:32clojurebot(+ 1 1)
00:33devn,(read-string "(((((((+ 1 1))")
00:33clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
00:33devn,(read-string "((+ 1 1)))")
00:33clojurebot((+ 1 1))
00:34devn,(read-string "#=(eval (def foo "foo"))")
00:34clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0)>
00:34devn,(read-string "#=3")
00:34clojurebot#<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>
00:35devn,(binding [*read-eval* true] (read-string "#=3"))
00:35clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Unsupported #= form>
00:35devnoh well, worth a try :)
00:35alandipertdevn, gotta quote that puppy
00:35devnwhich'un?
00:35brehaut,'puppy
00:35clojurebotpuppy
00:35alandipert(eval '(def foo ...
00:36devn,(binding [*read-eval* true] (read-string "#=(eval (def x 10))"))
00:36clojurebot#'sandbox/x
00:36devnx
00:36devn,x
00:36clojurebot10
00:36brehautnope, its because the string "foo" is not escaped
00:36devnbrehaut: good catch
00:37devn,(binding [*read-eval* true] (read-string "#=(eval (def x \"10\"))"))
00:37clojurebot#'sandbox/x
00:37devn,x
00:37clojurebot"10"
00:37brehautim very in tune with the parser atm ;)
00:37devnalign your chakras
00:38brehauti align my chakras left with the second child of the list
00:39devn,(binding [*read-eval* true] (read-string "#=(eval (defn hm [] (System/getProperty \"user.home\")))"))
00:39clojurebot#'sandbox/hm
00:39devn,(hm)
00:39clojurebot#<AccessControlException java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)>
00:42devn,(ns-publics (symbol (str *ns*)))
00:42clojurebot{hm #'sandbox/hm, x #'sandbox/x}
00:43devn,(map first (ns-refers (symbol (str *ns*))))
00:43clojurebot(sorted-map read-line re-pattern keyword? unchecked-inc-int ...)
00:45brehaut(keys (ns-refers (.name *ns*)))
00:45brehaut,(keys (ns-refers (.name *ns*)))
00:45clojurebot(sorted-map read-line re-pattern keyword? unchecked-inc-int ...)
00:47devnmuch prettier
00:47brehautits how we learn right?
00:47devni hope so, else I've been doing it very, very wrong
00:48brehautyeah me too ;)
00:48devnI've defaulted to using too much map I think
00:48brehautive defaulted to too much comp and partial
00:49devnha, I can share in that feeling
00:50devnit's clever and sometimes exactly what I need, but often times I'm just like "yeah! I can use juxt here!" when there's no need
00:50brehauthehe yeah :)
00:50devn"playing with your data"
00:55slyphonso, if i need to implement an interface for something i'm handing into java (a lightweight instance that only has one method) a good choice for that is...?
00:56brehautreify
00:57scottjslyphon: https://github.com/cemerick/clojure-type-selection-flowchart
00:57slyphoni did a project about a year and a half ago when 1.2 was coming out soon, coming back to clojure now i'm a little lost
00:57slyphonscottj: awesome
01:00brehaut,(let [named (reify clojure.lang.Named (getName [this] "hello, world"))] (name named))
01:00clojurebot"hello, world"
01:00slyphonhah
01:00slyphonman, i totally forgot how to structure things
01:00brehauti cant think of a simpler example ;)
01:00slyphonthat was a good one
01:08slyphonhrm, wasn't there a clojure version of a BlockingQueue ?
01:09brehautjava.util.concurrent.BlockingQueue
01:09brehautclojure.lang.PersistentQueue is not a replacement for it
01:09slyphonah
01:13jblomohow do I call a super's method from within a gen-class function?
01:14amalloybrehaut: i usually use ##(.size (reify java.util.List (size [this] 10)))
01:14lazybot⇒ 10
01:14brehautamalloy: aha thats much better
01:18amalloyjblomo: you seem to be doing an enormous genclass. are you sure you really need all that?
01:21jblomoamalloy: gen-class is not too large, but I am overriding a Hadoop class
01:21jblomoextending
02:11brehauthuh. you cant put an expontent on a hex number
02:11brehauti guess that shouldnt be surprising
02:59Raynesdakrone: Ping.
03:16devnbrehaut: we need a #tag or something in irc for "huh." moments
03:16brehautdevn: yeah?
03:16brehautoh yeah, heh
03:16devn./topic Concise '(huh moment) explained like this #huh_moment
03:17devnIRC is such a gold mine of information.
03:17brehautyeah totally
03:17brehauti wrote a log tagger for a bot i maintain on another channel
03:18devnbrehaut: I need your help.
03:18brehautits got some user interface crevases that needs work
03:18brehautyeah?
03:18devnI've seen your posts on parsers-- what I need is a clojure parser
03:19devnIt doesn't have to be perfect-- all I'm looking for is a way to extract "correct" s-expressions
03:19brehauta parser for clojure or a parser in clojure?
03:19devnfor
03:19brehautfunny you should mention that; i wrote one just this week (in javascript)
03:20brehautby correct you mean it fixes up unbalanced parens?
03:20brehautor only finds balanced expressions?
03:23devnbrehaut: blah! sorry about that. my other keyboard is a model M clone and it is REALLY loud. My girlfriend is working on serious business.
03:23devnI had to switch and couldn't find the right cable.
03:24devnbrehaut: All I care about is efficient checking to make sure something is a balanced expression.
03:24brehautok that should be pretty straight forward
03:24devnbrehaut: Icing on the cake is being able to look at the N most recent expressions and make an educated guess as to whether they are a logical group
03:25brehauti have something like written for lazybot (that has since been canned) let me find the commits
03:26devnbrehaut: This is great. I feel like building this specific library for others to use and putting out on clojars or getting accepted as a core lib would be a nice addition.
03:26devnputting *it out
03:26devngetting *it accepted
03:26devn*sigh*
03:26clojurebotCool story bro.
03:26devnBrool story co.
03:27brehautif you can ignore the expression prefixes, and atom specifics, it should be pretty simpl
03:27devnbrehaut: could you elaborate?
03:27devnexample, please.
03:28brehautso the prefixes are things like ^ @ ' ` ~ ~@ #
03:28devnreader macros.
03:28brehautatoms are the non list,vector,map,set things
03:28brehautyeah pretty much
03:28devnokay, understood
03:28brehautparsing all of clojure's legit number literals is a moderately large piece of work
03:29brehaut(for example
03:29brehaut)
03:29brehautif you just care about balanced expressions you can ignore all those fiddly details
03:29brehauthttps://github.com/brehaut/lazybot/blob/ce26d56fb1ebef2d7a5adadc611bc6c49f8e11de/src/sexpbot/plugins/clojure.clj#L61-90
03:29devnso, based on what you're saying, and what I was thinking earlier-- handling ^:dynamic
03:30brehautright, so handling that substantially increases the complexity of the parser
03:31brehautoh thats simple; it just produces a stream of tokens for parsing
03:31brehauttokens in that case are [ ] ( ) { } and anything else
03:31Raynesdevn: Sorry I missed you earlier.
03:31brehautso "((foo bar) baz)" becomes ["(" "(" "foo bar" ")" "baz" ")"]
03:31RaynesI wasn't at home at the time.
03:31devni had to parse the \\[\[\] brehaut
03:31devnRaynes: no worries
03:32devnbrehaut: *nod*
03:32brehautdevn: ah right, escaped squares in a character class? hmm. damn unreadable regexps :S
03:32devnI've seen this before in trying to parse ruby, which is much, much uglier :)
03:32brehautmuch :)
03:33devn1.9.3 makes a little more palatable, but not much
03:33devnRubyParser.new.parse "1+1"
03:33devn# => s(:call, s(:lit, 1), :+, s(:array, s(:lit, 1)))
03:33brehautso parsing meta data in my javascript imp is https://github.com/brehaut/inc-clojure-brush/blob/master/shBrushClojure.js#L107-116 and #L360-365
03:34brehautoh right, its given you an AST
03:34devnbrehaut: what if multiple passes were made
03:35brehautdevn on clojure?
03:35devnso there is a core that is generalized
03:35devnbut you go back over everything with a "static/dynamic" augmentation
03:35brehautdevn: if you can leverage the reader then you are going to win
03:36brehautdevn: im not actually sure i quite understand what it is you are building
03:39devnbrehaut: skynet
03:39brehautdevn: oh
03:40devnbrehaut: semi-kidding there
03:40brehauthah :)
03:40devnI want to be able to hunt all over the place for clojure gists, pastes, irc, the lists, github projects, etc.
03:40brehautoh man
03:41brehautthats a surprisingly tricky proposition
03:41devnYes, I know.
03:41devnI've been thinking about it for 2 years, and that hasn't increased my confidence.
03:41brehautif i were to make uninformed assertions,
03:41devnBut there is a poor solution out there.
03:41brehauti wouldnt write a parser
03:41brehautid gather together a big corpus of code
03:41devntrain it?
03:41brehautyeah
03:41devnrestricted boltzman or something?
03:42brehautway out of my field of knowledge
03:42brehautcemerick is probably a better person to talk to
03:42amalloydevn: does the code contain the string "(defn "? that's a pretty good filter already
03:42amalloytada, now you can tell if any input file has some clojure code in it :P
03:42brehaut:)
03:43devnheh, that's great, but now what if you want to make a guess about whether 3-5 segments are a logical group
03:43amalloyprobably less than a 0.1% false-positive rate
03:43devnif you choose yes and someone missed a ), you wind up with garbage
03:44devnamalloy: yeah, you're probably right
03:44brehautgarbage + read-string
03:44devnamalloy: little is published that doesnt actually run
03:44devnyeah i was looking at read string -- pretty encouraging how liberal it lets you be
03:44amalloyidentifying "logical groups" is (more or less) impossible
03:44devn,(read-string "((hm)))))")
03:44clojurebot((hm))
03:45devnamalloy: you could be stupid about it though
03:45amalloydevn: it just stops when it gets to the end of a single valid expression
03:45brehautdevn: sure, but its still found a valid string :)
03:45devnshort pastes reuse the same vars and string together an idea in general
03:45hiredmanhttps://github.com/dakrone/clojure-opennlp/blob/master/TRAINING.markdown
03:45brehautdevn: re:published that run: http://brehaut.net/blog/2011/ring_introduction search for ":only [app delegate]])"
03:46devnhiredman: thanks
03:47devnbrehaut: no thanks! ;)
03:47brehautlol
03:47brehauttl;dr: apparently the code i was really fussy with ensuring would run has some really dumb errors in it that ive only found now that i have syntax highlighting
03:48devnamalloy: *nod* -- that is simple, but does not allow for enough precision I don't think
03:48devnmaybe it does, just don't know...
03:48brehauti need to head to bed; good luck devn
03:49devnbrehaut: so before you go, last thing i promise
03:49brehautok shoot
03:49devnwe've been dancing around this, but I think the real idea here is to identify possible candidates and then have real people sort them out.
03:49devnso, I don't need the most precise thing, but I also don't know if the simplest thing will work
03:50devnI'm not convinced of that anyway
03:50brehautok
03:50brehautso the problem with a straight forward deterministic parser
03:51brehautis that the clojure grammer (being a lisp) is really quite broad
03:51devnI think the fact that I used the word "candidate" and then suggested real people would review them is reason enough to assume what I need is some AI juice
03:51brehautmy previous sentence is frinstance valid clojure sexps
03:51devn*nod* -- I've run into this already
03:52brehautsure
03:52devnI had years of #clojure logs and parsed them all -- ran them in a sandbox
03:52devnbut the sandbox can only do so much
03:52devnand many of these expressions are part of a logical group of expressions
03:52devnwhich is why they hold value
03:53brehautyup
03:53devnIDK, at the end of the day it makes me think that all I really need to do is chunk it up and make it a game like amalloy and 4clojure
03:53brehauthehe :)
03:53amalloyhah
03:53devn"mark the expressions in a logical group."
03:53amalloyi won't enslave my users to parse your sexprs!
03:53devn:D
03:53devnamalloy: it's for the good of the land!
03:53brehautthe IRC logs are a particulary tricky set i think; a lot of bad code is fed to the bots that never executes properly
03:54amalloythey're already busy writing my utility libraries
03:54devnbrehaut: it's also the most abused system in terms of hackery
03:54devnwhich is actually a net win
03:54brehauthaha sure
03:54devnthe sandboxes are good about being very selective
03:54devnbut that's also what makes them weak
03:55devnperhaps the sandbox just needs to get broader
03:55devnso you can perform "filesystem operations" in a virtual environment
03:55amalloydevn: that's easy to add. just add a jvm permission for ~/sandboxfs
03:55brehautif i were to guess at an approach, i'd look at the NLP tool hiredman linked, and then group the found expressions by the nick and timestamp
03:56amalloymount something there with a filesystem quota
03:56brehautand use similarity of expressions to determine if two nicks are collaborating on one thing
03:57devnthanks amalloy brehaut hiredman
03:57brehautkeep in mind that im speaking only from the perspective of knowing of statistical techniques but not the details, and having some experience writing simple parsers
03:57devnbrehaut: keep in mind i'm speaking from heavy idealistic ignorance
03:58devnI just want the best documentation and example code known to man-- automatically
03:58brehautlol :)
03:58brehaut:)
03:58devnwe talk about code as data
03:58devnlet's use it
03:59brehauti really need to head to bed. gnite
04:00devnbrehaut: thanks for the help, night
04:01devnwow. inc-clojure-brush is great.
04:39michaelr525heu
05:31guesyI am new to clojure. I was trying to setum a working environment for the first time. with NetBeans(7.0.1) and eClojure. But maven clean install never succedes.. I am not even able to install it from the plugin editor in NetBeans. Any suggestions ?
05:32guesyI keep getting this error: The plugin Lucene Integration is requested in version >= 2.10.1.232 (release version 1) but only 3.2.1 (of release version different from 1) was found.
06:20justin` /j ##closure-tools
06:20justin`that's embarrassing
08:08lobotomyugh, why isn't doc working with the slime repl with clojure 1.3.0
08:09lobotomylein new foobar; edit project.clj to have :dependencies [[org.clojure/clojure "1.3.0"]] :dev-dependencies [[swank-clojure "1.3.3"]] then lein swank, from emacs slime-connect, go to repl, "(doc +)" just says "Unable to resolve symbol: doc in this context"
08:09lobotomybut "(+ 1 2 3)" etc works just fine
08:10lobotomyfrom "lein repl", doc does work
08:13fliebellobotomy: doc is located in clojure.repl
08:19ukd1hi guys, I'm looking at learning clojure and would like to get a book - there are two out on amazon (uk) -- which one is recommeneded? The joy of clojure or the pragmatic programmers book?
08:21fliebelukd1: afaik, joy of clojure is a bit more advanced, so if you're new to clojure, lisp and functional programming, I would not recommend it.
08:21fliebelI'm not sure, but I think there are a couple of new books about to be released, which'll probably cover clojure 1.3
08:22ukd1fliebel, I've done a little common lisp, but not for a while. I was mainly worried they'd be out of date
08:22lobotomyfliebel: and clojure.repl isn't included by lein-swank by default any longer?
08:23fliebelukd1: Well, I'm not sure, but 1.3 was just released.
08:23lobotomyis "(clojure.repl/doc +)" supposed to work then from the emacs slime prompt? that's not working either
08:23fliebellobotomy: try (use 'clojure.repl) and then try again
08:24lobotomyah ok
08:24lobotomyso some smart guy decided to omit that use statement from lein-swank, just to piss me off. got it :p
08:25fliebelukd1: have you seen this one? http://www.manning.com/rathore/
08:26fliebelukd1: or http://pragprog.com/book/shcloj2/programming-clojure
08:28fliebeltechnomancy: would slamhound + lein repl be a nice idea?
08:28ukd1fliebel - nope - just looking!
08:32Saturnationukd1, I just started learning, and Joy of Clojure was a bit more than I needed, though still a good book. I've got the beta of the Pragmatic and picked up Clojure in Action. If I had to recommend one for a first book, I'd recommend Programming Clojure
08:37ukd1Saturnation, thanks! I've ordered that one :-)
08:51fliebelWhat is the status of XML in Clojure? I found clojure.data.xml, but it's not ready.
09:15erlukofliebel: what are you looking for?
09:16fliebelerluko: generating an atom feed. I have written something myself in the past, but it'd need some cleaning up.
09:16fliebelhttps://github.com/pepijndevos/ArmageDOM
09:19fliebelso there's clojure.xml and clojure.data.xml, neither of which are very active or complete.
09:19erlukoWould prxml work? http://clojure.github.com/clojure-contrib/prxml-api.html#clojure.contrib.prxml/prxml
09:21fliebelerluko: That's old contrib.
09:21erlukoah, yes it it
10:17Sindikat1hello everyone
10:18Sindikat1i want to write a game in clojure (as a practice). it will be a roguelike with graphics, and the graphics will be something like this - http://ianwitham.files.wordpress.com/2010/02/screenshot-python-libtcod-tutorial.png - what libraries should i use?
10:18diptanucHello folks can anyone explain my why does (identical? "foo" "foo") return true on my repl
10:19diptanucaren't these two different objects?
10:19diptanuc(= "foo" "foo") can be equal though
10:21raekdiptanuc: each function (or top level expression) is compiled into a java class. each class has it's own constant pool, so if the same string occurs more than once in a "class" it will still only be stored once
10:21raek&(identical? "foo" (str "f" "oo"))
10:21raek,(identical? "foo" (str "f" "oo"))
10:22clojurebotfalse
10:23raekdiptanuc: so in this case they happened to be the same object (due to this space optimization) but two strings that are equal are not identical in general
10:28diptanucraek: Thanks
10:28diptanucraek: Makes sense now
10:45technomancyfliebel: I think slamhound makes more sense with editor integration
10:46technomancyif you don't have the file right in front of you, you really don't want it running off and rewriting forms
11:01fliebeltechnomancy: I was thinking more along the lines of auto-loading stuff you use on the repl.
11:21Sindikat1hey, i did everything as it was said in 'getting started with emacs'. i have .clj file on one buffer and slime repl in another. when i try to call some function from .clj file, it throws error as function is unknown, but C-x C-e in the .clj works
11:29ejacksonSindikat1: how are you calling the function from the .clj file ?
11:29ejacksondo you mean from the repl ?
11:29ejacksonin that case have you changed to the correct namespace in the repl ?
11:29Sindikat1yeah, say i have function (defn location ...), and i call it (location) in slime
11:30ejacksonin the .clj file go C-c M-p
11:30ejacksonthat switches the repl to the namespace of the the file
11:30devn^
11:30ejacksonyou might also want C-l to load the file
11:30Sindikat1ha, works!
11:30ejacksonthen you're mustard
11:30devnThe only problem I have with C-c M-p is that once you've loaded a couple of namespaces for the same project it gets a little less productive
11:31devnC-c M-o is handy also
11:31Sindikat1hey, C-c C-l itself weren't working before
11:31ejacksondevn: what does it do ?
11:32Sindikat1so i always need to change namespace before working with repl, right?
11:32devnIt ejackson it'
11:32devnfjdisao ejackson nothing fancy -- it just clears your REPL
11:32ejacksonaaah, cool
11:33devnit can be nice when i've made a big mess or forgot to turn on *print-level* 2, *print-length* 10
11:33ejacksonSindikat1: no, you can do (use ...) the namespace from the repl and get the functions that way, but C-c M-p is usually easier.
11:33devnand have a 450,000 element hash-map in my REPL
11:33devngrinding emacs to a halt
11:33ejacksonas you do...
11:33devn:)
12:01devndakrone: you around?
12:05R4p70rAnyone's looking for a novice Clojure coder in Canada?
12:05mindbati'm getting a rather nasty exception when trying to compile the hello.cljs example from the clojurescript quick start
12:05mindbatanyone been able to get that quickstart working?
12:08mindbatthe error i'm getting is: Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil
12:08mindbatis there some part of the clojurescript example i'm missing?
12:10ejacksonmindbat: I'll take a quick look for you, no promises though
12:10mindbatejackson: awesome, thanks
12:10fliebelwhen you write (defmulti foo class), you can use defrecord instead, right? What about the default case?
12:11fliebelJust extend Object?
12:11ejacksonmindbat: works 100% here. Did you do everything in "One-time Setup" ?
12:12mindbatejackson: Where's the One Time Setup? I followed the three steps at the top of the quick start guide, then moved on to Using ClojureScript on a Web Page
12:13ejacksonits in the README.md or here: https://github.com/clojure/clojurescript/tree/master/samples/hello
12:13ejacksonits the minimum you need to get this sample going
12:14mindbatejackson: ah, didn't see that, thanks...was working purely off the hello.cljs example on the Quick Start page. I'll have a look at that example and try that
12:15ejacksoncool, those samples are great. They go as far as the repl browser, which you definitely want to check out.
12:31mindbatejackson: still get the same error when runnning 'cljsc src > hello.js' from the samples directory
12:31ejacksonmindbat. ugh
12:31mindbatejackson: (after setting the environment variables and path)
12:31ejacksonhmm... can you get a repl to come up in the root dir ?
12:33mindbatejackson: from the root clojurescript directory, i can get a clojure repl...but not a clojurescript repl
12:33mindbatejackson: repljs fails with: Exception in thread "main" java.lang.RuntimeException: java.lang.AssertionError: Assert failed: Can't find goog/base.js in classpath
12:33ejacksondid you do the bootstrap ?
12:33mindbatejackson: yep
12:34ejacksondo you have a goog.jar in the lib dir ?
12:34mindbatejackson: nope
12:34ejacksonyour bootstrap must have failed.
12:34mindbatejackson: should i run the bootstrap again?
12:35ejacksonyeah, from the root ./script/bootstrap
12:35mindbatejackson: says it completed, but: Building lib/goog.jar... jar cf ./lib/goog.jar -C closure/library/closure/ goog ./script/bootstrap: 34: jar: not found
12:36ejacksonweirdness.
12:36mindbatejackson: can i download the jar manually?
12:36ejacksonnoononono
12:36ejacksonmore is probably wrong
12:36ejacksonkill the whole dir and clone from github again
12:38mindbatejackson: done...same error
12:38ejacksonwindows ?
12:38mindbatejackson: ugh, no...ubuntu 10.10
12:38ejacksonubuntu.....
12:38ejackson1 sec I'm going to try over here
12:41ejacksonmindbat: you have curl installed ?
12:41mindbatejackson: yes
12:43TimMcOK, what are some good Clojure videos to watch, since my arm is being useless?
12:43ejacksonmindbat: gist up the output of bootstrap please for me to see
12:43ejacksonTimMc: consider for a second what you just said....
12:43TimMcThere's "Simple Made Easy" and I suppose some Conj videos -- what else?
12:44TimMcejackson: What?
12:44ejacksonit must just be me....
12:44TimMcMy right elbow is being all complainy -- Ishould stay away from the keyboard.
12:45ejacksonmindbat: my bootstrap output looks like this.... https://gist.github.com/1380546
12:45ejacksonTimMc: did you see "Are we there yet "
12:45mindbatejackson: and this is mine: https://gist.github.com/1380545
12:46ejacksonmindbat: I think you're mising the jar command
12:46ejacksontry calling jar from the command line
12:47ejacksonTimMc: if not, http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey is a cracker !
12:47TimMcoooh http://clojure.com/reading.html
12:47mindbatejackson: hmm...yep, it seems to be missing
12:47ejacksonmindbat, ok, here we delve into javaland... ugly
12:48ejacksonyou need to install the correct jdk package for ubuntu.... i'm not sure offhand what it is though.
12:48ejacksontry this: sudo apt-get install sun-java6-jdk
12:48mindbatejackson: there's the openjdk one, and sun-java...any idea if clojure/clojurescript plays nice with the openjdk?
12:49ejacksoni think openjdk doesn't work right
12:50mindbatejackson: ok, i'll grab the sun java package
12:51ejacksonyeah, try that and see if it brings down the jar binary for you, think that'll sort it.
12:54mindbatejackson: hey, that did it! everything works now!
12:54mindbatejackson: many thanks!
12:54ejacksonno sweat, happy hacking bro.
12:54TimMcejackson: Thanks.
13:03devnAnyone know anything about NLP?
13:08guesyI am new to clojure. I was trying to setum a working environment for the first time. with NetBeans(7.0.1) and eClojure. But maven clean install never succedes.. I am not even able to install it from the plugin editor in NetBeans. Any suggestions ? I keep getting this error: The plugin Lucene Integration is requested in version >= 2.10.1.232 (release version 1) but only 3.2.1 (of release version different from 1) was found.
13:13TimMcdevn: A bit...
13:13gfredericksNull Lointer Pexception?
13:14gfredericksdevn: actually now that I think about it, I took a class on it, if that means anything.
13:14TimMcdevn: I work at a company that does computational linguistics.
13:16bbommaritoGood afternoon all.
13:30dnolenguesy: if you just want an easy to use environment I suggest taking a look at clooj.
13:32bbommaritoWow, I had never heard of clooj.
13:45klauernWhat are some good examples of libraries that limit statefulness in places where it's often required?
13:45brehautdnolen: do you still believe theres only 4 things that need to be changed/fixed in javascipt?
13:45dnolenbrehaut: heh, what do you mean?
13:46brehautdnolen: http://dosync.posterous.com/fixing-javascript
13:46brehautthats pre clojurescript right?
13:46dnolenbrehaut: oh yeah, and clojurescript addresses all of those
13:48fliebeldnolen: How hard is it to mess with core.match?
13:49brehautpersonally i think the biggest thing clojurescript brings to the table is sane collections
13:49dnolenbrehaut: oh man seriously
13:49dnolenfliebel: not so bad given the utter lack of documentation
13:50guesydnolen: I looked at clooj. That is a usefull suggestion. Thank you.
13:51fliebeldnolen: I'm trying to write a ring routing lib based on it. (match req [:get foo "bar"] baz)
13:51guesydnolen: can you help me setup my environment in NetBeans 7.0.1 ?
13:51guesyI am running Ubuntu 11.10
13:51devnTimMc: gfredericks: I'm curious as to how I'd go about building a sentence detector for clojure. Do I need a dictionary first? Where would you start if you wanted to train a program to recognize valid clojure forms?
13:52TimMcdevn: That's not NLP, that's ALP. :-)
13:52dnolenfliebel: oh you're not hacking on it, yeah using it is pretty simple.
13:53dnolenguesy: I don't use Enclojure so I don't think I can be of much help.
13:53devnTimMc: give me reading material and stuff! :)
13:53dnolenguesy: Enclojure is quite cool, but it's not actively developed now as far as I can tell.
13:54TimMcdevn: A = Artificial. You don't need statistical models etc., you just need a parser.
13:54fliebeldnolen: Well, partially. I want to pass the bindings on to the handler, but the expanded form is just a let, so I'm looking for a way to get them.
13:54TimMcdevn: You're just trying to match forms?
13:55dnolenfliebel: so are you running into trouble? that looks like it should just work to me.
13:56fliebeldnolen: Well, say I write [:get foo "bar" baz] handler, I want to pass foo and bar to handler.
13:56guesydnolen: So which IDE is generally used by most of you ? workin with clojure ??
13:57TimMcEmacs.
13:57TimMcThen Vim and Eclipse, I think.
13:58TimMcguesy: Whatever you use, it really has to have paren balancing, either in strict mode or just an advisory mode.
13:58dnolenfliebel: you can do that
13:58dnolenfliebel: unresolved symbols become "named" wildcards
13:58Raynesdevn: ping
13:59dnolenguesy: I use Emacs
13:59dnolenguesy: but others use Eclipse, IntelliJ
13:59fliebeldnolen: I know, they are let'ed in the expanded form, but how do I figure out which variables the user entered?
13:59dnolenfliebel: ?
14:00guesyTimMc: i've been using emacs and vim all the time. I thought using an ide with a plugin for syntax assist might be helpful to start with.
14:00TimMcguesy: The Emacs Starter Kit is pretty good if you don't already have an environment set up. (And use Leiningen for building.)
14:00dnolenguesy: ah, SLIME w/ Paredit is pretty nice.
14:00TimMcguesy: Well, in Emacs you have paredit-mode (minor) and clojure-mode (major).
14:00fliebeldnolen: I and of course write (match foo ["bar" baz] (handler baz)), but I'd like to auto-wire that.
14:02guesyTimMC: dnolen: I am setting up my VM now. I guess EMacs as always is the ONE !
14:02TimMcyup
14:02TimMcespecially for s-expression languages
14:02dnolenfliebel: sorry I'm slow today, I don't see what needs to be done :)
14:02bbommaritoYea, emacs is pretty much the Lisp editor.
14:02guesyThank you guys. I will be back in a minute as soon as I complete the Environment Setup
14:03bbommaritoparedit mode is the greatest thing since sliced bread.
14:04fliebeldnolen: I want to have a list of all the let'ed symbols, so I can automagically pas them to the handler.
14:04devnRaynes: pong
14:06dnolenfliebel: ah yeah, there's no way to do that.
14:06Raynesdevn: Currently writing some marginalia docs in lein-newnew. Once I'm finished, I'll walk you through whatever you want.
14:07fliebeldnolen: Not in the match macro, or not at all? I suppose that to let them, you need to have that list.
14:08fliebelThat is why I said 'mess', because I think I need to step down a few levels.
14:09devnRaynes: that'd be cool
14:10devnTimMc: we were talking about this last night -- a parser doesn't seem like the right way to go according to brehaut
14:11TimMcdevn: What's an example?
14:11TimMcPoint me to a timestamp?
14:11dnolenfliebel: I don't think you need to change match. Write a route-match macro that analyzes for free symbols and move them over before match handles it.
14:11devnTimMc: 1sec
14:12TimMc(UTC or EST, or a search string)
14:13devnTimMc: http://clojure-log.n01se.net/date/2011-11-20.html#03:18
14:14TimMcthx
14:15devnTimMc: the problem is knowing it's a balanced expression is one thing, but being able to see if a group of expressions rely on one another would be great
14:15fliebeldnolen: Something like (filet symbol? (flatten pattern)) ?
14:15fliebel*filter
14:16dnolenfliebel: something like that, just make sure you exclude locals you find in &env
14:17fliebeldnolen: Ok, I'll write my macro monster, thanks :)
14:17dnolenfliebel: heh should be a pretty simple one.
14:18devnTimMc: I don't know -- maybe you're right. Sorry that's so long to read.
14:18fliebeldnolen: I hope so. One other problem I ran into is that match seems to require a literal vector for the pattern.
14:19fliebelSo I need to do some wrapping and unwrapping as well. Or is that different in head? Because I saw matching on a single value.
14:19devnTimMc: I'll be right back
14:19TimMck
14:19dnolenfliebel: you can match single things now
14:20fliebeldnolen: yay, thanks. This is going to be awesome :)
14:20dnolenfliebel: you don't need to change the left hand side anyhow, just the right hand side.
14:20fliebel?
14:20dnolenfliebel: you macro does change the patterns, just the right hand side clauses
14:21fliebeldnolen: right :)
14:21dnolen(route-match x [:get bar] handler) -> (match x [:get bar] (handler bar))
14:21dnolendoesn't change patterns i mean
14:21fliebel:)
14:22TimMcdevn: Arm "broken", gonna be concise: Use reader to extract symbols, match against Bayesian filter. Train hidden Markov Model on known Clojure and other sexp langs.
14:23TimMcdevn: You also want clustering of related code in a document? Look up in-doc coref.
14:24TimMcdevn: Nothing wrong with doing a little annotation yourself.
14:26fliebelWhat would be needed to make clojure.walk/postwalk retain metadata?
14:26devnTimMc: I had planned on some annotating by hand
14:26devnTimMc: thanks for the help
14:26Raynesfliebel: The tears of children.
14:27fliebelRaynes: I think so...
14:38TimMcdevn: What kind of code do you want to extract, what to ignore, and what to do with it?
14:42gfredericksdevn: I'm a bit confused as to why clojure.core/read doesn't do what you want
14:44RazWelles_Hey what's the status on ClojureCLR atm? Is it maturing?
14:50TimMcIt had a commit in September, I think.
14:52Rayneshttps://groups.google.com/d/msg/clojure-dev/OUTZC8i_-LI/tkbREu83BNIJ
14:58bbommaritoHrmmm, no websockets library for Clojure...might have to write one...
14:59fliebelRaynes: How do you get the tears of children? I can't get it to work.
15:00Raynesdevn: http://raynes.github.com/lein-newnew/
15:02gfrederickslein-difftest requires clojure-contrib? Am I supposed to make that a dev-dependency, or does it go somewhere else?
15:02RaynesIt does?
15:03gfredericksit wouldn't run until I added contrib as a dev dep
15:03RaynesOh, they didn't upgrade to the new difform version.
15:03gfredericksand then it ran
15:03Raynesgfredericks: If you just :exclude difform and then add difform 1.1.2 yourself, your problem will probably cease.
15:04gfredericksRaynes: in the project.clj? I just think it's gross that difftest is installed as a global plugin on my machine, instead of being listed in the project.clj, and yet I have to muck with my project.clj to make it work
15:05Raynesgfredericks: If you give me a moment, I'll update it myself and release a version to clojars under my own groupid until they release an official version.
15:06gfredericksso then I would uninstall the official plugin and install yours?
15:06RaynesYep.
15:06gfredericksthat sounds like a great solution.
15:07gfredericksthanks
15:10Raynesgfredericks: lein plugin uninstall lein-difftest 0.3.4 && lein plugin install org.clojars.raynes/lein-difftest 0.3.5
15:10RaynesShooting Brenton a pull request now, so I imagine an official release isn't too far off.
15:11gfredericks0.3.4? should be 1.3.4?
15:11RaynesEh, probably.
15:11RaynesYeah
15:11gfredericksso then 0.3.5 or 1.3.5 for yours?
15:11Raynes1.3.5
15:12gfrederickscoo
15:16gfredericksRaynes: works great, thanks!
15:21gfredericks(inc Raynes)
15:22gfredericks(dec lazybot)
15:22RaynesHuh.
15:23tmciverI'm trying to remember a function that returns an edited version of a nested map.
15:26gfrederickstmciver: assoc-in and update-in
15:27tmcivergfredericks, yes, thanks. I just saw update-in.
15:31fliebelI hate reflection, always takes years before I figured out where to put the type hint. So, reflection is slow, for humans too.
15:34TimMc(watching "Simple Made Easy")
15:35TimMcI think Rich is *complecting* the objective/subjective and absolute/relative axes.
15:35TimMc</smug>
15:35dnolenwoohoo, got printable types for CLJS :)
15:48Saturnationdnolen, with they repl in a browser you demoed at the end of the Conj, how hard is it to set up? Is it documented somewhere?
15:49Saturnations/they/teh
15:49Saturnationgah
15:50dnolenSaturnation: pretty easy w/ Emacs, it's all setup in the CLJS master branch.
15:50Saturnationeasy for someone with Clojure experience, or just easy in general? :)
15:51Saturnationtrying to get it set up for my team remotely...
15:51Saturnationactually, not trying, but thinking about...
15:53brehautSaturnation: you do know about the webkit inspector right?
15:54Saturnationso no
15:55brehautSaturnation: its got a repl console, debugger, profiler, resource and network inspector, and dom + css inspector
15:56dnolenprintable types branch here, https://github.com/clojure/clojurescript/compare/33-type-fn
15:56SaturnationI'm more interested in the ClojureScript because I'd hope it'd be a way to get the team interested in Clojure
15:56dnolenSaturnation: I don't know if it makes debugging JS easier, but it does make writing code a lot easier.
15:57dnolenSaturnation: it also removes lots of nasty JS corner cases
15:58brehautin chrome its spanner > tools > developer tools, and in safari its develop > show web inspector
15:58Saturnationdon't see anything obvious, but webkit inspector doesn't work with IE?
15:58dnolenSaturnation: no
15:58dnolenSaturnation: to debug IE you need Visual Studio Web
15:58dnolenwell for IE < 8, but the IE 8 devs tools aren't that great either
15:59Saturnationthanks for the info, something to chew on for a bit :)
15:59bbommaritoThat is why I do not support IE.
16:00dnolenSaturnation: one thing I'm excited about is getting the ClojureScript analysis stuff going, I think that could actually make the debugging ClojureScript experience light years beyond JS
16:00bbommaritoPain in the butt really
16:00sridcan this be made any more concise? -- (zero? (mod 6 4))
16:00brehautdnolen, Saturnation: IE has a rubbish inspector hidden behind F12
16:01brehautbut you can still pause and inspect without VS
16:01dnolensrid: that's not concise enough for you?
16:01sridjust wondering if there is any
16:01sridi was thinking of something like: (divisible? 6 4)
16:01sridthat reduces 2 applications to one
16:03brehaut(def divisible? (comp zero? mod))
16:03srid(min (f1 ...) (f1 ...) (f1 ...)) -- I want the 3rd value to `min` made conditional. what is the best way to do this? (apply min (conj (f1 ..) (f1..) (if condition (f1..))))?
16:11Raynesdevn: Let me know if the docs aren't sufficient. We can talk about whatever.
16:11gfrederickssrid: (zero? (mod 6 4)) can be shortened to false :)
16:12bbommaritogfredericks: Indeed, I think that would be the shortest way to write that.
16:12bbommaritoAnd that is only one form.
16:13gfredericksbbommarito: maybe (def f false) somewhere for brevity
16:14bbommaritogfredericks: Hrmmm, yes that would work. I don't think you could get much smaller than that.
16:14bbommaritoUnless...you define a space to be false...
16:17bbommaritoOkay, how the Detroit Lions managed to do this, I am not entirely sure...
16:23amalloysrid: (apply min (into [(f1 ..) (f1..)] (if condition [(f1..)])))
16:24sridalso: (apply min (remove nil? [a b c ...]))
16:24srid(apply min (remove nil? [a b (if condition c) ...]))
16:25amalloyyeah. fwiw, that function's actually in useful already
16:25BahmanHi all!
16:26amalloyhttps://github.com/flatland/useful/blob/develop/src/useful/utils.clj#L31 (built on ignoring-nils at https://github.com/flatland/useful/blob/develop/src/useful/fn.clj#L90 )
16:26Raynesgfredericks: technomancy just pushed 1.3.5 to clojars officially, fyi.
16:30gfredericksRaynes: w00p, thx
16:33devnRaynes: cool, ill take a peek
17:09jblomohas there been any discussion on extending the object.method calling syntax sugar?
17:10jblomoeg (map .toString [1,2,3,4])
17:11amalloy&(map (memfn toString) [1 2 3 4])
17:11lazybot⇒ ("1" "2" "3" "4")
17:12amalloyalso: no. .toString is not a function, and i doubt it ever will be. it's a method and you have to treat it that way
17:17devnha! so...as an experiment I've decided to rewrite a project we have at work in Clojure
17:18ejacksonis there a way to get the classpath while in a clojurescript repl ?
17:18devnI'm about 4 hours in and I think I have almost all of it done
17:25jblomoamalloy: ah cool, i hadn't used memfn before, thanks
17:26Wild_Cat&(map #(.toString %1) [1,2,3,4])
17:26lazybot⇒ ("1" "2" "3" "4")
17:27Wild_Cat&(map #(.toString %) [1, 2, 3, 4])
17:27lazybot⇒ ("1" "2" "3" "4")
17:30ejacksonto answer myself: put a call to print it out in the startup script.
17:30ejackson(before you start the cljs repl...)
17:37spoon16_I have a vector [ 0 1 2 3 99 0 6 18 3 4 5 ] and a predicate #(< 10 %) how can I get back a sequence of sub-sequences where predicate is true on the original vector… so the result would be ( (0 1 2 3) (0 6) (3 4 5) )
17:37spoon16_take-while is close
17:41lucianspoon16_: sounds like 4clojure's longest increasing subsequence. you should be able to see other people's solution to it
17:42brehaut,(take-nth 2 (partition-by #(< 10 %) [ 0 1 2 3 99 0 6 18 3 4 5 ]))
17:42clojurebot((0 1 2 3) (0 6) (3 4 5))
17:42brehautspoon16: ^
17:42spoon16_nice
17:43amalloybrehaut: danger! coll might start with fitting or not-fitting the predicate
17:43brehautamalloy: you are right
17:44amalloyjust the other day i wrote, yet again, (defn partition-around [pred coll] (filter (comp pred first) (partition-by pred coll)))
17:44amalloywhich does what spoon16 wants
17:44spoon16_amalloy, thanks
17:44amalloythough i actually wanted remove instead of filter for my application, so i wrote that instead :P
17:46dnolencljs.core.IFn, https://github.com/clojure/clojurescript/compare/96-ifn
17:46ejacksonbrehaut: that is cute.
17:46brehautejackson: and wrong half the time ;)
17:47brehautamalloy: do you have (partial partial apply) as something in useful?
17:48amalloyhah. no, but that does sound useful
17:49brehautincidentally, would that be a third order function?
17:49amalloy&(let [ap (partial partial apply)] (map (ap +) [[1 2 3] [4 5 6]])) or something, right?
17:49lazybot⇒ (6 15)
17:49brehautyeah
17:50amalloyi don't *think* so, because partial works just fine on first-order functions - that it receives a second-order function is "coincidental" in a way. but i'm not okasaki; maybe he disagrees
17:50brehautyeah i have no idea
17:51brehautpropably it depends on the type signature
17:56Raynesdevn: We're merging lein-newnew into Leiningen tonight or tomorrow.
17:57RaynesIf you have any changes or anything, you might want to wait for that.
18:24devnRaynes: noted -- ill still take a look in a moment, doing some chores around the house
19:07TimMcIs "Simplicity Ain't Easy" worth watching after "Simple Made Easy"?
19:22SaturnationIs there a Clojure function for accessing the methods on a Java object?
19:26TimMcSaturnation: listing them?
19:27scottjSaturnation: slime? use the inspector
19:29SaturnationI've seen it done at the repl before, just not sure if it was Clojure or Java interop
19:30RaynesTimMc: Stalk'd https://gist.github.com/1381252
19:31amalloySaturnation: clojure.contrib.repl-utils used to have a show function that does that
19:31amalloyi don't think it's in 1.3 though?
19:31TimMcRaynes: Huh, cool.
19:31Raynes(.getMethods java.io.File)
19:32SaturnationRaynes, that's probably it, thanks :)
19:32kephalei always pprint the bean of the class
19:32TimMcRaynes: needs to be printable...
19:33Raynes(doseq [method (.getMethods java.io.File)] (println method))
19:35Saturnationreflect seems to do something close to what I'm looking for...
19:35TimMcRaynes: Stalk'd https://gist.github.com/Raynes
19:36Saturnationor not...
19:40amalloyjust call seq on it: then it's printable
19:42RaynesTimMc: https://gist.github.com/1381270 too bad I can't edit your bio to say "I <3 Raynes"
19:44TimMcRaynes: Check again.
19:45RaynesHahaha
19:45TimMcActually, I should put something a real bio in there. Thanks for reminding me...
19:46RaynesTimMc: Dude!
19:46RaynesTimMc: Clone tentacles and do it from your repl. :>
19:46TimMctoo much typing
19:46RaynesHardly any at all.
19:46TimMcto do the writing, I mean.
19:46TimMcalso lazy
19:47RaynesClone the repo, lein repl, (use 'tentacles.users), (edit {:auth "login:password" :bio "new bio"})
19:47RaynesThat's how Clojurians were meant to use Github.
19:47TimMcshouldn't be keyboarding at all
19:48TimMcback to videos -- maybe tomorrow is a hammock day at work
19:49amalloy"TimMc went from 'How do you work this dang GitBook thing' to 'I <3 Raynes'"
19:54devnRaynes: you should keep the cover of your book like that
19:54RaynesEverybody says that.
19:55devnI seriously do like it.
19:56devnThe tentative ToC looks great also
19:56devnYo dawg, I herd u liek data
19:56devn:D
20:02TimMcRaynes: Bug the github folks to allow SSH access to profiles.
20:03RaynesWhat use would that be?
20:03devna big BBS!
20:03amalloy"SSH access to profiles"? i'm not clear on what that would mean
20:09TimMcRaynes: Not having to dig out my password and put it on disk.
20:10TimMcamalloy: Like, if they exposed a min-repo for everyone's profile I DON'T KNOW
20:10TimMc:-P
20:20TimMcRaynes: I don't like putting passwords on the command line, even inside a REPL.
20:20TimMcMaybe even more so in a REPL, since I don't know where the history is stored.
20:21amalloyTimMc: well, passing them as arguments to a process is clearly worse than giving them to a process on stdin
20:21TimMcyes
20:22RaynesAlso, I'm doing this stuff in SLIME.
20:22RaynesWhich isn't really the command-line.
20:22RaynesSo there.
20:34TimMcRaynes: Does SLIME havew a persistent history?
20:34amalloyyes
20:34RaynesTimMc: Do you wear a tinfoil hat and sleep under a rock?
20:34TimMcYes!
20:35amalloyit syncs your history to wikipedia for cloud persistence
20:35TimMcBut mostly I am being belligerant.
20:35TimMcI do have an encrypted hard drive, so I should just shut up. :-)
20:38TimMcno, it is ****
20:38amalloyTimMc: your password is juxt too???
20:38lazybotamalloy: Yes, 100% for sure.
20:38TimMcNope, it is fnil.
20:39TimMc(haven't seen that used much recently)
20:44scottjcljs: can you pass a clj map to a gclosure function that expects a javascript object or do you have to convert it first?
20:44amalloyscottj: convert it
20:44amalloywell
20:44brehautscottj: i hope so! javascript objects are retarded maps
20:45amalloymy understanding is that clojure has array-map and hash-map; cljs has hash-map and object-map
20:45brehaut(i hope you have to convert it)
20:45amalloyso you could pass an object-map in, i think, but not a hash-map
20:45scottjany idea how to convert it?
20:46amalloy(into (object-map) the-hash-map)? i dunno
20:47scottjI'd tried (into (js-obj) foo) but that didn't work
20:47amalloyi hear a lot of people have written a recursive converter, but the above should be fine for a flat map. bear in mind i know nothing about cljs though, aside from what i hear
20:51TimMcDoes anyone have a public cljs REPL up on the web? That is, a REPL that is in a browser page. (I write CLJS, it is sent to the server for conversion, the resulting JS is executed in the browser, and the result is printed as CLJS in the REPL.)
20:54lucianis cljs self-hosted already?
20:55TimMcCan't be.
20:55scottjthere is some clojurescript compiler web service package for the serverside part
20:59amalloyscottj: talking about the one announced on the ML last week? it looked atrocious
20:59TimMcIs the compiler generally safe to run on arbitrary code?
21:00amalloyTimMc: i've pondered that myself, and i can't think of any counterxamples but i'm still not sure
21:00amalloyaside from *read-eval*, of course
21:01TimMcThis is the first time I've seen a compelling demo of multimethods and hierarchy: http://pragprog.com/magazines/2011-07/growing-a-dsl-with-clojure
21:01amalloyTimMc: i wrote another one you might like
21:02TimMcshoot
21:02amalloyhttps://github.com/flatland/depot/blob/develop/src/depot/pom.clj
21:02brehauthaha xml is the perfect usecase for multis :)
21:03amalloyproduces a prxml-style vector for a pom.xml, and uses a "list" type that dependency/exclusion lists derive from
21:04amalloydependency/repository, i guess
21:04TimMcno docstrings ಠ_ಠ
21:04amalloyTimMc: well, there's only one thing you could put a docstring on, right? xml-tags
21:04TimMcyeah
21:04devnyou're in trouble!
21:04amalloyand look, brehaut, it's using partial apply again! that needs to get into useful, stat
21:04devnno docstrings!
21:04brehautTimMc: amalloy only needs one docstring; the one on juxt
21:05TimMchaha
21:05amalloy*chuckle*
21:05devnhah
21:05brehautamalloy: awesome :)
21:05devnthat's really nice.
21:05amalloydevn: i added that!
21:06devn!!! wha!? That's /awesome/.
21:06brehautdevn: the pygments clojure brush is a really nice tool
21:06devnbrehaut: didn't you just work on that?
21:06brehautdevn: nope
21:06brehautive been working on the javascript one
21:06devnwho was that? the ANN about the updated syntax highlighter.
21:06devnah yes
21:07RaynesSyntaxHighlighter != pygments.
21:07amalloygithub's highlighter is pygments, the python thingy
21:07brehautdifferent ends of the toobs
21:07devngot my syntaxhighlighter and pygments mixed up
21:07devn*nod* I've used them both
21:07devnsyntaxhighlighter had some semi-crappy defaults when I last used it
21:07devnhopefully that's changed a bit?
21:07brehautdevn: oh my yes
21:07brehautthe CSS in particular is pretty hoary on syntax highlighter
21:08amalloydevn: https://bitbucket.org/amalloy/pygments-main/changeset/6835410c2c6c#chg_pygments/lexers/agile.py_newline1428
21:08Raynessyntaxhighlighter is a big ol' bag o' crap.
21:08devnbrehaut: yeah, i've been through that
21:08Raynesbrehaut: Why don't you write a syntax highlighter in Clojure?
21:08Raynesbrehaut: 4Clojure (and I) could use that.
21:08TimMcin cljs
21:08devndidnt licenser do that?
21:08devnonce upon a time?
21:08RaynesMan, not everything has to be in cljs just because it exists.
21:08Raynesdevn: Yep.
21:08RaynesWould be something to look at.
21:08amalloyRaynes: wait, why would we want one in clojure? 4clojure should just use brehaut's js brush
21:08licenserdevn: what did I do?
21:08RaynesHasn't been updated or worked in in 10 thousand years.
21:09devnlicenser: you wrote a syntax highlighter for clojure in clojure
21:09licenseryes I did :)(
21:09devn:)
21:09Raynesamalloy: Because why do we want a JS syntax highlighter?
21:09licenserand I am happy to support it if anyone actually wants to use it ;)
21:09brehautlicenser: the smart choice
21:10RaynesDo you not have enough JS to load or something?
21:10brehautRaynes: in that case, whats 700 more lines?
21:10RaynesIndeed.
21:10amalloydevn: actually, i got highlighting of ::foo keywords wrong; i should fix that
21:10devnamalloy: why do you say it is wrong?
21:10devnthey stand out.
21:11licenserif you want the syntax highlighted in js you probably could use clojurescript to convert it :P
21:11brehautlicenser: have you got a link to your highlighter handy?
21:11devnno! your syntax highlighter needs to be its own node.js app!
21:11amalloydevn: well, the fact that other keywords don't stand out is due to github's js
21:11licenserbrehaut: https://github.com/Licenser/clj-highlight
21:12amalloyer, css
21:12brehautlicenser: thanks
21:12licenserbrehaut: if there is something you need from it you can just drop me a query :)
21:12brehauthaha mangler.clj ftw
21:12amalloyif you look at the page, you can see that `:foo` is marked as a "name, constant" (class=no), and `foo` is marked as a "name, variable" (class=nv). they only look the same because github's css doesn't distinguish
21:13brehautlicenser: sure; im mostly curious to see how you wrote it
21:13amalloythe highlighted : at the front of ::foo was not something i intended, i think
21:13licenserbrehaut: sure sure :)
21:13licenserRaynes: also for you if you want to use the highlighter for 4clojure feel free to bug me with updates ;)
21:14devnbrehaut: licenser: haha, mangler.clj indeed
21:14licenserwhat where?
21:14devnhttps://github.com/Licenser/clj-highlight/blob/master/src/clj_highlight/mangler.clj
21:15licenserI fail to see the fun in that - probably that is the funny part about it
21:15brehautits a fun name
21:15devnoh, i rather liked the code
21:15devn:)
21:16licenserah
21:18brehautRaynes: re: why i wrote my brush for syntax highlighter: because clojure isnt the only language i want to highlight on my site, and because i didnt want to write all the dom reading and generating nonsense myself
21:19Raynesbrehaut: I was responding to amalloy when I said "why do we want a JS highlighter". I think your brush is awesome.
21:19brehautRaynes: initially i was just going to use the existing brush to appease technomancy, and then i discovered that i could improve on it by starting from scratch
21:19brehautRaynes: ah right. thanks :)
21:19amalloyRaynes: we already have a js highlighter
21:20amalloyit would be nice to have a less-crappy one instead
21:20RaynesYes, but why would we choose to use it over a decent Clojure highlighter? We wouldn't have to load SyntaxHighlighter or deal with it.
21:20RaynesI can understand why we wouldn't put effort forth to obtain one, but if one already existed and was up to date...
21:21amalloyRaynes: i guess rendering it server-side might be nice. i hadn't really thought of doing it
21:22amalloyit might even be simpler, but it's certainly not easier. with JS, you can just dump it on the page with a "plz render this" note
21:22RaynesHEH
21:23brehautjust whatever you do, dont use the syntaxhighlighter autoloader if you can help it; that thing seems frighteningly inefficent
21:24amalloyi wonder if we're doing that
21:24chouseramalloy: looking at your macro patches. tricky problem.
21:26slyphonso, i'm messing around with apache zookeeper, and one thing you have to do is write an event dispatcher (where you register functions to be called when a node changes), is that something that would be a good fit w/ agents?
21:26amalloythanks! let me know if i can help with something, chouser
21:26brehautamalloy: you arent; the brush is included explicity
21:26slyphoni've done it in other languages w/ a threadpool popping off a queue
21:27chouserslyphon: an agent only has its own queue. if you want multiple threads pulling from a single queue, you'd be better off with an actual java concurrent queue.
21:28slyphonhmm
21:29slyphonmm'kay
21:29chouseragents are primarily a way to manage state. they can be forced into other roles, but tend not to give you the flexibility you'll want.
21:31slyphonthe zookeeper client delivers events on a separate thread, and in my other wrappers I've taken those events and turned them into hashes, then called any number of user-registered callbacks with the data
21:31slyphoni guess that doesn't sound like a great fit
21:33slyphonalso, interop question, how do i get at this interface? http://zookeeper.apache.org/doc/r3.3.3/api/index.html
21:33slyphond'oh
21:33slyphonnvm
21:34slyphonah yes, the nasty '$' weirdness
21:34Rayneschouser: You guys have got to accept his patch, man. If he submits even just one more patch without a resulting Clojure commit, the world is going to implode.
21:35RaynesI don't even care if it's correct.
21:35slyphonhahaha
21:35chouseramalloy: so, I don't fully understand everything that's going on here, but what should this return?
21:35chouser(binding [*print-meta* true] (prn ^{:foo :bar} (let [] ^{:bing :bang} [1 2 3]))
21:36chouserRaynes: he's committing directly to data.xml, for whatever that's worth to the structural stability of the universe.
21:37RaynesThat only saves Jericho.
21:37amalloychouser: certainly it shouldn't include foo/bar. i'm not sure about bing/bang because i don't know if reader meta on collection "code" turns into meta on the collections at runtime
21:37amalloyi'd guess no meta at all
21:38amalloy&(binding [*print-meta* true] (meta ^{:bing :bang} [1 2 3])) ;; that is, it should print the same as this, whatever that is
21:38lazybotjava.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!
21:38amalloy,(binding [*print-meta* true] (meta ^{:bing :bang} [1 2 3]))
21:38clojurebot{:bing :bang}
21:38chouserwhy shouldn't foo/bar be on the vector? I'm clearly missing something about the point of this change still, sorry.
21:39amalloychouser: because that's putting meta on the form, for the compiler to use in interop or other scenarios
21:39amalloynot putting meta on the value at runtime
21:40chouserMmm. ok.
21:40amalloysounds good. i'll go get dinner now that i've got you busy
21:40chouser:-)
21:41Raynesamalloy_: I want dinner.
21:42amalloy_Raynes: fyi you're a jerk for sending me an irrelevant highlight while i'm trying to leave
21:42RaynesI know.
21:54sridwouldn't it be nice if I can filter, process, group, ... irc messages in the REPL? "irc log as data"?
21:55slyphonsounds like a database of some sort is in your future
21:58brehautsrid: raynes has something for you there.
21:59brehautsrid: irclj
21:59brehautregister functions to receive giant maps of irc data
22:00duck1123I learned how to use Sphinx by indexing my wife's irc logs
22:00slyphonsounds like you're kind of the jealous type
22:01sridright. now I need to find a way to "group" conversation. eg: the one between chouser, amalloy_ and Raynes would be one "group"
22:01gfredericksI'd be shocked if I found out my wife had an irc log
22:01slyphonhah
22:01duck1123I didn't look at any of them, but I taught her how to use grep and was looking for a better way
22:02slyphonhah, yeah, it's probably a decent dataset
22:04ajsharpso i'm trying to extract day / month info out of Date objects -- is the best way to do this to use java's Calendar object?
22:05duck1123jodatime
22:06duck1123there's clj-time on top of that
22:07ajsharpduck1123: is jodatime an external package?
22:07duck1123yes
22:09brehautclj-time is a popular wrapper around joda
22:11ajsharpbrehaut: does clj-time work for both dates and times?
22:11brehauti think so
22:11ajsharpcool
22:11brehautit makes joda more straight forward anyway, and has coercion functions
22:11ajsharpgotcha
22:11ajsharpo
22:12ajsharpi'm pretty new to clojure, is there a documentation site for third-party projects?
22:12ajsharpsimilar to rdoc.info?
22:20duck1123not really. It's pretty scattered at this point. usually the docs are linked from the individual github pages
22:21duck1123when all else fails, there's the source and clojure.repl/doc
22:28devnyikes: http://pragprog.com/magazines/2011-07/growing-a-dsl-with-clojure
22:28devnthere are a lot of errors in there.
22:28lucianclojure *needs* to ship with better stack traces
22:28brehautlucian: what counts as better?
22:29lucianbrehaut: almost anything except what it has now?
22:29brehautlucian: constructive
22:29devnlucian: so, i don't disagree, but to play devil's advocate, it has been shipping without great stacktraces for quite awhile and people are using it
22:29devnthey don't actually bother me :X
22:29lucianbrehaut: more relevant to your clojure code
22:30lucianaccurate line numbers, less java machinery
22:30lucianit's just so annoying
22:30brehautive never encounted the line numbers not being accurate except in the repl
22:30brehaut(and then, they probably are, but they dont map to anything meaningful)(
22:30devnajsharp: a lot of the documentation you'll find is in the code.
22:30lucianhmm
22:30devn,(doc +)
22:31clojurebot"([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"
22:31lucianbrehaut: you can't argue they're not worse than Pythons, though
22:31brehautlucian: basicly, i dont like people complaining about removing information from the stack traces
22:31devnajsharp: http://clojuredocs.org has some third party projects included
22:31ajsharpduck1123: cool, thanks
22:31ajsharpdevn: so i can run (doc whatever) from the repl?
22:32devnajsharp: yes, you can also run (source whatever), as long as you're (use 'clojure.repl)
22:32lucianajsharp: find-doc is also useful
22:32brehautlucian: pythons are simpler for sure, but python is also simpler; using imperative idioms implies smaller stacks
22:32devn,(ns-refers 'clojure.repl)
22:32clojurebot{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, unchecked-inc-int #'clojure.core/unchecked-inc-int, ...}
22:32ajsharpdevn: lucian awesome, thanks
22:32lucianbrehaut: that's not the source of clojure's problem, though
22:32devn,(source juxt)
22:32clojurebotSource not found
22:33devnoh right
22:33lucianbrehaut: even strict JS bas better stack traces
22:33devn,(source interleave)
22:33clojurebotSource not found
22:33devn,(source #'clojure.core/interleave)
22:33clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol>
22:33devnwhat am I doing wrong on these?
22:34devnwhy wouldn't clojurebot have that source?
22:34brehautlucian: im not sure what 'better' means
22:34lucian&(source +)
22:34lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
22:34lucian,(source +)
22:34clojurebotSource not found
22:34devn&(use 'clojure.repl)
22:34lazybot⇒ nil
22:34devn&(source +)
22:34lazybot⇒ Source not found nil
22:34lucianbrehaut: you can find the cause, easily
22:34devnmust be a sandboxing thing
22:34lucianbrehaut: it's odd that you're defending a flaw in clojure
22:35devn,(meta #'clojure.core/interleave)
22:35clojurebot{:ns #<Namespace clojure.core>, :name interleave, :arglists ([c1 c2] [c1 c2 & colls]), :added "1.0", :static true, ...}
22:35lucianeven some simple formatting would improve things a lot
22:35devn,(:doc (meta #'clojure.core/interleave))
22:35clojurebot"Returns a lazy seq of the first item in each coll, then the second etc."
22:35brehautlucian: im not defending them per se; i just get sick of people ranting about the stack traces by saying blanket, empty statements like 'they suck. language X is better'
22:35devnajsharp: the above is a slightly more verbose way of getting the docstring for a function, but (source +) should work for you as long as you are using (use 'clojure.repl)
22:36devnerr (doc +)
22:36lucianbrehaut: i only said "language X's stack traces are better"
22:36ajsharpdevn: so i just need to use 'clojure.repl in my source file, and i'll get all these doc functions?
22:36lucianwhich they are, for almost any language except C/C++
22:36devnajsharp: one more thing for you...
22:36devn&(apropos "take")
22:36lazybot⇒ (take-while take-nth take-last take)
22:37devnajsharp: yes
22:37devnajsharp: note that if you're doing it from the ns macro it will be slightly different (ns myproject.core (:use [clojure.repl]))
22:38devnajsharp: vs (use 'clojure.repl)
22:38devn^-(when you're not in the (ns) macro)
22:38ajsharpright
22:38ajsharpi'm a little confused what's going on with the ns macro...do i have to use :use b/c ns takes a hashmap of options?
22:39devnajsharp: actually i dont think you have to use :use anymore
22:39devn(on 1.3)
22:40devnyou can use (ns foo.core (use [clojure.repl))
22:41ajsharpah
22:41ajsharpi see
22:41devnajsharp: but yes, in the past your statement would have held
22:43daakuany moustache users around? i'm wondering how to bind a static path component held in a var and prevent moustache from thinking it's the local name of a bound segment
22:44devndaaku: post the code?
22:44brehautdaaku: ive used moustache a bit. im not quite sure i understand what you are asking though
22:44devn(in a gist if it's long please)
22:44ajsharpdevn: great, thanks for all your help
22:44devnajsharp: np!
22:45daakusomething like: (defn- routes [mount] (app ["admin" mount &] my-handler))
22:45devndaaku: hm, this is old stuff I have but maybe it will help?
22:46devn[#".*\.js" {:get [(file-response "resources/public")]}
22:46devnerr
22:46devn[#".*\.js"] {:get [(file-response "resources/public")]}
22:46daakudevn: i'm not sure i follow how that helps
22:47devndaaku: you said static path component, i thought "file"
22:48devndaaku: ["example" mount] {:get [(fn [req] (my-handler req))]} ???
22:48lazybotdevn: Yes, 100% for sure.
22:49daakuoh, no. moustache is treating "mount" as something it'll bind to. what i'd like is instead to have it use the value of mount as is passed into the function "routes". since (app) is a macro, it seems like i need some way to trigger inlining the value of "mount" instead of passing in the symbol mount. i think
22:50devndaaku: so, I suppose I should have asked this first, but what are you trying to do?
22:50brehautdaaku: the problem you are encountering is that the syntax already has meaning for a symbol. without getting into form mangling, you would probably have to do something like… ["example" [_ #(when (= % mount) %)]] …
22:51brehaut(ie using a validator function for evil)
22:51brehautdevn: sorry
22:51daakubrehaut: that sounds like my problem and solution :)
22:52devnyou know, there was a time, it didn't last long, but there was a time, when this channel was not as active, and I could sit here and spin around in my chair and answer questions in a leisurely manner
22:52devnthose days are over
22:52brehautdaaku: its a horrible solution
22:52daakuagree it's hacky though, isn't this common?
22:52brehauti dont think so
22:53brehautpersonally, id probably write a ring handler for the interstitial step
22:53devnthat's where i was going next
22:53brehautrather than abuse validators
22:53devnsounds like middleware
22:53brehautyeah pretty much
22:53brehautthe only trick is to update the request map so that the inner moustache app gets the correctly abbreviated url
22:53daakuit's basically gonna do the same thing, extract out the segment, compare, and return nil or invoke the handler
22:54amalloydevn: use vs :use has not changed in 1.3 - it's been that way forever, but :use is preferred
22:54brehautdaaku: of course
22:55micryptAnyone know of a clojure riak driver?
22:55devnamalloy: crazy, i've been cargo culting for so long, and I skimmed a recent post about ns macro changes (:require :refer...) which said something about naked require/use in the ns macro
22:55devnamalloy: thanks for the info
22:56amalloywell, that was my groups post
22:56devnis there a good reason why we still err on the side of keywordized use/require
22:56brehautdaaku: if you do use the abused validator, push it out into a named function
22:59brehautdevn: rich likes it?
23:00devnbrehaut: ? "John forgot how much he loved moustache"
23:00devnbrehaut: i did a /me, not sure where you got the idea I was talking about Rich
23:02amalloydevn: <devn> is there a good reason why we still err on the side of keywordized use/require
23:02devnamalloy: brehaut: ahhh, sorry, thought you were responding to moustache love
23:05brehautyeah sorry
23:05brehaut(got distracted by a dog ralphing on the floor in the office)
23:05devnbahaha
23:09brehautit'd be funny if it werent for the smell
23:09amalloybrehaut: and the rest of us can't smell it, so...
23:09brehautamalloy: feel free to laught it up
23:09brehauts/t //
23:09gfredericksHuh. Apparently you can even use strings in the use/require expressions.
23:11amalloygfredericks: it's just calling name
23:11gfredericksyeah I figured so.
23:12gfredericksI'm gonna start sticking strings everywhere just to see what works
23:12amalloythat's pretty funny, though. gives you a little creative license in your namespaces
23:12gfredericksthe namespace name can't be a string
23:12amalloy("use" some-lib-we-dont-really-need)
23:13gfrederickshaha
23:14gfredericksthe ironic :use
23:24gfredericks("require" [clojure.string "as if" i-cared])
23:25amalloy("refer" [clojure.xml :only []]) ;; because xml is a buzzword
23:27gfredericks:D
23:27keith_is there a way to serialize several versions of a map and take advantage of their shared structure?
23:31amalloykeith_: probably if you use java serialization it Just Works
23:32keith_oh wow thats brilliant, I didn't even think of that
23:42devnhm, a lib using clojure.contrib.pprint is blowing up on missing ^:dynamic annotations
23:43hiredmanold lib
23:43devnwhat's the right course of action here?
23:43hiredmanclojure.contrib.pprint has been defunct since 1.2
23:43devn(to get it to 1.3)
23:43hiredmanpprint has been clojure.pprint since 1.2
23:44devn*nod* -- but it has 26 of the 38 things clojure.contrib.pprint had
23:44hiredmanyes
23:44hiredmanso the library you are trying to use is dead
23:45hiredman(if it wasn't, you'd assume it would have been fixed sometime in the past year)
23:45devnI'm trying to fix it.
23:45hiredmanso, fork and fix or don't use it
23:45devnlol, yes.
23:47devnhiredman: i'm asking about fixing errors between old pprint and new pprint
23:49devnnvm
23:54seancorfieldand presumably you're relying on some of those missing 12 things?
23:56ibdknox_hm, I must've left my IRC at work on... whoops