#clojure logs

2011-10-12

01:20qedHe had to modem in to the agency and say that there was an emergency and that he was posting an e-note on a colleague's TP asking her to cover his calls for the rest of the week because he'd be out of contact for several days due to this emergency. He had to put an audio message on his answering device saying that starting that afternoon he was going to be unreachable for several days.
01:21qedExpressivity is nebulous.
01:26pdki'm reading proust in 2 lines
01:27jliwell then
01:30qedpdk: I don't follow
01:31jlinot sure how I FEEL about this http://www.kk.org/thetechnium/archives/2011/04/born_digital.php
01:32qedjli: your emphasis on "FEEL" worries me
01:32qedI ranted on HN the other day about the reactions to Dart -- so superficial and full of emotion
01:33qed"feel" is a recipe for poor decision-making
01:33qedunless it is well-tempered by reality
01:34jliwhat were the reactions? something along the lines of "WHY BOTHER WE HAVE JAVASCRIPT"?
01:35qedjli: to respond to that link: I think the only reason we wonder is because we're secretly afraid we're dinosaurs
01:35qedand the truth is: we are.
01:36qedby the same token, we're just getting warmed up
01:36ivan__im sure this arguement is made every generation
01:36ivan__about different stuff
01:37qedivan__: indeed. it is an age-old argument.
01:37ivan__i rofl when people say that creativity is dying
01:37jliI accept being a 20-something grouchy old man
01:37qedjli: if you were truly grouchy you couldn't type that with confidence
01:37qedclearly you *aren't* a grouchy old man
01:38qedivan__: Books! Print is dead! Long live the web! (btw, I like physical copies of books, do you have XYZ?)
01:38qed(I'll pay for it)
01:39ivan__they had it so good in the olden days, what with much lower life expectancies, no real medical knowledge, having to hand wash clothes etc etc
01:40qedAnyway, this rant brought to you by: people's reaction to Dart, the sorry state of communication in our communities, and lack of personal responsibility
01:40qedivan__: heh -- I MISS OUTHOUSES! OH BOY WE HAD IT SO GOOD WITHOUT PLUMBING!
01:41ivan__how about lead piping :)
01:41jlitemperments are remarkably robust
01:42todunsrid: ok.
01:47todunbrehaut: require what?
02:15lnostdali'm not sure where to begin looking, but perhaps someone already knows how to go about getting Meta-Point (Alt-. or "slime-edit-definition") to lead to the actual source files of some dependency and not just the (read-only) contents of .jar files?
02:42tomojlnostdal: I think you want checkout dependencies?
02:43tomoje.g. in leiningen create a checkouts directory in the root of the project and put symlinks in it to other leiningen projects you depend on
02:43todunfinally got emacs for clojure up and running.
02:43todunthanks for all the help.
02:44tomojthen M-. will go to the source file in the other project because lein has put the symlinked code on the classpath
02:45lnostdalcool, will try that, tomoj .. thanks :)
02:45clojurebotthanks for your suggestion, but as usual it is irrelevant
02:45tomojnote you still need to explicitly include the dep in your project.clj
02:45lnostdalclojurebot, be quiet you
02:45clojurebotI don't understand.
02:45lnostdalok
02:45amalloy(inc clojurebot)
02:45lazybot⟹ 5
02:46todunI'm following the steps for newbies at http://dev.clojure.org/display/doc/Getting+Started
02:46todunI'm trying to do https://github.com/relevance/labrepl
02:46todundo I just download it into some folder then
02:46todunat the repl do lein ?
02:47tomojseems strange that the readme doesn't say how to use it
02:48toduntomoj: I didn't quite follow the readme. sorry about that.
02:49toduntomoj: all I really see is that I should run the test with lein test...not sure what tests or why
02:50tomojno clue, sorry, never used it
02:51tomojjust seems like a funny readme for a project for people new to clojure.. :)
02:51tomojmaybe they're supposed to find it some other way?
02:51toduntomoj: oh ok. I linked to it from the newbie page I listed above.
02:52tomojhttp://foognostic.net/labrepl-summary/
02:52tomojlooks like there are some working instructions there
02:52toduntomoj: thanks. checking it out now..
02:52tomojof course, if you're set up with swank.. :/
02:53toduntomoj: swank...how do I do so, what can it do for me?
02:53todunI just finished with leiningen, emacs start kit
02:53tomojhmm
02:53todunI dont mind throwing in swank in there if it's useful
02:53tomojhave you got a clojure repl inside emacs?
02:54toduntomoj: how do I check if I do?
02:55tomojuhh, dunno
02:55tomojyou'd have to have set something up
02:55tomojdunno what you've done already
02:55toduntomoj: ok.
02:56tomojdid you set up marmalade like it says at http://dev.clojure.org/display/doc/Getting+Started+with+Emacs ?
02:56todunyes
02:56tomojthink you should be able to install slime, slime-repl, clojure-mode from it
02:56todunok. how so?
02:57todunto what end?
02:57ibdknoxtodun: what editor do you normally use? I'm not sure that trying to learn emacs while also trying to learn Clojure is a wise decision
02:57tomojhttps://github.com/technomancy/swank-clojure
02:57tomojreadme here is helpful too
02:59todunibdknox: I'm trying to get more comfortable with emacs. so I'll be using emacs. Everything about emacs I'm familiar with, it's just that using M-x as a way to install stuff is so cool and new to me that I'm curious to know more.
02:59todunanyways, using it for typing and such I'm familiar with
02:59ibdknoxrighto
03:00tomojslime is an emacs package for working with lisps
03:01tomojswank-clojure provides clojure support, the readme there describes setup
03:01tomojjust need to `M-x package-install` slime-repl and clojure-mode I think
03:01tomojplus the lein plugin in the readme there
03:02tomojmaybe clojure-mode depends on slime now, dunno..
03:03toduntomoj: it's installing with lein now..
03:04tomojso I imagine script/swank in labrepl is what you want, then M-x slime-connect to get into the repl
03:04toduntomoj: what do I do after I start the swine sever?
03:04tomojor maybe you can just jack in to labrepl..?
03:04toduntomoj: when I try to start the swine server, I get the following error:
03:04todunDebugger entered--Lisp error: (error "Could not start swank server: Couldn't find project.clj, which is needed for jack-in
03:04todun")
03:04todun signal(error ("Could not start swank server: Couldn't find project.clj, which is needed for jack-in\n"))
03:04todun error("Could not start swank server: %s" "Couldn't find project.clj, which is needed for jack-in\n")
03:04todun clojure-jack-in-sentinel(#<process swank> "exited abnormally with code 1\n")
03:04amalloyheehee. swine server. a lovely combination of swank/slime
03:05todunoops! sorry people, I should have pastebined that
03:05todunamalloy: haha. actually that was a typo. but it's all good.
03:05tomojhmm, I dunno anything about jack-in..
03:06tomojif you're running script/swank in labrepl I think you'd want to M-x slime-connect, not use jack-in. if you're jacking in I guess you need to do it while visiting a file in labrepl's project directory
03:08toduntomoj: I don't follow. I'm using the instructions at https://github.com/technomancy/swank-clojure
03:09toduntomoj: doing it with your suggestion, where do I get to labrepl for instance?
03:09tomojthat is, you're running M-x clojure-jack-in ?
03:10todunyes
03:10tomojhmm
03:11tomojdon't know how that would work
03:11toduntomoj: dont know what it does. you're suggesting I try labrepl.
03:11todunhow so?
03:12tomojthe only easy way I see is to download labrepl and run script/swank
03:12tomojthen in emacs do `M-x slime-connect` instead of `M-x clojure-jack-in`
03:13tomojjust curious, what platform are you on?
03:14todunosx
03:14tomojwhew
03:14toduntomoj: I should follow the instructions here http://dev.clojure.org/display/doc/Getting+Started+with+Emacs ?
03:14toduntomoj: whew?
03:15tomojall of the instructions there up to "... install clojure-mode by pressing M-x package-install and choosing clojure-mode."
03:16tomojthen download labrepl and run script/swank inside it, and M-x slime-connect from emacs
03:16nybblesanyone know how i can get sort and floor functions? i gather than i have to install math.numeric-tower, but not sure how to do that using leiningen
03:18toduntomoj: downloading labrepl by zip? if so, then what? https://github.com/relevance/labrepl
03:19ibdknox,(doc sort)
03:19clojurebot"([coll] [comp coll]); Returns a sorted sequence of the items in coll. If no comparator is supplied, uses compare. comparator must implement java.util.Comparator."
03:19ibdknox,(doc floor)
03:19clojurebotPardon?
03:19ibdknox,(Math/floor 3.12434545)
03:19clojurebot3.0
03:19ibdknoxnybbles: ^
03:19tomojtodun: do you know how to use the terminal?
03:20ibdknoxnybbles: you don't need anything special for sort or floor
03:20tomoj,*clojure-version*
03:20clojurebot{:interim true, :major 1, :minor 3, :incremental 0, :qualifier "master"}
03:21tomoj,(require 'clojure.math.numeric-tower)
03:21clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate clojure/math/numeric_tower__init.class or clojure/math/numeric_tower.clj on classpath: >
03:21nybblesibdknox: ahhhh okay i'll try it out
03:21tomojthe floor there just behaves differently than the regular one?
03:22ibdknoxhuh?
03:22toduntomoj: yes. I'm using it now.
03:22ibdknoxhow can floor behave differently?
03:22toduntomoj: but I'm no terminal guru or anything like that.
03:22tomojtodun: ok, you just need to unzip labrepl, cd into it, and you will find a script/swank inside it, run that
03:23toduntomoj: ok. will do. apprise you of my progress..
03:25toduntomoj: all I did was double click it. will that give the same effect?
03:27tomojmaybe.. I don't remember osx very well
03:27tomojif it works, http://localhost:8080/ should have clojure stuff on it
03:28toduntomoj: I ask because I get this error when I run it from terminal like so
03:28todunhttp://pastebin.com/S4kvEg49
03:28toduntomoj: localhost is error for me
03:29tomojrun `lein deps` in labrepl first
03:31toduntomoj: but I dont have labrepl, or I thought I didn't hence all this.
03:31tomojhmm
03:32tomojwhere'd script/swank come from?
03:32ibdknoxtodun: he means in the project directory
03:32toduntomoj: the download of labrepl
03:32tomojright.. where you typed `script/swank` type `lein deps` first
03:33todunibdknox: oh ok.
03:33toduntomoj: k..
03:33todundownloading..
03:34todunthen do 'script/swank' ?
03:34tomojyep
03:35todunuhm ok. nice. it started another repl.
03:35todunthanks guys.
03:35toduntomoj: what does this do for me? how does it differ from lein's repl?
03:36todunwhich should I use now that I have this setup?
03:36tomojby "lein's repl" do you mean something you got by running `lein repl`?
03:37tomojscript/swank just starts up labrepl, so you can get to it at http://localhost:8080/ and connect from emacs with M-x slime-connect
03:37toduntomoj: yes
03:37tomojnormally you can just jack-in to your project or run `lein swank` in the project directory
03:37tomojonce you start building your own projects
03:38Blktgood morning everyone
03:38tomojit differs from `lein repl` because you can connect to it in slime to have the repl in emacs
03:39tomojthen you get code completion and lookup and macroexpansion etc in emacs too
03:39tomojas opposed to trying to balance parentheses on a repl in some terminal
03:40toduntomoj: I tried M-x, slime-connect...that didn't work.
03:41toduntomoj: it seems you're saying that I can use emacs to write my code then M-x slime-connect to sort of "compile" it?
03:41tomojwhen you ran `script/swank`, did it say "Starting swank..."
03:41tomojand perhaps "Connection opened on local port 4005" ?
03:42tomoj..or did it just give you a repl in the terminal there?
03:42tomojI guess it starts a repl in the terminal too
03:44tomojM-x slime-connect hooks slime up to a running jvm with the project's code (in this case, the labrepl code), so you get a repl inside emacs
03:44tomojthen you can also load files you're working on in that running jvm once connected, with C-c C-k
03:44tomojamong other things, I think summarized in the swank-clojure readme
03:44ejacksonmorning all
03:44toduntomoj: I said that, yes. Clojure 1.3.0-beta1 Starting swank...
03:45toduntomoj: then the repl
03:45todunin terminal
03:46tomojhrmm
03:46toduntomoj: ok. now I have the option of doing M-x, clojure-jack-in
03:47todunshould I do it?
03:47tomojwell
03:47tomojyou could
03:47tomojdo it starting from a file in the labrepl project directory
03:47tomojthe problem is, labrepl has some extra startup code sitting off in script/run.clj
03:48tomojthis is what script/swank is supposed to run, but yours apparently fails to start swank
03:48tomojif you C-x C-f to, say, project.clj in the labrepl directory, and run M-x clojure-jack-in, it should start swank and give you a repl
03:49toduntomoj: oh ok. my next question answered. don't delete the zip folder downloaded from labrepl, it will break everything, yes?
03:49tomojyeah you need that to use labrepl
03:51todundoes it matter if I move the dir i dowloaded?
03:52tomojyou can move it, but don't move it while you're connected with jack-in or slime-connect or editing files in it
03:54toduntomoj: dont have slime-connect in emacs just jacked-in
03:55tomojah, right
03:55toduntomoj: when I do jack-in I get a similar error like before...
03:55tomojjack-in sends slime over the wire
03:55todunhttp://pastebin.com/TSagcJr0
03:55tomojyou could do M-x package-install slime-repl
03:55tomojthen you should have M-x slime-connect
03:55tomojdunno how to get jack-in working, I never use it
03:56toduntomoj: I have slime-(stuff) not connect though
03:56tomojweird
03:56toduntomoj: oh. so I dont need jack-in
03:56todunjust slime?
03:56tomojjack-in is the currently recommended method I think
03:56tomojI just do it the old way because I haven't figured jack-in out yet
03:57toduntomoj: what is this old way, if you dont mind my asking(I just want to get this up and running so I can write beautiful clojure)?
03:57tomojthe old way, you install slime-repl (and slime, slime-repl depends on slime, so you can just install slime-repl) with package-install, run `lein swank` (`script/swank` for labrepl), and M-x slime-connect
04:00toduntomoj: ok, trying that now..
04:00todunbtw, all I need is the script/swank dir, right?
04:01todunthat is to say, I can get rid of everything else....
04:04tomojno
04:05tomojcertainly some of the stuff in there you don't need, but just keep it all
04:08toduntomoj: ok. will try all you said and let you know asap
04:11toduntomoj: when I launch emacs, must I be in script/ ?
04:13tomojdoesn't matter
04:19todunk. I'm guessing because of the setup at path, yes?
04:22tomojdunno what you mean
04:22tomojemacs is happy to run from anywhere
04:23tomojit's common to only run one emacs
04:28amalloychouser: i see you finished all of our dang problems. mission accomplished?
04:30toduntomoj: ok.
04:31toduntomoj: Ok I tried the following : install slime-repl (and slime, slime-repl depends on slime, so you can just install slime repl) with package-install, run `lein swank` (`script/swank` for labrepl), and M-x slime-connect
04:31toduninstall slime-repl works.
04:31todunlein-swank says...
04:31todunCouldn't find project.clj, which is needed for swank
04:31todunthat was step 2.
04:32todunstep 3 is M-x slime-connect
04:32tomojif you want to run labrepl, run `script/swank` in the labrepl dir
04:32todunit asks for port localhost etc, then says...
04:32tomojdon't run `lein swank`
04:32todunmake client process failed: connection refused, :name, SLIME Lisp, :buffer, nil, :host, 127.0.0.1, :service,\
04:32todun 4005, :nowait, nil
04:33toduntomoj: oh ok. why not though?
04:33tomojit fails to run extra labrepl startup code
04:33tomojwhich will make things easier when using labrepl
04:35toduntomoj: that's 'lein swank' I presume.
04:35toduntomoj: as per the slime-connect issue, what's up with that error?
04:36tomojyou didn't start swank
04:37todunI thought I did as per your instructions.
04:37tomojyou either have to run script/swank in the labrepl dir or `lein swank` in any lein project dir to start swank first
04:37tomojwhen it said "Couldn't find project.clj, which is needed for swank", it meant that it failed to start, I believe
04:38tomojprobably because you weren't in a project directory when running `lein swank`
04:39toduntomoj: what is a project dir then? I have a folder that I've been dumping all the stuff into.
04:39tomojthe labrepl zip you downloaded contained the labrepl project dir
04:40tomojif you cd into it, and run `script/swank`, it should start swank for the labrepl projec
04:40tomoja project dir is just a dir that contains a project.clj file
04:46toduntomoj: ok will try that. thanks.
05:23eirohello
05:25eiro(line-seq (slurp "http://khatar.phear.org&quot;)) doesn't work because slup returns a string, not a reader
05:25eiroany function to return http flow line by line ?
05:25raekeiro: you probably want to use clojure.java.io/reader here
05:26raekslurp is an alternative to line-seq + reader for the case when you want one big string
05:28eiroactually i don't want a big stream but i thought everything was lazy so slurp read my http flow line by line
05:28eiroi investigate reader
05:29raekline-seq reads lines lazilly
05:29raekin clojure only seqs are lazy so slurp has to be strict since it returns a (java) string
05:31raekso to print each line in the stream: (let [stream (reader url)] (doseq [line (line-seq stream)] (println line)) (.close stream))
05:31raekthe (let [x ...] ... (.close x)) thing can be replaced by (with-open [x ...] ...)
05:32raek(which additionally makes sure that .close is called even when an exception is thrown)
05:44eiroi tried slurp* from contrib.io but it doesn't work
05:44eiroit seems i have a classpath pb: i can't figure out where contrib is installed :)
05:46raekeiro: you don't need contrib for this. the stuff in contrib.io became clojure.java.io in clojure 1.2
05:46raekand slurp is now in clojure.core
05:46eiroslurp* isn't :)
05:46raekeiro: http://clojuredocs.org/clojure_core/clojure.java.io
05:47raekeiro: what was the difference from slurp?
05:47raeksome functions was refactored in the process. the "new way" is the recommended one
05:48eiroraek, it seems to me that slup returns a string when slurp* returns a "stream"
05:48eirook so with-open is my friend
05:48eiroi want to fix my classpath pb anyway :)
05:48raekeiro: ah. originally clojure.core only accepted a filename as a string as its argument
05:48raekbut since clojure 1.2 it calls clojure.io.reader to open the stream
05:49eirooh
05:49eirook
05:49raekso it accepts streams just like clojure.contrib.io/slurp*
05:49raekslurp* accepted a stream. it did not return one
05:50raekeiro: for the classpath problems, use a build tool like Leiningen to manage dependency libraries (e.g. contrib) and the classpath for you
05:51raekif you just want to learn the language, you don't gain much by managing the classpath yourself
05:55eiroit seems i'll be hooked to closure soon :)
05:58raekeiro: http://pastebin.com/xKzVnmTX
06:00eirothansk
06:00eiroraek, i use lein but it's boring when you have lot of scripts you want to launch
06:01eiro(or i missed something)
06:01eiroyou have to file project.clj:main and test/script1.clj-main constantly
06:03eiroit seems i just have to put a jar in $CLOJURE_HOME :)
06:15dbushenkowhat's the most idiomatic way to write to file with clojure 1.3?
06:16clgvdbushenko: clojure.java.io
06:17dbushenkoare there any examples? bcs I just don't understand this API
06:19clgvdbushenko: you can do something like (with-open [w (writer "my-file.txt)] (binding [*out* w] (print "My data text line")))
06:19clgvs/txt/txt"/
06:19lazybot<clgv> dbushenko: you can do something like (with-open [w (writer "my-file.txt")] (binding [*out* w] (print "My data text line")))
06:19dbushenkooh, this is great!
06:19dbushenkoand how about reading?
06:19dbushenkowhat it could look like?
06:20clgvhumm that depends what you write. do you write text lines like above?
06:20dbushenkoyep
06:20dbushenkoI know about slurp
06:20dbushenkobut how to do that with clojure.java.io?
06:21clgvclojure.java.io is the namespace that contains reader and writer
06:22clgvfor reading lines you can do: (with-open [r (reader "my-file.txt")] (line-seq r))
06:22dbushenkothanks!
07:20raekdbushenko: you need to force the whole seq inside the with-open form some how. either do the procedding there or add a doall: (with-open [r (reader "my-file.txt")] (doall (line-seq r)))
07:21dbushenkoraek: thanks!
07:22raekalso, reader/writer are for text. for binary data, use input-stream/output-stream. you might need to use java interop for those (see the javadoc for InputStream and OutputSteam for the methods)
07:25raekeiro: you can use lein run like this: "lein run some.other.namespace"
07:26raekeiro: sorry, that should be "lein run -m some.other.namespace"
07:27raeksee "lein help run". it also explains how you can give the namespaces shorter aliases
07:30todunwhen I run 'lein swank' from a directory with project.clj in it, I get the following exception trace: http://pastebin.com/u6CwMWza
07:30todunam I doing something wrong?
07:31raekI think that happens when you have two versions of swank-clojure on the classpath at the same time
07:31todunthe goal is to use emacs to write clojure.
07:31raekfor instance one as a :dev-dependency and one as a leiningen plugin
07:31todunraek: oh ok. how do I remove it?
07:31todunraek: I first installed leiningen then emacs starter kit
07:32todunthen I tried jack-in from emacs
07:32todunthat didn't work
07:32todunthen I installed labrepl
07:32todunthen swine as per the recommendations of tomoj
07:32raekjack-in didn't work for a clean new project?
07:32todunraek: yes. hence the swine suggestion
07:32raekswine?
07:33todunraek: slime
07:33raekswank-clojure?
07:33clojurebotsee swank
07:33todunraek: sorry. been making that mistake throughout the installation.
07:33todunraek: yes. swank
07:33raeksometimes a dependency brings in an old version of swank-clojure, and that can mess everything up
07:34raektodun: did you try jack-in for a clean leiningen project?
07:34todunraek: after all those installations, these are the steps I've taken to try to get this off the ground: -install slime-repl (and slime, slime-repl depends on slime,
07:34todunso you can just install slime-repl) with package-install,
07:34todun-run `lein swank` (`script/swank` for labrepl),
07:34todunand M-x slime-connect
07:34raektodun: also: do you want to work on your own project or someone else's?
07:34todunraek: on my own project.
07:35todunraek: if a clean project means, have I written any clojure code/script, no! I've been trying to make this work.
07:36todunraek: all the code I've done so far is in the repl so I can follow along the docs. will this make leiningen "unclean"?
07:36raekif you make a clean new project (lein new), remove everything in ~/.lein/plugins, install the swank-clojure plugin (lein plugin install swank-clojure 1.3.1) and then try jack-in, what happens?
07:37raekby "clean" I meant a project with no :dependencies declared in its project.clj file
07:38raekalso, labrepl is a tutorial, I think. it will certainly not make it simpler to set up your IDE.
07:39todunraek, translating what you're saying to this. lein new, rm -rf ~/.lein/plugins, M-x install-package swank-clojure
07:40todunraek: from where in my dir should I run lein new?
07:40todunraek: is it from the place where I have my project.clj ?
07:41raekno, not M-x swank-clojure
07:41raekthat is a deprecated elisp package that predates leiningen
07:42raeklein new myproject && rm -rf ~/.lein/plugins && cd myproject && lein plugin install swank-clojure 1.3.1
07:42raekthen C-x C-f myproject/src/myproject/core.clj
07:42raekthen M-x clojure-jack-in
07:42todunraek: myproject?
07:43raekthe name you give to the project
07:43todunraek: I don't have a project. Do I need one?
07:43raekthe project is the set of source files the clojure instance will have access to and the libraries it will use
07:43raekyes
07:43todunraek: what I mean is that I'm not sure what a project means here.
07:44todunraek: so is it like a java project?
07:44raekyes, the JVM doen't really like the "current working directory" approach
07:44todunraek: so I cannot have a folder for all my stuff.
07:44raekwhen you use lein to start the swank server, it will make sure that the source directories and all jars of the dependencies are on the classpath
07:45raekwell, the project is a folder
07:46todunraek: will it allow me to have a "workspace" then separate folders in that workspace representing separate projects?
07:46raeksure
07:47raeka project is just a directory with a project.clj file in it and some other dirs (src/, lib/, test/, etc...)
07:48raekyou can put the project folder in any other folder you like
07:48todunraek: can I use lein to create a new project then? so lets say I'm in some folder, I call 'lein make-project'. will it generate all that for me?
07:49raektodun: yes, calling "lein new myproject" will create the myproject/ folder in the current folder
07:50todunraek: now the folder it creates it in will be like my "workspace", correct?
07:50raekI guess. that folder does not have any special meaning for Leiningen, though
07:50todunraek: ok. just trying to wrap my mind around this all.
07:51raekput in Eclipse terms, that would be the Workspace
07:51todunraek: I'm trying the commands now...
07:51raekinside the project folder, you can use "lein repl" to get a repl in the terminal
07:52raekthat repl can access the source files in src/ and all the dependencies of the project
07:53raekyou use swank-clojure (indirectly, if you are using jack-in) when you want a repl in Emacs
07:53todunraek: ok. everything done. what is and where do I do then C-x C-f myproject/src/myproject/core.clj ?
07:53todunraek: in emacs
07:53todunraek: while in the /myproject ?
07:54raektodun: you need to open some file that belongs to the project. myproject/src/myproject/core.clj is a good place to start
07:55raekwhen you have that file opened (assuming you did the "lein plugin instal..." step) you should be able to do "M-x clojure-jack-in"
07:55raekand then a repl should pop up
07:56todunraek: all in emacs?
07:58todunraek: ok. doing that in emacs. It says starting swank server...
07:58todunraek: do I have to do all these steps for each project I make?
07:59toduncan I not just have one universal project with the core.clj?
07:59raekyou need to run "lein new ..", open a file in the project and invoke clojure-jack-in, yes
07:59todunraek: I get error in process filter: Symbol's value as variable is void: Copying
07:59raeksure. I think it's pretty common to have a "scratch" project
08:00todunwhen I do jack-in
08:00raektodun: that probably means you have installed an incompatible slime version in emacs
08:00raektry to remove all slime, slime-repl, swank-clojure, slime-clj and swank-clj packages
08:00raekonly keep clojure-mode
08:01raekswank-clojure comes with a compatible version which clojure-jack-in uses
08:01todunraek: how do I remove all those?
08:01raekso you don't need to install slime
08:02raekM-x package-list-packages
08:04raekthen you should be able to mark a package for deletion by pressing "d", I think
08:04raekand then "x" to apply
08:05raekif you don't have any important packages installed, maybe it's simpler to just wipe ~/.emacs.d/elpa/ and reinstall clojure-mode
08:07todunraek: trying all that now..
08:07todunraek: I have quite a few things there so I'll keep elpa
08:08todunso I should delete anything that has slime on it?
08:08raekyes
08:08raekand anything that mentions swank
08:09todunraek: I see these for slime: slime-clj 0.1.6 available Slime extensions for swank-clj
08:09todun slime-fuzzy 20100404 available Fuzzy symbol completion for Slime
08:09todun slime-ritz
08:10todunraek: so I move the cursor to the same line as 'slime-clj' press d and then x...
08:11todunemacs indicates I've selected nothing.
08:12todunraek: for swank, this is all I find: swank-cdt
08:24raektodun: if those are installed, remove them
08:24todunraek: yes. the d then x doesn't work for me though
08:26jcromartiehm, so you can't attach metadata to a ref huh
08:26raekI guess you can remove them from ~/.emacs.d/elpa/ manually
08:26raekjcromartie: alter-meta!
08:26duck1123I've never had much luck deleting packages through elpa
08:26todunraek: in there, I have slime-20100404.1 slime-repl-20100404
08:26todundelete those two folders?
08:27raekok, delete those
08:27todunraek: ok. done.
08:27jcromartieinteresting, thanks raek
08:27raekjcromartie: with-meta returns a new object, but for a ref you want to change the meat for *the* ref
08:27jcromartieah ha... that makes sense
08:28raektodun: restart emacs and try clojure-jack-in again
08:28jcromartiethis is perfect :) thanks
08:29todunraek: ok. it seems to work. I get this: ; SLIME 20100404
08:29todunuser>
08:29raektodun: congratulations!
08:30todunraek: how do I write clojure code
08:30todunI'm guessing you just run your code in that repl
08:30raekyou can evaluate expression in the repl directly
08:30raekyes
08:30raekquickly on how to use source files:
08:31raekadd (defn hello [] (println "Hello, world!")) below the (ns ...) line in myproject/core.clj
08:31raekpress C-c C-k in that buffer
08:32raekand then C-c M-p <RET> (after this, the repl should change to myproject.core>)
08:32raekthen you can eval (hello) in the repl
08:32raekwhen you make changes to a defn or a def, press C-M-x inside it to reload that def
08:32raekpress C-c C-k to reload the whole file
08:33todunraek: I get the following error http://pastebin.com/GypgAceq
08:34raektodun: you accidentally copied the word "below" too
08:34raekpress 0 to close that window
08:34todunraek: oops. it looked like clojure code :-P
08:34todunok. closed
08:35raekwrite that in the file, not in the repl
08:35todunraek: but how do I get to the file?
08:35raektodun: change to that buffer
08:35raekthe usual way
08:36raekC-x b
08:36raekor maybe you already have it in split screen. it depends on your emacs setup
08:37todunraek: ok.
08:37todunusing C-x b gets somewhere I can type into.
08:37todunIve pasted it in there. now what?
08:37duck1123C-x C-b brings up a nice list
08:38duck1123C-x b is faster if you know the name of the buffer
08:38raektodun: save the file (C-x C-s) and load it (C-c C-k)
08:38raekand then enter its namespace (C-c M-p <RET>)
08:39todunraek: I can give it any name, right?
08:39raekgive whay any name?
08:39todunI'm going with one.clj
08:39todunit says save in path..
08:39raekas long as you put it inside the src/ directory
08:39todunno file name?
08:40raekyou didn't open the src/myproject/core.clj file?
08:40Zolrathsame filename as its ending namespace
08:40ZolrathIf the project is hellokitty and the filename is socute.clj
08:40todunso core.clj?
08:40Zolraththe namespace would be (ns hellokitty.socute)
08:41raekif the top of the file says (ns myproject.core) the file should be in src/myproject/core.clj
08:41todunthis is the path I have
08:41todun"/src/first_project/core.clj"
08:41raekdots becomes slashes, hyphens become underscores
08:42raekok
08:42raekthen there should be a (ns first-project.core) in the top of that file
08:42raek(note the hyphen)
08:43todunthis is the new file:
08:43todun(ns first_project.core)
08:43todun(defn hello [] (println "Hello, world!"))
08:44Zolraththe underscore from the file is a dash when in the namespace
08:46todunZolrath: oh ok.
08:46todundo I overwrite core.clj?
08:46todunthat was generated by lein
08:47raektodun: if that file is called src/first_project/core.clj, then yes
08:47todun(ns first-project.one)
08:47todun(defn hello [] (println "Hello, world!"))File to save in: ~/Dropbox/CLOJURE/first_project/src/first_project/one.clj
08:48todunsorry about that...
08:48todunI meant to type this.
08:48todun(ns first-project.one)
08:48todun(defn hello [] (println "Hello, world!"))
08:48todunFile to save in: /first_project/src/first_project/one.clj
08:48Zolrathcorrect
08:49todunso this means in reality all I need is to save the files in /src/
08:50todunjust so I understand the steps:
08:51todun1.) connect to swank server: M-x, clojure-jack-in
08:51todun2.) C-x b to leave the repl to a place I can input my code.
08:52todun3.) C-x s save the file to some place in /src/
08:52todun4.) ?
08:52todun1 - 4) must I have a split screen?
08:52todunmakes it impossible to write a full length app
08:52raekno, but I personally find it convenient
08:52duck1123C-x C-s saves a file
08:53raekto split the emacs frame vertically
08:53raekI usually have the file I'm working on the one side and the repl on the other
08:54todunraek: how do I split vertically?
08:54duck1123C-x 3
08:54raektodun: C-c C-k to load the file. C-c M-p to make the repl be in the namespace of the file
08:55raekthen you have a repl in the right namespace and you can evaluate code that uses the functions that you have defined in the file
08:55duck1123I have (global-set-key (kbd "C-c s") 'slime-selector) so that I can hit C-c s r to get to my repl
08:55todunwhen I do C-x b to get to repl, I fall into oblivion.
08:56todunduck1123: sounds like a good idea. how did you set that up?
08:57duck1123I have ~/.emacs.d/duck.el just pasted that there
08:57todunshould I make mine duck.el?
08:58duck1123I don't use jack in, so I also have a fn to connect to slime on 127.0.0.1/4005 that I've bound to a handy key combo
08:58duck1123no, whatever your username is
08:58todunok
08:58todunhow do I find out my user name or it that of my computer?
08:58duck1123you login name for the computer
08:59duck1123near the end of starter kit's setup it looks for a file with your username and loads that
09:03todunhow to un-split screens?
09:04duck1123C-x 1
09:04duck1123or C-x 0 to just remove a split
09:05todunso there is a repl, then are namespaces and something else.
09:05todunhow do I move through all of them?
09:06todunmy last attempt sent me somewhere else.
09:07duck1123all of your open buffers? C-x b if you want to type a name, C-x C-b if you want to pick from a list, C-x [right] if you just want to cycle
09:09todunduck1123: what is a name and/or name space in clojure?
09:09todunwhat is a list?
09:10duck1123todun: I'm not sure I understand your question
09:10todunwhen I split the screen, I don't get the repl and I cannot switch between the split screens.
09:10todunyou mentioned I use C-x b if I want to type a name
09:10duck1123C-x [right] should allow you to cycle through the buffers
09:11todunI'm guessing that's the same as name space.
09:11Fossitodun: you want windmove
09:11todunI was not sure what a name space is in clojure
09:11todunright is the cursor?
09:11duck1123each buffer has a name, if you know the buffer is "core.clj" you can start typing that to jump to it
09:13duck1123by C-x C-b will bring up the list of buffers that you can choose from
09:13toduneach buffer as in each file?
09:14duck1123each open file (and some other things) each have a "tab" that emacs calls buffers
09:14todunFossi: what is windmove?
09:15todunFossi: where to download it from.
09:15duck1123If you have the starter kit, you should be able to shift + arrow to move to other sides of the split
09:15duck1123easier than C-x o
09:15todunFossi: http://www.emacswiki.org/emacs/WindMove just describes.
09:16todunduck1123: you mean the app version?
09:16duck1123are you using emacs in a terminal?
09:16todunyes
09:17duck1123If so, shift + arrow might not work
09:17duck1123C-x o it is then
09:17Fossiah, okay
09:19todunI'm perfectly willing to try the app
09:19todunin fact I'm there now. shift arrow sets a mark
09:20duck1123Ok, if you have windmove, that binds to windmove down. It's part of the v1 of starter kit, so I don't know where you get it
09:21todunduck1123: I did 24 nightly as suggested by raek
09:21todunwill this give me windmove?
09:22todunalso, the split is always between one name-space and another.
09:22duck1123couldn't say. I'm still on 23.2.1 and starter-kit v1
09:22todunso I do C-x 2 when I'm in clooj.clj. I get two windows of this
09:23todunduck1123: how do you do it with your version?
09:23duck1123now you can take one of those sides an switch to a different buffer
09:24todunhow do I switch between split screens?
09:24duck1123todun: I just delete my existing ~/.emacs.d and then checkout the starter kit to that location. I believe things may have changed with the newer verson
09:25duck1123M-x next-buffer or C-x <right> to cycle
09:26raektodun: with emacs-starter-kit, use Shift + arrow key
09:26duck1123sorry, raek's right
09:27duck1123C-x o if you don't have windmove or you're in a terminal
09:27todunshift arrow-key doesn't work for me.
09:28todunalso, I only seem to be switching between scratch, GNU emacs, Completions, one.clj
09:28todunusing C-x left/right arrow keys
09:29duck1123Those are probably the only files you have open. C-x C-f to open a new file
09:29todunduck1123: but how do I switch to the repl?
09:30duck1123Try M-x clojure-jack-in or start swank and M-x slime-connect
09:31duck1123Personally, I prefer the latter because I always have a screen session running in Guake.
09:32todunduck1123: had to remove slime because it was messign with jack-in
09:32todun*messing
09:32raektodun: actually, you can have slime installed. it's just that you must have the right version
09:32raekwhich can be tricky
09:33todunraek: ok. at this point I just want to understand all this so I can begin developing like a clojurian!
09:33duck1123I have only slime and slime-repl installed. Some of the other slime* packages cause me problems
09:34todunso I have it such that there are two screens. one with the repl, the other with the .clj
09:34todunnow what?
09:35duck1123code in the clj file. C-c C-k to load it, C-c M-p to set the namespace of the repl, run the function
09:37todunraek: doing C-c C-k to load the file. C-c M-p to make the repl be in the namespace of the file doesn't make the repl in my namespace...or am i missing something?
09:39duck1123if your point is in the file, C-c M-p should populate the namespace, otherwise you might need to type it. This assumes you're connected, of course
09:40duck1123And if you haven't required the namespace in any way, C-c M-p won't work. C-c C-k in that file first and you'll be all set
09:40raektodun: what duck1123 said. When you press C-c M-p it will diplay the namespace of the file in the minibuffer. press return to accept it.
09:40todunduck1123: what is a point ?
09:41duck1123your cursor
09:41todunok. yes I'm connected.
09:41duck1123A lot of emacs stuff uses it's own names for things.
09:41todunrequired the namespace?
09:42todunC-c C-k === Cntrl + c Cntrl + k ?
09:42duck1123yes, do that in the file
09:42todunC-c M-p == Cntrl + c Meta + p ?
09:43duck1123Meta is either alt+p or esc p.
09:44todunduck1123: how to make alt the meta?
09:44todunCntrl + c doesn't work for me. it instead puts in the character c and does nothing.
09:45raektodun: "meta" is the name emacs uses for the key that is called "alt" on PCs
09:45todunok. can you change the meta ?
09:45todunor you're stuck with esc?
09:46duck1123If emacs accepted the C-c, you should see "C - c -" at the bottom left
09:46raektodun: you can't use the alt key?
09:46lucianwhat's the standard for clojure package management (like python's pip, or ruby's gems)
09:46todunraek: yes. my meta is esc
09:46raektodun: you can use both
09:47duck1123most terminals won't send your alt commands, so you're stuck with esc.
09:47tdrgabilucian: leiningen
09:47todunraek: just tried
09:47todundidn't work
09:47raeklucian: packages = maven artifacts. build tools to make packages: Leiningen, Cake or Maven: repository: Clojars and Maven central
09:48duck1123I've gotten to the habit of always using esc w for kill-ring-save. I've been bitten by OSX to many times. Want to copy text and end up closing the window
09:48raekwell, you use the build tools to "consume" packages too
09:48todunC-c doesn't seem to be working for me.
09:49raeklucian: https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md
09:49duck1123C-c doesn't do anything on it's own, It's a prefix for multiple key commands
09:50lucianraek: hmm. is there a way to install things system-wide?
09:50lucianthanks raek tdrgabi
09:51duck1123lucian: it's really not encouraged
09:51raeklucian: cake has a "global project" which kind of works like that
09:51lucianduck1123: i know, but i want to do it anyway
09:51luciani'd rather not make a project just for playing around with things
09:51raekwith lein you need to make a "scratch project"
09:52raekthere's also Cljr
09:52lucianright, i'll have a look
09:53raeklucian: https://github.com/liebke/cljr
09:53lucianraek: ah, awesome. precisely what i want
09:53todungot C-c M-p to work. it displays: Package: first-project.one
09:53raektodun: press return
09:54todunraek: I see a bunch of files.
09:57todunperhaps I should get cljr?
09:58todunwill this help a newbie?
09:58clgvtodun: you could try eclipse with ccw or similar plugin for netbeans ;)
09:58duck1123perhaps in the short term, but if you're serious about clojure, you're going to need to know lein/maven/cake anyway
09:59todunclgv: ok. try that. but sine I've gone down this wabbit hole, might as well finish..
09:59xkbhi #clojure
10:00xkbI am trying to get the first 100 entries from a stream. I get the stream trough async-http: (string stream-seq client ....) and I'd like to just do (take 100 stream)
10:01xkbhowever this doesnt work (looks like it blocks)
10:01xkbany idea how I should handle this?
10:01clgvxkb: then you might have not enough data in there ;)
10:01xkbI can continually print the seq by using doseq
10:01xkb(its a twitter stream)
10:01andrewcleggI keep running into little things that would be easier in clojure but not worth starting a separate project for
10:02clgvand remember take is lazy and wont do anything unless you access does elements
10:02xkbis take allowed/working on a stream-seq?
10:02xkbhmm
10:02clgv*those
10:02andrewcleggis there a best-practice/least-friction way to do that?
10:02mikera@andrewclegg works fine for me with Eclipse / Maven in a Java project
10:02andrewcleggmikera: just have a separate src/main/clojure dir and add the clojure nature?
10:03mikerayep. also I use Maven for the clojure dependency but you don't have to
10:03andrewcleggdo you have to do anything funky to make sure the clojure stuff gets compiled before the java code that references it?
10:03andrewcleggI think I stumbled on that last time I tried
10:03mikeraNo - the clojure files get compiled on demand
10:03andrewcleggcool thanks, will try again and see how I get on
10:04cemerickandrewclegg: Do you need to distinctly compile the clojure stuff? Unless you're referring to types defined in Clojure, you can just ship the source .clj
10:04andrewcleggcemerick: I'm generally making jars to deploy to a repo for use by other java projects
10:05andrewcleggcan you just bundle the source .clj in the jar?
10:05cemerickandrewclegg: absolutely
10:05andrewcleggand that gets compiled when the clojure rt first needs it?
10:05cemerickIf your clients only touch the Java API, then there's no need to AOT-compile the clojure sources.
10:05andrewcleggthis is sounding better all the time :-)
10:06cemerickIn that scenario, you do need to load the Clojure sources at runtime (in a static init block, or somesuch), but you're otherwise golden.
10:06cemerickAgain, this is the case if you're not referring to Clojure-defined types from Java.
10:06mikeraI never used AOT compilation either, just bundles the .clj files in the jar
10:07cemerickYou can just put your .clj files in src/main/resources (if you're using maven), and they'll get rolled into the jar automatically.
10:08todunraek: so to develop in emacs, what steps should I take from M-x, clojure-jack-in...? thanks.
10:08andrewcleggwhat I'm thinking is: I provide a library jar which has interfaces defined in java, that my consumers speak to. the implementation classes in my jar delegate some of their work to clojure functions. my consumers never speak to the clojure functions directly
10:08andrewcleggso my impl. classes have to do something in static blocks to bring up clojure?
10:09andrewcleggI don't suppose anyone knows of a blog post with an example :-)
10:09cemerickandrewclegg: Sounds beautiful; yes, just require the relevant namespaces from Java, and invoke the functions you want.
10:09andrewcleggnice -- I'll try and see where that gets me
10:09andrewcleggthx
10:10xkbis there someway to "disconnect" from a stream?
10:10cemerickandrewclegg: There's extensive examples in my book (sorry for the self-promotion). In short:
10:10cemerickprivate static IFn requireFn = RT.var("clojure.core", "require").fn()
10:11cemerickrequireFn.invoke(Symbol.intern("your.namespace"));
10:11cemerickThen use RT.var to get access to the functions you defined in your namespace.
10:12andrewcleggsweet, thanks for summarizing
10:14raflso i implemented a library that provides a bunch of java classes and interfaces and i'd like to hand that off to the java people to write applications with
10:14raflfor that, i'd like to provide them with documentation for the java api
10:14raflshould i be looking at any tools to generate docs targetted at java people from doc strings or whatever?
10:14andrewcleggrafl: sounds like you just volunteered to write such a tool :-)
10:15clgvI want to implement a custom serializer for kryo in clojure. unfortunately "Serializer" is an abstract class and not an interface. is the only clojure way to use a genclass or what other options do I have?
10:15clgvI cant use a deftype, can I?
10:16raflandrewclegg: fair enough. i might as well :)
10:17raekclgv: you can only use proxy or gen-class in that case
10:17clgvok deftype does not work
10:17clgvraek: well then it's genclass since I do not need to proxy any of the methods
10:17cemerickrafl: I looked at generating javadoc from Clojure sources a long time ago.
10:17cemerickjavadoc is *not* easy or simple to extend
10:18raekor make a adapter class in java that delegates to something more clojure-friendly
10:18raflcemerick: actually, that's the route i was going to try first. did it turn out to be particularly impossible?
10:18cemerickThe general consensus we reached then was that generating dummy Java source files from Clojure-defined types and running Javadoc over that was the most reasonable path.
10:19raekyuck
10:19cemerickrafl: Yeah, it's *really* gnarly.
10:19rafl*nod*
10:19cemerickraek: That's what I thought at first. Then I looked at javadoc.
10:20clgvraek: hm right I could make a wrapper class that uses an interface
10:20raflcemerick: any chance of finding your clojure types -> fake java code stuff somewhere public?
10:20raekhow about the other way? is it simple to extract javadoc data from java source?
10:20cemerickrafl: Oh, I never actually implemented that! :-P
10:20raflmarvellous!
10:20cemerickWouldn't be super-difficult, but never hit the top of my priority list.
10:21cemerickraek: No. I don't recall the details.
10:21raflit seems quite doable, really. just a little unsure about how many yaks i want to shave today.
10:33emil`does anyone know why the clojurescript repl sample doesn't respond after the second post is sent to the server?
10:33mikera@andrewclegg - you're not the Andrew Clegg from RGS Guildford by any chance?
10:37andrewcleggmikera: yeah, from like 20 years ago!
10:46wjlroeHow do I check if an atom is defined?
10:46jingguoHi, All. Is tools.logging is a replacement of clojure.contrib.logging?
10:47pyrwjlroe: (if @atom) ?
10:48wjlroepyr: just says Unable to resolve symbol
10:49pyrwjlroe: well then that's something else entirely
10:49pyrwjlroe: it's not specific to an atom, you just have a symbol that's not declared
10:49wjlroepyr: I want to define an atom if it hasn't already been defined
10:50pyri'm not sure you're doing it right
10:50pyr(def foo (atom nil))
10:50pyr(when-not @foo (reset! foo some-val))
10:50wjlroepyr: ok, I'll try that
10:51pyror you can use memoize
10:51raekpyr: there is a race condition in that piece of code
10:52pyrraek: how so
10:52zoldar(swap! foo #(when-not % some-val)) ?
10:52clgvzoldar: thats it
10:53raekpyr: the atom can change between the deref and the reset!. swap! should be used here
10:53pyrah, of course
10:57wjlroeraek: thanks! I wouldn't have spotted that. makes the code much better implementing that
10:57wjlroepyr: thanks for your help
11:11ljosHi - If i want to do this in clojure how would I do it? frame.getContentPane().add(comp) I'm pretty new to clojure...
11:11jcromartie(.. frame (.getContentPane) (.add comp))
11:11jcromartieI think
11:11jcromartie(is ".." deprecated?)
11:12jcromartiehttp://clojure.org/java_interop
11:12ljoswait.. I wrote the wrong thing. It should be frame.getContentPane().add(comp, BorderLayout.CENTER)
11:12clgv jcromartie: idk, but you can also use (-> frame .getContentPane (.add comp))
11:13ljosCan I do it in a doto.. I have some other things I need to do to the frame as well..
11:14jcromartieclgv: ah yes, -> is more idiomatic
11:14jcromartieI am dipping into interop right now too
11:14jcromartieusing doto at the moment
11:16duck1123ljos: If you're using Swing, I'm pretty sure there's one or more libs that abstract away most of the nastiness
11:18ljosduck1132: probably, but there is very little swing I need to do. I just wanted the frame up and running.
11:19clgvljos: yes you can
11:19ljosMost of the swing stuff is in java. I just needed to start it properly.
11:19ljosclgv: Ty for your help, I just managed to make it work. This is sweet!
11:20ljosThanks to everyone who answers as well :D
11:21todunwhat's the difference between def, defn, clojure ?
11:22duck1123defn is a function, def is any var.
11:22duck1123(defn foo [x] x) vs (def foo (fn [x] x))
11:23jcromartieand defn supports a bit more than def, too
11:23jcromartielike comments
11:23jcromartieand pre/post-condition maps
11:24clgvduck1123: defn is a macro ;)
11:25duck1123Yes, there are more differences than what I showed, but that's the imortant part he needs to know
11:26duck1123if you're ever in the situation where you're trying to take the value of defn, you're probably doing something wrong anyway
11:30chridohi, i want to insert a joda-datetime thing with clojure.java.jdbc into the database, which format string do i have to use?
11:31chridoYYYY-MM-DD HH:MM:SS behaves quite funny, i get Incorrect datetime value: '2011-10-285 15:10:54' for column 'lastUpdate' at row 1
11:32duck1123chrido: I believe sending the time as a number works
11:33andrewcleggljos: are you doing swing? would this help? https://github.com/stathissideris/clarity
11:33duck1123285 days in October?
11:35chridoduck1123: do you know mean as timestamp?
11:35chridoyyyymmddhhmmss also doesn't work
11:37duck1123chrido: right, if you can get it as a timestamp, this should eliminate parsing issues
11:38duck1123but your real issue is your date is malformed
11:38duck1123'2011-10-285'
11:41chridoduck1123: this is what bothers me most, this is the code which prints "2011-10-285 17:10:14"
11:41chrido(. (org.joda.time.format.DateTimeFormat/forPattern "YYYY-MM-DD HH:MM:SS") print (new org.joda.time.DateTime))
11:42duck1123I don't know if it's the same as the java string, but try "yyyy-MM-dd hh:mm:ss"
11:42todunduck1123: ok. so def is like 'var ?
11:43duck1123todun: def defines a var, yes
11:44chridoduck1123: with "yyyy-MM-dd hh:mm:ss" i get "2011-10-12 05:43:16",
11:46chridoduck1123: "yyyy-MM-dd HH:mm:ss" is OK, gives 24hours
11:46todunduck1123: when I do this (def var 12) => 12, ('v 12) => nil, 'v => v
11:46chridoduck1123: thanks a lot! but will try to convert it to timestamp
11:47duck1123todun: v => 12
11:49duck1123'v gives you the quoted symbol. #'v gives you #'user/v (or whatever ns you're in) v gives the value pointed at by #'v
11:50clgv&#'v
11:50lazybotjava.lang.Exception: Unable to resolve var: v in this context
11:50clgv&#'map
11:50lazybot⇒ #'clojure.core/map
12:01llasramOOC, why are their multiple evaluation bots hanging out here, and are their interfaces documented anywhere?
12:01llasrams,their,there,
12:02jcromartiewhat's a good way to get a lazy seq of forms from a file
12:02jcromartieI'm trying to whip it up myself
12:02jcromartiebut if there's an example
12:02duck1123bots become smug when there's no cometition. It keeps them honest
12:03ejacksonduck1123: they're lispbots, its in their nature.
12:19galderz1hi all
12:19galderz1have a question about the move of contrib to separate git repos
12:19galderz1does anyone know where http://richhickey.github.com/clojure-contrib/string-api.html lives now?
12:20galderz1it's not clear from looking at http://dev.clojure.org/display/doc/Clojure+Contrib
12:23galderz1seems like i'm not the only one asking: http://groups.google.com/group/clojure/browse_thread/thread/973fae166ba4121d?pli=1
12:24duck1123clojure.string
12:25duck1123most of the string stuff come with clojure now
12:25galderz1duck1123 but grep is not there for example
12:25galderz1^^
12:25galderz1in particular, i wanted to grep a pattern in a file
12:25galderz1there might be easier ways to do it of course
12:35srid(apply merge (for [] ...)) <- the for returns a list of maps that needs to be merged. is there a better way?
12:37jkkramersrid: you could use reduce to work with one map from start to finish
12:37sridreduce seems conceptually over-complicated for implemented 'set comprehensions' though
12:38todunduck1123: ok. I'll have to read up some more. thanks.
12:39duck1123srid: looks like merge uses reduce1, so you're probably better off with apply
12:40sridseems so. {for [] ...} would have been better ;-)
12:40duck1123since there's no special case for different # of args
12:40jkkramersrid: (into {} (for [] ...)) may also work, depending on what you produce with for
12:41duck1123if you can produce only the sets of keys you want, you could (into {})
12:41srid,(into {} (for [x (range 5)] {x (* x x)}))
12:41clojurebot{0 0, 1 1, 2 4, 3 9, 4 16}
12:41sridok
12:42jkkramer,(into {} (for [x (range 5)] [x (* x x)])) ;also common
12:42clojurebot{0 0, 1 1, 2 4, 3 9, 4 16}
12:43todunhow to quit out of a clojure repl
12:45trptcolintodun: ctrl-d will do it
12:45toduntrptcolin: ok. no special "quit" or other?
12:45trptcolinnope
12:46toduntrptcolin: thanks.
12:46jcromartieplease critique my lazy form sequence function: https://gist.github.com/1281781
12:46jcromartieI'm a lazy-seq noob
12:46trptcolinsure thing. lein repl has a fancy command: (exit), but nothing built-in
12:47toduntrptcolin: that didn't work for me though,
12:47trptcolinusing which version of lein?
12:47todun'lein repl' user=> exit
12:47todun#<core$exit leiningen.core$exit@4b17b450>
12:47trptcolin(exit)
12:47trptcolinit's a function call
12:47todunha. like all of closure :)
12:47todun*clojure
12:49jcromartieseems to work well enough
12:49sridlamina question: i defined a second filtered/mapped channel like this: (defonce event-queue (->> sink-queue (map* foo) (filter* identity))) ... but this would run in module load. what if I wanted to define this only when a function (eg: "initialize") is called?
12:51duck1123srid: [shameless plug] you could try definitializer in Ciste. https://github.com/duck1123/ciste
12:51sridwhich file?
12:51srid\
12:51duck1123But that also hooks into the config and environment system
12:52duck1123it's in ciste.config
12:55todunI'm about to write my first clojure in emacs now. but I'm a bit hazy as to some of the details. First I have to create a project(still not sure if I have to do this all the time like eclipse workspace). Then I know I have to open emacs in /src. Then connect to some swank server using M-x, clojure-jack-in. Then be in a name-space....etc. Does anyone know where I can find steps to do all this? thanks.
13:01technomancytodun: your patience is remarkable =)
13:01dnolentodun: if you just want to learn Clojure it seems like you're going thru a lot of trouble.
13:01jcromartietodun: might I recommend 4clojure?
13:01technomancyI signed off irc last night when you were figuring out clojure-mode and the first thing I see when I sign back on is that you're finally ready to code =)
13:02jcromartiehttp://www.4clojure.com/
13:02duck1123todun: have faith. It gets better.
13:03cemericktodun: I have to check: did you try the eclipse plugin, and find it not to your liking (I'm assuming here you are more familiar with eclipse…)?
13:03technomancytodun: the steps you've listed are correct. for starters it's simpler if you stay in one namespace/file
13:04todunthanks all.
13:04todunI'm interested in emacs so that I can know what to do whatever the platform. in other words, I want to be platform agnostic when learning clojure.
13:05cemerickcarry on, then :-)
13:05toduncemerick: sure.
13:05toduntechnomancy: so the steps are correct.
13:06toduntechnomancy: should I have to create a project each time I start?
13:06technomancytodun: no need; if you're doing experimentation you can re-use a scratch project
13:06toduncan I just have one folder which has /src in it. then from there have all my .clj in /src ?
13:07toduntechnomancy: scracth project?
13:07toduntechnomancy: will this let me save the work into a file?
13:08technomancyright; just do "lein new scratch" and work in the src/ dir of that project; that's probably the simplest for just experimentation
13:09technomancyyou can get standalone sessions outside a project, but for learning's sake it's quicker to just get accustomed to a project-centric approach
13:09todunok. trying that now...
13:10duck1123sooner or later you're going to want a library outside of clojure, and it's easiest if you can just add it to the project file
13:10todunI cd scratch
13:10clojurebotNo entiendo
13:11todunduck1123: meaning?
13:11todunduck1123: as in which is the project file?
13:11todunduck1123: is there a main project file?
13:11technomancytodun: project.clj in scratch defines your project settings including dependencies
13:11duck1123when you do "lein new scratch" it will create a "project.clj" file
13:12todunduck1123: I though scratch of anything I do with 'lein new project' is a project file
13:12duck1123that's how lein knows what libraries you're using
13:12technomancyat some point you should read "lein help tutorial" though I hate to distract you from actually writing code.
13:13toduntechnomancy: this doesn't cover dev in emacs though : https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md
13:14todunduck1123: ok.
13:15todunafter creating, opening a file first-project.clj(in /src), connecting to server, then what?
13:15technomancytodun: open the file in src/scratch/core.clj and do C-c C-k; that will compile it in the repl
13:15technomancywrite some code in there, and then recompile to see its effects
13:16technomancythen C-c M-p to switch the namespace repl buffer to match the file you're currently in
13:17toduntechnomancy: so I should keep the name of core.clj?
13:17technomancyif it's just for experimentation it doesn't matter
13:17duck1123for now, unless you have a better name
13:18todunoh I see. core.clj doesn't exist yet.
13:18duck1123it should be in src/scratch/core.clj
13:19duck1123in the scratch directory that lein new made
13:19todunactually it does at sractch/src/scratch/core.clj
13:20duck1123cd into the scratch folder and work from there
13:20duck1123then do a git init and make your initial commit
13:20todunok. I have it open with (ns scratch.core) as its sole content
13:20duck1123magit is an awesome git client
13:21todunso it allows me to make commits directly from emacs?
13:21todunI actually have an idea of a group of functions I want to write.
13:21duck1123C-x g (assuming you're using starter kit)
13:22todunyes
13:22technomancyduck1123: in v2 it's actually C-c g if you're using the bindings module; M-x magit-status if not
13:22todundo I write my code before I connect to the swank server?
13:23duck1123technomancy: Not sure how I feel about that. My fingers are too trained
13:23technomancytodun: doesn't really matter, but you can't try it out until you're connected
13:23technomancyduck1123: trying to be a little better about followin gconventions
13:26toduntechnomancy: ok. let me write something quick and test it.
13:28todunhow to undo in emacs starter-kit? I've always used C - ?
13:29duck1123C-_
13:29duck1123or C-/ or C-x u
13:30TimMctodun: M-x undo and then look at the hint that appears in the minibuffer.
13:30TimMcIt should tell you a keybinding.
13:30todunTimMc: thanks.
13:30duck1123C-h f undo <ret>
13:31TimMc:-)
13:39todundoes anyone get a weird indent when using emacs starter kit?
13:39todunI get it whenever I comment out a line.
13:39todunand hit return.
13:41toduntechnomancy: duck1123 ok. I have my function written in scratch. what next?
13:41todunconnect to swank?
13:42duck1123connect to swank, switch to that ns, run the fn and make sure it works
13:43duck1123then write a unit test for it.
13:45todunconnecting to swank...switch to ns ?
13:53dnolenso any opinions on the ClojureScript string/keyword patch? http://dev.clojure.org/jira/secure/attachment/10382/84-str-on-symbol-keyword.patch
13:55todunmy comments in emacs-starter-kit seem to be right-justified. is this normal?
13:55duck1123if you do ;; then emacs will keep them in line with the code
13:56todunduck1123: ok. thanks.
13:56todunI had to go back to the cli. emacs app was acting funny
13:56todunso I'm connected. what did you mean by switch to the ns?
13:56ibdknoxdnolen, what's the practical implication of that change?
13:57todunduck1123: I thought I was already in the ns
13:57dnolenibdknox: (str :foo) -> ":foo"
13:57dnolenibdknox: currently (str :foo) -> :foo
13:57todunduck1123: when I start in core.clj
13:57dnolenibdknox: same for symbols
13:57duck1123You start off in the user ns, the repl will show your current ns
13:57jkndrknhey all. i'm working with a multi-threaded webservice. we want to collect timing information for a request. we'd like to avoid making ad-hoc changes to our existing code in order to pass in and pass out a map that will accumulate timing information.
13:58ibdknoxdnolen, the same for symbols?
13:58dnolen(str 'foo) -> 'foo in CLJS
13:58ibdknox,(str 't)
13:58duck1123todun: if you C-c C-k the core.clj file, the C-c M-p it'll switch you to the right ns)
13:58clojurebot"t"
13:58ibdknoxdnolen, why the difference?
13:58dnolenibdknox: exactly, patch aligns CLJS w/ Clojure
13:59ibdknoxgotcha
13:59duck1123todun: alternately (do (require 'scratch.core) (in-ns 'scratch.core))
13:59jkndrknhowever, if we were to create some kind of global state (a map) that could instead be passed timing information from within arbitrary parts of our system, we would still need to pass around some kind of request-id in order to assign timing data to the global map in a way that it uniquely identifies timing information for a given request
14:00jkndrknunfortunately, we don't already pass the same data structure to all corners of our request, otherwise we would simply accumulate performance data on that data structure via metadata.
14:00jkndrknhave any ideas?
14:00ibdknoxdnolen, looks fine to me
14:01jkndrknwe're using compojure (jetty), if that helps
14:01todunC-c C-k then C-c M-p ==== (do (require 'scratch.core) (in-ns 'scratch.core))
14:02ibdknoxjkndrkn, middleware + an atom + thread binding
14:02todunduck1123: where do I put (do (require 'scratch.core) (in-ns 'scratch.core)), before (ns scratch.core) ?
14:02duck1123essentially. C-c C-k reloads the current file, C-c M-p switches the repl's ns
14:03duck1123todun: in your repl
14:03duck1123You could do it as two commands, the do is so it's a single command in your history
14:04todunduck1123: so they're equivalent at least in action?
14:05duck1123todun: right. You can't switch to the namespace until it's loaded. That's what require does. The in-ns changes the repl's ns
14:06jkndrknibdknox: we've considered an atom and thread binding. could you clarify as to how you would use middleware?
14:07todunduck1123: this is what my emacs stuff looks like: http://pastebin.com/AxVUq9Cg
14:07ibdknoxjkndrkn, you need your atom to be specific to each request. if you bind at the level of middleware, it will be. Take a look at the session implentation in ring or noir
14:08ibdknoxjkndrkn, https://github.com/ibdknox/noir/blob/master/src/noir/session.clj#L49
14:09ibdknoxjkndrkn, then you just need to make sure other threads that are spawned from that request use bound-fn
14:09ibdknox,(doc bound-fn)
14:09clojurebot"([& fntail]); Returns a function defined by the given fntail, which will install the same bindings in effect as in the thread at the time bound-fn was called. This may be used to define a helper function which runs on a different thread, but needs the same bindings in place."
14:09todunduck1123: after putting the line of code, what next? did I put the line of code in correctly?
14:09ibdknoxactually.. there was talk at some point of having threads automatically pick up the bindings of whatever called them, did that ever happen?
14:10jkndrknthanks, i'll look into that
14:10duck1123ibdknox: that's cool, didn't know that one. Have some code to simplify
14:10mabesibdknox: in 13 the bound-fn would not be needed
14:10mabesibdknox: er.. 1.3
14:10ibdknoxmabes, k, so it does it by default in 1.3 then?
14:11ibdknoxthat would be the desired behavior in my mind
14:11mabesibdknox: that is my understanding yes, you need to declare the var as dynamic though
14:11ibdknoxyep yep
14:11duck1123todun: try calling your function. Does it work?
14:11todunduck1123: so I just call it from the repl?
14:13todunduck1123: I get the following error: http://pastebin.com/iWj6BNuU
14:14duck1123todun: what does your repl prompt say? If it still says "user>" then you didn't change the ns correctly
14:14duck1123mabes: So I had to do something like https://github.com/duck1123/ciste/blob/master/src/ciste/triggers.clj#L33 are you saying that's no longer required?
14:16mabesduck1123: that is what I'm saying, but I haven't actually updated my apps to 1.3 yet.. so I may be incorrect, but that is what I remember from Rich's keynote at the last conj and other readings
14:16mabessomone with actual 1.3 experience may want to confirm the thread local bindings queustion...
14:17duck1123I vaguely remember hearing that, but I wrote this well before that feature would've been put in
14:17todunduck1123: this is what it says. ; SLIME 20100404
14:17todunuser> greeting
14:18duck1123todun: you're still in the default user ns. Try switching the ns again
14:18todunduck1123: I changed to it and pressed enter. It then changed to this: http://pastebin.com/TXXAygzp
14:19todunduck1123: I thought that the line of code I put in my app did that on my behalf, no?
14:19duck1123put it in the repl, not the code
14:19amalloy,(future (println "1"))
14:19clojurebot#<core$future_call$reify__5733@1d4e606: :pending>
14:19amalloy,@(future (println "1"))
14:19clojurebot1
14:20mabes,*clojure-version*
14:20clojurebot{:interim true, :major 1, :minor 3, :incremental 0, :qualifier "master"}
14:20amalloyduck1123, mabes: this works only because clojurebot is on 1.3. lazybot, on 1.2, should behave differently: ##@(future (println "1"))
14:20lazybot⇒ nil
14:20todunduck1123: ok..
14:21duck1123amalloy: good to know. I use a bound var to represent some things and I needed those things to still be bound in my triggers
14:24todunduck1123: ok. I think that worked. is that all I do?
14:25duck1123yep, code some more, C-c C-k in that file, then run it again from the repl
14:29todunduck1123: anytime I try to load a new function, the old one persists.
14:29todundo I have to restart eclipse over again ?
14:30duck1123todun: Oh, you're on eclipse now? I think there's an option to reload the repl
14:50daniel___https://github.com/danielstockton/evolve/blob/master/src/evolve/core.clj can anyone point out a method to println each generation?
14:51daniel___i've seen you can use do to execute side effects, but the problem is the important statement is the return statement
14:51daniel___i can't println until it's been evaluated
14:52daniel___line 26 is the one i need to modify, so for each iteration i can log whats going on
14:56amalloy&(doto (inc 5) println)
14:56lazybot⇒ 6 6
14:56ipostelnikdaniel___, look at clojure.contrib.trace
14:57ipostelnikdaniel___, returned value of a do is the last form executed
14:57ipostelnikamalloy, that's a clever trick
14:58duck1123daniel___: Here's the macro I use https://github.com/duck1123/ciste/blob/master/src/ciste/debug.clj#L5
15:03Raynesdakrone: Ping.
15:03TimMcamalloy: Huh, kind of acts like a begin0
15:06ibdknoxor just use a let?
15:13amalloyTimMc: i think you mean a prog1, you crazy schemer
15:14daniel___doto does the reverse order of do?
15:14daniel___so the first is returned
15:14RaynesDo does something completely different, but sure, the first is returned.
15:15Raynes&(doto "hi" println)
15:15lazybot⇒ hi "hi"
15:15daniel___ah ok
15:15llasramdaniel___: doto evalutes it's first argument, and embeds the evaluated value as the first argument in the subsequent forms. Check the macroexpansion
15:15Raynes&(macroexpand '(doto "hi" println))
15:15lazybot⇒ (let* [G__15133 "hi"] (println G__15133) G__15133)
15:15daniel___ok, will do...it's jsut what i wanted
15:19daniel___one more thing, with vimclojure when i launch the repl \s....should the file be loaded so i can call functions in it's namespace? or do i have to explicitly load it? because at the moment it cannot resolve symbols i've defined
15:23dakroneRaynes: pong
15:24Raynesdakrone: How much trouble would it be to release some sort of alpha or something of clj-http? I'd like to have something non-snapshot and running on 1.3 to depend on.
15:24RaynesAssuming that it isn't currently broken or something.
15:25dakroneRaynes: the current release "0.2.1" runs completely fine on 1.3, or did you need some feature in master that hasn't been released?
15:25RaynesOh, it does? Awesome. In that case, nevermind.
15:26dakroneI've been testing with 1.2.1 and 1.3 since I took it over to make sure it's always compatible with both
15:31TimMcamalloy: More of a Racketteer, really.
15:32zakwilson,(format "%x" (- (BigInteger. "4e95d6b5975a97db24369193", 16) (to-long (now)))) ; is there an easy way to do this?
15:32clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: to-long in this context, compiling:(NO_SOURCE_PATH:0)>
15:32zakwilsonOh, right.
15:32zakwilson,(format "%x" (- (BigInteger. "4e95d6b5975a97db24369193", 16) 1318447929255))
15:32clojurebot#<IllegalFormatConversionException java.util.IllegalFormatConversionException: x != clojure.lang.BigInt>
15:33technomancyTimMc: not a raconteur?
15:33TimMchmm
15:34zakwilson,(format "%x" 10000000000000000000000000000000) ; reduced to the simplest version
15:34clojurebot#<IllegalFormatConversionException java.util.IllegalFormatConversionException: x != clojure.lang.BigInt>
15:34TimMcmouseketeer
15:34technomancyTimMc: http://www.penny-arcade.com/comic/2007/03/23
15:35daniel___is there anything i can call within an iterate to give me the number of the iteration?
15:35llasramzakwilson: clojure.core/format is thin wrapper around java String.format(), which doesn't know about the Clojure 1.3 BigInt type
15:37llasramzakwilson: http://dev.clojure.org/display/doc/Documentation+for+1.3+Numerics
15:47wiseenClojureScript doesn't seem to support docstring in ns macro ? Is this true/intentional or a bug ?
15:49wiseen(ns test "DocString?") -> java.lang.AssertionError: Assert failed: Only :refer-clojure, :require, :require-macros, :use and :use-macros libspecs supported
15:50duck1123we need a clojurescript bot in here
15:51wiseenduck1123: Think it's my install ? I'll pull the latest but I think I'm only a few days behind ... and it works otherwise
15:54wiseennope, same thing ... will submit a bug report then
15:56zakwilsonOk, maybe I'm just dumb, but I'm not seeing a simple way to format a BigInt as a hex string without going Bigint -> String -> BigInteger -> String.
16:02alpheus`Heh. I needed to look at some vectors of maps so I'm emitting orgtbl-mode format for easy viewing in Emacs.
16:20todun_duck1123: just got your message. not on eclipse I mis-typed(was obviously nodding off). still emacs.
16:20todun_duck1123: if I make a change, do I reload the namespace somehow?
16:21duck1123C-c C-k in the changed file will reload it in the current vm
16:22todun_duck1123: after I use those commands, I get this Compilation finished. (No warnings) [0.01 secs]
16:22todun_duck1123: then I switch wondows.
16:22duck1123todun_: that means it's working :)
16:22todun_then I get an exception when I call the function with args.
16:23todun_duck1123: I call the function like so: (greeting "work")
16:24duck1123What does the exception say? If it compiles but does not run, there's probably some logic error
16:24todun_duck1123: (defn greeting "'Hello, username.' This is tough, but fun." [username] (str "hello, " username))
16:25todun_duck1123: that's the function.
16:25todun_duck1123: I already suspected it didn't compile because it doesn't let me tab complete.
16:26todun_duck1123: exception is http://pastebin.com/RtJGp3Av
16:27duck1123todun_: you're in the user ns again
16:29todun_duck1123: phew. I think I'm certifiably confused.
16:29todun_duck1123: shouldn't have that line of code in repl be equivalent to compiling it like we did using C-c C-k?
16:30duck1123C-c C-k compiles the line, but it does not change your repl's namespace
16:31duck1123that's what C-c M-p is for or in-ns
16:31duck1123The prompt in the repl shows your current ns, so if you see "user>" then you need to change
16:32todun_duck1123: so that changes it to a name space called scratch.code, right?
16:33todun_duck1123: thanks! it now works. it all does makes sense now, finally.
16:33duck1123C-c M-p will auto populate the ns associated with the current file. (whereever your pointer is)
16:34todun_duck1123: C-c C-k to compile ; C-c M-p to switch namespace. Then, like a script, call functions.
16:35todun_if I were using lein as 'lein repl', will I have to do all this?
16:35duck1123If you're using lein repl, then you don't have the fancy emacs commands
16:35todun_could I just emacs my thing then open a new repl in the same folder and do my testing?
16:35todun_duck1123: yeah, but I'll have another window.
16:36todun_duck1123: and perhaps achieve the same results, no?
16:37zerokarmaleftlein repl isn't quite as nice as slime/swank
16:37raektodun_: in lein repl you type (require 'scratch.code :reload) instead of C-c C-k and (in-ns 'scratch.code) instead of C-c M-p
16:37duck1123it's all the same in the end, you just won't have any of the features that slime provides. (ie. you can't C-c C-k to reload the file)
16:37todun_duck1123: if I wanted to use this scheme, how will I load my core.clj into the lein namespace which seems to be eternally 'user'
16:37todun_?
16:38zerokarmalefttodun_: what raek said
16:38raektodun_: for future reference http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
16:38todun_raek: should I have it like so (do require 'scratch.code :reload) (do in-ns 'scratch.code)
16:39raektodun_: no. why the "do"?
16:39todun_zerokarmaleft: sorry was typing out of sync with them. got it.
16:39duck1123raek: I posted an example with do earlier
16:39todun_raek: didn't work the first time. I thought I saw duck1123 do that earlier.
16:39raektodun_: (do a b c) is not the same as (a b c).
16:40duck1123The do was only so both commands were the same command so you can pull it up from your history
16:40ibdknoxoo
16:40ibdknoxI wonder if that's a 1.0 of ring
16:40raektodun_: another neat trick is (doto 'scratch.code (require :reload) (in-ns))
16:41todun_duck1123: I see.
16:41raekthat's the same as calling (let [x 'scratch.code] (require x :reload) (in-ns x) nil)
16:41raek...or (let [x 'scratch.code] (do (require x :reload) (in-ns x) nil))
16:41duck1123raek: should return x actually
16:41raekbut let has an "implicit do" so you don't need to write it
16:41raekduck1123: correct. my bad.
16:42ibdknoxlol
16:42todun_raek: do I run them on the same line like so (require 'scratch.code :reload) (in-ns 'scratch.code)
16:42ibdknoxdoto twice in one day
16:42todun_raek: or line by line?
16:42raektodun_: doesn
16:42raektodun_: doesn't matter
16:42amalloyraek: the nil at the end of your doto/let/do doesn't make any sense
16:42raekamalloy: yes, I know. I meant (let [x 'scratch.code] (require x :reload) (in-ns x) x)
16:43todun_raek: this is the output I get.
16:43todun_http://pastebin.com/ZEd69Fm4
16:43ibdknoxlol
16:43ibdknoxtodun_, it has to be the name of your namespace
16:44raektodun_: I think you called in-ns by accident before you called require
16:44raektodun_: that way you are now in an empty namespace with nothing in it. not even 'require'.
16:44duck1123todun_: isn't is 'scratch.core or did you rename?
16:44raektodun_: enter (in-ns 'user) to get back, and then call (doto 'scratch.code (require :reload) (in-ns)) again
16:45cgrayit seems like my -main function is not exiting immediately when it's done running code... is there anything i can do to make it exit?
16:45ibdknox,(= 'scratch.code 'scratch.core)
16:45raek(I think in-ns is hard-coded into the repl)
16:45clojurebotfalse
16:45amalloyyes, in-ns and several other things
16:45raekcgray: sometimes you need to run (shutdown-agents)
16:47cgrayraek: thanks, that worked
16:47todun_duck1123: I didn't rename it.
16:47amalloyraek: fwiw you don't have to get back to the user ns to do this; you could instead (clojure.core/require ...) from inside the "broken" ns
16:47todun_ibdknox: should I space out in-ns to in - ns ?
16:47todun_raek: ok. let me try that.
16:48ibdknoxI think there are too many people telling you what to do :)
16:48duck1123todun_: unlike most languages, - is legal in variable names. The proper name is "in-ns"
16:49todun_raek: I get this error. http://pastebin.com/FpKqSk4V
16:49ibdknoxamalloy, what triggers injecting clojure.core into a namespace?
16:49todun_duck1123: oh ok. thanks.
16:50amalloyibdknox: nothing does. you can reference anything that's been loaded by fully-qualifying it
16:50amalloyor do you mean, in the non-broken case? like (ns foo)?
16:50ibdknoxamalloy, yes
16:50duck1123todun_: you still have the namespace wrong. 'scratch.core
16:50todun_duck1123: I cd like so : http://pastebin.com/NEAY7T7C
16:51amalloythe ns macro has an implicit (refer 'clojure.core), whose parameters you can modify with the :refer-clojure directive
16:51todun_duck1123: yes. .core NOT .code! thanks
16:51ibdknoxI see
16:51amalloy,(macroexpand '(ns test))
16:51clojurebot(do (clojure.core/in-ns (quote test)) (clojure.core/with-loading-context (clojure.core/refer (quote clojure.core))))
16:52todun_duck1123: raek thanks all!
16:52amalloy,(macroexpand '(ns test (:refer-clojure :only [inc])))
16:52clojurebot(do (clojure.core/in-ns (quote test)) (clojure.core/with-loading-context (clojure.core/refer-clojure (quote :only) (quote [inc]))))
16:52amalloyi think
16:52todun_duck1123: is this all I need to know to begin developing using emacs and 'lein repl' ?
16:52ibdknoxhaha I like the quote of a keyword
16:52ibdknox,(= :test ':test)
16:52clojurebottrue
16:53amalloyibdknox: just in case some future version of clojure makes keywords not self-evaluating, i'm sure...
16:54ibdknoxamalloy, Planning for the future is important ;)
16:54zerokarmalefttodun_: that's a good start
16:54duck1123todun_: keep in mind, the emacs stuff isn't going to work if you're using lein repl
16:54zerokarmalefttodun_: you may find the cycle of reloading source files after you've changed them so you can test in your REPL to be a PITA
16:55zerokarmalefthence the keybinding in slime/swank for that sort of thing
16:55amalloyibdknox: macros write all kinds of silly code that programmers never would, of course
16:55amalloy(do (do (do (inc 1)))) :P
16:55ibdknoxhaha
16:55ibdknoxyeah
16:56ibdknoxI still love dnolen's first impl of match and the code it spit out
16:56ibdknoxit was like 18 nested fn's
16:56todun_zerokarmaleft: oh ok. I wanted to know of the option just in case I needed to work without need of a text editor.
16:56todun_duck1123: emacs wont work if in lein repl, meaning?
16:57technomancytodun_: you can use it with lein repl, but it's kind of dumbed-down compared to swank
16:57duck1123C-c C-k and C-c M-p are swank commands
16:57todun_technomancy: use what with 'lein repl'?
16:58amalloyibdknox: really? if you nest too many fns you actually get something that won't AOT-compile because the classfile's name is too long to write to disk
16:58ibdknoxhaha
16:58ibdknoxamalloy, it is *much* better now
16:58amalloy&(class (for [_ [1] _ [1] _ [1] _ [1] _ [1] _ [1] ] (fn [])))
16:58lazybot⇒ clojure.lang.LazySeq
16:59amalloy&(class (first (for [_ [1] _ [1] _ [1] _ [1] _ [1] _ [1] ] (fn []))))
16:59ibdknoxlast I saw it generated some very reasonable code
16:59lazybot⇒ sandbox12208$eval15263$iter__15244__15264$fn__15265$iter__15246__15266$fn__15267$iter__15248__15268$fn__15269$iter__15250__15270$fn__15271$iter__15252__15272$fn__15273$iter__15254__15274$fn__15275$fn__15276$fn__15286
16:59raekwhoa
16:59technomancytodun_: there's rudimentary emacs integration that works with lein repl
17:00technomancy(setq inferior-lisp-program "lein repl") ; in Emacs lisp, followed by M-x run-lisp
17:00amalloyand even that filename is less than 256 characters, i guess. but you can see how if you nested things too deep you could run into trouble
17:00technomancythat should probably be set by default
17:01todun_technomancy: oh ok. interesting. that way I wouldnt have to connect to a server.
17:01todun_right?
17:02clojurebotto be fair I dunno that I've ever had code out right rejected, it just sits in jira or assembla or where ever, or if I ask if there is any interest (before writing any code) I get told to go write alioth benchmarks
17:02zerokarmalefthaha
17:02amalloyclojurebot: i officially reject your code
17:02clojurebotcode-review is <rhickey> yikes
17:02technomancytodun_: right. it's not as fancy, but it's easier to set up
17:02ibdknoxlol
17:02ibdknoxfeisty little bastard
17:02todun_technomancy: ok. thanks for that.
17:03amalloyclojurebot: someone oughta teach you to respect your betters
17:03clojurebotHello, wiseen
17:03ibdknoxrofl
17:03duck1123todun_: really though, stick with swank until you get the hang of the basics
17:03todun_duck1123: how do I use the labrepl now that I have all this setup?
17:04duck1123It's good to know how to drive a stick shift, but when you're just learning to drive, an automatic is easier
17:05ibdknox&(println "clojurebot is annoying")
17:05lazybot⇒ clojurebot is annoying nil
17:06ibdknoxI was hoping he might respond
17:06ibdknoxit's not clear to me what gets clojurebot to say things
17:06ibdknoxI guess I should look at the code sometime
17:06amalloyhaha good luck with that
17:07RaynesI'm still trying to figure out what makes lazybot say things.
17:07amalloyfrom experience, though: (1) messages starting with ~ or clojurebot: (2) messages ending with ? (3) occasionally just for fun
17:07todun_duck1123: ok will do. thanks again.
17:07todun_thanks all.
17:07technomancyibdknox: there's like a 1% chance he'll interpret any given line as being addressed to him
17:07ibdknox~hey
17:07clojurebotwhat's up
17:07technomancy(sorry to spoil the magic)
17:08ibdknoxlol
17:08ibdknoxaw
17:08amalloythough he's obviously pickier about (2) since he diesn't answer all questions
17:08zerokarmaleftonly the questions where the answers are snarky
17:08amalloyhaha
17:08amalloyclojurebot: are you a snark bot?
17:08clojurebotThanks! Can I have chocolate next time
17:08ibdknoxlol
17:08amalloywow, really? snark<=>snack?
17:08ibdknoxsnark != snack
17:09ibdknoxI wonder if it just matches first and last or something haha
17:09RaynesThat's strange.
17:09ibdknoxclojurebot, sna
17:09clojurebotThanks! Can I have chocolate next time
17:09ibdknoxclojurebot, s
17:09clojurebotlisp is the red pill
17:09ibdknoxclojurebot, sn
17:09clojurebotI don't understand.
17:09ibdknoxclojurebot, snalfgd
17:09clojurebotI don't understand.
17:09ibdknoxhm
17:10amalloyclojurebot: ibdknox doesn't understand
17:10clojurebotTitim gan éirí ort.
17:10ibdknoxhaha
17:11amalloyclojurebot: you're not helping
17:11clojurebotHuh?
17:12ibdknoxclojurebot, snamp
17:12clojurebotPardon?
17:12ibdknoxclojurebot, snam
17:12clojurebotPardon?
17:12ibdknoxwpw
17:12ibdknoxwow*
17:12ibdknoxwtf is the code that matches that
17:12amalloyibdknox: in fairness you don't make any sense to me either
17:12ibdknoxhaha
17:13ibdknoxamalloy, I'm talking gibberish most of the time, so that's fair
17:40alpheus`does vals return things in the same order as keys does or is the order undefined for both keys and vals
17:40TimMc,(doc vals)
17:40technomancyalpheus`: order is guaranteed to be the same if called on the same map.
17:40clojurebot"([map]); Returns a sequence of the map's values."
17:40TimMc,(doc keys)
17:40clojurebot"([map]); Returns a sequence of the map's keys."
17:41TimMcShould be doc'd, really.
17:41technomancyI think there's an open issue for it?
17:42TimMcOh yeah, and how long does it usually take for a CA to get entered?
17:42brehautTimMc: its not a short process
17:42TimMc:-/
17:43alpheus`technomancy: same map means *identical* map? or a map with the same keys?
17:43amalloyalpheus`: i think it has to mean identical
17:43brehautTimMc: i think if you send one in, and then have some work you'd like to contribute and say you've sent one in, it'll get done as sooner
17:43alpheus`that's what I would have guessed.
17:44brehautTimMc: call by need ;)
17:44amalloysince a given impl of IPersistent map can do whatever it wants for keys/vals, and can return a different impl of IPersistentMap for any call
17:44amalloy&(class (dissoc (hash-map :x 1) :x))
17:44lazybot⇒ clojure.lang.PersistentHashMap
17:45TimMcbrehaut: Lazy loading? :-P
17:49bsod1I can't run example in this page of clojurescript https://github.com/clojure/clojurescript/wiki/Quick-Start , I'm getting `cljs is not defined` error in chromium, any ideas?
17:49amalloy&(zipmap (keys {:a 1 :b 2}) (vals {:b 2 :a 1})) ;; alpheus`
17:49lazybot⇒ {:b 1, :a 2}
17:49amalloyi guess is the easiest proof that it doesn't hold for arbitrary maps
18:15hiredman"Using it as a library from Clojure apps is likely a minority case." <-- does this seem ridiculous to anyone else?
18:16brehauthiredman: context?
18:16ibdknoxhiredman, yes
18:17ibdknoxthat thread made me sad
18:17hiredmanbrehaut: rich talking about clojurescript
18:19brehautits curious given that clojure itself is a library as much as it is a language tool
18:25technomancyrich criticizing imprecise use of the term "language tool" without actually defining it himself was kind of irritating
18:26hiredmanrich … is kind of irritating
18:37amalloyi wonder what the majority case is supposed to be
18:39hiredmanhow dare anyone assume you can use clojure and clojurescript together
18:40ibdknoxwell, I think we're missing what matters
18:40ibdknoxthere won't be a majority case if it's not easy to use lol
18:41technomancypeople are going to use maven releases of clojurescript; it's just a question of whether there will be an official one or if it'll be community-driven
18:41brehauti would rather not return to that
18:41technomancymuch like the entire CLI experience, actually
18:41technomancydeja vu
18:42ibdknoxtechnomancy, yeah, and I'd rather it be official just to prevent us from having 30 cljs jars around
18:43technomancyibdknox: as long as there's a strong community consensus I think that can be avoided
18:43ibdknoxtechnomancy, fair enough
18:44ibdknoxlol
18:44hiredmantechnomancy: https://twitter.com/#!/aemoncannon/status/124252083477155841 so when can we get this from slime?
18:45technomancyhiredman: heh; vals vs vars? so like ... clojure.lang.IRefs are all blue? =)
18:46hiredmanlexical vs. global bindings
18:46technomancyah! now there's a thought.
18:46technomancyM-. working on locals would be 100% badass
18:46hiredmanuh, I don't care about that
18:47hiredmanjust make them different colors
18:47technomancywell, if you can tell the difference, you might as well offer nav aid too
18:47technomancybut yeah, both would be rad
18:47hiredmanI guess
18:47technomancyI guess if you need M-. on locals you probably have functions bodies that are way too long for your own good
18:48ibdknoxwaaaaay too long
18:49brehautie core :P
18:49todunhow to quit out of emacs nicely when using swank?
18:50technomancytodun: C-x C-c
18:51toduntechnomancy: but that doesn't work cleanly in that swank is still running.
18:52technomancyjust tell it yes
18:52hiredmantechnomancy: depends how he is running swank
18:53todunhiredman: I'm running it with split window
18:53brehauttodun: the question is are you starting it from emacs (e.g. clojure-jack-in) or from lein
18:53hiredmanusing lein swank? clojure-jack-in? other?
18:54technomancyeither way exiting emacs will not be harmful
18:55duck1123I've found that if I run swank in a terminal, when I kill emacs I get an exception in the terminal window, but it doesn't harm the app
18:55todunhiredman: clojure-jack-in
18:55clojurebothttp://paste.lisp.org/display/74305
18:55toduntechnomancy: ok.
18:55todunduck1123: uhm. ok
18:56hiredmanduck1123: right, it's just swanking complaining
18:57todunhiredman: ok. thanks.
18:57todunhow do I get back to using labrepl?
18:57hiredmanugh
18:58todunI want to do its exercises but my local host can't connect t o it anymore
18:58hiredmandoes anyone maintain that?
18:58todun*clojure labs
18:58todunhiredman: clojure labs. sorry about that.
18:59duck1123hiredman: last activity 25 days ago
19:01todunactually I was right. it is called labrepl http://foognostic.net/labrepl-summary/
19:01todunit shows up in your local host as Clojure labs
19:04ibdknoxthe koans might be more interesting
19:04todunibdknox: referring to me?
19:05ibdknoxtodun, yeah
19:05ibdknoxeasier to start with too
19:05ibdknoxthough the easiest is still try-clojure
19:05ibdknoxor just messing around in clooj
19:06todunibdknox: this https://github.com/functional-koans/clojure-koans ?
19:06ibdknoxyep
19:06todunok. thanks.
19:34mabeswhere does -?> live? I can never remember.. or is it ->?
19:34brehaut-?> is clojure.contrib.core i think
19:35mabesbrehaut: thats it, thanks!
19:45Viluinhey guys
19:45Viluincould anyone help me out with a small problem?
19:46TimMcViluin: Just go ahead and ask your question; if someone can help they will answer.
19:46Viluinclojure is really weird to me
19:47amalloyi don't think that's a question yet
19:47Viluingetting there :P
19:47Viluinhttp://pastebin.com/SfS1yRMy I was hoping this would return true if integer n was larger than the amount of characters in string s
19:47Viluinbut it doesn't compile at all
19:47Viluin;x
19:48TimMcneeds [] around the args
19:48amalloyprefix functions
19:48amalloy(< x y), not (x < y)
19:48Viluinoooh
19:48TimMcthat too
19:48Viluinforgot about that
19:49TimMcI sometimes do that still. >_<
19:50Viluin(defn big [s n] ( < (count s) n)) just seems to return n, not a boolean
19:50Viluinerr
19:50Viluinsorry, that wasnt true
19:51Viluinthat was me failing to run it correctly
19:51TimMc,((fn [s n] (< (count s) n) "1234" 12)
19:51clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
19:51TimMc,((fn [s n] (< (count s) n)) "1234" 12) forgot a paren
19:51clojurebottrue
19:51Viluinit seems to work
19:52TimMcViluin: While we're on the topic, ##(< 1 2 3 4) is a way to check if a series of numbers is in increasing order.
19:52lazybot⇒ true
19:52TimMc(## is the bot trigger)
19:53ViluinI'm using ClojureBox on Windows, this is really cumbersome to work with
19:53TimMcand Clojure predicates don't always use true and false -- they may return logical false (nil or false) or logical true (everything else.)
19:53Viluinthe REPL doesn't seem to support trivial things like copy-paste and pressing uparrow for the previous command
19:54Viluinhmm
19:54TimMc,(or nil 5 false)
19:54clojurebot5
19:55Viluinif there's only 1 arg does it still need [] around it?
19:55amalloyisn't clojurebox basically emacs? it supports all of those things, but in less-crazy ways than you might expect
19:55Viluinemacs, yes
19:55Viluinnever used it before
19:55TimMcViluin: Yes, it needs the []/
19:55TimMc.
19:55amalloyM-p and M-n do the actions you expect from the up/down arrows
19:56ViluinI have no idea what that means :|
19:56amalloyalt-p/n
19:56TimMcM-p = Alt+p
19:56TimMcblah
19:56Viluinoh
19:57Viluinsometimes I wonder.. why?!
19:57Viluinuparrow works.
19:57Viluinwhy make it alt+p
19:57duck1123up arrow moves up, which is more what people expect
19:57hiredmanbecause it's a text buffer like anyother, so you can use up/down to scroll around
19:57TimMcViluin: For hysterical raisins.
19:58TimMc(historical reasons)
19:58hiredmanfind some old output, copy and paste it, etc
19:58TimMcArrow keys and such do not always transmit well in terminals.
19:58amalloyTimMc: that is not true at all
19:58TimMcamalloy: Really?
19:58amalloyi mean, yes, they often don't transmit well in terminals
19:58amalloybut your claim that it's historical is nonsense
19:59amalloyit's because, as hiredman says, you want to be able to edit text in the buffer
20:00Viluinif I have a collection, how do I check to see if it's a map, list or vector?
20:00TimMcViluin: You usually don't care.
20:00ViluinI really don't, just doing some practice assignments to get to know this thing
20:01duck1123,((juxt map? list? vector?) {})
20:01clojurebot[true false false]
20:03Viluinit's unclear to me what juxt does
20:03amalloy&(doc juxt)
20:03lazybot⇒ "([f] [f g] [f g h] [f g h & fs]); Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to t... https://gist.github.com/1282995
20:04amalloy&((juxt inc dec) 1)
20:04lazybot⇒ [2 0]
20:04Viluinso it applies all the functions to the arg and returns all the results?
20:05amalloywell, it returns a function which, when called, will do that
20:05clojurebotanonymous functions are functions with no names
20:05amalloygood call, clojurebot
20:05amalloy&(let [do-math (juxt + - * /)] (do-math 10 20))
20:05lazybot⇒ [30 -10 200 1/2]
20:07Viluinhmm
20:07Viluinso if I want to write a function that determines the type of a collection
20:07Viluincan I just make three if statements that go like if (map? collection) "map" etc?
20:08TimMcYou might look at cond or condp.
20:10Viluinwhat's the difference?
20:10Viluinwouldn't if statements work?
20:10TimMcSure.
20:10Viluincoljure compiler errors are really good at providing absolutely no info about the error
20:10Viluinlol
20:23amalloyclojurebot: juxt is usually the right answer
20:23clojurebotOk.
20:24ibdknoxamalloy, what does that enable you to do?
20:24amalloyibdknox: hm?
20:25ibdknoxdoes telling clojurebot let you trigger him somehow?
20:25amalloy*nod*
20:25ibdknox~juxt
20:25clojurebotjuxt is usually the right answer
20:25ibdknoxI see
20:25amalloyamalloy: what's a good way to perform two functions on the same input?
20:25amalloyjuxt?
20:25clojurebotjuxt is usually the right answer
20:25ibdknoxlol
20:25ibdknoxfun
20:26amalloyibdknox: this one's just for fun, of course, but in general it's a useful way to create canned replies
20:26amalloyclojurebot: where can i find zipWith?
20:26clojurebotIt's greek to me.
20:26amalloydamn
20:26ibdknoxhaha
20:26amalloyclojurebot: zip?
20:26clojurebotzip is not necessary in clojure, because map can walk over multiple sequences, acting as a zipWith. For example, (map list '(1 2 3) '(a b c)) yields ((1 a) (2 b) (3 c))
20:26brehautamalloy: why sporks?
20:26ibdknox~contrib
20:26clojurebotcontrib is http://github.com/richhickey/clojure-contrib/tree/master
20:26amalloybrehaut: because you said it yesterday and i thought it was funny
20:27Viluinwell I've had enough for tonight, heading off to bed, thanks for the help guys!
20:27brehautfair enough
20:27amalloyclojurebot: forget contrib |is| http://github.com/richhickey/clojure-contrib/tree/master
20:27clojurebotI forgot that contrib is http://github.com/richhickey/clojure-contrib/tree/master
20:28brehautclojurebot: tell me about contrib
20:28clojurebotcontribute is http://clojure.org/contributing
20:30ibdknoxcontrib?
20:30clojurebotcontribute is http://clojure.org/contributing
20:30amalloyclojurebot: where did contrib go?
20:30clojurebotwell... it's a long story: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
20:31ibdknoxah
20:31ibdknoxthat's the one
20:31duck1123clojurebot: where's contrib?
20:31clojurebothttp://clojure.org/contributing
20:31ibdknoxI assume it's just a string match
20:32amalloyi think there is some fairy dust involved
20:32duck1123One of these days I want to try getting an Alicebot working in Clojure
20:32amalloyspecifically he has some kind of database of "things", with a full-text index of all "things"
20:32amalloyand i don't understand full-text indexes, but i understand that he can look for "whatever is close to X"
20:33amalloyduck1123: is that different from eliza?
20:34duck1123amalloy: quite a bit more advanced, but same idea. A chat bot
20:34duck1123it used a XML language to define the bot's knowledge. Perfect job for a Clojure DSL
20:35brehautduck1123: port it to core.logic
20:37amalloymehhhhhh. the LA clojure usergroup made some desultory collaborative effort in this direction at https://github.com/Factual/eliza but it never really went anywhere. i think having a canonical way to represent the bot's knowledge isn't as interesting/flexible as having a ring-wrapper sort of architecture for it to make it more pluggable
22:08zakwilsonA potential client just asked for examples of sites built with Clojure. While I think the question is stupid, I have to humor him. Any good examples I can use?
22:11@chouserzakwilson: I'm sure there are many. 4clojure.com is one
22:12zakwilsonchouser: I'm aware there are likely hundreds. I just want a couple I can point at and say "See? These are nice and professional-looking.".
22:23jkkramerzakwilson: http://dev.clojure.org/display/community/Clojure+Success+Stories might help
22:23zakwilsonjkkramer: thanks
22:40darevayFor those that have been frustrated by vimclojure, here's my attempt at a "base" configuration that people can build from or sanity check: https://github.com/daveray/vimclojure-easy
23:06sridzakwilson: heroku uses clojure. checkout github.com/heroku/pulse which is their internal real-time operations dashboard
23:07zakwilsonsrid: thanks.
23:08sriddell uses clojure http://groups.google.com/group/clojure/browse_thread/thread/d1b77050260340f6
23:53brehautamalloy: how are passwords stored on 4clojure?
23:53amalloy$google jasypt
23:53lazybot[Jasypt: Java simplified encryption - Main] http://www.jasypt.org/
23:54amalloybrehaut: that is, we one-way hash them and store the hash. we don't do any salting afaict, so a replay attack would probably work? i'm not an expert in the area
23:55brehautamalloy: cool, thats all i really wanted to know :)
23:55amalloysweet
23:55technomancyclojurebot: how do you safely store passwords?
23:55clojurebotGabh mo leithscéal?
23:56technomancyclojurebot: how do you safely store passwords is <reply>bcrypt. http://codahale.com/how-to-safely-store-a-password/
23:56clojurebotOk.
23:56technomancybut to be fair jasypt probably gives you a better deal than sha1
23:56brehautthat article must have insane google juice by now
23:58technomancygooglebot crawls our logs, right? =)
23:58brehautits the primary source
23:59technomancyjkkramer: did you get my privmsgs?
23:59dsantiagoThis is probably a really dumb question, but why does (type '(+ 1 2)) return a PersistentList and (type `(+ 1 2)) return a Cons?
23:59duck1123~passwords
23:59clojurebotbcrypt. http://codahale.com/how-to-safely-store-a-password/
23:59amalloydsantiago: ` does a lot of stuff
23:59technomancydsantiago: basically you're never supposed to know there's a difference between the two classes
23:59amalloy&''(+ 1 2)
23:59lazybot⇒ (quote (+ 1 2))
23:59technomancywhatever you do, don't use the list? predicate
23:59amalloy&'`(+ 1 2)
23:59lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/+)) (clojure.core/list 1) (clojure.core/list 2)))