#clojure log - Nov 06 2011

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:00 tensorpudding: god, i fell for it again

0:00 i published my gist anonymously for the dozenth time

0:00 brehaut: cemerick: mostly lazy san arial is much nicer

0:00 cemerick: brehaut: san arial?

0:00 brehaut: sans

0:00 without

0:00 TeXnomancy: ibdknox: fallback nick

0:00 cemerick: oh, using the lambda

0:00 yeah

0:01 brehaut: cemerick: sorry, i fail at typing

0:01 ibdknox: TeXnomancy: that's awesome lol

0:01 TeXnomancy: I'm copying 4GB of photos across the wifi on my home network and my poor consumer-grade router is having fits

0:01 * TeXnomancy has to catch up on his photo sorting as far back as June; ulp.

0:03 tensorpudding: oh man, how did that happen

0:03 my saved password for github doesn't work

0:03 not being able to change your password while logged in without the old password is really aggravating

0:04 i need to extricate the old password from chrome

0:05 the downside of using randomized passwords in a password manager

0:09 and when i logged in, the gist i made was gone

0:10 why gist requires you to login separately i have no idea

0:12 ibdknox, https://gist.github.com/1342462

0:12 there

0:15 ibdknox: tensorpudding: when you start your server are you just passing it main-routes?

0:15 tensorpudding: yes

0:16 ibdknox: tensorpudding: then as amalloy suggested, you never add the middleware that makes sure you get params. You just need to use compojure.handler/site: https://github.com/weavejester/compojure/blob/master/src/compojure/handler.clj#L27

0:16 tensorpudding: sure wish the api docs, tutorials or examples mentioned that you need that in order to get params

0:17 well

0:17 ibdknox: tensorpudding: so when you start your server, do (jetty-start (handler/site main-routes) ...

0:17 tensorpudding: that's why I wrote Noir

0:19 tensorpudding: ah, that works like a charm now

0:19 why isn't that default?

0:19 ibdknox: tensorpudding: because compojure is low level

0:19 amalloy: for the same reason not every program opens a window with a "Click Here To Start" button. you don't always want it

0:20 tensorpudding: well

0:20 i went for what i saw first

0:20 * cemerick didn't know he liked "low-level" libs ;-)

0:20 tensorpudding: there's a ton of libraries out there

0:21 ibdknox: cemerick: well it's as low as you want it, I guess is the better thing to say

0:21 cemerick: ibdknox: I'm just being obnoxious :-P

0:21 brehaut: tensorpudding: theres 3 core libs for web apps in clojure (on top of ring, and not including things like templates or forms) and they each have a different focus

0:21 tensorpudding: what are they?

0:21 brehaut: tensorpudding: moustache, compojure, noir

0:21 tensorpudding: moustache?

0:21 clojurebot: moustache is http://github.com/cgrand/moustache

0:22 ibdknox: lol

0:22 brehaut: tensorpudding: and thats in order of close to ring -> abstracted from ring

0:22 tensorpudding: that's templating

0:22 isn't it?

0:22 ibdknox: ~botsnack

0:22 clojurebot: Thanks, but I prefer chocolate

0:22 Raynes: mustache != moustache

0:22 tensorpudding: bah

0:22 lame

0:22 name collisions

0:22 brehaut: moustache is basically glue for ring handlers

0:22 tensorpudding: i would be happy if there was one that had a big sign saying "you should use me!"

0:22 ibdknox: there is

0:23 brehaut: tensorpudding: if you dont know about ring, or dont care to learn, its noir

0:23 cemerick: not everyone wants the same thing

0:23 amalloy: tensorpudding: www.webnoir.com ?

0:23 ibdknox: http://webnoir.org/

0:23 lol

0:23 amalloy: ibdknox: oh, org?

0:23 ibdknox: yeah

0:23 cemerick: tensorpudding: this is a year old, so grain of salt, but: http://web.archive.org/web/20110218134955/http://www.glenstampoultzis.net/blog/clojure-web-infrastructure/

0:24 Raynes: amalloy: Click on the .com link for tons of fun.

0:24 amalloy: Raynes: yeah, i did that

0:24 tensorpudding: i do need a database i think

0:24 to make a proper app

0:24 cemerick: ibdknox: what do you use to find fonts?

0:25 ibdknox: tensorpudding: then you might like one of my other projects: http://www.sqlkorma.com

0:25 Raynes: Font Book. :p

0:25 tensorpudding: i want a backend for sqlite

0:25 ibdknox: cemerick: dafont is good, but you have to have patience

0:25 brehaut: ibdknox: caveat that its WIP ;)

0:25 cemerick: Raynes: you have a mac?

0:25 tensorpudding: since i'm too lazy to deploy postgres

0:25 Raynes: cemerick: Yes.

0:25 cemerick: :-O

0:25 Raynes: For a long time now.

0:25 ibdknox: tensorpudding: it'll work with sqllite too

0:25 tensorpudding: i was going to dive right into the database thing

0:26 but the first one i saw looked scary, starting talking about a jdbc or something

0:26 ibdknox: tensorpudding: both noir and korma have plenty of docs

0:26 Raynes: ibdknox: I'd like to hire you to market my next product.

0:26 ibdknox: Raynes: lol

0:26 Raynes: Because you're obviously top notch.

0:26 amalloy: tensorpudding: if the letters JDBC terrify you, you probably shouldn't try to Connect to a DB in Java

0:27 tensorpudding: i don't use java

0:27 Raynes: Wont stop you from getting a NewFactorySocketConnectionSQLDatabaseWithStuffInItForYou object.

0:28 amalloy: tensorpudding: s/Java/JVM if you prefer. you're in the java ecosystem, even if you prefer to pretend you're not

0:28 tensorpudding: i don't delude myself by it

0:28 it grates me though

0:28 java gets up in your face with a million exception backtraces whenever you make it angry

0:29 ibdknox: tensorpudding: I did my best to ease that

0:29 tensorpudding: in all of the things I've written for others to use

0:29 tensorpudding: i don't suppose you make a templating library either

0:29 ibdknox: tensorpudding: I <3 hiccup

0:30 tensorpudding: i want to actually write html though

0:30 cemerick: gaaah! :-)

0:30 tensorpudding: try enlive. Top notch.

0:30 tensorpudding: enlive is what i'm using

0:30 but it's heavy-duty

0:30 cemerick: heavy-duty?

0:30 tensorpudding: well

0:30 i've used a few templating engines before

0:30 brehaut: i second the enlive suggestion

0:31 ibdknox: it has a fairly high cognitive density that doesn't *have* to exist

0:31 tensorpudding: mustache, the one in django, the one in google go

0:31 and they're all very simple

0:31 amalloy: s/simple/easy ?

0:31 tensorpudding: enlive is high-level composable transformations

0:31 not "cut out a tag here and replace it with text"

0:32 cemerick: not sure if that's "heavy", but I know what you mean

0:32 My favorite templating engine prior to enlive was ZPT :-P

0:32 amalloy: i think the problem with enlive is that it's a mess of macros, right?

0:32 ibdknox: it's definitely more complicated than that.

0:32 brehaut: cemerick: Z = Zope ?

0:32 cemerick: amalloy: it's no longer macro-heavy

0:32 brehaut: amalloy: most of the operations are functions

0:33 amalloy: oh, that's good to hear

0:33 i love hiccup but feel confident if i were a good person i would prefer enlive

0:33 cemerick: amalloy: cgrand's talk at the conj last year was rooted in his transforming enlive from macros to fns

0:33 * cemerick despises writing HTML in sexprs

0:34 cemerick: brehaut: draped with plone, but yeah

0:34 Raynes: amalloy wasn't at the conj last year.

0:34 cemerick: lifetimes ago

0:34 brehaut: cemerick: did anyone ever use zope without plone?

0:34 cemerick: Raynes: I know :-)

0:34 amalloy: going this year?

0:34 Raynes: Yes.

0:34 cemerick: brehaut: frighteningly, yes :-(

0:34 amalloy: cemerick: it would take some kind of zombie apocalypse to stop me

0:34 brehaut: cemerick: im sorry to hear

0:34 * ibdknox sets up defenses for the zombie infection he just spread

0:35 cemerick: Better to ask, "did anyone ever use zope, in any shape whatsoever?"

0:35 amalloy: was there one last year? ;-)

0:35 brehaut: cemerick, amalloy: PHP is a zombie apoc?

0:35 cause i wouldnt be surprised

0:36 * cemerick will take PHP over zope any day

0:36 amalloy: brehaut: have you seen the hordes flocking to the latest hot things? their droning "nooooode" sounds about the same

0:36 brehaut: amalloy: rimshot

0:36 ibdknox: ~rimshot

0:36 clojurebot: Badum, *ching*

0:37 brehaut: yes please, id like to bring all the horrors of client side programming to the server

0:37 ibdknox: best thing *ever*

0:37 cemerick: "I heard you like acquisition, so I put it in *everything*."

0:37 Only I could make a bad yo dawg joke about zope.

0:38 amalloy: cemerick: acquisition? i guess i'm glad not to get it

0:38 cemerick: Noooo, don't google that. Save yourself!

0:38 brehaut: amalloy: its "an important topic for Zope developers"

0:38 cemerick: LOL

0:38 brehaut: there are _way_ too many grocer quotes in this page

0:39 amalloy: i had literally never even heard of zope

0:39 but it sounds like googling for it would be practically nsfw

0:39 cemerick: You can blame me later.

0:39 brehaut: amalloy: its why python sucked for the web for years :P 

0:39 amalloy: with all the blood & gore

0:39 brehaut: (wsgi is the new reason python sucks for the web ;)

0:39 cemerick: Ironically, pylons really made web dev pleasant for the first time for me, so it's a wash.

0:39 ouch!

0:40 brehaut: it had good intentions

0:40 but it optimsed for old use cases just in time to make the new use cases awkward

0:40 cemerick: it's just a ring spec for python…

0:40 (roughly)

0:40 brehaut: cemerick: roughly.

0:40 cemerick: *shrug* hard to argue with it too badly, then

0:41 vs. zope / servlets / CGI

0:41 brehaut: haha fair

0:41 * brehaut shudders

0:41 cemerick: My first web programming was using CGI via webstar on Mac OS 8, so…

0:41 hrm

0:42 probably 7.5.1, now that I think of it.

0:42 tensorpudding: writing this clojure app took longer than writing a similar one in django

0:42 brehaut: CGIs in C was mine. that was a mistake

0:42 tensorpudding: i knew python a good bit better at the time though

0:42 amalloy: tensorpudding: are you counting the time you've spent learning python and learning clojure?

0:42 cemerick: brehaut: as much as CGIs in RealBASIC? :-P

0:42 brehaut: cemerick: ouch

0:42 tensorpudding: well, i spent a few months with clojure back in 2009

0:43 i got sidetracked with learning c, and python, and google go

0:43 ibdknox: tensorpudding: I'll race you ;)

0:43 cemerick: I paid for my first year of college doing consulting projects with RB, so I can't complain.

0:43 Cross-compiling *way* before its time, AFAIK.

0:45 tensorpudding: i had the notion i would try writing a webapp in go and clojure

0:45 and see which one took less effort

0:45 ibdknox: tensorpudding: use Noir for that

0:46 cemerick: tensorpudding: are hello-world webapps really what will make or break things for you?

0:46 amalloy: and also watch out for the difference between writing your first app and writing a real one

0:46 tensorpudding: no?

0:46 i mean

0:46 cemerick: (sorry, didn't mean for that to sound so sarcastic)

0:46 tensorpudding: i want to get a feel for how fun the language is to use

0:46 cemerick: ah, fair enough

0:46 tensorpudding: and how good the project tools are

0:47 and library support

0:47 brehaut: django: the ORM + admin let you write a stupidly simple site really fast. and then your domain model grows larger than the intersection of objects and tables and you are in pain

0:47 tensorpudding: i dislike lein, not going to lie

0:47 brehaut: what‽

0:47 tensorpudding: being able to get deps through jars is nice

0:47 but it's slow

0:47 brehaut: lein is one of the major factors for me prefering clojure to python for web programming

0:48 cemerick: I think we can all agree that all build tools will always suck, forever.

0:48 tensorpudding: maybe it's just me coming off of go

0:48 brehaut: cemerick: hah true

0:48 tensorpudding: which has trivial build time

0:48 ibdknox: the key is to not build

0:48 cemerick: s/build/startup

0:49 ibdknox: tensorpudding: I'm telling you Noir is a very, very different experience

0:49 tensorpudding: refresh and you see your change

0:49 tensorpudding: okay

0:49 i might

0:49 cemerick: ibdknox: noir autoloads all the time, I take it?

0:49 ibdknox: cemerick: watches for changes, yep

0:49 tensorpudding: i don't know where the slowness came from

0:50 what does "lein run" have to do that takes so long?

0:50 cemerick: There's an option for that in lein-ring, isn't there?

0:50 ibdknox: start the jvm

0:50 cemerick: yessir

0:50 tensorpudding: starting the jvm takes ten seconds no matter what?

0:50 cemerick: no, jvm startup is actually ~1.5s

0:51 tensorpudding: maybe it's just jetty taking a long time to start

0:51 cemerick: Then there's load Clojure, load lein bits, start jetty, etc

0:51 amalloy: cemerick: that's going to differ a lot by platform etc though. on my c64 it's like 15s

0:51 tensorpudding: it's not that shocking once you realize it's jvm

0:51 cemerick: amalloy: screenshots or it didn't happen

0:51 tensorpudding: i've not met a java apps that didn't have a slow startup

0:52 * amalloy looks around for a photoshop crash course

0:52 cemerick: :-D

0:53 tensorpudding: but anyway

0:53 cemerick: amalloy: http://www.mts.net/~kbagnall/commodore/java.html !!

0:53 tensorpudding: the slow startup is really putting a damper on my dev experience

0:53 brehaut: tensorpudding: once you stop starting up constantly, its not a problem

0:54 cemerick: tensorpudding: regardless of approach, no one restarts their jvm regularly

0:54 tensorpudding: i'd *like* to be able to test my app in slime

0:54 but i assumed that you can't have jetty running at the same time

0:54 brehaut: tensorpudding: what is stopping you?

0:54 Raynes: You just need to stop the server.

0:55 brehaut: tensorpudding: (start-jetty #'handler {:join? false}) ?

0:55 tensorpudding: what does that do

0:55 ibdknox: tensorpudding: tensorpudding I did a demo of writing a noir app completely in the REPL

0:55 brehaut: jetty doesnt take over your repl thread

0:55 ibdknox: it can definitely work

0:55 tensorpudding: i don't write in repls

0:55 i test in repls

0:55 ibdknox: ..

0:55 cemerick: You can send any arbitrary code through a REPL connection.

0:56 *or* your web framework (noir or ring) can reload code for you automatically

0:56 tensorpudding: reload code?

0:56 brehaut: tensorpudding: this is like saying 'i tried driving car A in reverse, and it wasnt as easy as driving car B forward'

0:57 tensorpudding: you used django right?

0:57 tensorpudding: two years ago or so

0:57 i remember it

0:57 brehaut: tensorpudding: did you use the manage.py runserver ?

0:57 tensorpudding: yes

0:57 brehaut: and it reloads your code on change right?

0:57 tensorpudding: if it did i didn't notice

0:58 brehaut: well that analogy fails

0:58 tensorpudding: what do you mean by "writing in the repl" anyway

0:58 you still have to put your code into files

0:59 amalloy: tensorpudding: no you don't

0:59 tensorpudding: if you don't, how does it persist?

0:59 amalloy: i haven't watched his video, but you can do anything you want in a repl, and start up a jetty server from there

0:59 it doesn't

0:59 tensorpudding: oh, of course you can write anything you want in a repl

0:59 i know that

0:59 i've done it

1:00 while writing python code

1:00 i'd go and open up python, type a half dozen lines

1:00 but you can't save your program

1:00 once you exit the interpreter your work is gone

1:02 i guess we're not arguing

1:02 i thought you were saying something like do all your programming in a repl

1:02 amalloy: i do my programming *connected to* a repl

1:03 tali713: but if your repl is attached to a running image and the running image isn't exited then the prgram persists. (not that this is a good idea, but it works)

1:03 amalloy: editing files, repl open. "i'm done with this code, send it to the repl"

1:03 cemerick: The effective use of the REPL in clojure goes *way* beyond what you'd do in python.

1:03 tensorpudding: that's what i do, for the most part

1:03 cemerick, how is that

1:03 amalloy: tensorpudding: so stop typing lein run

1:03 tali713: amalloy: now that /is/ a good idea.

1:04 tensorpudding: it's easier to type lein run than (require 'blog.core) (blog.core/-main), then having to kill slime when i want to stop jetty from running

1:04 amalloy: tensorpudding: like five times someone here has told you how to stop jetty from slime

1:04 tensorpudding: they never explained what it actually did

1:05 and someone else said something else and it the topic was avoided

1:06 brehaut: (def j (start-jetty #'myhandler {:join? false})) … some time later (stop-jetty j)

1:06 ibdknox: (noir.server/stop server)

1:06 amalloy: goodness. you mean, irc didn't go into exactly the level of detail you wanted without you asking for it?

1:06 ibdknox: lol

1:07 tensorpudding: i did ask

1:07 i can't find where i said it in my log

1:09 ibdknox: damn

1:09 where is technomancy when I need him

1:09 tensorpudding: not letting me connect to swank this time

1:09 he's never around when you need him!

1:11 where is start-jetty?

1:11 brehaut: tensorpudding: you arent a regular here are you?

1:11 tensorpudding: isn't it run-jetty

1:11 brehaut, #emacs

1:11 brehaut: ring.adapter.jetty

1:11 cemerick: tensorpudding: just about any clojure live-coding video will demonstrate reasonable usage of the REPL, modification of code in long-running processes, etc.

1:12 tensorpudding: i have run-jetty

1:12 brehaut: and its probably because its called run-jetty and i screwed up

1:13 tensorpudding: okay

1:14 that seems to work

1:14 but stop-jetty doesn't

1:14 where is that

1:15 Raynes: (.stop j)

1:15 Don't know where he got stop-jetty from.

1:15 amalloy: though you usually don't have to stop the jetty server at all, if you're careful ahead of time

1:16 tensorpudding: i don't see how

1:16 brehaut: Raynes: not a place for polite conversation apparently

1:16 amalloy: tensorpudding: we'll save that for later

1:17 tensorpudding: i tried changing my .html files while jetty was running, it had cached old templates or something

1:17 amalloy: short version: instead of giving jetty your actual code, you give it a pointer to your code and change what that points to when you want to update

1:18 Raynes: brehaut: <3

1:20 tensorpudding: still disappointed that doc needs to be imported

1:21 is there a way to configure slime so that it'll do that for me every time it starts

1:21 Raynes: At least it exists.

1:21 cemerick: what version of clojure are you using?

1:21 tensorpudding: 1.3

1:21 Raynes: I'd kill for doc in Haskell *period*. Don't care where they put it.

1:21 tensorpudding: haskell has hayoo

1:21 which is pretty sweet

1:22 brehaut: Raynes: they put it in the internet; its called hoggle

1:22 Raynes: Clojure has clojuredocs.

1:22 tensorpudding: err, hoogle

1:22 hayoo is a thing too

1:22 but i was actually thinking of hoogle

1:22 Raynes: I know about hoogle and hayoo, but that doesn't replace doc.

1:22 cemerick: hrmph, that's slime/swank then. `doc` is always referred to in the REPL in 1.3 by default.

1:22 tensorpudding: hmm

1:22 i copy-pasted the version of swank-clojure i use

1:22 1.3.3

1:22 no idea if that's new or not

1:22 Raynes: However, the APIs for those tools could probably be used to create something similar to doc.

1:23 tensorpudding: i somewhat dislike how i have to hardcode library version names into the project.clj

1:23 docstrings in python are one thing i rather like about it

1:23 doc in clojure is as good

1:23 Raynes: Oh what a mess it would be if you didn't.

1:24 tensorpudding: except when the docs themselves are bad

1:24 amalloy: $findfn 1 7 8 ;; not as good as hoogle, but still cool

1:24 lazybot: [clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int]

1:24 tensorpudding: pygobject is really funny, because its docs are all autogenerated from c

1:25 well, hoogle leverages the fact that haskell is statically typed

1:25 amalloy: yes, i realize why we can't have hoogle

1:25 tensorpudding: a badly worded clojure doc makes it totally unclear what the inputs and outputs are supposed to be like

1:26 amalloy: c'mon, it takes obj, m, coll, and xs! what else could it possibly mean! :)

1:27 tensorpudding: heh

1:27 coll is suggestive

1:27 what's xs?

1:27 a list?

1:27 amalloy: probably

1:27 Raynes: Er, xs is used in Haskell.

1:27 amalloy: something you're going to treat as a sequence, anyway

1:28 tensorpudding: yes

1:34 okay

1:34 i changed my .html file, but the change isn't propagating to the app

1:05 Raynes: Clojure source files can't have periods in the name, can they?

1:05 Please say no.

1:06 cemerick: Raynes: load/load-file won't mind. require will.

1:06 Raynes: That's good enough.

1:07 ibdknox: I took webnoir.org down for a minute

1:09 and we're back

1:17 brehaut: ibdknox: you can reload that sort of thing‽

1:17 ibdknox: brehaut: hm?

1:18 brehaut: poor joke

1:18 ibdknox: lol

1:18 amalloy: brehaut: he didn't write it in a repl

1:18 ibdknox: ~rimshot

1:18 clojurebot: Badum, *ching*

1:19 amalloy: brehaut: you have some kind of hotkey for that interrobang, right?

1:27 ibdknox: Noir 1.2.1 released with a small breaking change: https://groups.google.com/forum/#!topic/clj-noir/llDUdYILGsw

1:28 cemerick: links to new-style google groups are a form of rickroll IMO

1:29 ibdknox: haha

1:30 cemerick: ibdknox: breaking changes on a patch release? You dare not use semantic versioning?

1:30 ~guards

1:30 clojurebot: SEIZE HIM!

1:30 cemerick: ;-)

1:31 ibdknox: cemerick: I know, I know... but really? I need to release noir 2.0 for that change?

1:31 I'll be on noir 3453467.0.0 in 6 months ;)

1:31 cemerick: update releases are the new major release, it seems

1:31 ibdknox: actually, I think this is the first breaking change Noir has had

1:32 cemerick: ballsy then that you're > 1.0

1:32 ibdknox: well

1:32 I tried to be semver

1:32 which states once in prod = 1

1:32 cemerick: should have at least 42 breaking changes before 1.0 ;-)

1:32 brehaut: amalloy: re: ‽ i setup a system wide text replacement for it

1:32 cemerick: once in prod, 1.0? o.0

1:33 ibdknox: yessir

1:33 * cemerick conveniently forgot that bylaw

1:33 brehaut: and new google interface style is like looking through a big white letter box

1:33 ibdknox: How do I know when to release 1.0.0?

1:33 If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you're worrying a lot about backwards compatibility, you should probably already be 1.0.0.

1:33 cemerick: eh, that's silly

1:34 I'll go register semver2.org and fix that

1:34 ibdknox: that being said, I'm comfortable with the API.. that change was the result of something that was introduced really recently

1:34 lol

1:34 brehaut: if you accidentally release 1.0.0 because you forgot to change the lein defaults, you should probably be 1.0.0

1:34 ibdknox: cemerick: FORK

1:34 cemerick: FORK IT, FORK IT NOW

1:34 clojurebot: fork is FORK IT, FORK IT NOW!

1:34 clojurebot: Ok.

1:34 cemerick: brehaut: LOL

1:35 brehaut: cemerick: not that that happened with necessary-evil in any way…

1:35 ibdknox: haha

1:35 brehaut: dinner time

1:36 djanatyn: noir is pretty cool!

1:36 I had no idea that clojure was so mature and usable.

1:36 * ibdknox needs to make something cooler than Noir now

1:37 cemerick: A widget toolkit for cljs that doesn't suck would be nice.

1:37 ibdknox: widget in what sense?

1:37 I mean I have pinot

1:37 cemerick: extjs / dojo / etc -style

1:38 toolkit wrapper, perhaps, in that case

1:38 ibdknox: ah components are for wusses, not us awesome picture slinging interactive website builders ;)

1:38 djanatyn: also, clojuredocs.org is awesome

1:38 cemerick: ibdknox: I need palettes next to my picture slinging! :-D

1:39 ibdknox: haha

1:47 amalloy: ibdknox: i think if you claim to be semver you can't really release breaking changes in a patch release. i prefer to ignore the "1.0 if you're in production anywhere" rule instead, which seems a lot less useful

1:47 and if you go 1.0 too soon and wind up at 59.0, then...well, i guess you're probably apache

2:04 tensorpudding: how does one keep track of all the special syntax in clojure

2:04 amalloy: i was going to point out that cassandra is *still* at 0.x, but i guess that's not true

2:04 ibdknox: lol

2:05 amalloy: tensorpudding: you probably don't mean "syntax" there

2:05 tensorpudding: i mean those weird bracket/brace things

2:06 amalloy: since clojure has very few syntactic rules. unlike, say, python, which has special syntactic rules for everything, like (for example) list-comprehensions

2:06 tensorpudding: and the, for lack of a better term, "sigils" used for quoting, unquoting, keyword, atom, etc

2:07 it's not that there's a lot of it

2:07 but that they all look about the same

2:08 varying combinations of punctuation

2:11 amalloy: that much, at least, is a fair point

2:11 but for all of them except unquote (i think) you can omit the shorthand if you want

2:11 (quote foo) instead of 'foo

2:11 tensorpudding: yeah, it's syntactic sugar

2:12 cemerick: you don't *need* to use unquote; just don't use syntax-quote

2:13 tensorpudding: i'm staying away from the macro stuff

2:13 amalloy: cemerick: oh, of course

2:13 but it does lead to a pretty terrible mess if you're writing any macros

2:14 cemerick: Nature of the beast, unless you have syntax-rules or somesuch

2:14 i.e. it's just templating, which is a pretty terrible mess

2:14 amalloy: see patch 3 on my recent compiler issue at http://dev.clojure.org/jira/browse/CLJ-865

2:14 trying to improve a macro at a point in bootstrapping before we have `

2:16 cemerick: tensorpudding: Compared to Java, python, ruby, any shell scripting, or regular expressions, you'll find no more syntactic cognitive load in Clojure than in other environments — and usually much, much less.

2:16 "look about the same" == simple unfamiliarity, not inherent difficulty

2:18 tensorpudding: i don't think clojure will ever look pretty to my eye

2:18 ibdknox: really?

2:19 cemerick: :-|

2:19 ibdknox: I always thought clojure was pretty

2:19 tensorpudding: why do people think clojure looks pretty?

2:20 ibdknox: look at the first block of code here:

2:20 http://sqlkorma.com/

2:21 without compiler level changes, I've never seen something that can match that level of succinctness and cohesion

2:21 tensorpudding: the parenthesis make it less like natural language

2:22 cemerick: No programming language is like natural language

2:22 amalloy: tensorpudding: would you say (in your experience) that natural language has no parens? or that it's filled with this.that.the_other hierarchies?

2:22 cemerick: And those that try are horrible (viz. applescript, various ruby/scala DSLs)

2:22 ibdknox: except this one of course! http://shakespearelang.sourceforge.net/report/shakespeare/

2:22 tensorpudding: no

2:23 ruby does give the feeling of them sometimes

2:23 these examples ignore the grievous complexities of the multitude of functions that clojure has

2:23 ibdknox: no they don't

2:24 cemerick: grievous complexities?

2:24 tensorpudding: how many different variations on function declaration are there?

2:24 ibdknox: two?

2:24 amalloy: i'll never know how python, ruby, and haskell manage to get by with only two functions in the whole language

2:24 tensorpudding: err, declaration in general

2:24 there's fn

2:24 and defn

2:24 and def

2:24 cemerick: fn creates a function

2:24 tensorpudding: and i thought i saw a defn-?

2:24 cemerick: def defines a var

2:25 tensorpudding: printing was a bigger culprit

2:25 there's were like six different functions which handled printing strings

2:25 all variations on the word print

2:25 cemerick: tensorpudding: how many methods are there in all of the classes and modules in python?

2:26 tensorpudding: i don't see how that's comparable

2:26 cemerick: why not?

2:26 ,(count (ns-publics 'clojure.core)) ;; just FWIW

2:26 clojurebot: 573

2:26 tensorpudding: are there six different print functions in python?

2:27 that vary in name by a few letters?

2:27 ibdknox: I think you're the first person I've ever heard complain about not finding "print" and "println" intuitive

2:27 alexbaranosky: python, yawn

2:28 cemerick: well, you were talking about the complexities of the multitude of functions

2:28 the naming of those functions hadn't come up yet :-)

2:28 tensorpudding: i'm only considering clojure.main, anyway

2:28 cemerick: insofar as we have a variety of ways to print things in different ways that are composable, that seems like a good thing

2:29 print "foo" is not the only useful thing in the world

2:29 tensorpudding: err, clojure.core!

2:29 cemerick: right

2:29 ,(count (ns-publics 'clojure.core))

2:29 clojurebot: 573

2:29 cemerick: I think the method/function count in all modules and all classes in python is a perfectly analogous measure.

2:30 tensorpudding: 573 functions in one namespace actually seems like too many

2:30 maybe they could split that up

2:30 well, functions and vars

2:31 amalloy: 573 is too many, but remember that's including a bunch of things that other languages would consider "language constructs" like `for`

2:32 tensorpudding: language constructs aren't that numerous are they?

2:32 amalloy: tensorpudding: go read the language grammar for python, then come back and say that :P

2:32 tensorpudding: i'm sure clojure is easier for machines to parse

2:33 i like python's syntax better

2:33 i find it easier for me to parse

2:33 cemerick: syntax != language constructs

2:33 amalloy: so use python, bro. we like clojure, but it sounds like you don't want to learn it

2:33 tensorpudding: i like haskell's better too, it's not me disliking functional languages

2:33 i want to give it a try

2:33 cemerick: you like haskell?!

2:34 ibdknox: hah

2:34 yeah

2:34 amalloy: ~salespitch

2:34 clojurebot: Huh?

2:34 ibdknox: I'm confused

2:34 tensorpudding: what's weird about me liking haskell?

2:34 cemerick: liking haskell and worrying about "sigils" is…striking

2:35 amalloy: clojurebot: salespitch is <reply> We aren't gonna lie. Clojure sucks. Some of us tolerate it, but we can't tell you if YOU'LL be able to. Try it and make up your own mind.

2:35 clojurebot: c'est bon!

2:35 cemerick: where'd that come from?

2:35 tensorpudding: i don't know what haskell has to do with sigils

2:36 amalloy: cemerick: the salespitch in #emacs

2:37 cemerick: let pgen (p:xs) = p : pgen [x|x <- xs, x `mod` p > 0]

2:37 right-o!

2:37 alexbaranosky: Clojure's awesome features are all hidden by its simplistic, weird syntax

2:37 tensorpudding: there is no sigil in that

2:38 alexbaranosky: you can't appreciate Clojure until you've learned a lot about why the design decisions were made OR you already know a ton about Lisps

2:38 tensorpudding: there's (:), which is a special-cased infix type constructor, and the special [ | ] syntax for comprehensions

2:38 ibdknox: alexbaranosky: eh, I dunno about that

2:38 alexbaranosky: I had never used a lisp until clojure

2:38 tensorpudding: i want to eventually appreciate why people care about lisp

2:39 alexbaranosky: ibdknox: well maybe its different strokes for different folks

2:39 :)

2:39 tensorpudding: i always assumed it had to do with code-as-data

2:39 cemerick: tensorpudding: right; so it seems odd that you're concerned with '

2:39 tensorpudding: i don't mind '

2:39 alexbaranosky: All I'm saying is tensorpudding should probe deeper into the whys behind Clojure before deciding it is too weird/complicated

2:39 tensorpudding: i was more worried about the weird ones that other lisps don't use

2:40 cemerick: weird ones

2:40 tensorpudding: like @

2:40 cemerick: equivalent to `deref`

2:40 alexbaranosky: #, @, #{}, {}

2:40 cemerick: ,(read-string "@d")

2:40 clojurebot: (clojure.core/deref d)

2:40 alexbaranosky: oops... last one's pretty common ;)

2:40 tensorpudding: i think it was ~@

2:40 let me find it

2:41 something in the compojure source

2:41 alexbaranosky: ,(read-string #"\w+")

2:41 clojurebot: #<ClassCastException java.lang.ClassCastException: java.util.regex.Pattern cannot be cast to java.lang.String>

2:41 cemerick: ,(read-string "`(apply + ~@numbers)")

2:41 clojurebot: (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/apply)) (clojure.core/list (quote clojure.core/+)) numbers))

2:41 tensorpudding: yeah, it was ~@

2:41 and `

2:42 which i know has to do with macro splicing or something

2:43 amalloy: cemerick: might be more convincing to point out that `(apply + ~@numbers) is the same as (list* 'apply '+ numbers)

2:43 rather than the horrific nonsense spewed by `

2:43 tensorpudding: i wish you could get documentation on everything from clojure.repl/doc

2:43 alexbaranosky: I'd say that the macro stuff is in fact funky

2:43 ibdknox: it is

2:44 alexbaranosky: just ignore macros for now

2:44 tensorpudding: instead of everything except special forms and such

2:44 ibdknox: with power comes some level of weirdness

2:44 tensorpudding: which are usually the things that are not easy to grok

2:44 ibdknox: clojure.org

2:44 tensorpudding: having to pull out language specs is boring

2:44 ibdknox: lol

2:44 tensorpudding: oh

2:44 i don't like clojure.org either

2:45 alexbaranosky: the fact that you don't immediately grok them, though, doesn't necessarily mean they're a bad approach... it could just mean that they are very foreign to you

2:45 tensorpudding: okay, that's harsh

2:45 alexbaranosky: for what its worth: Python is hot garbage compared to the power of Clojure, imho :)

2:45 amalloy: !?

2:45 clojurebot: CLABANGO!

2:45 tensorpudding: i don't like using it to find out how to do things

2:46 ibdknox: huh?

2:46 amalloy: oh, saying you don't like clojure.org is harsh?

2:46 ibdknox: let me get this straight

2:46 tensorpudding: no

2:46 amalloy: i thought you were upset with alexbaranosky's assessment

2:46 which would be crazy

2:46 tensorpudding: wait, yes amalloy

2:46 alexbaranosky: ClojureDocs is very nice for looking up functions

2:46 ibdknox: you won't take the time to RTFM and then complain that you don't understand how it works?

2:47 alexbaranosky: hehe

2:47 tensorpudding: it's hard to find things in the reference

2:47 ibdknox: this trolling is getting a bit ridiculous

2:47 tensorpudding: this isn't trolling

2:47 this is me ranting

2:47 i guess that's not better

2:48 alexbaranosky: tensorpudding: you've got to bite the bullet and learn Chinese, only then can you complain about the syntax :)

2:48 brehaut: i dont understand the complexitities of modern medicine. man do i hate that shit!

2:48 ibdknox: lol

2:48 tensorpudding: i'm looking at http://clojuredocs.org/clojure_core

2:48 alexbaranosky: I hate Chinese too, what with all of those characters, I can't even use my keyboard

2:48 ibdknox: tensorpudding: why?

2:49 tensorpudding: because alex brought it up

2:49 it's more condensed than clojure.core's api docs on clojure.org

2:49 need to turn up the font though

2:49 alexbaranosky: I love the example usages for each function/macro at that site

2:50 tensorpudding: this is better than clojure.org, def.

2:54 amalloy: ,(doc .)

2:54 clojurebot: Gabh mo leithscéal?

2:54 amalloy: ,(use '[clojure.repl :only [doc]])

2:54 clojurebot: nil

2:54 amalloy: ,(doc .)

2:54 clojurebot: Cool story bro.

2:54 amalloy: man. i thought you could do that in 1.3?

2:55 tensorpudding: is this irish

2:55 brehaut: amalloy: im sure theres heaps of code in c.r for special forms too

2:55 alexbaranosky: c.r. ?

2:55 brehaut: clojure.repl

2:56 amalloy: brehaut: i've read the source of c.r.doc, and it has a lot of code aimed at special forms

2:56 i don't really understand what version clojurebot is running if this doesn't work

2:56 brehaut: &(doc .)

2:56 lazybot: ⇒ "Special: .; The instance member form works for both fields and methods.\n They all expand into calls to the dot operator at macroexpansion time."

2:58 amalloy: not actually a very helpful doc though

2:59 brehaut: no especially eh

3:09 amalloy: btw can i get some upvotes on http://dev.clojure.org/jira/browse/CLJ-865 if anyone's around? patch has been there for a week or two and it fixes an issue i've run into a couple times

3:11 ibdknox: amalloy: done

3:17 amalloy: thanks

4:53 bOR_: small question, if anyone knows. Decided while developing to use clojure 1.4.0-master-SNAPSHOT

4:53 but that seems to lose me the ability to use doc in a repl (doc map) for example.

4:54 raek: bOR_: (use 'clojure.repl)

4:54 bOR_: thanks

4:54 will that also get me to use (source ...)?

4:55 great.

4:55 yep!

4:55 gracias.

8:21 goodieboy: I'm using the contrib.duck-streams lib, trying to append to a file but getting this: Can't dynamically bind non-dynamic var: clojure.contrib.duck-streams/*append-to-writer*

8:22 i think it's because i'm using clojure 1.3 ?

8:23 duck1123: goodieboy: yes, in 1.3 you can no longer re-bind vars that aren't markes as dynamic. You don't want to use duck-streams anymore

8:23 most of the stuff has moved to new libs

8:23 goodieboy: duck1123: ahh ok that's what i thought. Do you know what I could use for appending to a file?

8:24 duck1123: spit takes an append option

8:25 (spit "event.log" "test 1\n" :append true)

8:25 goodieboy: perfect thanks!

9:14 mbac: did (use 'clojure.contrib.io) the other day and someone told me unqualified use is bad, but they're asleep so i can't ask them what to do instead

9:17 oh, (use '[clojure.contrib.io :only (murders executions)]) must be what they meant

9:17 cemerick: exactly right

9:17 There are still some sane usages of unqualified use, but they're rare.

9:20 mbac: also is there a name for the -> and ->> combinators?

9:21 cemerick: They're not actually combinators, they're macros.

9:21 Usually called threading macros.

9:21 mbac: fogus has this one: http://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/

9:22 mbac: yeah, saw

9:22 that's what lead me to ask about the threading macros

9:22 cemerick: ,(doc ->)

9:23 clojurebot: "([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."

9:23 cemerick: I think people take their cue from the verb at the start.

9:23 I think I've heard them called "chaining" macros too. *shrug*

9:28 leo2007: hi

9:31 gtrak``: why doesn't this work?

9:31 , (javax.xml.bind.DataTypeConverter/parseBoolean "t")

9:31 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: javax.xml.bind.DataTypeConverter>

9:33 gtrak``: oh, damn, spelling error :-)

9:35 mindbender1: When I clojure-jack-in to a project from emacs and get an

9:35 repl.. I've been having troubles switching to a files namespace

9:35 with (in-ns "foo.bar"). I keep getting

9:35 ..lang.ClassNotFoundException

9:36 gtrak``: you have to compile the file

9:36 mindbender1: oops*

9:36 gtrak``: or use require

9:36 otherwise it won't know what to do

9:36 but compiling a top-level file will compile all the referenced ns's as well

9:36 mindbender1: gtrak: can I compile from the repl?

9:36 gtrak``: require

9:37 but you can also just use emacs C-c C-k I think

9:38 which has the advantage of letting you navigate buffers by symbols

9:40 TimMc: mbac: Only use :use with :only. :-)

9:40 cemerick: I like to call them stitching macros, personally.

9:40 clojurebot: use?

9:40 clojurebot: chouser is ruthless about breaking other people's code

9:40 TimMc: heh

9:40 ~use

9:40 clojurebot: I want to go to there

9:40 TimMc: wtf

9:41 clojurebot: use is |reply| Only use :use with :only.

9:41 clojurebot: 'Sea, mhuise.

9:42 TimMc: Well, pretty sure I screwed up that factoid, but oh well.

9:47 gfredericks: clojurebot made sure to reply with a phrase that included "use" as a subsequence.

10:00 TimMc: gfredericks: Oh, wow... you can't spell "chouser" without "use".

10:01 and I bet the second one was *said* by chouser

10:01 ~use

10:01 clojurebot: use is |reply| Only use :use with :only.

10:01 TimMc: ugh

10:02 need brokets

10:03 clojurebot: use |is| <reply> Only use :use with :only.

10:03 clojurebot: Alles klar

10:03 TimMc: ~use

10:03 clojurebot: Only use :use with :only.

10:45 svjson: Is there anyone around who can answer a basic ClojureScript/goog.dom question?

11:15 bsteuber: svjson: just ask and we'll see :)

11:16 svjson: bsteuber: I sort of solved it, I think....

11:16 It's about rendering of the dom

11:17 I kept getting nothing back from my (.getElementsByClass goog.dom "...")

11:17 I then resorted to put the script stuff at the bottom of the page inside a div, and now it sort of works

11:18 bsteuber: so you tried to access an element before it was created?

11:18 svjson: But It'd be preferrable, to me at least, to wait for the dom to be properly rendered, á la jQuery's $(document).ready(..)

11:19 I'm guessing that's the case, yes

12:25 tensorpudding: obnoxious swank problems...

12:33 and korma connections aren't working

12:38 psql works, but korma times out

12:39 ibdknox: hm?

12:41 tensorpudding: i have a database blog, role blog (with login) and a password 'blog'

12:41 i configured korma to connect to it

12:41 leo2007: any idea why C-c C-d C-d in slime does not show any doc for special forms?

12:41 tensorpudding: but when i do a select the connection times out

12:42 ibdknox: well, it can definitely connect to psql

12:42 do you have the psql driver on your path?

12:43 tensorpudding: the which now?

12:43 Vinzent: ,def

12:43 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: def in this context, compiling:(NO_SOURCE_PATH:0)>

12:44 ibdknox: tensorpudding: ah k, just one sec

12:44 tensorpudding: if you mean the psql program, yes

12:45 ibdknox: nope, JDBC requires the specific driver for your database, I never told you to do that in the docs so I will fix that shortly.

12:45 tensorpudding: you'll need to add a dependency for [postgresql "9.0-801.jdbc4"]

12:45 Vinzent: leo2007, doc shows docs for special forms because it's hardcoded there, but special forms don't have corresponding var with meta

12:45 ibdknox: that is what allows JDBC to talk to psql

12:47 tensorpudding: hmm

12:50 much improved

12:51 ibdknox: great. Sorry about that, I'm adding to the docs now

12:52 leo2007: Vinzent: but swank.commands.basic/print-doc* seems to have code for special forms.

13:02 scottj: leo2007: I don't think that code ever gets run, perhaps it never worked, or perhaps it did on an older version of clojure

13:02 leo2007: scottj: thanks.

13:06 tensorpudding: is there any way to force reloading of code with slime?

13:36 simard: I get this error when doing M-x clojure-jack-in (emacs 23.3 under Windows 7): error in process filter: clojure-eval-bootstrap-region: Non-hex digit used for Unicode escape

13:37 is there a fix for that ?

14:19 przemek_: any idea why this:

14:19 (defn job [x] (println "hello" x) 1)

14:19 (def sched (Executors/newSingleThreadScheduledExecutor))

14:19 (.scheduleAtFixedRate sched (job 1) (long 0) (long 100) TimeUnit/MILLISECONDS)

14:19 gives me #<ClassCastException java.lang.ClassCastException: Cannot cast java.lang.Long to java.lang.Runnable> in REPL ?

14:20 shouldn't each function implement Runnable ?

14:20 brehaut: przemek_: (job 1) evaluates the function job with the argment one (returning a long) and passes that as the first argument to the .scheduleAt… method

14:21 przemek_: try #(job 1) or (fn [] (job 1))

14:21 przemek_: :)

14:22 my bad

14:22 thanks a lot

14:51 * djanatyn reads Clojure - Functional Programming for the JVM

14:51 djanatyn: I want to dedicate today entirely to Clojure :D

14:57 tomoj: .ui sai

14:58 djanatyn: you still using emacs?

15:02 djanatyn: tomoj: Yep.

15:03 I've got it set up with swank and lein and everything, thanks to help from #clojure.

15:03 tomoj: oh, nice

15:03 was going to recommend ignoring the getting started instructions in that article :)

15:04 chouser: Seriously. Bullet points. Now.

15:04 No more messing around in 4clojure or #clojure.

15:04 Oh, whoops.

15:04 djanatyn: I was so confused for a second :)

15:04 chouser: I'm still confused, if that's any help

15:04 cemerick: chouser: daily affirmations? ;-)

15:06 * gfredericks imagines chouser was speaking firmly to his kids

15:09 chouser: heh

16:19 drguildo: why doesn't "(filter Character/isUpperCase "TeStINg")" work?

16:19 mdeboard: Hm how do I search for a jar on Clojars & Maven via Leiningen? I'm trying to find Korma

16:20 brehaut: drguildo: Character/isUpperCase is not a function, its a (static) method

16:20 mdeboard: Sometimes I ask stupid questions

16:20 brehaut: ,(filter #(Character/isUpperCase %) "TeStInG")

16:20 clojurebot: (\T \S \I \G)

16:21 drguildo: should the distinction be obvious? i can call isUpperCase as a function, can't i?

16:21 Raynes: mdeboard: 'lein search korma'

16:21 drguildo: ,(Character/isUpperCase \X)

16:21 clojurebot: true

16:21 mdeboard: Raynes: Yeah, hence my "Sometimes I ask stupid questions" comment :P

16:21 brehaut: drguildo: theres sugar in place there

16:22 ,'(Character/isUpperCase \X)

16:22 clojurebot: (Character/isUpperCase \X)

16:22 brehaut: damnit

16:22 ,(macroexpand '(Character/isUpperCase \X))

16:22 clojurebot: (. Character isUpperCase \X)

16:22 drguildo: brehaut: do you have any pointers to where i can learn about the distinction?

16:22 hrmm, ok

16:22 brehaut: drguildo: http://clojure.org/interop ?

16:23 drguildo: sorry http://clojure.org/java_interop

16:23 drguildo: thanks

16:24 brehaut: drguildo: basicly, if its a java method, you cant use it as a function. you can tell because either its bound to a class (which ussually has a CapitalCamel name) and has a slash in it, or it is preceeded by a dot eg .toUpperCase

16:25 icefox: Is there a specific room for Clojure-conj?

16:25 Raynes: Nope.

16:26 Nobody will string you up for talking about it here. We're all very excited.

16:27 icefox: Just arrived in raleigh

16:28 drguildo: brehaut: ok, thanks

16:28 amalloy: icefox: dude, i think you're early

16:29 icefox: going to the training too

16:29 brehaut: Raynes: remember to check under your seat at the keynote for your early beta reader macros

16:29 Raynes: brehaut: Heh

16:30 icefox: The person at the desk said there was some sort of get together this evening at the bar, but don't know anything more

16:38 jli: I don't understand the difference between next and rest

16:39 amalloy: &((juxt next rest) [1])

16:39 lazybot: ⇒ [nil ()]

16:40 amalloy: jli: ^

16:40 jli: is that .. all?

16:40 amalloy: yes

16:40 jli: huh. cool. thanks.

16:41 brehaut: for some reason i though one is slightly more lazy than the other too

16:41 amalloy: brehaut: that's the same thing, really

16:42 brehaut: i guess so, although if you arent looking for it, that implication might be missed

16:42 amalloy: *nod*

16:42 next has to realize the next element to decide whether to return nil or not, whereas rest always returns a lazy sequence and doesn't have to realize anything

16:57 gfredericks: so (= next (comp seq rest))?

16:58 * Nocab has a clojure conendrum

16:58 Nocab: Im reading "the joy of clojure" and I'm at the chapter about macros

16:58 gfredericks: don't write macros

16:58 Nocab: and there I see some code using assoc on an empty map

16:58 assoc {} key val

16:58 as opposed to just {key val}

16:58 what on earth is the point of that?

16:59 * gfredericks doesn't know

16:59 Chousuke: can't say much without context, but probably no point :P

16:59 Nocab: its a good book and the authors seem to grok clojure and idiomatic clojure pretty well

17:00 gfredericks: I can imagine every once in a while that might make an expression more readable...

17:00 Nocab: I'm going to assume it's not 100% pointless

17:00 brehaut: Nocab: whats the page number?

17:00 Nocab: 174

17:00 from lining 8.11

17:00 listing

17:01 brehaut: oh yeah, the pre post stuff

17:01 theres no obvious reason from the context

17:01 Chousuke: yeah looks like it would be just fine with a literal map

17:02 Nocab: ok

17:02 Chousuke: might just be a habit from writing lots of (into {} ...) :P

17:02 Nocab: so there is no hidden clojurism or idomaticism over this

17:02 heh

17:02 TimMc: Yeah, send a pull request to the authors... :-P

17:02 Nocab: thanks

17:03 :P

17:03 ok

17:03 TimMc: (Which reminds me, I have a huge typo list to send to the author of a book I've been reading...)

17:04 djanatyn: heh, I never realized that mutable state was an oxymoron

17:04 Nocab: depends on your definition of "state"

17:05 if you -mutate- the definition of state into fitting your argument, then yes, mutable state is an oxymoron :P

17:05 photex: So at first glance, I thought that Korma was along the lines of an ORM... but I would still need to setup a database and whatever schema by other means correct?

17:05 Nocab: photex: from what Ive seen, yes

17:06 photex: ok cool

17:07 I'm still new to Clojure, coming from Python

17:09 tolstoy: Seems like korma is something that allows you to model verbs for your data access, whereas other ORMs model nouns. (Looking for a pithy description.)

17:10 brehaut: korma lets you a) describe the relationships between entities, and b) write SQL using composable primatives

17:10 photex: that makes perfect sense

17:11 * gfredericks wonders if korma is as composable as clojureql

17:11 tolstoy: What's the value of composable primitives?

17:12 brehaut: the value is that you can write your wheres, froms, aggregates etc as seperate functions

17:12 amalloy: tolstoy: that's basically what programming is, right?

17:12 brehaut: and trivially reuse them

17:12 tolstoy: amalloy: Yep.

17:12 Nocab: tolstoy: from what I read korma should be "composable", but I have no idea how composable it is

17:13 gfredericks: I got a lot of good use out of clojureql for its composability vs c.c.sql

17:13 brehaut: tolstoy: i have some korma that looks like this: (def chronology (-> (select* fragments) (with timestamps) (mod-dates) (live-only)))

17:13 tolstoy: I've seen some nasty PHP code where there were lots of if/ands/buts for crafting up a query based on customer configuration. I could see korma really helping with that.

17:14 brehaut: Could you say that it allows you to craft up a DSL for your particular problem set?

17:14 brehaut: just a word of caution, korma is still very new, and theres some bugs

17:14 tolstoy: if i were a hipster yeah

17:14 id just call it programming

17:15 tolstoy: do you call writing functions and using them 'crafting a DSL' ?

17:15 gfredericks: just the phrase "DSL" reminds me of ruby and that "data as code" thing

17:15 Nocab: brehaut: what a perfectly troll like response with an actual point :P

17:15 amalloy: brehaut: a hipster *or an advertiser*

17:16 tolstoy: Well, no, but now that I think of it, it sort of is. Building your primitives up into a language that lets you solve a problem.

17:16 brehaut: sorry, didnt mean to be snarky

17:16 amalloy: Nocab: you seem to be the only one who found it trollish

17:16 chouser: Nocab: The assoc is most likely left over from a previous version of that code that may have been building up a map rather than returning a new one.

17:16 Nocab: chouser: thanks

17:16 tolstoy: brehaut: I was trying to think of a way to describe it to (say) colleagues who might know the value of an ORM, but who might see Korma as no different than raw strings.

17:17 Nocab: when I said troll-like, it was meant in a positive way. finely crafted to provoke attention, but with an actual point attached ;)

17:17 brehaut: tolstoy: the parralell in the python world is probably SQL Alchemy

17:17 amalloy: tolstoy: i like the comparison of verbs vs nouns, personally

17:18 tolstoy: amalloy: I'm normally one of those "just use SQL and shut up" kind of people, so I'm trying to find the real value in this. (I don't use SQL in my day job these days.)

17:19 brehaut: tolstoy: korma is only a slight level above 'just use SQL'

17:19 all its operations are SQL operations

17:19 tolstoy: So, yeah, brehaut, if I can keep a "hipster" slogan in mind, I might be able to then unpack it if I need to. ;)

17:19 brehaut: rather than some set of operations of its own, or something more abstract like clojureql's use of relational algebra

17:20 gfredericks: I imagine that with korma half your typos will get caught by the compiler rather than silently sitting in your string literals

17:20 brehaut: the biggest abstraction korma provides is the has-many request

17:21 where it will choose to do a second query to get related table data

17:21 photex: yeah, that is pretty cool

17:21 but what about many-to-many?

17:21 doesn't that always require a separate table?

17:21 brehaut: photex: i believe many-to-many is currently just two has-many's to a many-to-many table

17:21 photex: would I still just be more or less manually putting that query together

17:22 ah o

17:22 brehaut: you are 'manually' creating a query, but you dont need to repeat yourself as much as in SQL

17:22 photex: but it's automatically (potentially) executed

17:23 with connections handled for you

17:23 which is the other aspect I was attracted by

17:23 ok, well, I'm going to noodle with it a bit

17:24 tolstoy: BTW, is it known that when you C-c C-k a file in slime-clojure, mismatched parents in commented-out code cause errors?

17:25 Er, parens. This mac autocorrects. ;)

17:25 photex: are there any sources of information about input sanitation when working with Clojure and a dbms?

17:25 brehaut: tolstoy: system preferences > language & text > correct spelling automattically

17:26 tolstoy: brehaut: Generally, I like it. Wish I could turn it off for just this app.

17:26 photex: Colloqyu?

17:26 raek: tolstoy: yes.

17:26 brehaut: tolstoy: you can temporarily turn it off for a particular field by rightclicking

17:26 photex: has it's own setting

17:26 oh nm

17:26 raek: tolstoy: 'comment' is implemented as a macro, so the stuff between the parens has to be valid syntax

17:27 photex: it'll "check" spelling

17:27 tolstoy: brehaut: Without using a fancy plist setting.

17:27 photex: the correction is a lion thing

17:27 tolstoy: Ah, cool. Didn't know about the right-click thing.

17:27 raek: No, I mean commented out with semi-colons.

17:27 brehaut: tolstoy: right click in the text entry field > spelling & … > correct spelling automatically

17:34 gfredericks: I'm getting a zip exception for some reason; the sort you'd get for a corrupt jarfile. But I blew away all my jars (including ~/.m2) and it's still happening. Anybody know any other cause?

17:35 brehaut: tolstoy: the reason i was objecting to 'DSL' etc is that in clojure its prefered that things are just functions and data rather than magical mystic special stuff. clojure (being a lisp) supports the magic stuff with macros, but in general it hurts reuse etc so they are used as a seasoning on functions and data.

17:35 tolstoy: in korma the root operations for select, update etc have a macro form for convenience, and a function that you can also use. eg select and select*

17:36 tolstoy: brehaut: Yeah, I get you. What I was thinking was this: with korma, you can build up a set of more abstract functions on top of the SQL stuff (which you've composed together) such that your app can be large grained rather than fine grained.

17:36 This is indeed "programming".

17:37 But maybe korma influences the kinds of more-abstract functions you might do than an ORM style tool.

17:37 brehaut: related: http://vrac.cgrand.net/DSL.pdf

17:37 amalloy: tolstoy: it is not known, and indeed is untrue in any config i've ever used

17:38 that is, ;; ())((( compiles just fine

17:38 tolstoy: I'm probably using DSL in a more general sense, or maybe just completely wrong. ;)

17:38 amalloy: Okay, good to know. I'll have to pay attention and craft up a use case when (if) it happens next, and submit it if I can reproduce it.

17:38 brehaut: tolstoy: that presentation is the result of cgrand converting some DSLy libs into more idiomatic, macro free clojure

17:41 tolstoy: amalloy: Seemed to happen when I'd commend out some code (using ;;) and then compiling that form. Very surprising. I really hope I just messed something up somewhere.

17:41 amalloy: tolstoy: that can happen if you've done it incorrectly, causing the actual un-commented code to be unbalanced

17:42 eg, by commenting out an open-paren but not its matching close

17:42 though emacs does its best to stop you from doing that accidentally

17:42 tolstoy: Right. I spent a lot of time looking for that, watching the flashing paren matchers, etc. Tabbing to see indent levels. Then I added a paren to the commented-out code, and it worked! So strange! ;)

17:43 If no one else has seen this, then that's good to know. I'll chalk it up to User Error. ;)

17:43 brehaut: i think whacking a mark is the way i typically find myself break paredit

17:43 hugod: I've seen unbalanced parens in comments cause issues

18:01 seancorfield: ring question... i'm trying to use wrap-resource and i figured out how to get favicon.ico found

18:02 but now it's matching "/" and returning the URI of a directory so the home page of my app is not being executed

18:04 brehaut: seancorfield: i believe that wrap resources intercepts your request prior to it reaching your ring handler and returns a resource if it finds an equivalent relative to the root-path map you provide to the wrapper function

18:05 seancorfield: yes, but it shouldn't return a directory request which is what seems to be happening

18:05 brehaut: looking at the code that would be my expectation too

18:06 seancorfield: it's returning a :body of a File for which .isDirectory returns true... i just checked

18:06 photex: Is korma compatible with Clojure 1.3.0?

18:07 brehaut: seancorfield: thats surprising; resource-response explicitly checks for directors and doesnt return them

18:07 https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/util/response.clj#L77

18:08 seancorfield: yup, that's what i'm looking at

18:08 and if i run the code myself in the repl, i still get the directory back...

18:09 brehaut: it must be coming back with a "file" protocol…

18:09 err not

18:10 seancorfield: try (.getProtocol (io/resource path)) in your repl?

18:11 seancorfield: file

18:12 photex: ok, actually, didn't mean to single out korma, but when trying to (require) a module in the repl, which itself only uses clojure.contrib.sql and korma.db; I was getting a stacktrace

18:12 but going back to 1.2.1 I can load it just fine

18:12 seancorfield: specifically (.isDirectory (:body (resource-response "" {:root "example/"}))) is true - which should not happen

18:13 photex: monolithic contrib (1.2.0) does not fully work with clojure 1.3.0

18:13 photex: ah

18:13 brehaut: seancorfield: the middleware unwraps the {:root …} map

18:13 photex: thanks seancorfield

18:13 seancorfield: use the new modular contrib libraries instead (specifically clojure.java.jdbc instead of clojure.contrib.sql)

18:13 brehaut: seancorfield: oh. my bad, it does the reverse

18:14 photex: ok, man so much information now is just incorrect for new folks like me

18:14 seancorfield: brehaut: yeah, that caught me out at first

18:15 resource-response expects a map with a key :root (for some odd reason)

18:15 wrap-resource takes the path (string) and passes it in a map {:root path}

18:16 anything except a request for / correctly goes thru my app

18:19 very weird (and frustrating)

18:20 brehaut: seancorfield: what routing / app lib are you using?

18:22 djanatyn: hmm

18:22 in clojure, (= x/y (/ x y))?

18:22 brehaut: seancorfield: because you could always put a fallback handler in place in moustache or compojure and call resource-response explicitly

18:23 djanatyn: ah, rational numbers are simplified if possible

18:23 seancorfield: i noticed that the isDirectory code is recent, since october 9th

18:23 but i'm using 1.0.0-RC1 so i should have that code

18:24 ah, my lib folder has an old version of ring!

18:24 *facepalm*

18:24 brehaut: aha!

18:24 :(

18:24 cemerick: seancorfield: I found I had to depend upon ring-core 1.0.0-RCx to get the fix

18:25 because other libs were depending upon older ring revs

18:25 (could use "[1.0.0-RCx,)" instead, I suppose)

18:26 seancorfield: i forgot to run lein deps on my desktop since i switched back to it after working on my netbook most of yesterday

18:26 i had updated from ring 0.3.8 to 1.0.0-RC1 yesterday to pick up other fixes...

18:28 oh well, only an hour wasted :(

18:28 now i can get back to expanding FW/1 :)

18:28 cemerick: seancorfield: is that your re-invigoration of the enlive frontend?

18:29 seancorfield: it's a port of my MVC from CFML

18:29 cemerick: right…but you were hung up on enlive at some point, right?

18:29 (may be mis-remembering strangeloop conversations)

18:30 seancorfield: yeah, but chatting with you at strange loop got me past that :)

18:30 cemerick: fabulous

18:30 seancorfield: http://corfield.org/blog/post.cfm/real-world-clojure-html-email-generation -- you get a credit there for helping me out!

18:31 https://github.com/seancorfield/fw1 -- CFML version -- https://github.com/seancorfield/fw1-clj -- Clojure version (work-in-progress)

18:31 cemerick: nice :-)

18:31 seancorfield: convention-based... auto-discovers controllers, views, layouts...

18:33 i have enough working that i think i can port one of the sample apps from cfml to clojure and start to demo it :)

18:34 cemerick: how would this sit with your frontend guys?

18:39 tolstoy: brehaut: I like that pdf presentation you liked to. ;) Sorry for using the world DSL. Lots of good sense in there.

18:39 mdeboard: Bleh, I shouldn't have tried to use postgres for this project where I'm also trying to learn Korma :|

18:40 tolstoy: brehaut: Er, I mean, "linked" to.

18:40 brandel: is the best approach for dom manipulation in clojurescript to build up a lib like dom-helpers.cljs in the twitterbuzz sample or is does clojurescript have it's own dom functions?

18:40 ^or does

18:42 just note that r.hickey has wrapped most of the dom/* functions in his own

18:43 ah, it's a js library - dom/foo is from google closure

18:44 mdeboard: Anyone here have any experience with Korma yet?

18:45 I'm using (sql-only) on an (insert) call, but it's returning `VALUES (?, ?, ?)` (literally the "?" marks) instead of the values I've actually set in the map.

18:48 brandel: it would be nice to have these defined in something along the lines of clojure.script.dom, but perhaps I'm failing to understand something fundamental here :)

18:49 mdeboard: Here, a more general question: Has anyone had success connecting to a PG db with Clojure?

18:49 brandel: doesn't clojure just use jdbc?

18:50 mdeboard: brandel: Yeah.

18:50 brehaut: yes and yes i believe

18:50 technomancy: mdeboard: https://github.com/abedra/shouter and https://github.com/technomancy/clojars-web/tree/heroku both use it

18:51 mdeboard: technomancy: Thanks

18:51 * mdeboard feels like he needs to just get a shirt that says "Thanks, technomancy"

18:51 technomancy: haha

18:51 mdeboard: or a tatoo.

18:51 ttoo*

18:52 technomancy: by "it" do you mean jdbc or korma? I thought you meant the latter bu tnow that I think for a sec you must mean the former

18:52 cemerick: technomancy: an addition for your cafepress store

18:53 technomancy: mdeboard: oh sorry, that all predates korma

18:53 mdeboard: technomancy: Yar, no worries

18:59 brandel: ok, now I'm confused clojure.browser.dom exists alonside goog.dom :|

19:11 mdeboard: What's data type is ^{} ?

19:11 s/What's/What

19:11 seancorfield: cemerick: "how would this sit with your frontend guys?" -- our team know FW/1 in its CFML form and the pure HTML views / layouts in the Clojure version of FW/1 would work better with our UI guys...

19:11 mdeboard: ^{} is a map of metadata

19:11 like ^{:doc "docstring"}

19:11 mdeboard: ah

19:20 Raynes: technomancy: Is there a way I can check to see how much memory tryclj is consuming on Heroku?

19:21 archaic: i need to create dynamic? cond statement https://gist.github.com/1343842 can someone look at that please - the function seems to work but i don't like it at all

19:22 brehaut: archaic: a cond statement is inherently closed for extension. the most obvious choice for an open for extension choice is multimethods

19:23 archaic: and using eval is a code smell

19:23 archaic: yeah, thats why i asked

19:23 brehaut: archaic: what problem are you trying to solve?

19:25 archaic: I have temperature data I want to group by different ranges -> i'm passing the above function to group-by to generate frequency distributions for different ranges

19:29 brehaut: archaic: how about you use math?

19:30 archaic: http://gist.github.com/1343875

19:31 archaic: i used an anonymous function to closure over the bounds you wanted, and then just calculate the new keyword (which btw is a bit horrible) on request

19:32 archaic: brehaut: thanks .. what was i thinking jesus

19:32 way to overcomlicate things

19:33 brehaut: archaic: the ability to create functions inline is an extremely powerful mechanism for enabling polymorphic behaviour

19:33 Raynes: I don't think brehaut was trying to overcomplicate things or be condescending.

19:33 cemerick: brehaut: reminded me of http://xkcd.com/208/ — just s/regular expressions/math

19:33 archaic: no i mean't i overcomplicated things not him

19:33 meant

19:34 brehaut: cemerick: lol :)

19:34 Raynes: Oh.

19:34 * Raynes slips out of the room with his head down.

19:34 brehaut: i lvoe how 'perl!' is onomatopoeia

19:35 cemerick: electronic communication has set back interpersonal relations by a century

19:35 brehaut: at least

19:35 unfiltered stupidity broadcast in nanoseconds

19:35 and typically in 7pt verdana

19:36 archaic: instead of the keyword in your code, i would probably use either a vector or map

19:37 archaic: either [lower upper] or {:lower lower :upper upper} or similar (depending on the usecase for the function

19:37 mdeboard: whoa.

19:38 brehaut: mdeboard has just seen the matrix

19:38 mdeboard: brehaut: emacs just crashed while trying to connect to a db :(

19:38 brehaut: mdeboard: slime + swank ?

19:38 archaic: brehaut: probably good idea, only was using that form since a display function im using takes keywords

19:38 mdeboard: brehaut: Yeah. Trying to troubleshoot this problem with Korma being unable to connect to a db

19:39 so I tried doing it with jdbc, crash

19:39 brehaut: mdeboard: i found that if i tried to use bare select on an existing DB that the resulting data would swamp swank or slime and something would die

19:39 mdeboard: "whoa"-worthy because I've never had emacs crash randomly without having some issue with recursion

19:40 brehaut: although, only some scripts in emacs rather than emacs itself

19:41 sritchie_: hey all -- is there a way to view the class path at the clojurescript browser repl?

19:44 I'm running (load-file "…"), but entering the wrong thing causes the repl to exit back to clojure 1.3

19:44 amalloy: i should answer more questions with "try using math"

19:44 brehaut: amalloy: in hindsight i realised that i could have used math _and_ juxt

19:45 amalloy: brehaut: pretty sure you could work partial and comp in there, no problem

19:45 brehaut: amalloy: definately a partial. (defn temp-range [start by end x] …)

19:46 amalloy: brehaut: btw, i finally added *** to useful: https://github.com/flatland/useful/blob/develop/src/useful/fn.clj#L66 - dunno why it took me so long to stop whining about its absence and just add it

19:46 brehaut: haha awesome :)

19:47 looks good

19:47 name is as good as any

19:48 amalloy: brehaut: ninjudd and lancepantz spent like five to ten minutes making up names for it cause they hated collude so bad

19:48 brehaut: hehe

19:48 and apparently grok was not accepted

19:48 amalloy: in fairness i didn't like grok either

19:49 brehaut: rats

19:49 haha (def ! complement)

19:50 amalloy: that one's surprisingly handy

19:50 brehaut: yeah im sure it is

19:52 amalloy: brehaut: see https://github.com/flatland/useful/blob/develop/src/useful/map.clj#L173 for a bit of magic that made ibdknox laugh when i linked to it

19:53 brehaut: amalloy: please hold. taking brain out of neutral

19:54 what does to-fix do?

19:55 amalloy: (to-fix foo bar) => (fn [x] (if (foo x) (bar x) x))

19:55 impl is in useful/fn.clj, but it's a bit messy

19:55 brehaut: care to enlightment on the name? also huh

19:56 amalloy: brehaut: well, it's paired with (defn fix), which actually does the fixing. to-fix returns a function which, "to fix" things which aren't sets, calls hash-set on them

19:56 brehaut: oh right

19:56 i was having trouble getting past 'fixed point' in my head

19:56 amalloy: ah

19:58 brehaut: thats clever

19:59 amalloy: thanks. it's really nice having useful around to dump all the neat ideas i/we come up with for reuse

19:59 brehaut: yeah

19:59 i need to remember to use it

20:00 Raynes: amalloy: That describes it well. idea.dump/fix

20:01 mdeboard: I am having a very damn hard time creating a connection to a database with Clojure. Very frustrating. I am tryinig to use the examples here http://en.wikibooks.org/wiki/Clojure_Programming/Examples/JDBC_Examples#MySQL but am getting the error, "SQLException No suitable driver found for jdbc:mysql://localhost:3306/cljshrink java.sql.DriverManager.getConnection (DriverManager.java:640)". Can anyone shed some light on

20:01 this?

20:01 clojurebot: This is a test.

20:01 mdeboard: hhe

20:01 heh*

20:01 amalloy: mdeboard: you need to declare a dependency on the mysql jdbc driver

20:02 mdeboard: Hm, ok

20:02 amalloy: $google jdbc maven driver mysql

20:02 lazybot: [Maven Repository: mysql » mysql-connector-java » 5.1.6] http://mvnrepository.com/artifact/mysql/mysql-connector-java/5.1.6

20:03 amalloy: so, that, i guess. [mysql/mysql-connector-java "5.1.6"]?

20:03 mdeboard: yeah I was about to ask if I needed the version in there.

20:03 guess so

20:03 brehaut: im using 5.1.13

20:03 amalloy: yeah, you always need a version

20:05 mdeboard: amalloy: boom.

20:05 BOOM

20:05 shakalaka

20:05 brehaut: mdeboard: i believe correct incantation is

20:05 (inc amalloy)

20:05 lazybot: ⇒ 20

20:05 amalloy: hah

20:06 mdeboard: brehaut: I was told I am not allowed to inc anyone except technomancy

20:06 sritchie_: dnolen, I think I might have found a bug in the clojurescript repl

20:06 dnolen: sritchie_: what's the problem your seeing?

20:06 mdeboard: amalloy: That did it, my god thank you so much.

20:07 sritchie_: dnolen: I've got index.html working, which is great -- if I move the <script src="path/to/bootstrap.js"></script> up into the header, the repl stops working

20:08 here's the difference more clearly: https://gist.github.com/1343942

20:08 sorry, that's backwards

20:08 okay, there we go

20:11 alexbaranosky: useful looks to be filled with.... useful stuff

20:11 dnolen: sritchie_: what's in bootstrap?

20:11 Raynes: Useful and thoughtful and horrible and vague. These are some of my favorite things.

20:11 sritchie_: dnolen: compilation from cljs-watch

20:11 dnolen: sritchie_: you're not waiting for document ready right?

20:12 sritchie_: ah, true

20:12 https://github.com/ibdknox/cljs-watch/blob/master/cljs-watch#L28

20:12 dnolen: sritchie_: yeah, interacting with Google Closure means putting all your scripts into the body.

20:13 sritchie_: got it

20:14 okay, I'll move it down in the enlive template

20:15 the one other question I had was about how to use load-file properly in the browser repl

20:15 to access files on my classpath

20:15 (load-file "clojure/string.clj") worked fine, but attempting to load my namespaces was causing a failure

20:17 dnolen: sritchie_: I haven't tried load-file, but are you sure the classpath includes the dirs for your project?

20:19 sritchie_: oh, you know what, (load-namespace 'my.ns) actually works out

20:20 dnolen: it'd be interesting to use enlive to embed a call to repl/connect in every page when working in dev-mode

20:21 dnolen: sritchie_: that would be neat.

20:21 sritchie_: dnolen: thanks for the help -- I'm off to absorb some reasoned schemer before the conj

20:25 tensorpudding: how does korma handle data types?

20:29 brehaut: tensorpudding: from mucking about, it leaves that all to clojure's jdbc layer

20:30 tensorpudding: apparently java datetime or whatever don't get marshalled into sql date types

20:30 brehaut: indeed. i believe there is an sql time object that inherits from the java datetime or something

20:31 have a look at prepare and transform to handle marshalling

20:31 mdeboard: SELECT to_timestamp("11/06/11 17:55:54", "MM/DD/YY HH24:MM:SS"); for MySQL anyway

20:31 tensorpudding: i don't know how marshalling would work

20:31 mdeboard: then you use--

20:31 yeah

20:31 dukeofmexico: does anyone know what the clj/java equivalents to scipi/sage/natural language toolkit are?

20:31 tensorpudding: i just grabbed clj-time

20:31 clojurebot: Huh?

20:31 brehaut: clj-time is jodatime based

20:32 tensorpudding: yes

20:32 brehaut: it has a namespace full of coercion stuff

20:32 tensorpudding: which does, clj-time?

20:32 mdeboard: tensorpudding: Yes

20:32 uh

20:33 amalloy: oh god, brehaut, it doesn't actually inherit from juDate, does it?

20:33 mdeboard: tensorpudding: https://github.com/ibdknox/Noir-blog/blob/master/src/noir_blog/models/post.clj#L13

20:33 brehaut: amalloy: http://download.oracle.com/javase/6/docs/api/java/sql/Date.html tears before bedtime

20:33 mdeboard: tensorpudding: http://p.mattdeboard.net/ctime.html writes a timestamp value fine

20:34 admittedly my code is probably clunky but.

20:35 brehaut: mdeboard: i think you can skip the strings and use to-long and from-date

20:36 (java.sql.Date. #^Long (coerce/to-long jodaDatetime))

20:36 and i think from-date should accept a java.sql.Date directly from the DB

20:37 mdeboard: http://p.mattdeboard.net/insert.html seems to write properly

20:37 based off my exhaustive testing

20:37 whcih includes (select link)

20:39 Man that's pretty exciting.

20:42 amalloy: whoa, #^Long. let's stick with ^Long (or really, ^long) in new code

20:42 brehaut: yikes my bad

20:42 i copied unthinkingly from clj-time

20:44 mdeboard: (dec brehaut)

20:44 lazybot: ⇒ 4

20:44 brehaut: damnit

20:44 mdeboard: lol

20:44 alexbaranosky: lol

20:44 (inc mdeboard)

20:44 lazybot: ⇒ 2

20:44 tensorpudding: i don't get it

20:44 what format does korma expect?

20:44 mdeboard: tensorpudding: It doesn't expect any format

20:45 brehaut: mdeboard: you are banned from decrementing karma on anyone except technomancy too

20:45 tensorpudding: i did roughly what you said

20:45 mdeboard: brehaut: Sorry only technomancy can tell me to whom I'm restricted in dec/inc'ing

20:45 brehaut: mdeboard: rats

20:45 tensorpudding: it complains that the database uses type timestamp, but i sent it a character varying

20:45 i used a built-in formatter for the date

20:46 amalloy: ,(symbol "(inc brehaut)")

20:46 clojurebot: (inc brehaut)

20:46 lazybot: ⇒ 5

20:46 brehaut: lol

20:46 * amalloy won't get his own hands dirty

20:51 gfredericks: ,(list 'inc 'gfredericks)

20:51 clojurebot: (inc gfredericks)

20:51 lazybot: ⇒ 4

20:51 gfredericks: that felt immoral

20:52 amalloy: pretty sure i know why, buddy

21:00 mdeboard: hahaha

21:02 :o

21:02 brehaut: ibdknox has been fixing a bunch of bugs today

21:02 mdeboard: well thank god

21:03 j/k I can't program

21:04 amalloy: brehaut: you can only tell he's releasing new versions. probably adding bugs

21:04 brehaut: amalloy: ive also watched my issues get closed

21:04 mdeboard: cackle

21:05 tensorpudding: it doesn't matter what i do, it keeps complaining about a type mismatch

21:05 mdeboard, what sql date type were you using for the date in that example

21:05 mdeboard: tensorpudding: Weird, what's the data type of your column?

21:05 timestamp

21:05 tensorpudding: timestamp

21:05 mdeboard: :O

21:05 tolstoy: Is someone here the moderator for the clojure mailing list?

21:05 tensorpudding: in postgres

21:06 mdeboard: tensorpudding: You might have to do like `SELECT to_timestamp("<your timestamp>", "<time format string>")`?

21:06 tolstoy: I accidentally pressed space (or something) and now my very poor post has gone to "review".

21:06 mdeboard: tensorpudding: I was using pgsql earlier but gave up.

21:06 amalloy: tolstoy: probably better off just posting another one with a "sorry for the last one"

21:07 brehaut: tolstoy: due to changes in google groups, nobody will actually be able to read it even if it makes it through review, so dont sweat it

21:07 tolstoy: amalloy: Argh! ;) If I could get the text back, I would.

21:07 mdeboard: brehaut: Do you get weird indentation with (insert) e.g. http://p.mattdeboard.net/indentation.html ?

21:08 brehaut: huh?

21:08 amalloy: mdeboard: that's the correct, default indentation

21:08 mdeboard: amalloy: Why is (values) aligned under `link`?

21:08 that's the only place that happens in mein clojure-mode

21:08 amalloy: you are way wrong, bro

21:09 mdeboard: I see

21:09 Usually in like `(<fn> <arg> <opts>)` opts gets indented two spaces, under <fn>

21:09 amalloy: if you have one or more arguments, followed by a newline, then more arguments, they should line up with the first one

21:10 mdeboard: Oh, well that explains that.

21:10 moogatronic: noob question: is there some clojure style guide that will help someone new to both clojure and LISPs in general know when to "press enter" when writing s-expressions?

21:10 amalloy: the indentation you mention is "defun-style" indentation, intended for things that are kinda like defns

21:10 mdeboard: moogatronic: Yes!

21:10 amalloy: or with-macros

21:10 mdeboard: moogatronic: Oh my god hold on

21:10 moogatronic: mdeboard: excitement! =)

21:10 amalloy: $google mumble scheme style

21:10 lazybot: [Riastradh's Lisp Style Rules - mumble.net main page] http://mumble.net/~campbell/scheme/style.txt

21:10 mdeboard: moogatronic: http://mumble.net/~campbell/scheme/style.txt

21:10 moogatronic: AND

21:11 http://dev.clojure.org/display/design/Library+Coding+Standards

21:11 amalloy: though i'm not sure this guy actually covers when to press enter. he's more about making sure you press the right number of spaces after each enter

21:12 moogatronic: is it a personal pref? like, jazz musicians who leave lots of space Miles Davis, vs someone who's very noty (John Coltrane) ?

21:12 amalloy: more or less

21:12 mdeboard: A foolish consistency is the hobgoblin of little minds

21:12 - Michael Scott

21:13 moogatronic: for me, since i have to concentrate to even read lisp - more "air" around the sexps makes them eaisier to read.

21:13 amalloy: moogatronic: go for it

21:13 moogatronic: i will read these links though, thanks amalloy and mdeboard

21:14 i'm still a bit in shock at my Lindenmayer System implementation. it's like one line. feels wrong. =)

21:15 amalloy: $google Lindenmayer System

21:15 lazybot: [L-system - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/L-system

21:15 brehaut: moogatronic: you can write extremely simple L-System in functional languages

21:15 moogatronic: yeah, i have a map of maps, and a looping flatten maper

21:15 =)

21:16 ultimately, i need more than what I have, i just implemented a context-free version, very easy as you say.

21:17 brehaut: moogatronic: is it just generate the expressions, or is it also doing the drawing?

21:17 moogatronic: brehaut: just generating the expressions. I'm converting this to music at some point.

21:17 not going to do the turtle graphics.

21:17 brehaut: oh hey thats cool

21:18 moogatronic: but maybe to actually learn clojure, i should implement a simple turtle graphics version too.

21:18 brehaut: the turtle is pretty straight forward to write

21:20 moogatronic: http://media.brehaut.net/files/tmp/lsystem.html the javascript is embeded

21:22 moogatronic: nice!

21:22 brehaut: moogatronic: its a bit ugly because its JS ;)

21:23 moogatronic: yeah, but it's also cool that it's JS. most examples out there are java applets..

21:23 did you make it just 'cause? or part of some other project?

21:23 brehaut: mdeboard: btw that quote is ralph waldo emerson http://en.wikiquote.org/wiki/Consistency

21:23 moogatronic: just for fun one day

21:24 mdeboard: brehaut: Yeah, the "- Michael Scott" thing is just a joke from The Office

21:24 brehaut: mdeboard: i am not familar with the american office

21:24 mdeboard: brehaut: It used to be funny

21:24 the end

21:24 brehaut: lol

21:24 i think you are thinking of the UK office ;)

21:24 moogatronic: mdeboard: sometimes it's still funny…

21:25 gfredericks: the UK office used to be funny and then it was over. the US office used to be funny.

21:25 moogatronic: but there are better 'candy' shows on the major networks.

21:25 community… i think for a network show, it's pretty hilarious and creative.

21:26 brehaut: i just realized I've had one of your blog posts as a tab in my browser for like 3 weeks or so now..

21:26 i should read it. =)(

21:26 "a brief overview of the clojure web stack"

21:26 brehaut: moogatronic: aha :)

21:28 cemerick: good grief, what happens if one wants to go to all of the conj unconference sessions? :-P

21:29 moogatronic: cemerick: has a schedule emerged for all of those?

21:29 cemerick: no schedule

21:29 it'll get worked out once people are on-site, I suspect

21:30 moogatronic: yeah, there are a few i'm not signed up for that I want to check out, but I figured i'd just do it there, rather than post a "add me to X" message.

21:30 brehaut: moogatronic: (defn l-system [transforms d s] (if (zero? d) s (mapcat (comp (partial l-system transforms (dec d)) transforms) s)))

21:31 cemerick: moogatronic: make sure the ones you're interested in have a quorum; otherwise, the organizer might bail

21:31 brehaut: moogatronic: is that roughly what you had?

21:34 moogatronic: basically - i used loop and recur… and stored my l-system definition as a map of maps.

21:34 and used a lot more CR's

21:34 =)

21:35 brehaut: moogatronic: ah, my lsystem definition is a map of vectors

21:35 moogatronic: my familarity with the language is low. I am looking at how you did yours… lots of C-c C-d d

21:36 brehaut: moogatronic: (ls {:a [:a :a :b] :b [:a]} 2 [:a]) ; => (:a :a :b :a :a :b :a)

21:37 moogatronic: the core if it is that mapcat is appied recursively; i use some point free in the middle

21:38 moogatronic: you could rewrite the first argument to mapcat as #(ls transforms (dec d) (transforms %))

21:39 amalloy: brehaut: seems nicer to capture the transforms in a closure somewhere instead of passing them through over and over

21:39 brehaut: ,(map {:a [:a :a b] :b [:b]} [:a :b])

21:39 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling:(NO_SOURCE_PATH:0)>

21:39 moogatronic: ah, mapcat seems to do the same as (flatten (map …))

21:40 brehaut: ,(map {:a [:a :a :b] :b [:b]} [:a :b])

21:40 clojurebot: ([:a :a :b] [:b])

21:40 ibdknox: lol

21:40 brehaut: moogatronic: exactly

21:40 amalloy: nooooo, it does better than that flatten. never use flatten

21:40 ibdknox: ~flatten

21:40 clojurebot: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.

21:40 brehaut: ,(mapcat {:a [:a :a b] :b [:b]} [:a :b])

21:40 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling:(NO_SOURCE_PATH:0)>

21:40 brehaut: fark

21:40 ,(mapcat {:a [:a :a :b] :b [:b]} [:a :b])

21:40 amalloy: thanks ibdknox. i forgot that already

21:40 moogatronic: is IRC the way a noob finds out to never use flatten? =)

21:40 ibdknox: yes

21:40 amalloy: moogatronic: mentioning it in my presence, mostly

21:40 brehaut: moogatronic: among many other functions ;)

21:40 amalloy: but i spend a lot of time in

21:40 moogatronic: well, then i should keep chat open all the time then. =)

21:41 amalloy: irc, so...

21:41 ibdknox: just try to use records... see what happens ;)

21:41 amalloy: haha

21:41 brehaut: moogatronic: once you are more familiar with functional programming, you might want to learn about the mapcat / for equivalence

21:41 clojurebot: (:a :a :b :b)

21:41 moogatronic: brehaut: ok. yeah, currently, i'm at the point where i just use the first thing that sounds like it will give me the right results, from random googling

21:42 tomoj: the mapcat/for equivalence?

21:42 brehaut: moogatronic: for sure, thats how you start out :)

21:42 cemerick: amalloy: no worries, this is a pretty decent hang :-)

21:42 amalloy: cemerick: "hang"?

21:42 ibdknox: hang out

21:42 cemerick: "place to spend time"?

21:42 brehaut: amalloy: thats not the queens english either :P

21:42 amalloy: tomoj: brehaut likes to remind people that for and mapcat are the same thing

21:43 * amalloy has just discovered all the cool kids think hang is a noun

21:43 brehaut: amalloy, tomoj: its my soap box

21:43 * cemerick is from Massachusetts, and should not be ahead of the vernacular curve

21:43 danlarkin: yeah but western mass

21:43 ibdknox: amalloy: no no, cemerick is just stuck in yester-year

21:43 danlarkin: so c'mon

21:44 amalloy: cemerick: i don't think it's possible for anyone who says "vernacular curve" to be ahead of it

21:44 tomoj: I don't see it, isn't mapcat like (apply concat (for ...))?

21:44 ibdknox: amalloy: the cool kids have moved way past things like "hang"

21:44 moogatronic: amalloy: lol!

21:44 cemerick: ibdknox: it goes round and round :-P

21:44 brehaut: ibdknox: i hear that things are now 'off the shelf' or something

21:44 cemerick: amalloy: I am decidedly baroque.

21:44 amalloy: &(mapcat (fn [x] [x (inc x)]) (range 5))

21:44 lazybot: ⇒ (0 1 1 2 2 3 3 4 4 5)

21:45 alexbaranosky: mapcats the same as for, like binds the same as do

21:45 in Haskell

21:45 sorta

21:45 amalloy: &(for [x (range 5), elt [x (inc x)]] elt)

21:45 lazybot: ⇒ (0 1 1 2 2 3 3 4 4 5)

21:45 brehaut: mapcat is monadic bind with the arguments reversed

21:45 alexbaranosky: but it only works for seqs

21:45 brehaut: (monadic bind in the sequence monad)

21:46 alexbaranosky: if you use clojure.algo.monad/domonad then you can have comprehensions for other monads too

21:46 ibdknox: cemerick: only 60bpm Overtures, Minuets and Fugues then?

21:46 tomoj: huh, I think I almost never use more than one binding for for

21:46 amalloy: tomoj: it is super-dang-awesome. do it more often

21:46 ibdknox: lol

21:46 super-dang-awesome

21:47 (dec amalloy) :p

21:47 amalloy: ibdknox: all the cool kids are saying it

21:47 brehaut: tomoj: the addition of :when and :let make for amazingly powerful

21:47 ibdknox: huh

21:47 (dec amalloy)

21:47 lazybot: ⇒ 19

21:47 ibdknox: interesting

21:47 alexbaranosky: domonad is the expanded `for` right?

21:47 brehaut: alexbaranosky: its comprehension notation thats actually implemented in terms of monadic operations; for is not

21:47 alexbaranosky: its used in the bowels of Midje for error-handling so I've seen a little of it

21:47 brehaut: (neither is let for that matter)

21:48 alexbaranosky: brehaut: right

21:48 ibdknox: speaking of for

21:48 I've never seen a piece of documentation that tells you about :let :when and so on

21:48 cemerick: ibdknox: I am doubly baroque in that I prefer non-Baroque-period stuffs. :-P

21:48 amalloy: &(doc for)

21:48 lazybot: ⇒ "Macro ([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost... https://gist.github.com/1344081

21:48 ibdknox: hm

21:49 cemerick: ibdknox: (mostly I'm just overtired :-)

21:49 brehaut: one of my friends wrote a soluction to http://en.wikipedia.org/wiki/Magic_square entirely in one for ;)

21:49 amalloy: brehaut: he's my friend too, now

21:50 brehaut: amalloy: wha?

21:50 amalloy: just for doing that

21:50 brehaut: oh right

21:50 hah

21:52 ibdknox: btw

21:52 someone asked why Korma used maps too and not just (and (< :blah ...

21:53 amalloy: easy assoc/dissoc to modify the maps, i imagine?

21:53 ibdknox: http://groups.google.com/group/sqlkorma/browse_thread/thread/bcc9f7488653a9f1/d907301789a5b89a#d907301789a5b89a

21:53 eh

21:53 just the last message in the thread by me

21:54 danlarkin: cemerick: when are you coming down to raleigh?

21:55 cemerick: Wednesday

21:55 good grief, @ 9:30

21:55 ibdknox: amalloy: yeah, basically very easily composed where statements

21:55 * cemerick goes to fire the fool that booked that

21:56 brehaut: the boss is always an idiot when you are self employed

21:56 and a cheapskate

21:56 cemerick: brehaut: right on

21:56 * cemerick 's boss is an asshole

21:56 cemerick: danlarkin: why, what's up?

21:56 ibdknox: srsly.

21:57 actually, I think it was chouser who asked about korma maps

21:57 moogatronic: how do people in NC pronounce Raleigh?

21:57 ibdknox: Raw-lee

21:57 well

21:57 sort of

21:57 Rawl-ee

21:57 moogatronic: good to know. In my mind it's encoded as "Ralley"

21:57 danlarkin: cemerick: just wondering, sonian's already down here, plus relevance and the trainees

21:58 rahl-ee

21:58 cemerick: Sounds like the setup to a horror movie.

21:58 danlarkin: there's gonna be a rumble

21:58 cemerick: "The trainees just went nuts."

21:58 ibdknox: it's kind of ironic that I flew across the country to just end up being involved with something that is based in NC again

21:58 cemerick: "There were experiments. I have the files."

21:59 ibdknox: hold your tongue! http://clojurewest.org :-D

21:59 brehaut: there needs to be clojureincrediblysouth.org

21:59 ibdknox: true! I'll be doing training there it sounds like

21:59 amalloy: brehaut: clojureunderworld

21:59 cemerick: Cool. I was going to suggest something to Alex, better get on that.

22:01 brehaut: amalloy: down here lisps are postfix languages

22:01 ibdknox: and they mostly just look like ssssssss

22:13 goodieboy: anyone know how to convert a java.util.Date to a joda date?

22:13 brehaut: goodieboy: look in clj-time.coerce

22:14 goodieboy: https://github.com/getwoven/clj-time/blob/master/src/clj_time/coerce.clj#L43-47

22:14 hugod: swank became a binary protocol today: http://lists.common-lisp.net/pipermail/slime-devel/2011-November/018290.html

22:15 ibdknox: hugod: practical implication for those of us who are not swank users?

22:15 brehaut: "Third party backends, for Clojure etc., are obviously broken now." vs previously, when they were subtly broken?

22:15 ibdknox: :(

22:15 goodieboy: brehaut: awesome that's perfect, thanks

22:15 hugod: ibdknox: none really

22:16 I have a local branch of ritz that seems to work with the changed protocol

22:16 ibdknox: sweet

22:17 hugod: I just realized that was a really bad phrasing for my question, it should've been what's the partical implication (since I don't use swank)

22:18 and thus wouldn't know

22:19 hugod: ibdknox: that makes more sense - still, no implication for swank-clojure users

22:19 dnolen: ok I have the beginnings of a proper ClojureScript Node.js REPL

22:19 ibdknox: ah, good, that thread made it sound like the world just blew up

22:20 tensorpudding: what's clojurescript

22:20 is that like coffeescript but with lisp syntax?

22:20 ibdknox: eh

22:20 kind of

22:20 dnolen: tensorpudding: Clojure that compiles to JS

22:20 ibdknox: it's an implementation of Clojure that happens to compile to JS

22:20 tensorpudding: meh

22:21 ibdknox: which means all the datastructures/fns etc are there

22:25 tinto: hi. I'm trying to get into clojure and thought the best way would be to try using a few of the libraries out there. I read up on Lein and included a library I found on clojars in my dependencies. I now have the jar file for the library, but were can I find documentation or the README for the library? Or, failing that, even just being able to see the source would be good, but all I seem to have is a .jar file.

22:26 I'm pretty new to the JVM so sorry for what is probably a stupid question

22:27 brehaut: tinto: what was the library? some libs are better than others for source or docs

22:27 amalloy: tinto: source for most libs is on github, and a quick google search will find them

22:27 tinto: I just chose one at random that didn't sound like it would be too big, or too intimidating.

22:27 I chose "pirate"

22:27 hard to google that!

22:27 :)

22:28 brehaut: github.com/simonhicks/pirate

22:29 i just googled github clojure pirate

22:29 amalloy: https://github.com/simonhicks/pirate

22:29 i see brehaut wins

22:29 tinto: right on, thanks! but there's nowhere on clojars or anything that is a standard place for docs for the libs or anything?

22:29 amalloy: afraid not

22:30 tomoj: that pom on clojars does happen to link to the github page, though.. http://clojars.org/repo/pirate/pirate/0.0.1-SNAPSHOT/pirate-0.0.1-20110104.084027-2.pom

22:30 brehaut: this library is pretty blunt about its purpose :P

22:31 tinto: ha. so it is.

22:40 goodieboy: could someone recommend a library for dealing with directories (mkdir -p) etc.?

22:40 flognikr: greetings -- I am still trying to make my new GNU emacs 24 install work with Leiningen/swank. Now the error message I get when I execute "M-x clojure-jack-in" is "That's not a task. Use \"lein help\" to list all tasks.

22:40 ")

22:40 signal(error ("Could not start swank server […snip…snap…]

22:40 clojure-jack-in-sentinel(#<process swank> "exited abnormally with code 1\n")

22:41 any thoughts are highly appreciated.

22:41 mdeboard: What is the `{:as user}` bit here on the noir docs? I'm trying to figure out how to pass form data to a [:post] controller.

22:41 alexbaranosky: goodieboy: fs ?

22:41 https://bitbucket.org/tebeka/fs/src/b9ca3df74f55/src/fs.clj

22:42 mdeboard: flognikr: Did you run `lein deps` and `lein plugin install swank 1.3.0` (or whatever the latest version is, then restart emacs?

22:42 goodieboy: alexbaranosky: nice :) thanks

22:42 mdeboard: flognikr: Also where is your lein script (e.g. `which lein`), and what happens when you do M-x shell-command lein run

22:45 flognikr: mdeboard: thanks -- yes, I installed swank 1.3.3, did leon deps...

22:46 mdeboard: ~/opt/bin/lein

22:46 mdeboard: flognikr: Is that the mac equivalent of like /home/flogniker/bin ?

22:46 technomancy: flognikr: probably the $PATH for emacs doesn't match the $PATH of your shell

22:47 happens a _lot_ on Macs when you launch from a GUI

22:47 mdeboard: technomancy: There wer ea couple other folks like that in here last night

22:47 flognikr: mdeboard: I have "(setenv "PATH" (shell-command-to-string "echo $PATH"))" in my init.el

22:47 mdeboard: technomancy: (plus me last week)... is it possible something changed path-wise in emacs 24?

22:48 technomancy: mdeboard: not that I know of; it's just a stupid mac bug

22:48 sorry, "quirk"

22:48 amalloy: anythin is possible, of course

22:48 mdeboard: technomancy: shrug i'm on ubuntu 11.10 and the guy last night was as well afaik

22:48 technomancy: huh

22:48 tensorpudding: isn't ~ in mac /Users/<username>/ or something

22:49 technomancy: well there are plenty of ways to screw up environment variables on any OS

22:49 moogatronic: My lein/swank/24/mac setup seemed to work first try, but I have an alias that I launch from zsh to start emacs…: emacs='open /usr/local/Cellar/emacs/HEAD/Emacs.app'

22:49 flognikr: I am certainly able to screw up environments ;-)

22:49 leo2007: technomancy: Can C-c C-d C-d work on special forms?

22:49 technomancy: flognikr: actually this could be a different bug though; there's an issue in the latest release of lein where duplicate plugins in ~/.lein/plugins get ignored; maybe make sure you only have one copy of swank

22:50 leo2007: I think it needs an actual var to attach to

22:51 tensorpudding: swank fails about 75% of the time i start it

22:51 flognikr: technomancy: I'll give it a try, thanks!

22:51 tensorpudding: the error was related to fontifying or something

22:51 eventually it works after trying to start it often enough

22:52 flognikr: technomancy: ok, one step forward: now it says "Couldn't find project.clj, which is needed …"

22:53 moogatronic: flognikr: do you have a clojure source file open in your buffer from the same dir as your project?

22:53 flognikr: (I executed the jack-in command while editing the project.clj file)

22:56 moogatronic: well, I had the project.clj file open. When I load a .clj file from down in the src path, I get the same result.

22:56 I must be doing something very simple very wrong ...

22:56 moogatronic: does lein swank work from the prj dir?

22:56 tensorpudding: what does the jack in function actually do?

22:57 moogatronic: if you just need to get going, you could run lein swank, and then M-x slime-connect from your buffer

22:57 tensorpudding: does it just load all the .jar files in the libraries into the class path?

22:57 moogatronic: afaik, it run lein swank and slime-connect for the current path you're editing files in. =)

22:57 technomancy: tensorpudding: it bootstraps the known-compatible version of slime.el from inside the swank jar into the Emacs process, starts a swank server, and connects emacs to it

22:58 flognikr: well, when I do "leon swank" from the project dir, I get "> lein swank

22:58 user=> Connection opened on local port 4005

22:58 #<ServerSocket ServerSocket[addr=localhost/,port=0,localport=4005]>" and then it hangs…

22:58 moogatronic: ok, thats good. =)

22:58 tensorpudding: how does it know the classpath?

22:58 flognikr: hmm … not feeling it :-)

22:58 moogatronic: now switch to your emacs buffer and do M-x slime-connect

22:58 i mean, clojure-jack-in is much nicer, but this way you can at least verify your system is working…. at some leve

22:59 tensorpudding: i don't claim to understand how java does libraries, but i know that swank would need to know how to find the .jar files in the project

22:59 technomancy: tensorpudding: leiningen calculates it from project.clj

22:59 flognikr: now emacs doesn't find the slime-connect command ...

22:59 tensorpudding: i didn't know swank clojure depended on lein

23:00 moogatronic: flognikr: do you have slime installed?

23:00 flognikr: so there must still be sth fishy with my emacs install. yet, I used marmalade to install clojure-mode. thought that would bring in slime and swank.

23:01 moogatronic: flognikr: i'm not really sure, i'm probably only a couple of steps ahead of you on my setup. =)

23:01 flognikr: installing slime manually now ...

23:01 technomancy: tensorpudding: well technically you could launch it various ways, but M-x clojure-jack-in uses leiningen by default

23:01 tensorpudding: really?

23:01 i thought clojure-jack-in was from clojure-mode

23:01 moogatronic: I got it working one night and was like hells yeah, not f'ing with the config anymore.

23:02 technomancy: tensorpudding: yeah, the elisp invokes lein as a shell command

23:02 Raynes: clojure-jack-in *is* in clojure-mode, but it isn't the only way to launch slime. Furthermore, clojure-jack-in is in no way tied to Leiningen. I recently added an interface for it to cake.

23:02 technomancy: (it's insane the hoops you have to go through when you can't modify the classpath at runtime)

23:02 tensorpudding: i like things that work

23:02 and for that i thank you

23:03 technomancy: heh

23:03 tensorpudding: well

23:03 technomancy: still about 20% of the troubleshooting in here is about slime

23:03 tensorpudding: it works like 75% of the time

23:03 technomancy: but before jack-in, it was at least 45%

23:03 tensorpudding: i had issues with slime when i experimented with sbcl

23:03 a few years ago

23:04 not quite the same as the ones with clojure but still annoying

23:04 the hate part of the love-hate relationship with slim

23:04 e

23:05 flognikr: so after manual slime install it still says it can't find the project.clj...

23:05 moogatronic: M-x slime-connect, does that work now?

23:06 flognikr: It says "Connected. Your hacking starts… NOW!"

23:07 that sounds good.

23:07 moogatronic: so , you should have a slime-repl buffer

23:07 maybe yuo should try "turning it off and on again"..

23:07 )

23:09 flognikr: moogatronic: I have a *slime-events* buffer, but no *slime-repl* buffer… wait, let me check the dev-dependencies.

23:12 ok, I removed swank from the dev-dependencies, but that results in no luck either.

23:13 moogatronic: i'll restart my sessions and see if i can replicate

23:19 flognikr: i'm using the following packages, not sure if our setups are similar: starter-kit starter-kit-lisp starter-kit-bindings clojure-mode

23:19 then some other unrelated stuff...

23:20 i'm not /really/ sure what's in all of those pacakges, but that seemed to be the minimal set to get mysetup working, iirc.

23:21 flognikr: moogatronic: thanks for your help on this -- I tried to no use starter kits, and just follow the procedures specced for leiningen, clojure-mode and swank-clojure in technomancy's github :-)

23:21 but I'll try again tomorrow with your setup...

23:21 moogatronic: i don't think the starter kit is probalby necessary, but I didn't try without.

23:22 your lein setup seems to be working

23:24 flognikr: I think it does. when I do "leon swank", and then "slime-connect" from within emacs, I'd expect that a C-x C-e would interact with my slime REPL. however, it still tries to veal elisp.

23:24 there is some broken connection between emacs and the slime/swank-clojure setup that I haven't traced down yet.

23:30 sritchie_: dnolen, that browser repl script is great -- I wonder if there's a clean way to get the project's lib/*.jar files onto the browser-repl classpath

23:31 otherwise, namespaces referenced in :require-macros don't get picked up

23:31 flognikr: moogatronic: victory! I have followed your list of startup kits, and have successfully connected via slime-connect! thanks very much!

23:32 moogatronic: must be something in the starter-kit-lisp

23:32 at least you can have fun and figure out what you want to remove later. =)

23:33 flognikr: yes -- clojure-jack-in still refuses to cooperate.

23:33 moogatronic: oh really? weird.

23:33 flognikr: but this at least gets me forward -- so thanks again

23:33 dnolen: sritchie_: yeah, something to bring up at the conj, there's a couple annoyances like that which should get sorted out asap.

23:33 sritchie_: lack of js literal is frustrating

23:34 sritchie_: yup

23:34 no real complaints, I've been looking forward to getting set up like this for some time now

23:35 the only other one I found had to do with the browser repl not liking the metadata carat: (defn ^:export greet [n] (str "Hello " n))

23:39 dnolen: sritchie_: yeah all around CLJS is pretty great.

23:43 flognikr: technomancy: is Leiningen the most recent version (just checking to rule out an obvious error source)

23:53 amalloy: he's probably tinkering away in his lab, working on

23:53 flognikr: likey -- don't want to disturb that process :-)

23:54 tensorpudding: is the most recent tagged version, i'd guess so

23:55 flognikr: tensorpudding: thanks!

23:58 ok -- clojure-jack-in won't budge -- I'll have to tackle it another day. Thanks to all of you for your help and advice.

Logging service provided by n01se.net