#clojure logs

2010-08-28

00:12slyrusit took me a little while, but: (defmacro defn* [fn-name & rest] `(intern (symbol ~(namespace fn-name)) (symbol ~(name fn-name)) (fn ~(symbol (name fn-name)) ~@rest)))
00:12slyrusseems to do what I want
00:13slyrus(defn* chemiclj.core/make-atom ...)
00:15slyrusyeah, that's great, except for the NPE on a clean restart. hmm ):
00:18slyrusah, no graceful failure if I don't provide an ns-qualified fn-name
00:18greghping
00:19gregherp
00:48slyrusin case you want to read my writeup of the ns hackery: http://slyrus.github.com/2010/08/27/chemiclj-namespaces.html
02:00tomojanyone else still getting the 'default-repos does not exist' error with native-deps 1.0.3?
02:02tomojoh, hmm, default-repos does exist.. strange
02:19notsonerdysunnywhat does this mean? I created the jreality-native-deps clojar.. When I fetch the library via "lein deps" I get.. [WARNING] POM for 'org.clojars.sunilnandihalli:jreality-native-deps:pom:0.1:compile' is invalid. It will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project
02:19notsonerdysunnycan anybody tell me what this means?
02:21notsonerdysunnyI get a NullPointerException when I run "lein deps" without doing a "lein clean" .. is this expected?
02:21tomojyou have modelVersion 0.1 in your pom
02:21tomojit should be 4.0.0
02:23notsonerdysunnythanks tomoj
02:25notsonerdysunnytomoj I get a NullPointerException when I run "lein deps" without doing a "lein clean" .. is this expected?
02:26tomojI got that too a bit ago with overtone
02:26tomojit's certainly not intended behavior though..
02:27tomojdoesn't seem to affect all projects, so I don't have a clue where the bug is
02:28notsonerdysunnyoh ic
02:28notsonerdysunnyhmmm
03:04bortrebhow can I make an array of chars in clojure?
03:05bortrebnm -- it's (into-array Character/TYPE (seq "sdfasf"))
03:06fliebelmorning
03:12slyrusbortreb: or (char-array "this-is-crazy")
03:14bortrebnice --- I like char-array
03:19notsonerdysunny,(char-array "this-is-crazy")
03:19clojurebot#<char[] [C@793a99>
03:20notsonerdysunny,(vec "this-is-crazy")
03:20clojurebot[\t \h \i \s \- \i \s \- \c \r \a \z \y]
03:20slyrus,(aget (char-array "this-is-crazy") 0)
03:20clojurebot\t
03:22notsonerdysunnyis clojars slow? I am trying to scp a clojar and been unsuccessfull... :(
03:22notsonerdysunnyclojars.org
03:42notsonerdysunnyis there an alternative to clojars.org where I can upload my jars?
03:47seangroveWhat is a ctor?
03:47seangroveclojurebot: help?
03:47clojurebothttp://www.khanacademy.org/
03:47bortrebconstructor
03:47seangroveThanks
03:47bortrebnp :)
04:14notsonerdysunnywhen I searched for jogl on clojars .. I found a bunch of them .. does anybody have a suggestion as to which one to use?
04:47seangroveHow would I generate a sequence of integers from 0 to 1000?
04:47seangroveAnd yes, this is project euler related :)
04:49seangrovegot it
04:49seangroverange
05:11fliebelAnyone knows a project euler challenge that does challenge my Clojure skills, but not so much my math skills? I want to warm my fingers with some Clojure without cracking my brain on math.
05:22mrBlissfliebel: I find these problems https://sites.google.com/site/prologsite/prolog-problems/1 most of the problems can be solved with an already existing clojure function, but try it using only recursion, first, rest and cons
05:22mrBlisss/find/like/
05:22sexpbotfliebel: I like these problems https://sites.google.com/site/prologsite/prolog-problems/1 most of the problems can be solved with an already existing clojure function, but try it using only recursion, first, rest and cons
05:24fliebelmrBliss: I'll have a look
05:30fliebelwhat's the opposite of butlast?
05:32arbschtin which sense?
05:32fliebelsomething that returns the list except for tis first item.
05:32mrBlissfliebel: do you mean rest
05:33fliebelyea..
05:34fliebelI really miss slices in Clojure. In python you can do all this stuff with slices.
05:35mrBlissfliebel: write your own slice function with concat, drop and take
05:36fliebel*looks up the docs* This how I'd do it in Python: range(100)[-2::-1]
05:40fliebelmrBliss: I can see you you could do the start and lenghts part of a slice, but negative numbers and the step parameter requires some more magic.
05:40mrBliss,(doc range)
05:40clojurebot"([] [end] [start end] [start end step]); Returns a lazy seq of nums from start (inclusive) to end (exclusive), by step, where start defaults to 0, step to 1, and end to infinity."
05:43fliebelmrBliss: Yea, but that is only for a generated range, not for any random seq.
05:44mrBliss,(find-doc #"nth")
05:44clojurebot------------------------- clojure.contrib.seq/rand-elt ([s]) DEPRECATED. Prefer clojure.core/rand-nth. Return a random element of this seq ------------------------- clojure.contrib.seq-utils/rand-elt ([s]) DEPRECATED. Prefer clojure.core/rand-nth. Return a random element of this seq ------------------------- clojure.core/nth ([coll index] [coll index not-found]) Returns the value at the index. get returns nil if index out
05:45mrBlissfliebel: try (find-doc #"nth") in your repl, you'll see some better functions than the ones clojurebot knows
05:45fliebelmrBliss: Thank you :)
05:47fliebelmuhahaha! my very inefficient palindrome list calculator
05:47fliebel,(let [l [1 2 3 4 5 5 4 3 2 1]] (every? #(= (first %) (last %)) (map vector l (reverse l))))
05:47clojurebottrue
05:48fliebelAny better solutions?
05:49mrBliss(if (< (count l) 1) true
05:49mrBliss (and (= (first l) (last l)) (recur (rest (butlast l)))))
05:51fliebelmrBliss: Let me chew on that… if… recur… chop… lenght…. sounds like a nice solution
05:53fliebelI can't figure out how recur works in this context...
05:54mrBlissfliebel: calls the same function again
05:54fliebelwhich function?
05:54mrBlissoh yeah, wrap it in (defn palin? [l] ...)
05:55fliebelah, that was the missing part of the puzzle.
05:55mrBlissfliebel: sorry about that. Some microbenchmarks point out that your functions is actually faster
05:55mrBlisss/functions/function/
05:55sexpbotfliebel: sorry about that. Some microbenchmarks point out that your function is actually faster
05:56fliebelmrBliss: Mine can actually be made twice as fast by chopping l in halg
05:56fliebel*half
05:57mrBlissfliebel: butlast is linear, that's probably why mine is slower
05:57mrBlissfliebel: yours is quite clojure-y, mine is more scheme-y
06:01fliebelmrBliss: This looks more like it:
06:01fliebel,(let [l [1 2 3 4 5 5 4 3 2 1]] (every? #(= (first %) (last %)) (map vector (take (/ (count l) 2) l) (reverse (drop (/ (count l) 2) l)))))
06:01clojurebottrue
06:02fliebelhooray fro readability :D
06:03mrBlissfliebel: nice
06:04fliebelmrBliss: Only due to integer devision [1 2 3 4 5 666 5 4 3 2 1] also returns true.
06:04mrBlissfliebel: that list is palindromic
06:04fliebelYou're right
06:05fliebelSo what I was saying… due to the fantastic integer devision this even works for odd lenght lists :DF
06:06mrBlissfliebel: very clever ;-)
06:17patrkrisis there anything inherent to Vim that makes it more difficult to create a SLIME-like thing? is emacs better suited for that?
06:17patrkrisjust wondering
06:21ChousukeAs far as I know the main reasons are that 1) vimscript sucks and 2) that vim is not really designed to interact with external programs.
06:21patrkrisah
06:21patrkrissad thing with vimscript
06:22patrkrisnever wrote much in vimscript besides what goes in .vimrc and various ftplugin files
06:22patrkrisChousuke: do you use emacs or vim for clojure development?
06:22Chousukeemacs
06:23ChousukeI mostly use vim only for quick edits nowadays.
06:24incandenzaqq
06:24incandenzaoops
06:25kwertiiEmacs is actually a general-purpose Lisp interpreter that happens to come with some text editing programs preloaded. Vim is "just" a text editor
06:26patrkris:)
06:26Chousukeostensibly :P
06:27patrkrisi have often thought about learning emacs, but I think I'm turned off by the meta-key thing
06:27patrkrisi would hate having to hold Ctrl or Alt all the time
06:27ChousukeThere's actually a vi emulator for emacs.
06:27patrkrisbut that's probably one of the main gripes by most users
06:27patrkriscoming from vim
06:27patrkrisyeah, heard about that
06:27fliebelyay, next problem solved:
06:27fliebel,(let [l [1 1 1 2 3 3 1 1 4 4 4 4]] (reduce #(if (= (last %1) %2) %1 (conj %1 %2)) [(first l)] (rest l)))
06:27fliebelChousuke: Nice word to use… I learnt that word while reading an xkcd comic about lisp. (i'm dutch)
06:27clojurebot[1 2 3 1 4]
06:27Chousukebut it doesn't work so well with most plugins :/
06:28fliebelclojurebot: just in time ;)
06:28clojurebotmultimethods is what separates the boys from the men.
06:28kwertiipatrkris: if you do take the plunge, it's _far_ easier to use if you swap Ctrl and Caps Lock, like on a Sun keyboard
06:28ssiderisgood morning
06:28fliebelmorning
06:29patrkriskwertii: yes, but right now I have CapsLock mapped to Esc because of Vim :)
06:29kwertiipatrkris: ugh :)
06:29patrkriskwertii: actually non-trivial to get working on Apple hardware
06:30patrkriskwertii: but essential for Vim I think
06:30fliebelOF WHAT USE IS CAPSLOCK ANYWAY, EXCEPT FOR CLAIMING IT'S STUCK?
06:30kwertiiI dream of owning a USB space cadet keyboard someday. the one with Alt, Meta, Super, Hyper, etc. keys
06:31patrkrishah
06:32LuytYou could use a Windows keyboard and relabel the Windows and Menu keys
06:33kwertiiLuyt: It wouldn't be the same :)
06:33kwertiiand anyway I need more keys than that
06:33Luytnot really no... the space cadet keyboard also weighted 10 kilos and was made with steel plating
06:34kwertiiLuyt: ... adding considerably to its awesomeness
06:35LuytI still have a 25 year-old PC AT keyboard
06:35kwertiiI wonder how much it'd cost to do a production run of ergonomic USB space cadet keyboards
06:37fliebelkwertii: I bet there is a huge market of vim users for them. You should do it :)
06:37kwertiiLuyt: can you get a usb adapter for that?
06:37LuytNot sure. It has a big DIN connector. Somewhere I must have an adapter cable from large DIN to small DIN.
06:40fliebelwhat? lambda is actualy a greek letter?
07:07ssiderissooo
07:07ssiderisI have this record:
07:07ssideris(defrecord (point) [coords colour])
07:07ssiderisand then I have this (test) function:
07:08ssideris(defn look-at-point [{[x y z] :coords, [r g b a] :colour}] ...
07:08ssiderisseveral print statements follow
07:08ssiderisis there any way to avoid putting this whole destructuring thing in every function that deals with points?
07:08ssideriscan I reuse it?
07:15mrBliss"Alias s already exists in namespace user, aliasing clojure.contrib.string", how do I remove an alias for a namespace without restarting my repl?
07:15mrBlissns-unmap doesn't help
07:25hoeckmrBliss: ns-unalias
07:25incandenzans-unalias ?
07:26mrBlissthanks, quite obvious
08:40arnorhshey guys
08:40arnorhsI'm a n00b trying to start using clojure
08:40arnorhsAnd I haven't done any java development in 10 years and never any web development
08:41arnorhsI've got clojure running
08:41arnorhsso far so good
08:41arnorhsbut can you recommend a good guide for doing web development in clojure
08:43kilofuI'm not much more than a noob myself
08:43kilofubut I've been hearing good things about compojure
08:44arnorhsis that a framework?
08:44kilofuya
08:44kilofua minimal framework
08:45arnorhsI come from a PHP background and I don't know what type of webserver you run clojure through or how it works
08:45arnorhsCan I use apache?
08:45arnorhsI runs as a process, right?
08:46mrBlissyou can use different webserver for compojure, but I think jetty is the default
08:46mrBlisshttp://weavejester.github.com/compojure/
08:47mrBlisss/webserver/servers/
08:52arnorhsjetty
08:52arnorhsok, that's what I was looking for
08:52arnorhsand lein is like gem for ruby or something?
08:53mrBlissnot entirely
08:53mrBlissI don't fully know gem, but lein is only for your own projects
08:53mrBlissyou don't install programs with it, only libraries
08:53arnorhsahh ok
08:54mrBlisshttp://github.com/technomancy/leiningen
08:54arnorhsyeah, I've got that set up
08:55mrBlissI don't really know Rake, but it looks like Ruby's leiningen
08:56arnorhsI don't really know ruby :)
08:56arnorhsI've just dabbled around in it
08:56arnorhsdidn't seem to be that much it had to offer over php
08:56arnorhssyntax wise
08:56arnorhsI've been writing really weird php code for years anyways
08:57arnorhsusually my code becomes really long lines of stuff and I'm always trying to help my self write as less code as possible
08:57arnorhsand there's just stuff in the syntax that I'm really tired of
08:57arnorhsthat I can't shorten
08:57arnorhsI'm a slow typer and I hate writing a lot of code to do simple things
08:57arnorhsI'm hoping clojure will help me :P
08:58arnorhsSince clojure code looks like my php code
08:58mrBlisswhat do you mean? it looks the same?
08:59arnorhsI do everything in arrays in PHP
08:59arnorhsI have a lot of magical array functions that I've used and do a lot of function callback hacking and stuff like that
08:59arnorhsphp's arrays are really powerful and 99% of php developers don't know how to use them right
08:59arnorhsAnd I'm not a big fan of OO programming
09:00arnorhsI used to, when I started out and was in school
09:00arnorhsbut through the years I've gradually written fewer and fewer classes
09:00arnorhsat least smaller
09:00mrBlissIt annoys me that you can't do get_array()[0] in PHP (till recently)
09:00arnorhsyeah, that's true
09:00ssiderisarnorhs: if you like to write concise code, i think you'll like the fact that clojure has macros
09:01arnorhsyes, I've been looking at a lot of clojure examples
09:01mrBlissever played with another lisp?
09:01arnorhsand they look powerful
09:01arnorhsno
09:01arnorhsI tried classic lisp, don't remember what it was, ANSI lisp maybe?
09:01arnorhsanyways
09:01arnorhsthat was a long time ago
09:01mrBlissExactly my experience: http://xkcd.com/224/
09:02arnorhsAnd it was horrible with all the different compilers out there and everything was just so much trouble
09:02arnorhsI got inspired to write lisp first a few years ago when I read PG's hackers and painters essay
09:02arnorhsand dabbled around
09:02arnorhsbut that pretty much sucked :P
09:03arnorhsmrBliss: that's a good one :P
09:03arnorhsI've been hearing about clojure a lot lately, but I didn't realize it was a lisp
09:04arnorhsI didn't know what it was
09:04mrBlissI enjoyed these videos by Rich Hickey: http://clojure.blip.tv/posts?view=archive
09:05mrBlissStart with the "Clojure for {Lisp,Java} Programmers" depending on your background
09:05arnorhshey, awesome
09:05arnorhsgreat
09:05arnorhsthanks
09:14notsonerdysunnyHello everybody.. I want to configure my leiningen to download http://download.java.net/maven/2/net/java/jogl/jogl/1.1.1-rc6/ .. how can I add it to the list of repositories?
09:28arnorhsAre you guys using jetty?
09:28arnorhsis there a lot of difference between jetty 6 and 6 ?
09:28arnorhsis there a lot of difference between jetty 6 and 7 ?
09:29notsonerdysunnyHow can I add the repository above ?
09:29notsonerdysunnyto leiningen
09:39emhI know you can implement protocols on interfaces (for other protocols), but this is not good if you're not dealing with Java compatibility, because interfaces is a host implementation detail, right?
09:40emhand say I have a protocol for printing something, and I implement it on at Set and a Graph interface, then what happens if a type implements both Set and Graph?
09:42emhbest way is to always implement protocols in the concrete types, and use default mixins for things that are implemented using other protocols that the concrete type implements? just checking that my understanding is correct
09:57raeknotsonerdysunny: http://github.com/technomancy/leiningen/blob/master/sample.project.clj see key :repositories
09:59raekyou probably want to add the repo root directory or something (maybe http://download.java.net/maven/2/ ), but I don't know the details
09:59notsonerdysunnythanks raek
10:01arnorhsI can't even get this jetty thing working
10:01arnorhsI think my java inabilities are holding me back
10:01arnorhsmayb clojure is just fun for java developers
10:02arnorhsit seems most of the documentations and everything is made for people moving out of java
10:02mrBlissdid you follow this: http://weavejester.github.com/compojure/docs/getting-started.html ?
10:03mrBlissno need to install jetty
10:03arnorhshmmm
10:03arnorhsahh
10:03mrBlissit's not like apache and php
10:03mrBlissjetty is a server, but it's just a java process
10:04arnorhsahh ok
10:04arnorhsso the clojure process itself becomes the webserer
10:05arnorhsthen everything that the webserver has to be able to, must be implemented by the library or your own code?
10:05mrBlissjava
10:05mrBlissright
10:05mrBlissimo a cleaner approach than apache+php
10:06arnorhsThe best thing about apache is that it handles all the hard stuff about running a webserver
10:06arnorhsall the threading
10:06arnorhsand development becomes so easy when it's all request based
10:06arnorhsI do realize that this will not work the same way
10:06mrBlisscompojure does this for you
10:06arnorhsit will be interesting
10:06mrBlissyou write the routes and the request handlers
10:14arnorhsok, there is a reference to jetty in the project configuration example that the compojure doc has
10:14arnorhsdoes that mean jetty has to be installed? because I uninstalled it ? :P
10:15raekno, leiningen will pull down the needed jars
10:15raeksince compojure has it as a dependency
10:15arnorhswow, there's some magic happening
10:16mrBlissin your project dependencies, you'll probably have ring-jetty-adapter
10:16mrBlissthese are the dependencies or ring-jetty-adapater: http://github.com/mmcgrana/ring/blob/master/ring-jetty-adapter/project.clj
10:16raekhrm, yes. maybe that is not a dependency of compojure anymore....
10:16raekI use moustache for the routing instead of compojure nowadays
10:17raekanyway, Ring does most of the stuff anyway
10:21arnorhshmm
10:22arnorhsI executed: lein repl src/arnorhs/core.clj and I got this error:
10:23arnorhsarnorhs@ubuntu:/opt/clojure/projects/arnorhs$ lein repl src/arnorhs/core.clj Wrong number of arguments to repl task.
10:23arnorhsand Expected ([project])
10:24mrBlissare you in lein project folder (containing a project.clj)?
10:25arnorhsyes
10:26arnorhswait sorry
10:27arnorhsI copy pasted the example code but it has a reference to the project name
10:27raekarnorhs: you don't specif the file name as an argument
10:28raek-ify
10:28raeklein repl
10:28arnorhsoh
10:28raekand then (require 'arnorhs.core)
10:28raekand maybe (in-ns 'arnorhs.core)
10:29arnorhsyou're right
10:29arnorhsworking
10:29raekI've heard about a new "lein run" command that can be used to run a file as a scriåt
10:29raek*script
10:29arnorhsthe compojure guide showed it like that: http://weavejester.github.com/compojure/docs/getting-started.html
10:29arnorhssomebody needs to edit that guide
10:30raekhrm, maybe a new feature in leiningen
10:30arnorhsno wait
10:32arnorhsawesome
10:32arnorhsHello World Wide Web!
10:32arnorhsthanks a lot raek
10:32arnorhswhen I make source code modifications, do I always have to type in those two commands?
10:33arnorhslein repl and then (require 'arnorhs.core)
10:33mrBlisswhich editor are you using?
10:33arnorhscurrently just gedit
10:34arnorhsI can also use emacs
10:34mrBlissthat would be perfect!
10:34raekarnorhs: no, just paste the updated code into the repl
10:34raekyou don't need to restart the server
10:34mrBlissinstall clojure-mode, slime and slime-repl
10:35mrBliss(via ELPA)
10:35raekif you use emacs with slime, just use C-x C-e to send the current form to evaluation
10:36mrBlissOr C-c C-k to compile the whole buffer
10:36raekor C-M-x to evaluate the top level form containing the point (usually a def)
10:37raekyou can do a (require 'arnorhs.core :reload) in the repl to reload the whole file
10:37raekbut then surround the server call in something
10:38raek(defonce server (run-jetty example {:port 8080, :join? false}))
10:38raekno wait, this is better (defonce server (run-jetty #'example {:port 8080, :join? false}))
10:42raek(since if you would redfine example, the server would use the new one automatically)
11:10arnorhsmy god, a lot of things to learn/install just to start programming :)
11:10arnorhsI followed the guide here: http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Emacs
11:10arnorhsand thereby configured lein repl to be the inferior lisp or whatever
11:11arnorhsand I got the clojure.core> prompt inside emacs
11:11arnorhsand could run my little application
11:11arnorhsso far so good
11:11raekI usually do "lein swank"
11:11raekand then connect to it with "M-x slime-connect"
11:12arnorhswhat does that do?
11:12raekworks out of the box, no config required
11:12raeklein swank starts a repl server that slime can use
11:12arnorhsthis ? http://github.com/technomancy/swank-clojure
11:12raekah, yes
11:12arnorhsgoddamnit, so many things to learn
11:13arnorhsneed to go help my brother move
11:13arnorhsbrb
11:13raekthe way you did it is build-tool independent
11:14raekbut when you do multiple projects which may have dependencies, you will most likely want to use some build tool (like leiningen)
11:14BahmanHi all!
11:14raekarnorhs: my repertoire for setting up everything:
11:15raek1) get emacs and install clojure-mode, slime and slime-repl through elpa
11:15raek2) get leiningen
11:16raek3) create a leiningen project and add :dev-dependencies [[swank-clojure "1.2.1]]
11:16raek4) run lein deps and lein swank
11:16raek5) start emacs and connect with M-x slime-connect
11:16raekdone!
11:17raek(this installs clojure and contrib too, as they are added as dependencies)
11:17raek(dependencies are added to the project.clj file)
11:18raek(a leiningen project skeleton can be created with lein new)
11:21raekthis is of course opinionated towards emacs+leiningen
11:23raekyou can use pretty much any combo of {Netbeans, Eclipse, Idea, Emacs, Vim, Textmate} x {Leiningen, Maven, Gradle, Cake, Cljr}
11:24qbgHmm. I found a typo in The Joy of Clojure
11:26qbgTable of contents -> Part 1 -> 2: "Firehos" should probably be "Firehose"
11:27bobo_qbg: they would probably be happy if you added it: http://manning-sandbox.com/forum.jspa?forumID=624 there
11:34rosejnanyone have advice for tracking down a java.lang.ExceptionInInitializerError?
11:34rosejnTrying to move to 1.2, and it's coming up in code that previously loaded fine.
11:36chouserrosejn: can you get a stack trace?
11:37rosejnyeah I can, but it doesn't say much
11:37rosejn1 sec and I'll get it
11:39rosejnhttps://gist.github.com/60138f739bc0b7ebec47
11:39rosejnThat's the stack trace
11:43raekwhat's at line 2 of ugen.clj?
11:44rosejnhttp://github.com/overtone/overtone/blob/clj1.2/src/overtone/core/ugen.clj
11:44rosejnA doc string
11:45raekstrange
11:45raekyou're not using incompatible versions of, say, clojure and contrib or something?
11:45raekor aot-compiled libs?
11:46raekor openjdk?
11:46rosejnI'll check
11:46rosejndon't think so
11:50rosejnhuh... I removed the classes directory and the error went away
11:50rosejnnot entirely comfortable that this should happen though
11:54raekit seems like you have done a "lein compile" at some point
11:56rosejnDoes that happen automatically when you "lein jar"?
11:57rosejnSo the compiler doesn't recognize if code has changed it needs to reload from source?
11:58raekin what situation?
11:59raekI'm not certain if lein jar runs lein compile
11:59raekI have not used that function much
11:59raekanyway, classes/ is added to the classpath
12:00RaynesI don't think lein jar will compile anything unless you ask it to in your project.clj
12:00RaynesIf it does, I've certainly never noticed it.
12:00RaynesBut if you have old compiled files in classes/ for whatever reason, you can definitely expect weirdness.
12:00raeksince you might have, for example, java code that needs to be compiled and available on the classpath for the repl
12:01rosejnok, so basically you have to delete classes all the time before re-running code?
12:02rosejnas in the "classes" directory
12:03raekafter you have AOT-compiled source, yes
12:03raekwhich you mostly only do when you release a package
12:03raekthe internal clojure compiler does not output class files to the classes/ dir
12:05raekfor example, (fn [] "foo) is compiled and generates a class under the hood, but it isn't stored in any file
12:07RaynesMost of the time, you don't have to AOT compile code. The only time you really have to do that is for serious Java interop purposes (a la gen-class).
12:08chouserrosejn: (sorry, stepped out) That stack trace is incomplete.
12:08chouser(e) only returns the root cause, which is almost always insufficient for compile-time errors
12:09Raynes._.
12:09RaynesI guess we frightened him.
12:09raekbtw, will (.printStackTrace *e) print the full stack trace?
12:09chouserraek: yes
12:09opqdonutnot the causes though?
12:27leafwanybody knows if kotka's memoize functions made it into clojure libs? Or contrib?
14:08chouseropqdonut: the full stack trace and the full chain of causes. (.printStackTrace *e) prints everything
14:09opqdonutok
14:09opqdonutwas the behaviour different earlier or am I misremembering
14:16arohneropqdonut: clojure.stacktrace/print-stack-trace doesn't print causes
14:16opqdonutah
14:16arohnerbut c.stacktrace/print-cause-trace does
14:17arohner(stupid, IMO)
14:17opqdonutyes
14:17opqdonutthat was it
14:17opqdonutIMO too
15:05arnorhsslima
15:05arnorhsslime
15:09arnorhshow do I stop "lein repl" inside my emacs?
15:09arnorhskillall in command prompt? :P
15:09LauJensenAnybody here had problems with uberjars not being able to run, because they are not able to establish the root binding of *warn-on-reflection* ?
15:10arnorhsis there a command i can execute?
15:10LauJensenarnorhs: ,q
15:10LauJensenoh sorry, you wanted to kill the lein repl
15:10LauJensen(System/exit) ?
15:10arnorhsyes
15:10arnorhsand some command to execute?
15:12raekarnorhs: I suppose you could kill the *inferior lisp* buffer
15:12LauJensenarnorhs: if you hit "(System/exit 1)" in the repl, doesn't the jvm die?
15:12raeklein repl starts a clojure process outside emacs, so what did you mean?
15:12arnorhsahh I see
15:13raekI recommend using slime + swank
15:13raekthen you can basically control everything from emacs
15:13arnorhsI don't know why I'd only want to control 50% from emacs
15:14arnorhseither everything or just run from command prompt
15:14arnorhsthis is just confusing as hell
15:14arnorhsI'll just uninstall everything, use the syntax highlight and run clojure from the command prompt
15:15fbru02I want to code a simple function to emulate a python generator, what's a good way to incremente a local on each call of the generator ?
15:15ssiderisarnorhs: you'll be missing the interactivity like that
15:15arnorhsssideris: I'll have to start somewhere
15:15LauJensenfbru02: iterate?
15:15ssiderisarnorhs: yeah ok start like that if the setup is too much for you right now, but keep in mind that there is more
15:15fbru02LauJensen: yes basicaly
15:16raekI find it useful to be able to edit one definition and only reevaluate that one when I'm done with it
15:16ssiderisarnorhs: for example, if you setup swank+slime, you'll be able to re-write a function and replace it in your program without restarting your program at all
15:16arnorhsAnd so far.. with java, jetty (which I didn't have to worry about), emacs package editor, lisp syntax highlighting, installing clojure, installing leiningen, compojure...
15:16ssiderisarnorhs: replace it as in "hot" replace
15:17arnorhsit's just a large chunk of stuff to eat and understand in a single afternoon
15:17somniumfbru02: the idiomatic way is to use a lazy sequence (like from iterate), but its possible to use atoms and closures to be purposefully mutable
15:17ssiderisarnorhs: agreed :-)
15:17arnorhsI just want a simple hello world at this point
15:17arnorhs:P
15:17fbru02somnium: cool, i was just openning the page on that in clojure.net thanks
15:17arnorhsSo, emacs+code highlighting, and lein is fine for me
15:17raeka repl in a terminal can be a good start :)
15:18arnorhsyes, I'll ask you guys about the emacs magic after a week
15:18raekbut when writing longer pieces of code, the interactivity becomes very neat to have
15:18arnorhsI'm also using desktop linux for the first time in 8 years :)
15:19arnorhsok, when that becomes an issue/problem, then I'll appreciate it
15:20arnorhsThanks for all the help raek and everybody
15:20arnorhsIt's been super helpful
15:20raekarnorhs: how far did you get? did you ever use slime-connect?
15:20arnorhsno, not slime
15:20raekhow did you run things in emacs?
15:21arnorhsI was about to install it, I saw the lisp script needed to install on http://common-lisp.net/project/slime/doc/html/Installation.html#Installation
15:21arnorhsthe inferior lisp program, I don't know the location? would that be "lein repl" or?
15:22raekthe easiest way, I think, is to use ELPA to get clojure-mode, slime and slime-repl
15:22raekit's very automatic
15:22ssiderisarnorhs: i think the stable way to do it is to run "lein swank" from a console and then run "slime-connect" from emacs
15:22LauJensenraek: Last time I tried it failed
15:22arnorhscan you use elpa also to get slime and slime-repl?
15:22LauJensenarnorhs: yea
15:22ssiderisraek: i never got as far
15:22arnorhswhat was swank again and why do I need it?
15:23raek"swank" is the server that the "slime" client connects to
15:23Bootvishow can you use (read-line) in a repl?
15:23raekor "swank-clojure", more accurately
15:23ssiderisyeah "swank" can refer to any such server (for other lisps etc)
15:23raekbasically, you start a swank server outsite emacs with, for example, lein swank
15:24raekand then connect to that with emacs (using M-x slime-connect)
15:24arnorhsI'm sorry but I'm reading your text but the information is just not parsing
15:25arnorhsI might be too dumb for clojure in general
15:25arnorhswhat does slime do again?
15:25raektalk to swank
15:25ssiderisslime is the emacs extension for developing lisp
15:26arnorhsI thought that was the clojure-mode I installed
15:26raekclojure mode is syntax highlighting and indentation
15:26raekit does not give you a repl in emacs
15:26arnorhsok
15:26raekthat is what slime does
15:27raekyou could think of swank as a "repl server" and slime as a "repl client"
15:27arnorhsOk and if slime does that, why do I need swank?
15:27raekbut it can do more that just the repl...
15:27arnorhsahhh
15:28raeklike a web browser (client) and a web server
15:28ssiderisswank is like an instance of clojure sitting around waiting to be send commands from slime
15:28arnorhshmm.. so swank is the thing that's controlling the clojure process (somehow through lein) and slime is the client that connects to that process to insdert the new updated code into it
15:28ssiderisyes!
15:28arnorhsso when I make modifications etc, I use slime to inject it into swank, the controller of the server
15:29raeklein is a tool for, amon other things, starting clojure processes with the right CLASSPATH stuff
15:29arnorhsbecause java is too uncomfortable to work with out of the box?
15:29raekswank-clojure is actually an ordinary clojure library
15:30arnorhsand it also generates the project files and handles dependencies etc of java/clojure libraries
15:30raekyes
15:30rmarianskii'm trying to create a simple implementation of something seqable, but i'm running into some issues
15:30rmarianskihttp://pastie.org/1122898
15:30rmarianski(first (FooSeq. 7))
15:30rmarianskiseems to work
15:30rmarianskiso does (first (next (next (FooSeq. 8)))
15:31rmarianskibut, i can't use the other seq functions with it
15:31rmarianskilike take
15:31raekwhen I set up emacs and stuff last time I did it like this:
15:31rmarianski(take 3 (FooSeq. 8))
15:31rmarianski> ([:x 8])
15:31rmarianskianyone have any ideas?
15:32arnorhsraek: you should make an online guide for setting everything up that you need for proper clojure web development
15:33ssiderisrmarianski: i think that defrecord is more for map-based types, maybe deftype is more appropriate for your case
15:33rmarianskissideris: when i try that, i get an error message:
15:33rmarianskiNo message. [Thrown class java.lang.AbstractMethodError]
15:33raek1) installed emacs 2) installed elpa by pasting the code at http://tromey.com/elpa/install.html in the *scratch* buffer and evaluated with C-x C-e 3) install clojure-mode, slime and slime-repl from the M-x package-list-packages menu
15:34raekarnorhs: I should probably do that...
15:34rmarianskimaybe it's because it doesn't know how to print out the type?
15:34rmarianski(the repl that is)
15:35rmarianskii get the same error when i try to explicitly print an instance of the type
15:35arnorhsah ok, you can use the package manager to set all that up.. interesting
15:35arnorhswhat about swank?
15:35arnorhsyou need to install that outside of emacs, right?
15:35ssiderisarnorhs: lein takes care of that, you just list it the dev-dependencies
15:36rmarianskiadding a toString to it doesn't seem to be help, so maybe it's something else
15:36arnorhsahh, right
15:36raekexactly, you dont have to install it
15:36raekit is a dependecy, just like clojure and contrib
15:37raeklein deps will fetch the versions specified
15:37ssiderisrmarianski: not sure, haven't worked much with records and types yet
15:37arnorhsso just add :dev-dependencies [[swank-clojure "1.2.1"]] to all your projects
15:37rmarianskissideris: ok, thanks ... i appreciate it
15:38raekarnorhs: I usually start with something like this: http://gist.github.com/555485
15:39rmarianskissideris: would you happen to know where in the clojure codebase the java collections are made seqable?
15:40rmarianskii figure that might give me some clues
15:40ssiderisrmarianski: they are a different implementation
15:40arnorhsraek: except I also have compojure
15:40ssideristhey are not java collections at all
15:40arnorhs+ jetty
15:40rmarianskissideris: right, but i can seq a java.util.ArrayList for example
15:40rmarianskithat's very similar to what i'm trying to do
15:41raekjust wanted to provide the minimal getting started with emacs project file...
15:41ssiderisrmarianski: sorry, I'm new around here too :-)
15:41raekafter doing "lein deps" you should be able to start a swank server with "lein swank" (by default on localhost and port 4005)
15:42ssiderisraek: as far as I can tell, there have been attempts to be able to manage clojure-swank from within emacs, but that's still buggy, right?
15:43raekyou mean clojure-mode.el=
15:43raek?
15:43raek"Previous versions of Swank Clojure bundled an Elisp library called swank-clojure.el that provided ways to launch your swank server from within your Emacs process. While swank-clojure is still distributed with the project, it's a much more error-prone way of doing things than the method outlined above.
15:43raekIf you have configured your Emacs to use M-x swank-clojure-project then it should still work, but it's not recommended for new users."
15:43raekfrom the swank-clojure docs
15:43ssiderisby the way, is there a way to re-use destructuring statements?
15:44ssiderisraek: yeah, that's what i mean
15:44raekI think it was very hard to maintain
15:44arnorhsyeah, I saw that swank-clojure is listed from the packages list in emacs
15:44arnorhsso I should just ignore that
15:44raekyes
15:45raekdon't start slime with just "M-x slime". that is what's in swank-clojure.el (which is very outdated)
15:46raekM-x slime-connect seems to be the way to go, nowadays
15:46ssiderisi should automate all the questions that slime-connect asks me every time
15:48arnorhsnice :D
15:49raekI've been thinking about writing this for a long time
15:49arnorhsI'll upvote that on every single site that has a vote button
15:49ssiderishaha
15:49gfrlogwhat should I use if I like atoms but not retries?
15:49ssiderisraek: a lot of people that haven't ever seen a lisp will not know what a repl is and they certainly wont know about slime
15:50arnorhsI got a 3 page error list when installing slime and slime-repl from the package list :)
15:50raek:(
15:50somniumI thought even java has a repl these days
15:50somniumbeanshell or something?
15:50somniumcant imagine its very pleasant to use
15:51raekarnorhs: warnings or errors?
15:51raekhttp://github.com/technomancy/swank-clojure section "Connecting with SLIME" is what I have read
15:52raekarnorhs: do you have other versions of slime lying around?
15:52arnorhswell, hmm, I did download it with cvs
15:53raekdoes emacs know about it? :)
15:53gfrlogI'm going to guess agents with promises
15:53arnorhsit shouldn't
15:53arnorhsI didn't start installing
15:55raekmaybe you could try with the package.el linked from the swank-clojure docs
15:56arnorhsI'm trying to remove it from the packages menu
15:56arnorhsthere doesn't seem to be a remove command documented anywhere
15:57arnorhswhy is there a sudoku game available as an emacs package?
15:57ssiderisarnorhs: emacs is HUGE
15:57technomancyraek: have you thought about adding your info to the assembla wiki page instead?
15:57ssiderisarnorhs: there are e-mail plugins, twitter clients, tetris etc for emacs
15:58Raynestechnomancy: Rather than add to the 6 thousand old "Get started with Emacs, SLIME, and Clojure" blog posts!?!? No way man. ;)
15:58raektechnomancy: yes
15:58technomancyssideris: Emacs is a lot of things: http://p.hagelb.org/emacs-is.html
15:59raekit would not follow the current structure of the getting started wiki, but maybe that's a good thing
15:59arnorhsare there any get started with emacs, slime and clojure blog posts?
15:59technomancyarnorhs: tons and tons!
15:59RaynesThe problem is that most of them are outdated.
15:59technomancyless than half of them have correct, useful info
15:59arnorhsorly
16:00technomancy"The great thing about standards is that there are so many to choose from."
16:00arnorhslike this one (top of google for get started with emacs slime and clojure):
16:00arnorhshttp://nklein.com/2010/05/getting-started-with-clojureemacsslime/
16:00ssideristechnomancy: it doesn't mention "Get things done" app
16:00arnorhsit ends with the sentence "What didn’t work .. i tried tried tried ... Edit: Ah, it appears that the Subversion repository for Clojure that I found is deprecated. But, I don’t have the energy to try the git repository myself at this point. Maybe next week."
16:01arnorhsso it doesn't look like the kind of guide you'd want to read
16:01raekwhoa
16:01Rayneswut
16:02RaynesAnd that post is recent!
16:02technomancypar for the course. =\
16:02arnorhsyes
16:02arnorhsbut this one is alright http://lifeofaprogrammergeek.blogspot.com/2009/03/learning-clojure-and-emacs.html
16:02arnorhsbut it doesn't explain anything
16:03arnorhsit doesn't mention swank
16:03arnorhsor lein or anything
16:03technomancyreally the only thing to be done is try to increase the ranking of the assembla wiki and official docs
16:03arnorhsbut this guy also wrote this: http://riddell.us/ClojureWithEmacsSlimeSwankOnUbuntu.html
16:03arnorhsno, he linked to that
16:03arnorhswhat is assembla?
16:03arnorhsI've seen that wiki and read some stuff
16:04technomancyClojure uses assembla as its official wiki and issue tracker
16:04technomancyclojurebot: assembla?
16:04clojurebotassembla is http://www.assembla.com/spaces/clojure
16:04technomancy~botsnack
16:04clojurebotthanks; that was delicious. (nom nom nom)
16:04Raynes$botsnack
16:04sexpbotRaynes: Thanks! Om nom nom!!
16:04RaynesI totally didn't steal that.
16:05technomancyclojurebot stole it from fsbot
16:05fliebelgood evening
16:05Raynessexpbot comes from a long line of thiefbots.
16:09raektest
16:09fliebelraek: test coming through ;)
16:10arnorhsThe errors I get when just trying to install slime: http://pastebin.com/hKRWee87
16:11raektechnomancy: what do you think should be mentioned (at minimum) in a getting started with emacs tutorial?
16:12raekor, make that emacs and swank-clojure
16:12arnorhsthose are actually just warnings
16:13arnorhsbut here's the error I get when installing slime-repl: http://pastebin.com/y4JDdQc2
16:13arnorhsSeems like actual code errors
16:13raekI think it is important to have a getting started tutorial that covers the whole process, from emacs to the clojure jvm
16:14arnorhsyes, and one step at a time.. first just java+clojure+lein, then a seperate one for web development using compojure and then a third tutorial about installing slime, swank, slime repl, clojure highlighting etc.. , maybe?
16:15ssiderisslime+swank etc is of general use
16:15ssideristi applies to non-web work
16:15technomancyraek: you could mention that Emacs 24 will come with an up-to-date package.el
16:15ssiderisit
16:15technomancyraek: I really need to fix up my own personal package archive though
16:16arnorhswho manages the slime packages in emacs?
16:16arnorhsdo you think there's somebody who'd like to know about the errors I'm getting?
16:16technomancyarnorhs: I'm the packager; upstream is really careless about releases.
16:16arnorhsahh
16:17arnorhswho's upstream and where does he live?
16:17raekthat says, this is a set of tools you may want to use. this perticular combination of tools is used as described here... etc
16:17technomancyarnorhs: http://common-lisp.net/project/slime/
16:19ihodesdoes anyone have any news on Enlive? I'd like to use it, but i'm a little worried it's been put on hold, and i don't want to maintain it… though it might be fine for my uses now, i'll have to test.
16:20raekwhat is the issue about the old package.el, and how do I install the new one in a simple way?
16:20arnorhsI was wondering about these installation instructions, since emacs install of slime is not working: http://common-lisp.net/project/slime/doc/html/Installation.html#Installation
16:20technomancyraek: the old one had some bugs preventing package insallation in some edge cases. it also doesn't support installing from multiple sources.
16:21technomancyraek: there are two versions that fix those problems: the one on my github, and the one in Emacs 24. they aren't really the same
16:21technomancyGNU adapted package.el for inclusion in Emacs 24 straight from tromey's buggy version
16:21arnorhs(setq inferior-lisp-program "/opt/sbcl/bin/sbcl") ; should this be just "lein repl" ?
16:21technomancyso I had to go back and replay my fixes on top of theirs
16:21ihodestechnomancy: awesome. ugh.
16:22technomancyraek: I haven't tried the one bundled in 24 with 23, but it would be good to give that a spin and see if it works
16:22technomancythat would simplify things quite a bit; I wouldn't have to keep my github fork around
16:22arnorhsyes and you would make my life sweet :)
16:22arnorhsis 24 not out yet?
16:23tomojslime cvs is still broken for clojure, right?
16:23technomancyarnorhs: still at least a year away probably
16:23arnorhsok
16:23technomancytomoj: I haven't heard reports either way
16:23technomancymaybe people just stopped using trunk; that would be nice. =)
16:24raekshould one install elpa as usual and the replace the package.el file, or just put the package.el in .emacs.d/elpa/ and add a suitable line in .emacs?
16:24arnorhsso as things stand now, even though you guys say that using slime is the best way to develop... I can't install it because installaction from cvs isn't working and installaction from emacs packages are not working either?
16:24technomancyraek: the latter, I think
16:24technomancynote that package.el from 24 needs an extra line of config to make it work with the elpa archive
16:25raekI'll try that
16:25technomancyraek: also would be good to make a clear distinction between package.el (the software) and ELPA (the site providing packages)
16:25technomancysince now the FSF has their own package archive (which is basically useless since it only accepts libs with copyright assignment)
16:25technomancyI've been guilty of conflating the two in the past
16:25arnorhshmm.. what is package.el?
16:26arnorhsthe script that controls the packages?
16:26arnorhs.el == emacs lisp or something?
16:26technomancyright
16:27arnorhswould that be (eq ".el" "emacs lisp") ?
16:27arnorhslol
16:27raekit's a packet manager for emacs extensions
16:28raekpackage-list-packages is a part of it
16:28arnorhsbut for somebody starting out, this is a pretty horrible resource to start with: http://clojure.org/getting_started
16:28raektechnomancy: it is great that you provide all this important information :)
16:28arnorhsyes it is
16:29ihodeshttp://data-sorcery.org/2009/12/20/getting-started/ this helped me get everything set up
16:29arnorhswhat is incanter?
16:29technomancyarnorhs: that's pretty bad; it should be set up as a redirect to the assembla getting started page
16:29technomancythat one is much better.
16:30arnorhsyes
16:30ihodesarnorhs: don't worry about incanter: this is applicable to just getting started. it's a stats library
16:30arnorhsihodes: that's a great article
16:30arnorhsit starts out with just the words I wanted to hear
16:32LauJensentechnomancy: emacs is a GUI toolkit?
16:32ssiderisarnorhs: yeah, but given that you have no previous java experience, it's unlikely that you'll know of any of the other tools :-)
16:33arnorhsssideris: yes :)
16:33arnorhsI programmed java applets in the 90's
16:33ihodesarnorhs: i'm so sorry
16:33ihodes;)
16:33arnorhslol
16:33ssiderishaha
16:34arnorhsI made a drawing application that you could save to files and I hated java forever after that
16:35arnorhsit was awesome
16:35LauJensenI once did an application that rendered text in a webrowser, I haven't been able to look at PHP since that :(
16:35ihodesyeah i did a stats program in Java about 5 years ago. it was gross.
16:35ihodeshad to interface with R. that was so painful.
16:36ssiderisi write java for a living...
16:36ssiderisswing in particular
16:36arnorhsR the language?
16:36arnorhsJava is probably pretty awesome today
16:36ihodesssideris: i made 6.95 an hour for that…but i guess i can't call it a living.
16:36ihodesarnorhs: yes
16:36ssiderisihodes: and now?
16:37ihodesssideris: got 12.50/hr for a summer working in Clojure. i was in high school then, so 7$ wasn't bad: didn't need to be making a living.
16:37arnorhsnow he makes 695 an hour
16:37ihodeshaha i wish. now i'm a poor college student.
16:40ssiderisihodes: so what were you working on? clojure itself? or writing something in clojure?
16:41ihodesssideris: with clojure; it was/is a data analysis app for a neuroscience lab.
16:41ssideriswas the language your choice?
16:41ssiderisor were they using it already?
16:41ihodesdefinitely mine haha
16:42ssiderisah ok
16:42ihodestheir only other full-time computer engineer/programmer was using VB. and labview.
16:42ssiderisjust wondering how widely used it is already
16:42ssiderisVB! my favourite! (not)
16:42ihodesyeah. the program they were using crashed if you used it too quickly…
16:43ssiderisyeah you don't want to surpise VB
16:43ssideris*surprise
16:43ihodeshaha yeah
16:44raekhrm, would you say that swank-clojure starts a "swank server" or a "slime server", btw?
16:44ihodesswank
16:44ihodesswank = server, slime = client
16:44raekswank is the protocol, right?
16:44arnorhsprocess?
16:45clojurebotprocessing is a language/toolkit for visualizations. See the Clojure wrapper at http://github.com/rosado/clj-processing/
16:45arnorhslol
16:45ihodeshaha
16:45arnorhsclojure?
16:45clojurebotclojure is far closer to perfection then python
16:45arnorhslol
16:45arnorhspython?
16:45clojurebotpython is ugly
16:45ssiderishikey?
16:45arnorhsLOL
16:45ihodesit's a server–it's not like a protocol or anything (AFAIK)
16:45ihodeshickey?
16:45ihodesrish?
16:45clojurebotis_rhickey_is_a_minor_god? is yes
16:45ihodesrich?
16:45ihodesexcellent
16:45arnorhsslime?
16:46clojurebotslime-installer is http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560
16:46technomancyclojurebot: underscores? I am disappoint.
16:46clojurebotExcuse me?
16:46technomancyclojurebot: forget slime-installer
16:46clojurebotslime-installer is http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560
16:46ihodesemacs?
16:46clojurebotemacs is best configured for Clojure with instructions at http://technomancy.us/126
16:46seangroveTrying to get familiar with lazy sequences and what not - would it make sense for a lazy sequence that generates multiples of 20?
16:46ihodeshaskell?
16:46technomancyclojurebot: slime-installer is deprecated
16:46clojurebot"you have to see features like that in the context of Haskell's community, which is something like Perl's community in the garden of Eden: detached from all shame or need to do any work." -- ayrnieu
16:46clojurebotc'est bon!
16:46ihodeshaha so excellent
16:46arnorhshaskell?
16:46clojurebot"you have to see features like that in the context of Haskell's community, which is something like Perl's community in the garden of Eden: detached from all shame or need to do any work." -- ayrnieu
16:46arnorhsheh, sorry
16:47arnorhsruby?
16:47clojurebotChunky bacon!
16:47tomojseangrove: that would make sense, yes
16:47arnorhshtml?
16:47arnorhsphp?
16:47clojurebotmake a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive
16:47arnorhslisp?
16:47clojurebot"Like DNA, such a language [Lisp] does not go out of style." - Paul Graham, ANSI Common Lisp
16:48ssiderisi saw a talk of Rich Hickey today were he apologised for teaching c++ in the past :-)
16:48arnorhslol
16:48arnorhsehhe
16:48arnorhsyes
16:49ssiderisraek: maybe fire up graphviz and make a real graph?
16:49ssiderisyou know dot, right?
16:49raekI do in fact... it's nice
16:50ssiderisi like the fact that it's almost zero effort
16:51ska2342Hi. Is anyone around who could help setting up compojure with maven?
16:53ssiderisraek: are you doing this, or should I?
16:53raekI have done it on a piece of paper
16:53arnorhsmaven is a lein alternative?
16:54ssiderisarnorhs: maven is lein for the java world
16:54arnorhsahh
16:54ssiderisarnorhs: lein uses maven in the background
16:54arnorhsi see
16:54ska2342maybe I should have added "without making fun of it" :-)
16:55arnorhslol
16:56ska2342anyway. As far as I understand things (and I am neither a Java nor a Maven guy) the 0.4.1 JAR of compojure doesn't include compojure.html anymore. When I try to :use compojure.html it can't be found and without that, I don't get the (html ...) functionality.
16:56raekleiningen uses maven for the whole dependency machinery
16:56ordnungswidrigska2342: this has moved do hiccup
16:57raekska2342: that has been split into a library called hiccup
16:57ska2342Ah, OK. I'll try that.
16:58ssiderisgreat name
16:58ska2342would 0.3.0 suffice?
17:03ssiderisraek: does this describe the situation accurately?
17:03ssiderishttp://i.imgur.com/A7E7W.png
17:05ihodesi prefer to skip the package.el part
17:05ihodesbut thats' about right
17:07raekssideris: yes! that was what I had in mind
17:08ssiderisraek: ok, should I improve the formatting a bit and re-post it, or do you think it's unnecessary?
17:09raekI know how to make my own
17:10technomancythere should be some relationship (different from a dependency) between swank-clojure and slime
17:10technomancysince they talk over a socket
17:11ssiderisok, I'm firing up inkscape
17:13ihodesssideris: it'd definitely be useful. how might i contact you if i'd like ot use it in a blog post, if i may?
17:14ssiderisihodes: wait a few minutes for the better version and feel free to use it whenever you like...
17:14ihodestechnomany: you suggested a java/clojure IO kind of post; i'm having trouble deciding what to cover. definitely stuff like slurp, spit and line-seq, and things like with-open and file etc. but what about things like read and PuchBackReader, BufferedRead
17:14ihodestechnomancy: see above
17:15raekssideris: I think I will go with your version too
17:15ssiderisok... preparing shinier version, please wait
17:15technomancyihodes: the basic java.io classes would be a good start, maybe followed by "best of" clojure.java.io?
17:16technomancyPushBackReader is worth a mention too just because it's quirky and you won't be able to find much about it in the general Java literature.
17:16ihodesthat's what i was thinking: i'd mention it along with 'read' in particular
17:17ihodessince read's a fun deal. kind of a big deal/
17:17raekno hurry :)
17:18ihodesi'm trying to decide if i should split it up into 2 posts. but there's no great way of modularizing the content… and i'd prefer to publpish it all at once
17:20ihodesbut i have the best first line for the post, ever: It is a truth universally acknowledged, that a programmer using Clojure will want to perform IO.
17:20technomancynice!
17:20ihodeshaha gotta shove some english lit in there, right?
17:21technomancythat's always been my approach
17:21LauJensentechnomancy: when you got a sec, check your query window
17:22raekpreliminary outline: http://gist.github.com/555595
17:23ihodesnice. and html5, to boot ;)
17:25raekit follows the structure of the graph ssideris made
17:25ihodestechnomancy: per the mailing list, seems 1.3.1 would be good to go for windows as well
17:26darrenaustinHi folks, quick question: does 'lein repl' work correctly with 1.2?
17:27ihodesdarrenaustin: it should
17:27darrenaustinI am running lein 1.3 and when I start the repl, it drops me in clojure.core and none of my project appears to be on the classpath.
17:27ihodesare you sure you're starting lein from your project's directory?
17:28ihodesand that your project.clj has 1.2 specified for its version of clojure
17:28darrenaustinyes to both.
17:28technomancyihodes: I saw a crazy bug on someone else's machine where the standalone install task put the shell wrapper in the wrong place and didn't even bother to get the deps
17:28ihodesand you're sure that you're running 1.3? are you on windows or a nix?
17:28technomancybut I can't repro here
17:29darrenaustinI am on Mac OS X
17:29ihodestechnomancy: could that happen if they have some funky env variables set up?
17:29technomancymaybe
17:30ihodesdarrenaustin: could you put in a gist or pastebin what you see after you start lein repl?
17:30darrenaustinif I wanted to try to reinstall lein, what do I need to delete other than the lein script itself?
17:32ssiderisraek, ihodes: http://i.imgur.com/Z7ICw.png
17:32ssiderisalso available in SVG if you prefer
17:32ihodesssideris: freakin' awesome
17:32ssideris:-D
17:33darrenaustinsure thing, but there are no errors. It just starts with "REPL started; serverl listening on localhost:12610." and then dumps me into the repl in the clojure.core namespace.
17:33ihodesexcept who uses emacs without -nw? haha ;)
17:33raekawesome!
17:33ihodesdarrenaustin: so instead of user=> you get clpojure.core=>
17:33ssiderisglad you like it, feel free to use it
17:33darrenaustinlhodes: yeah.
17:34raekssideris: found a typo... "swank-mode"
17:34ihodesssideris: thanks so much. raek: good catch! should be swank-clojure
17:34ssiderisoops
17:34darrenaustinand when I try to use a library from the project, it complains that it can't find the classes.
17:34ssiderisok let me update it
17:34darrenaustinBoth of which work fine from swank.
17:36darrenaustinI'll try reinstalling lein and see if that clears it up. Thanks for the help.
17:36ssiderisraek, ihodes: http://i.imgur.com/ll4L2.png
17:36ihodesdarrenaustin: please let me know–i'd like to fix this if it's a recurring issue. that's so bizarre
17:37ihodesssideris - i hate to ask you change it again... but maybeee instead of package.el, it should be ELPA
17:37seangroveHey all, I have this: (def multiples-of-20 (iterate (fn [x] (+ x 20)) 20))
17:37ihodesfor Emacs Lisp Package Archive, which is what package.el runs
17:37raekas I learned today: ELPA is the central repository
17:38tomojseangrove: you'll probably want to turn that into a defn instead of a def
17:38raeknot the project written in emacs lisp
17:38ihodesseangrove: you could do (iterate (partial + 20) 20) instead
17:38tomojfor example (defn multiples-of-20 [] ...)
17:38ssiderisihodes: ok ok
17:38ihodesssideris haha sorry for the trouble–it really looks awesome
17:39tomojas a def, multiples-of-20 will always point to the beginning of the seq, and so the beginning won't be garbage collected
17:39seangroveinteresting
17:39tomojso if you tried to do (nth multiples-of-20 100000) or something, all 100000 elements would end up in memory at once
17:39tomojas a function, (nth (multiples-of-20) 100000) works fine, because multiples-of-20 there refers to the function and you're not hanging on to the beginning of the seq
17:40tomoj(called "holding the head" around here)
17:40raek22:23 < technomancy> raek: also would be good to make a clear distinction between package.el (the software) and ELPA (the site providing packages)
17:40seangroveVery cool!
17:40raek22:23 < technomancy> since now the FSF has their own package archive (which is basically useless since it only accepts libs with copyright assignment)
17:40raek22:24 < technomancy> I've been guilty of conflating the two in the past
17:40raekfor me, the nodes in the graphs represent softwares, so would like it to remain "package.el"
17:40seangroveThank you!
17:41ihodesraek: good call, didn't even think of it
17:42ssiderisok so what's the verdict?
17:42ihodeskeep package.el :) you got it perfect
17:42ihodesdon't listen to me
17:42ssiderisok
17:42ihodeshaha sorry about that
17:43ssiderisok, final version: http://i.imgur.com/9ZUMG.png
17:43ssideris(i hope!)
17:44tomojwhat do the edges represent?
17:44ssideristomoj: depends on
17:44ssiderisapart from the one btween swank-clojure and SLIME
17:44ihodesssideris: it looks awesome :)
17:44ssideris:-)
17:45ssideristhe one between swank-clojure and SLIME represents "these two things are connected with the power of thunder"
17:45ssiderisor something
17:45RaynesSexy.
17:52emhwhat's a good way to set warn on reflection in a lib so that it works when I run the file for testing and when it is used/required by another file without throwing IllegalStateException?
17:52emhjust catch the exception?
17:53emhI mean, it doesn't have to take effect when loaded from another file
18:09LauJensenGood night all - Here's a tip on how to unify development and production mode, so you dont have to switch around all the time: http://i.imgur.com/QbQVB.png
18:12ssiderishaha
18:17gfrloghow do I check if a promise has been delivered
18:17gfrlog?
18:19danlarkinwhat function has the prototype (f '[a b c d] '[1 2 3]) => '[[a 1] [b 2] [c 3] [d nil]]?
18:21opqdonut, (map vector [1 2 3] [4 5 6 7])
18:21clojurebot([1 4] [2 5] [3 6])
18:21opqdonutalmost :)
18:22ssiderisit reminded me of zipmap
18:25danlarkinpartition-all can do the second half, but interleave won't pair pas the end of the shorter seq
18:26opqdonutmaybe make a version of map that follows the longest sequence and not the shortest?
18:28Raynesgfrlog: http://www.mail-archive.com/clojure@googlegroups.com/msg27029.html
18:28tomojif you knew which arg was the longest you could lazy-cat the rest with (repeat nil), but that seems Wrong
18:28opqdonutit sure does
18:30tomojcopying map and just changing 3 things seems Wrong too :(
18:30ssiderisit's very Perl-ish
18:31opqdonuthow come?
18:31ssiderisin perl you can say: my ($a, $b, $c) = (1, 2);
18:31ssiderisand $c will be undefined
18:32ssiderisi mean what you're trying to do reminds me of perl somehow
18:32ssiderisnot the solution
18:34gfrlogRaynes: thanks
18:46danlarkinhere's what I've come up with, http://gist.github.com/555658
18:46danlarkinchange interleave to not stop at the length of the shorter seq
21:22emhthe elegant simplicity of functional programming is ever growing on me :) . I just realized that instead of creating macros to compose protocols to create a more complex abstraction, I should just define predicate functions to check whether an object satisfies a set of protocols. OOP had me all screwed up, thinking in terms of hierarchies
21:23ssiderisbut how do you compose protocols then?
21:24emhI don't. it's not necessary
21:24emhthat's what I realized
21:25ssiderisah ok (don't know enough about protocols yet)
21:26ssiderisso you were creating a meta-macro of sorts?
21:26emhnot to be confused with composing _default implementations_, or mixins, of protocols, which can be done with something like the methods a la carte library
21:26emhssideris: no, I was thinking I was going to have to
21:26ssiderissorry I meant meta-protocol
21:26ssiderisor super-protocol
21:27emhyeah, the idea was to have a protocol that had all the methods of several other protocols, and to paste it together using some macro trickery
21:27emhbut it's all backwards doing it that way
22:29n2n3,()
22:29clojurebot()
22:44arnorhsihodes: http://twitter.com/ihodes/status/22403264493
22:44ihodesarnorhs: gotcha :) what are you hacking on now?
22:49arnorhsihodes: not much. My first clojure project will be a half-baked comet implementation
22:50arnorhsI've been working on this simple (yet another) task list manager
22:50arnorhswhich I only created to play around with html5 technologies
22:50arnorhshttp://fridgelistapp.com/
22:51arnorhsI've got a big revision change coming up with almost a complete rewrite
22:51arnorhsand I'm doing real-time editing/updates of sharet tasklists through a lot of small ajax requests
22:52arnorhsso if you and I are editing the same tasklist in real time, you send an ajax request to edit and I have to pull it on a regular basis
22:52arnorhsI wanted to create a push mechanism by using "comet" (which isn't an actual technology but a term used to describe push through javascript)
22:53arnorhsI wanted to implement this thing in a language that is natively a process
22:53arnorhsand I've wanted to try clojure for a long time
22:53Raynes->()
22:53sexpbot=> ()
22:53arnorhsso, this seemed like the perfect time
22:54arnorhsI thought about using web sockets (sexy) and I should actually do that instead of the comet thing.. but it's only supported in FF4, chrome and safari 5 (no IE support yet)
23:08ihodesarnorhs: that sounds really interesting
23:08ihodesarnorhs: as for sockets; are the people who'll be using your app using IE?
23:08ihodesarnorhs: i hate waiting for a shitty browser to play catch-up, and its market char is dropping fast (though i guess it's sitll significant)
23:20arnorhsihodes: It's just about everybody
23:20arnorhsI have a few regular users and there are a lot of them using ie
23:21arnorhsI might just use comet for IE and web sockets for the rest.. and then gradually throw comet out
23:22arnorhstraditional comet is done through an invisible iframe and it works crappy in safari
23:22arnorhsso web sockets+comet
23:22arnorhsanyways
23:22arnorhsgn
23:22arnorhsit's 3:20 am here in Iceland
23:24ihodesgoodnight :)
23:24ihodesit's just 11:30 here. plenty of time
23:37tomojihodes: websockets work in firefox?
23:38tomojoh, FF4, huh? cool
23:38ihodesyeah. can't wait to use them everywhere soon :)
23:44ihodeshaha *that* ff4 won't be seeing websockets any time soon
23:45technomancynot even on the DS remake?
23:45ihodesno, you're right. it'd really enhance the game ;)
23:45ihodesi'm sure it makes it into the DS
23:46stacktracerhow do I set clojure.pprint/*print-miser-width* (for repl purposes)?
23:47slyrusand when is *print-circle* going to be implemented?
23:48tomojdoes the DS have opera or is that just the wii?
23:49technomancytomoj: it does, but it's slooooow.
23:50technomancyit's not built-in either; I had to order mine from Japanland
23:53stacktracernever mind ... *print-right-margin* is the thing I was looking for ...