#clojure log - Mar 13 2012

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

0:08 devn: aperiodic: all the time, just for fun. :)

0:08 no one ever said whether premature optimization was bad when used only as an exercise

0:09 besides, if he doesn't care about adding to the end of the nested vector and it is more performant out of the gate, then why not use that, eh?

0:11 alek_b: are you around?

0:11 aperiodic: devn: i've been guilty of my fair share of microbenchmarks

0:12 devn: aperiodic: it used to be a bit more en vogue in this channel to bench things i think

0:12 maybe im just getting old

0:12 aperiodic: devn: just as long as everyone recognizes when it's premature

0:13 i haven't seen many benchmarks in here, but i haven't been around here very long

0:13 devn: *nod* -- totally agree, but if someone says: "hey how do i transform this to this?"

0:13 then why not give them options

0:13 y'know?

0:15 aperiodic: can't argue with that

0:16 devn: aperiodic: so, whatcha hackin' on?

0:17 aperiodic: right now, finishing up some stuff at work. gonna start porting some of my processing sketches over to quil once i'm home, though

0:18 devn: you?

0:18 yoklov: if i have a function which needs to io and i want it to be configurable, what's the perferred way to have that happen?

0:19 just use *in* and *out*?

0:20 devn: aperiodic: a lot of thinking without enough doing. im working on a css/xpath screen scraper, mostly a wrapper around existing libraries, not much code to show yet

0:20 i refactored clj-xpath the other day, updated it to 1.3.0 and then realized it didn't fit my needs at all after the fact

0:20 aperiodic: have you played around with enlive at all?

0:21 devn: and finally i have sort of a dream of an interactive clojure explorer library

0:21 yeah i really dont like enlive

0:21 i find it to be like pulling teeth. I get something back and then need to call first on it, or call a key and then first, etc.

0:21 it feels like it's missing pieces, and also feels overly complex for what i want to do

0:22 i loved mustache, but enlive just feels... i dont know... weird.

0:23 i get how it works. i realize why it's cool. but at the end of the day when im trying to just get stuff done, i feel like i'm wrestling with it

0:23 aperiodic: i haven't done much besides kick the tires with it

0:23 devn: ive heard a dozen or so people say the same thing. i think we need a better scraping lib.

0:24 aperiodic: this is what i'm working on at the moment -- very, very early days: https://github.com/devn/yokogiri

0:24 inspired by yoko harada's work on doing the pure java port of nokogiri

0:26 aperiodic: there's also this: https://github.com/devn/indiana/tree/master/src/walton

0:26 it's an old project im reworking

0:26 https://github.com/devn/clj-xpath that too

0:26 just a big old refactor, hope the authors don't hate me for it

0:27 but it's like reading clojure from...well, a year or two ago, not a big surprise given the age of the lib

0:29 aperiodic: i wonder if you couldn't get what you want with some macros on top of enlive

0:32 that'd let you write things like (for [node (select-css root > h2 a)] ..)

0:32 at least, that's my first instinct whenever i feel like i'm fighting with some code i'm writing

0:44 jkdufair2: if, in the process of handling a ring request, i need to make a separate, synchronous request to another server, how do i do this? i'm trying to do so with clj-http and getting a ClientProtocolException

0:51 devn: aperiodic: it just feels like too much cake to eat

0:51 aperiodic: cool, automaton generators and all of this stuff

0:51 there's a reason that multiple tutorials exist for enlive

0:52 it's because no one gets it. i learned emacs. that took me like 4 tries. i've done the same with enlive, but it just doesn't work for me.

0:52 it feels wrong. it hurts to use it.

0:54 that might be ill-founded nonsense. maybe im missing something obvious, but ive never wrestled harder with a library than i have with enlive. i find it to be brilliant garbage.

0:54 ibdknox: I'm not going to really cover it in my class

0:54 devn: (yikes. i love cgrand.)

0:54 but i can't pretend it's just dandy

0:54 it's terrible to use

0:55 ibdknox: yes it is

0:55 it's not what we should be promoting for Clojure

0:55 it is neither simple nor easy

0:55 devn: no. not at all. we really need a better story

0:55 it is clever as fuck

0:56 matadon: Question: Is there something else required to get Leinengen plugins to work? I've got 2.0.0-preview2, and 'lein plugin install X' just gives "That's not a task.". When I check 'lein help', 'plugin' isn't listed.

0:56 ibdknox: stencil, comb, and hiccup are the ones I'm directing people to these days

0:56 devn: ibdknox: wanna help me with a nokogiri port :)

0:56 ibdknox: im not familiar with stencil or comb

0:56 ibdknox: dude, I have less time than none :p

0:56 stencil = mustache

0:56 comb = something like erb templates

0:56 devn: haha, well hey, it was worth a try

0:56 ibdknox: i really, really want to do haml for clojure

0:57 i know people puke at that

0:57 but i swear it would be good for the community

0:57 matadon: devn: I'd use it.

0:57 technomancy: matadon: check out the upgrade guide linked to from http://leiningen.org

0:57 devn: we need a better templating library. am i down to use hiccup? you bet.

0:57 is a designer? nope. is a rubyist who is checking out the clojure webstory? hell no.

0:58 technomancy: I would have a hard time recommending something other than hiccup for HTML

0:58 it's just so obvious

0:58 devn: technomancy: unless you're new and it isnt!

0:58 it looks like primitive hell

0:58 it is everything parenophobes are afraid of out of the gate

0:59 technomancy: well they need to learn how functions work

0:59 devn: they do, but time is time

0:59 they need to take some

0:59 technomancy: learning how to template before you know how to do abstractions is silly

0:59 devn: technomancy: i dont think it'd hurt anyone to provide something like haml for newbs

0:59 it's an entry point

1:00 ibdknox: we have a couple of sensible entry points for those people

1:00 devn: they can use hiccup in a little bit, it won't tarnish the community or ruin clojure

1:00 technomancy: I'm pretty suspicious of code targeted explicitly at newbs

1:00 ibdknox: mustache is a great solution for designers

1:00 technomancy: if it's not intended for its own author, there's not much hope for it

1:00 ibdknox: comb is great for the ruby crowd

1:00 devn: im not. half of the ruby gems ive used are targeted at newbs

1:00 ibdknox: technomancy: I am as well

1:00 valid abstractions span the skill gap

1:00 devn: i think there's a /balance/

1:00 technomancy: if you go down that path you end up at sweet-expressions

1:01 devn: if you want to be hardcore and be all like: "totally functional, bro"

1:01 then you can use enlive

1:01 but that's not how people tick

1:01 matadon: There's a lot to be said for making an environment newbie-friendly.

1:01 devn: there's a balance to be had here. a middle ground

1:02 and being opposed to one extreme or the other is wrong on its face

1:02 it's the middle

1:02 technomancy: matadon: that's fine; I'm saying don't target newbies primarily

1:02 devn: compromise your clever lib that has a totally crazy interface in order to let people do things with it

1:03 ibdknox: matadon: absolutely, and I do tons of work to make that true - but it also isn't some watered down thing for "newbs"

1:04 technomancy: focus on getting the abstraction right, then you can make it palatable to newcomers

1:04 ibdknox: yep

1:04 technomancy: if you try to do it in the other order you'll end up with a mess

1:04 devn: or not

1:04 what if you're a newcomer?

1:04 and you write a library?

1:04 ibdknox: I was

1:04 I was new when I wrote noir

1:05 devn: so you did it exactly the opposite of what is being prescribed there

1:05 ibdknox: no

1:05 devn: you wrote a lib for a newcomer

1:05 because you wrote it for yourself

1:05 ibdknox: I wrote a lib that worked at every level of the stack

1:05 technomancy: the abstractions were already there

1:05 with noir

1:05 ibdknox: yep

1:05 * devn throws his hands up

1:05 devn: (not like ice cube)

1:06 technomancy: ibdknox: I don't think I'm advocating libs for newbs as par for the clojure course.

1:06 but i also think this community has a tendancy to be arrogant, holier-than-thou, etc.

1:06 ibdknox: I'm arguing that the notion of a lib for newbs doesn't exist :)

1:06 there are just good and bad libraries

1:07 a good lib will work for anyone of any skill level

1:07 devn: people can write god-awful interfaces and be praised for years

1:07 enlive is case and point

1:07 it's still a standard, and it is terrible

1:07 ibdknox: is it?

1:07 I've not seen a single open source project that uses it

1:07 lol

1:07 that was a big problem Raynes had with it

1:08 devn: ibdknox: im on several lists, someone recently said: "So what do I use from screen scraping?"

1:08 5 people replied with enlive

1:08 no other suggestions

1:08 ibdknox: sure, it's actually pretty good at that

1:08 not so great for templating

1:08 devn: what?

1:08 clojurebot: what is short for ,(doc ...)

1:08 devn: dude, that's ridiculous

1:08 it's terrible for scraping

1:09 it was built for templating, and scraping is an afterthought

1:09 that's how bad it is at scraping

1:10 technomancy: devn: I agree with that notion; I just think hiccup is good because it's got really solid ideas at the core, not because it makes concessions to newbies in any way

1:11 devn: meh, im not gonna go on and on, but here's what im trying to say: we can talk about being "newb friendly", and i agree that we should not write libs for the express purpose of satisfying people who dont care to learn, but at the same time, there is an incredible amount of clever stuff that deters people who are new to the community, and those things are recommended defaults, and that is just not good for us in general

1:11 technomancy: if you can pull it off with simple abstractions that anyone can understand at a glance, the bar is going to be a lot higher for fancy stuff

1:11 devn: technomancy: yeah, honestly i agree with hiccup. i really do like it

1:11 and i dont think it's scary for newbs, despite what i was saying before

1:11 it was obvious to me when i found it

1:11 technomancy: obviousness is tops

1:11 devn: yeah, absolutely.

1:12 technomancy: anyway, gotta head off

1:12 devn: take care phil

1:13 matadon: I've got a quick question, actually — is there a SASS library for Clojure? Not 'a CSS template system', but specifically SASS? Google doesn't seem to turn much up, but today seems to be my day to find nothing useful.

1:13 s/SASS/SCSS/

1:13 ibdknox: I thought most people just used the compass watcher?

1:14 devn: ibdknox: they can, but it bones you if you want to deploy to heroku

1:14 ibdknox: ah true

1:14 devn: a gemfile means you get treated as a ruby deploy on cedar

1:15 matadon: im pulling for you, buddy. we'll get you sass and haml, i promise. :)

1:15 ive been working on a better haml-ish solution for clojure than haml-macro

1:15 haml-macro is decent, but it's buggy and incomplete

1:16 matadon: devn: I'd like that. I've just started playing with Clojure, and while I love the language, the tooling is *incredibly* frustrating.

1:17 ibdknox: as requested: https://github.com/ibdknox/cljs-template

1:17 :D

1:17 devn: :)

1:18 matadon: honestly, it gets better, and honestly, if you're coming from Ruby the tooling is "easy" while it simultaneously ruins your life

1:18 nothing is perfect. there is room for improvement, but i have a hard time looking at rvm and bundler and thinking it's magically delicious

1:19 matadon: devn: Yeah, I've noticed that; even though I've got enough of a Java background (lots of time with JRuby), there's a lot of things that just don't seem to work. I'm about an hour in to trying to play with Compojure, and haven't managed to even get it to the 'Hello, world!' stage yet, because I can't find a set of dependencies that Leinengen (I'm on Lein2; maybe that's the problem?) will load.

1:20 devn: lein means "gemsets" are a default. i like that. namespaces vs ruby classes, another (inc) for clojure, and the list goes on. Tools are tools. they make your life easier, but the really "great" tools, usually give you a pain your ass after a short while.

1:20 matadon: devn: RVM is crap, Bundler was horrific for the first few releases, but the current Bundler works fairly well.

1:20 devn: yes, but even recently there was bundler hell to deal with

1:20 0.9.2 rake + bundler => /me pukes blood

1:21 i stil find myself needing to randomly use bundle exec

1:21 it's craziness. while some of the tooling that i wish was there in clojure isn't, it's still more sane overall than some of the issues ive dealt with in other environments

1:22 im not trying to make excuses, that's just anecdotal evidence

1:22 but that's how i've felt lately

1:22 dnolen: matadon: I wouldn't mess w/ lein2 just yet if you just want to get things done.

1:23 devn: dnolen: i havent had a chance to read up -- what does lein 2 bring to the table?

1:23 be my rss feed. XD

1:24 matadon: dnolen: Good to know; installing 1.0 still shows missing dependencies when trying to have a go with Compojure.

1:24 devn: btw dnolen thanks for being so involved in the GSoC stuff -- i've brought that up for the last 2 years in IRC but never took the initiative you have on the group

1:24 dnolen: devn: cleaner design, faster REPL start, REPLy

1:24 devn: thanks for that.

1:24 robinkraft: can someone point me at a command line java profiler? I've been using jvisualvm locally but on a cluster I need something that's command-line only.

1:24 dnolen: np, hopefully something comes of it.

1:24 matadon: Anybody in here actually successfully using Compojure, and if so, what do your deps look like?

1:25 ibdknox: matadon: you should give noir a go

1:25 dnolen: matadon: 1.0 of what?

1:25 ibdknox: matadon: if you're new, it'll give you everything you need. http://webnoir.org

1:25 amalloy: matadon: https://github.com/4clojure/4clojure/blob/develop/project.clj

1:25 devn: im sure it will! dnolen: just let me interview them. i was part of the plan9 project and had a terrible experience.

1:25 hiredman: robinkraft: there aren't really any as far as I can tell, people tend to just attach a local profiler to the remote process

1:26 devn: ill make sure we dont get any riffraff

1:26 matadon: dnolen: Leinengen; I'm very-new-to-Clojure, and wanted to play around with things today, but it's been a big pile of Things Not Working. That might be due to Leinengen, so I dropped 2.0 and installed Lein1.

1:26 amalloy: Thanks.

1:26 ibdknox: Will check out Noir as well; I'm just exploring today. :)

1:26 devn: matadon: how new to clojure?

1:26 dnolen: matadon: you mean 1.7 right?

1:26 amalloy: though ibdknox's suggestion to use noir is probably good if you're having trouble with compojure. i imagine noir has a better out-of-the-box experience

1:27 robinkraft: hiredman: hmmm I'm not sure how that would work. Is that something I could do with jvisualvm?

1:27 devn: matadon: have you checked out how cool the ns-* functions are? metadata? I remember those things blowing my mind.

1:27 hiredman: you can it, it takes some port forwards and some chicken blood

1:28 devn: &(map #(:doc (meta %)) (take 5 (map second (ns-publics 'clojure.core))))

1:28 lazybot: java.lang.SecurityException: You tripped the alarm! ns-publics is bad!

1:28 devn: awwwww

1:28 matadon: matadon: Today is my first day; I've got a very heavy JRuby and C background, and would really like an alternative to POJO on the JVM. Big Lisp fan as well, so Clojure is kind of a natural fit.

1:28 hiredman: you might also consider moving to "metric gathering" approach when deployed

1:29 devn: matadon: why so heavy on JRuby? self study or for work?

1:29 robinkraft: I'm low on chicken blood, so maybe metric gathering is the way to go

1:29 devn: robinkraft: no. never. err on the side of chicken blood.

1:29 (this is important)

1:30 robinkraft: devn: haha ok.

1:30 devn: ,(ns-publics 'clojure.core)

1:30 clojurebot: {sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, unchecked-inc-int #'clojure.core/unchecked-inc-int, ...}

1:31 devn: two bots in here...

1:31 i tell ya

1:31 ,(map #(:doc (meta %)) (take 5 (map second (ns-publics 'clojure.core))))

1:31 matadon: devn: Both? I often find myself needing to drop down into POJOs for performance, and really like having both proper threads and decent profiling.

1:31 clojurebot: ("keyval => key val\n Returns a new sorted map with supplied mappings." "Reads the next line from stream that is the current value of *in* ." "Returns an instance of java.util.regex.Pattern, for use, e.g. in\n re-matcher." "Return true if x is a Keyword" "Returns a number one greater than x, an int.\n Note - uses a primitive operator subject to overflow.")

1:32 hiredman: robinkraft: there is some log analysis based metric library some where, which is kind of nice, you don't need to run a metric server like graphite, just run the code over the logs

1:32 robinkraft: is it the sort of thing that would help me detect memory leaks? I need to figure out what's going on before I get stack traces!

1:33 hiredman: oh, no

1:33 devn: perfstats hiredman?

1:33 hiredman: yes for memory leaks you'll want a profiler, or to get good at reading code

1:33 https://github.com/sbtourist/nimrod

1:33 devn: JMeter + levand's perfstats is a nice combination, FWIW

1:34 (for load and perf testing)

1:34 it's a hook into incanter via jmeter

1:35 matadon: Okay, I think it's time to take a break — there must be something seriously wrong with my internet, as I'm getting missing dependencies from *anything* I try to install.

1:35 There's no way the repos are that broken; it's got to be on my end.

1:35 Thanks for the help, guys. :)

1:35 devn: matadon: where are you trying to get them from?

1:36 robinkraft: ok, I'll explore these options. I'm tearing my hair out over numerics code using JBLAS that works on my laptop but dies on servers in a hadoop cluster

1:36 hiredman: :(

1:36 hadoop is not fun

1:36 devn: robinkraft: lots of differences between a laptop and VMs, no?

1:36 robinkraft: oh man it's so true!

1:37 matadon: devn: Whatever the defaults with Lein1 are?

1:37 hiredman: http://tech.backtype.com/the-dark-side-of-hadoop

1:37 the forking oom can be a killer

1:37 devn: heh, great article

1:38 robinkraft: good stuff hiredman, I'm glad I'm not alone

1:39 devn: lots of differences yes, plus hadoop, plus bringing data in via cascalog. So many places it could fail … This is the first time we've come across this kind of error though

1:39 devn: robinkraft: binary search time.

1:39 :)

1:40 robinkraft: eeeeek!

1:41 thought I'd nailed it last week - I thought there's no way my puny laptop could handle the code, but it does ...

1:49 TEttinger: Iceland_jack, you wouldn't happen to write a blog called The Oblong, would you?

2:08 muhoo: what's a good way to break out of a doseq loop, from the repl?

2:08 start it in a separate thread maybe?

2:28 TEttinger: is there any way of leaving a message (using a bot) for someone who isn't here?

2:34 hiredman: /win 15

2:42 amalloy: $mail TEttinger here's a message for later

2:42 lazybot: Message saved.

2:42 TEttinger: thanks

2:43 $mail snut Is your Clojure roguelike in LWJGL open source?

2:43 lazybot: Message saved.

2:52 forsakendaemon: Hey guys, probably a silly question, but is there any way to find out the signature of a function after it's been defined?

2:54 Just discovered clojure.reflect. Thanks!

2:56 daaku: is there an easy way to pipe clojure.tools.logging output to emacs?

2:56 s/easy/any/

3:03 forsakendaemon: Spoke too soon, that doesn't seem to do what I need.

3:43 dbushenko: hi all!

3:43 does anyone use marginalia?

3:51 y3di: does anyone know of a good emacs set up for new clojure hackers?

4:00 raek: y3di: try https://github.com/technomancy/emacs-starter-kit

4:00 sritchie: ibdknox: good luck on the class tomorrow!

4:01 raek: it's also very easy to install clojure-mode with it (M-x package-install <RET> clojure-mode)

4:05 y3di: thanks raek

4:06 fliebel: Are there any examples of n-queens in core.logic around? Minikanren also acceptable :)

7:09 jaley: does anyone here use clojure-hadoop or know it's current status? there appears to be a version 1.3.1 in clojars but no information about this release in github

7:16 clgv: jaley: you can check whether it has a branch 1.3 with a recent commit

7:29 jaley: clgv: can't see any obvious branches or tags. I'm guessing the code just hasn't been pushed to git yet

8:01 tdrgabi: If I'd like to contribute to some clojure osource projects, where can I find one who needs a beginners help?

8:10 gtrak``: tdrgabi, what kind of stuff do you like?

8:11 tdrgabi: gtrak``: hard to answer. I would like to learn a lisp-like language, so clojure is a good fit. also, I never contributed to osource even if I wanted too.

8:11 but I don't know what kind of stuff I like

8:11 gtrak``: web, games, etc.?

8:11 tdrgabi: maybe you could put some names of projects

8:12 games is ok, web (but not too frontendy), would be nice to learn something hard like nlp or form recognition

8:12 clgv: tdrgabi: maybe you should first start to learn the language

8:12 tdrgabi: clgv: true, but there is no milestone on that. I can write some clojure already

8:13 but I haven't learned it yet, probably won't happen in years

8:13 clgv: tdrgabi: ok, next step would be to use it for some of your tasks.

8:13 tdrgabi: did for some, got stuck in others.

8:13 this will sound bad'ish, but even if I like to code, there's not much I want to do

8:13 gtrak``: tdrgabi, maybe play around with overtone, i made my first OS contribution this way :-)

8:14 clgv: I am currently adjusting incanter to my needs since I need to display properites of datasets

8:14 tdrgabi: gtrak``: did you have an interest in music before?

8:14 gtrak``: yes

8:14 i wrote a bit of code to interface with a grid controller

8:15 tdrgabi, but I'm like you, I like learning more than doing

8:18 tdrgabi: besides incanter and overtone, anything else comes up?

8:18 gtrak``: the way that worked was I tried to use a library for something, it had some limitations, I worked around them and worked with the upstream guy to make the solution cohesive. But first, I had an itch to scratch. I suggest you try to apply a library in some way and go from there.

8:18 clgv: tdrgabi: what do you do in your "day job"?

8:19 tdrgabi: clgv: coding erlang for a financial company

8:19 it's ok but not terribly interesting

8:19 clgv: ok. if there were spots you always wanted to do better - you could have shot for that ;)

8:20 tdrgabi: gtrak``: thanks, I'll try that

8:20 clgv: yes, it's not such a bad idea

8:21 but it's erlang

8:21 clgv: tdrgabi: learning new algorithm concepts and implementing them could be nice as well

8:21 gtrak``: upstream guys generally listen to use-cases more than accept code that might break stuff anyway

8:21 tdrgabi: anyway, thanks guys

10:06 deo__: in clojurescript, how do i make a proper method call on a native object to avoid the "is no longer a property access" warning?

10:06 i tried (.method obj)

10:08 as in (.toString (js/Date.))

10:18 mefesto: deo__: i don't know much about clojurescript but have you tried (. obj method) ?

10:20 (. (js/Date.) toString)

10:20 gtrak`: i think there's a dash syntax now

10:21 http://dev.clojure.org/jira/browse/CLJS-89

10:40 fliebel: Any minikanren pros around?

10:41 gtrak`: I'd like to be one someday :-), up to page 25 of reasoned schemer

10:47 fliebel: gtrak``: I read it, but I'm trying to play with cKanren, and I fail.

10:48 cjfrisz: fliebel: what are you wondering about?

10:48 fliebel: I mean, == not found, what is that nonsense... http://pastebin.com/pJPD3Gz7

10:48 cjfrisz: I actually have one of the implementers of cKanren right here

10:49 Seb: hi fellows

10:49 fliebel: cjfrisz: I'm trying to implement a stripborad layout generator... little bit like n-queens ;)

10:49 *stripboard

10:49 Seb: wondering what's wrong with the 2nd test at https://gist.github.com/2029234

10:50 I was trying, just for kicks, to "factorize" the call to 'count

10:50 even if the end it's not gonna be shorter or anything... but I get "java.lang.String cannot be cast to clojure.lang.IFn"

10:50 fliebel: Seb: your list is not quoted

10:51 cjfrisz: fliebel: I take it you've read the n-queens example in the cKanren paper?

10:51 fliebel: it tries to call a with b

10:51 vijaykiran: (a b) means you are calling function a

10:51 Seb: hmm, but quoting that list yields "count not supported on this type: Symbol"

10:51 fliebel, vijaykiran: ^^^

10:51 fliebel: cjfrisz: Yea, but it's a little more complicated. However, now I'm just running into silly problems.

10:52 cjfrisz: fliebel: what's going on?

10:52 Is there something for me to go look at?

10:52 Seb: so I'm not sure what the right way to do this actually is

10:52 fliebel: Seb: (list a b) or [a b] should work.

10:52 dnolen: fliebel: what's the issue?

10:52 vijaykiran: Seb: you may want to add a b to a list and try again

10:53 fliebel: dnolen, cjfrisz: Right now, this silly thing: http://pastebin.com/pJPD3Gz7

10:53 cjfrisz: Oh that

10:53 Seb: fliebel, vijaykiran: ok, got it

10:53 fliebel, vijaykiran: thanks guys, makes perfect sense now

10:53 cheers !

10:54 dnolen: fliebel: are you using the calvis cKanren repo from GitHub?

10:54 vijaykiran: Seb: the gist syntaxh highlighting is giving you a hint 'a' in bold :)

10:54 Seb: vijaykiran: well, yeah, I sorta knew why the 1st version wasn't working, I should have pasted the '(a b) one ;)

10:54 fliebel: dnolen: yes. The weird thing is, once I remove the connectedo... wait I know

10:54 It's not *that* == that is not found.

10:55 Is there a listo in minikanren, or do I have to conso them all together?

10:56 I can't remember if (== q (list w1 w2 w3)) is okay.

10:56 dnolen: fliebel: it is ok

10:56 cjfrisz: That should be okay

10:57 dnolen: fliebel: if I recall I think you may need to bring (import) == from a different file, you might want to take a look at her tests. bbiab.

10:58 fliebel: dnolen: yea, it's in minikanren.scm

10:58 I'm trying to express a stripboard, where some components must be on the same lane, but not on the same lane as some other components.

10:59 Right now, I express lanes as a domain, with wire links as a pair of lanes. Now I'm writing a function to tell if a lane is connected.

11:01 yoklov: if i have a function which needs to io and i want it to be configurable, what's the perferred way to have that happen?

11:01 e.g. should i just be using *in* and *out* or should i take params for the reader and writer

11:01 rhickey: compiler-options and disable-locals-clearing pushed, please try if interested

11:03 fliebel: dnolen, cjfrisz: victory! http://pastebin.com/ZbKZyf9e

11:03 cjfrisz: Cool cool

11:03 TimMc: Sweet.

11:04 fliebel: Is there a way to expect a failed goal? To express 2 lanes should not be connected.

11:05 cjfrisz: fliebel: short answer: yes

11:05 You might have to write a not-connectedo

11:06 TimMc: So *elide-meta* has been replaced with *compiler-options*.

11:06 fliebel: cjfrisz: Ok, it's not nearly as simple as... (== f# (connectedp)), or something like that.

11:07 cjfrisz: fliebel: I doubt it

11:07 jlongster: does Clojure have anything like `loop` that allows non-TCO calls, or are you supposed to just use recursive functions?

11:07 cjfrisz: That kind of relation is the reason that they added the constraint system

11:08 devn: jlongster: loop/recur

11:08 jlongster: devn: recur has to be in a tail-call position, I'm asking if there's another looping form that doesn't have that constraint

11:09 clgv: jlongster: if you can bound recursion depth a priori then you are safe to use plain recursion otherwise there is trampoline for mutual recursion

11:10 jlongster: clgv: yep, just curious if people ever ran into wanting to do mutual recursive inline inside a function

11:10 clgv: jlongster: but in general you will have to change the code to tailrecursion. a trick is to pass the current return value to the next function invocation

11:10 TimMc: jlongster: I'm trying to imagine a looping construct that *doesn't* map to tail position calls.

11:11 I mean, isn't that the definition of a loop?

11:11 jlongster: TimMc: I don't have a strong argument for them, but I come from the Scheme world

11:11 yoklov: letfn lets you do mutual recursion

11:11 thats as best as i've got :/

11:12 clgv: yoklov: but with all the downsides of missing tail call optimization in the jvm ;)

11:12 yoklov: right

11:12 cjfrisz: jlongster: I'm a Clojure-come-Schemer, too. You'll probably want to use letfn

11:12 jlongster: (let loop ((i 0)) (foo (loop (+ i 1)))) ; stopping condition omitted for brevity

11:12 yoklov: you don't have to tell me, i just wrote a bunch of code in CPS and had to use trampoline to not blow the stack

11:12 cjfrisz: I miss let loops, too

11:12 yoklov: i'm coming to clojure from scheme also :)

11:13 jlongster: cjfrisz: thanks! I'll look into it

11:13 I'm just doing research, not actually writing code right now

11:13 Iceland_jack: cjfrisz:

11:13 cjfrisz: fn can be named

11:14 devn: trampoline?

11:14 clojurebot: trampoline is http://groups.google.com/group/clojure/browse_thread/thread/6257cbc4454bcb85/3addf875319c5c10?#3addf875319c5c10

11:14 devn: someone mentioned mutual recursion

11:14 yoklov: trampoline can be frustruating to use.

11:15 (but on the whole it rules)

11:16 cjfrisz: Iceland_jack: that's true

11:18 RobertLJ: hi fogus .. if you are around I have a question for you .... about core.cache

11:19 I have been working on porting a few od the clojure contrib libs to use on clojureCLR .. and I have a question or two

11:23 * fliebel bends mind

11:23 * cjfrisz fears for fliebel 's mind

11:24 RobertLJ: The error I am seeing is: "Unhandled Exception: clojure.lang.Compiler+CompilerException: clojure.lang.CljCompiler.Ast.ParseException: Must hint overloaded method: assoc

11:24 "

11:26 cjfrisz: Question for people using Emacs+SLIME/Swank+Paredit mode: Do you find that closing square brackets in the SLIME REPL also skips a closing round paren?

11:26 And is there a known solution for this?

11:26 RobertLJ: code and the error is: https://gist.github.com/2029389

11:29 clgv: RobertLJ: maybe you have a name conflict between clojure.core/assoc and that protocol-method

11:30 RobertLJ: you can use :refer-clojure to :exclude 'assoc

11:31 TimMc: cjfrisz: Give an example, like (foo [bar|]) + \] = (foo [bar])|

11:31 RobertLJ: huum ok .. clgv .. will take a look at that .. thanks

11:32 fliebel: cjfrisz: Hm, I'll leave it for now, or I'll break my mind. To many unsolved problems at once.

11:32 cjfrisz: TimMc: That's exactly it

11:34 TimMc: Unfortunately, I don't have SLIME set up...

11:35 cjfrisz: I can backspace into the enclosing S-exp, but that's an extra pinky keystroke that I'd rather not have to do every time

11:39 tmciver: cjfrisz: yes, that happens for me too. I just usually C-f through the closing square bracket so that doesn't happen.

11:40 cjfrisz: tmciver: That's probably a better solution than mine, but still...ugh

11:40 There's got to be a way to fix that

11:41 Looks like I'm digging in on some Emacs Lisp in the near future.

11:41 tmciver: cjfrisz: yes, I agree. I've long wished you could just TAB through the closing bracket/paren.

11:41 * cjfrisz probably shouldn't be so excited about that prospect

11:41 pandeiro: i'm trying to decide how to structure my server-side api - i want to have 'document' types that can be edited simultaneously by different users -- would this be a use case for atoms or refs?

11:42 TimMc: pandeiro: Do you need coordination between multiple documents?

11:42 pandeiro: TimMc: the long-term answer is possibly yes, right now for this simple prototype, no

11:42 TimMc: If updates are independent, use atoms.

11:43 pandeiro: gotcha

11:46 TimMc: i'm storing all these documents in one mega-atom right now, it just occured to me that i will start to have a lot of concurrent changes... but if they're all 'atomic', no need for ref right?

11:49 TimMc: pandeiro: Why not a collection of atoms?

11:50 pandeiro: TimMc: ah ok, so the collection itself doesn't need to be an atom

11:56 TimMc: It could be!

11:56 You could manage collection membership with an atom, and the members could be atoms as well.

12:03 dnolen: fliebel: did you get your problem sorted out?

12:03 fliebel: dnolen: I let it rest, there is to much stuff i have no solution for at present.

12:04 dnolen: fliebel: around describing the problem?

12:04 fliebel: dnolen: How to express the many constraints and how to represent the data.

12:06 dnolen: fliebel: as in, the example in the paper didn't shed any light on how to best describe the constraints for you?

12:06 fliebel: dnolen: The example? You mean n-queens?

12:07 dnolen: fliebel: n-queens, send-more-money - I think they have another in the tests?

12:07 fliebel: dnolen: It helps, but there are 2 things that make the problem a bit more involved.

12:08 dnolen: fliebel: which 2 things?

12:08 fliebel: dnolen: In the most basic case, 2 parts on the same lane are connected, but it is allowed and necessary to 1) add wire-links 2) break lanes

12:09 dnolen: So 2 parts on the same lane can be disconnected, and 2 parts on a different lane can be connected.

12:09 dnolen: fliebel: ah so the issue is you think you need to be able to remove a constraint?

12:10 fliebel: dnolen: I don't know.

12:11 dnolen: fliebel: are you trying to implement something that is described somewhere that I can read?

12:12 fliebel: dnolen: You could read about stripboards and schematics, but this is not some exercise that has its own wikipedia page.

12:13 dnolen: I could explain the problem in more detail in an appropriate place.

12:14 dnolen: fliebel: you've got a blog don't you ;)

12:15 TimMc: fliebel: Does this have anything to do with breadboards?

12:15 fliebel: dnolen: I usually blog about things that already work, but I guess I could describe the problem.

12:16 TimMc: Yea, a stripboard is like a breadboard with coper strips on its back, i guess.

12:17 TimMc: I want to translate this schematic graph to a stripboard layout.

12:17 TimMc: Oh, I see -- you actually solder to it, it's like PCB.

12:18 dnolen: fliebel: it's just as useful to blog about wishful thinking in my experience. You want to apply miniKanren/cKanren to your problem, so let's see the problem and your difficulty in describing it in cKanren.

12:19 TimMc: hurrrkkk https://upload.wikimedia.org/wikipedia/commons/d/d1/Computerplatine_Wire-wrap_backplane_detail_Z80_Doppel-Europa-Format_1977.jpg

12:19 dnolen: fliebel: would be useful to see how you would do it in plain 'ol Clojure as well.

12:19 fliebel: dnolen: Ok, I'll describe the problem as best as I can.

12:20 cjfrisz: TimMc: And the problem is? :-|

12:20 fliebel: dnolen: I guess that knowing how to do it in plain Clojure helps doing it in minikanren... but... I don't know.

12:22 dnolen: fliebel: heh, well that makes two of us ;)

12:24 fliebel: dnolen: It's good to remember computers never think for you, which is secretly what I hope for when using minikanren.

12:56 ibdknox: A bunch of folks here were asking for this, so in case you missed it last night: https://github.com/ibdknox/cljs-template

12:56 I think that's about as simple as I can make starting a clojurescript project

12:56 RickInGA: wow, cool

12:58 technomancy: ibdknox: "Copyright (C) 2011 FIXME" in the readme

12:58 ibdknox: oh no's

12:58 technomancy: yeah, shame on you for not using unicode. =)

12:58 TimMc: OHNOSE

12:59 technomancy: ibdknox: also: adding :url "http://example.com/FIXME" to the project.clj would be great

12:59 ibdknox: RickInGA: we'll use it in the class :)

12:59 technomancy: trying to encourage folks to add more metadata to their project.cljs

13:00 RickInGA: how does one get lein2?

13:00 ibdknox: technomancy: done

13:01 RickInGA: I'd stick with 1.7 for now

13:01 technomancy: ibdknox: cool

13:01 pandeiro: will lein2 be available via lein upgrade?

13:01 technomancy: pandeiro: yeah

13:01 TimMc: lein dist-upgrade

13:01 :-P

13:01 RickInGA: ah, looks like the script on the git page pulls version 2

13:02 LEIN_VERSION="2.0.0-preview2"

13:02 technomancy: hm; I should make the distinction more clear in the readme

13:05 ibdknox: technomancy: yes please :) It seems to be a current source of confusion

13:10 RickInGA: ibdknox: that looks pretty cool! amazing how quick it is to get up and running

13:10 ibdknox: the magic of computers :)

13:11 RickInGA: about 15 min ago I finished the example from programming clojure that has you upload an app to heroku, again simple

13:12 my first several weeks of clojure were difficult, trying to find what tools to use and how to use them, but once you get the right things, it is really nice!

13:12 ibdknox: RickInGA: what did the example use?

13:12 compojure?

13:12 clojurebot: compojure is http://github.com/weavejester/compojure/tree/master

13:12 ibdknox: lol

13:12 thanks clojurebot :p

13:12 RickInGA: ibdknox noir.

13:12 ibdknox: oh cool

13:13 I forgot about that. I should probably pick up a copy of the book, huh?

13:13 RickInGA: I got bought the pdf from the publisher, not sure if the hardback is out yet

13:13 I will have it with me in class if you want to look at it tomorrow

13:14 ibdknox: technomancy: I think those readme changes will remove a lot of confusion :)

13:14 RickInGA: Should I have a database installed for class? I have mongo already

13:14 ibdknox: RickInGA: yeah, that'd be great :)

13:14 RickInGA: nope

13:14 we'll run it off my machine

13:14 /heroku if we need to

13:15 technomancy: ibdknox: on the other hand now that lein-ring and lein-midje are upgraded, the number of incompatibilities should be quite small

13:15 ibdknox: technomancy: the number of people who need guidance though and will get stuck are the ones reading what they should do from all the other sources on the internet

13:16 at that point incompatibility of plugins isn't the problem, it's that the canonical sources of information about how to use stuff in lein will be out of date

13:17 technomancy: true

13:17 I'll add a stub plugin task that points people to the upgrade guide

13:17 that seems to be the most common hang-up

13:17 ibdknox: good idea

13:21 tmciver: ibdknox: what is this class you mentioned above? When/where is it taking place?

13:21 ibdknox: tmciver: ClojureWest tomorrow and thursday

13:22 tmciver: Ah yes. Too bad I'm not going.

13:22 ibdknox: if there's interest, I'd considered doing another one at some point

13:26 spoon16: anyone know how to use leiningen with an Ivy repository?

13:27 RickInGA: ibdknox how do I get to a repl from my new cljs app? (I use emacs)

13:28 technomancy: spoon16: ivy repositories are just maven repositories, right?

13:29 ibdknox: RickInGA: you just need to uncomment the repl/connect line in main.cljs

13:29 RickInGA: thx

13:29 ibdknox: after that I'm not sure how to start a clojurescript repl in emacs

13:29 since I use vim

13:37 jaley: how do people feel about use of pre- and post- conditions generally? the coding standards suggest it should be idiomatic going forwards. but... they've been there since 1.1 - is there some reason they're not more prevalent?

13:37 spoon16: technomancy, except that they don't necessarily have pom files

13:37 we have a massive ivy repository that has only .xml files

13:37 technomancy: spoon16: oh, ok. that's not going to work.

13:38 jaley: technomancy: ivy seems to let you do crazy stuff to your repo layout too if you want to. our company ivy repo wouldn't work with lein out of the box. i created a new repo for clojure projects with the default layout to work around it.

13:38 dnolen: jaley: new habits are hard to form?

13:39 ibdknox: pre and post are also extremely ugly

13:39 spoon16: technomancy: would you be interested in providing me some guidance on how to make it work?

13:39 jaley: dnolen: well if that's the only reason i'm going moderately and carefully nuts with them

13:39 ibdknox: drives me crazy

13:39 dnolen: jaley: that said, I only find my self using them if there's some very specific invariant I want to make sure I don't forget.

13:39 technomancy: spoon16: I've never used ivy, but I can try to help

13:40 jaley: dnolen: well i was thinking at public interface level for a namespace it might help make api usage errors less cryptic

13:41 dnolen: i.e. "must have a :id field" is easier to debug than NPE from Integer/parseInt?

13:41 spoon16: technomancy: I'll do a bit of reading on the ivy stuff, I'll try to hit you up with some questions mostly focused on lein integration

13:42 dnolen: jaley: definitely

13:42 cemerick: FYI: Mostly λazy Episode 0.0.5: @chouser at Clojure Conj 2011 http://wp.me/p1Y10D-1g

13:43 ibdknox: jaley: I kinda wonder if there's library waiting to make api-level errors easier

13:43 technomancy: jaley: part of it is that AssertionErrors are kind of weird IIRC

13:43 ibdknox: it's something that we don't do a great job of

13:43 RickInGA: cemerick I really like those podcasts… keep em coming!

13:43 ibdknox: I tried making some of them a lot better in Noir

13:44 so there's at least some sensible explanation

13:44 cemerick: RickInGA: Thanks; the queue is empty now, though I'm sure it'll fill up at ClojureWest again.

13:44 clojurebot: Ok.

13:44 cemerick: I didn't mean for it to be a confererence podcast, but time is short for recording stuff otherwise :-(

13:44 jaley: technomancy: presumably they're RuntimeException-derived?

13:45 technomancy: jaley: they are not

13:45 ,(ancestors AssertionError)

13:45 clojurebot: #{java.lang.Throwable java.lang.Error java.io.Serializable java.lang.Object}

13:46 jaley: technomancy: ah. so... how?

13:46 ibdknox: yeah, I've found pre/post doesn't really give you the right level of error message

13:46 it's better than nothing

13:46 but still not what we should shoot fo

13:46 r

13:47 technomancy: jaley: (catch Exception ) won't catch them

13:47 ibdknox: cemerick: I don't think there's anything really tying you to conferences at this point. You can always do them over skype or whatnot

13:47 dnolen: technomancy: you should be catching pre/post as far as I can tell anyhow.

13:48 technomancy: dnolen: you mean catching Error?

13:48 dnolen: technomancy: I just mean pre/post assertions shouldn't be caught

13:48 fdaoud: ibdknox: noir comes with hiccup but what if one wants to use a more recent version of hiccup?

13:49 spoon16: technomancy: any general info on how I might modify lein dependency resolution? Would the right thing be to just make a plugin specifically for ivy dependency resolution? something that would be used via "lein deps-ivy" or something?

13:49 technomancy: dnolen: right, it's just that the distinction is not well-understood

13:49 jaley: dnolen: well I guess a failing contract is an indication of programmer error and should be treated as fatal?

13:49 dnolen: jaley: defintely

13:49 ibdknox: fdaoud: you can exclude hiccup from noir I think

13:49 dnolen: jaley: pre/post is for development

13:49 jaley: there's a flag to turn them off.

13:49 technomancy: spoon16: that's an option, though I suspect you could find existing tools to convert it to a maven repo

13:49 fdaoud: ibdknox: ah, exclude it and then add a dep on the version I want, as in maven?

13:49 jaley: dnolen: yeah, *assert*?

13:49 dnolen: jaley: yes

13:50 ibdknox: fdaoud: you can do it lein, but yeah - I think that'd work. If not, I'm happy to take a pull request for 1.3.0-alpha* to move to the new hiccup

13:50 jaley: dnolen: would be quite useful to set that in the dev profile with lein i guess

13:50 cemerick: ibdknox: sure, the first ep with seancorfield was via skype. I meant that I personally have been running a time deficit already, even without arranging and recording stuff.

13:51 jaley: dnolen: well, maybe not as a default for everyone, but for me personally I mean :)

13:51 ibdknox: cemerick: ah

13:51 fdaoud: ibdknox: thanks! btw I watched your cljs/noir/music screencast, that was cool. thanks for posting that.

13:51 technomancy: jaley: it's already on by default

13:51 it's turning it off in production that you'd need to do

13:51 ibdknox: fdaoud: np :) noir-cljs makes some of that stuff less of an issue

13:51 jaley: technomancy: ah yeah]

13:51 ibdknox: fdaoud: also the game thing is way cooler than the overtone controller one

13:51 :)

13:51 technomancy: I'm hesitant to include a production profile by default since everyone's needs will vary

13:52 dnolen: so it looks you can now configure locals clearing and you can elide metadata in 1.4.0

13:52 jaley: technomancy: well I guess it's common to want multiple production profiles anyway

13:52 technomancy: jaley: semi-common

13:52 fdaoud: ibdknox: which one is that?

13:52 dnolen: ~max

13:52 clojurebot: Most users ever in #clojure: 404

13:53 ibdknox: fdaoud: http://www.chris-granger.com/2012/02/26/connecting-to-your-creation/

13:54 cemerick: dnolen: that response was hardcoded some weeks ago

13:54 the max command in both bots has been broken ~forever

13:54 fdaoud: ibdknox: thx, I'll check it out

13:55 dnolen: cemerick: heh

13:55 fdaoud: I used to not want to sit there and watch screencasts but now I do 45-50 min on the exercise bike first thing in the morning, and that's a good time to watch and learn

13:56 ibdknox: fdaoud: that one is just 5 minutes demoing

13:58 mefesto: when using lein-ring, how do you handle when you want to test against different dbs? (e.g. test, development, production)? is it typical to set an environment variable for each of the db pool connection params?

13:59 spoon16: technomancy: you mean like some sort of maven -> ivy proxy? Really what I want is to be able to define my repos and dependencies in the project.clj and when an *-ivy.xml file is encountered (instead of a *.jar file) it will expand the dependency into the set of dependencies identified by the *-ivy.xml file. I'm sure there is some complexity there, but it looks like IVY is mostly just converting a single dependency definition into a bunch of actu

13:59 .jar files.

13:59 technomancy: mefesto: that's what profiles in lein2 are for

13:59 spoon16: technomancy: I haven't worked in any other Java shops, but this must be a pretty normal tool used by larger orgs

13:59 * mefesto reads up on lein2 :)

14:00 TimMc: spoon16: "a bunch of actu<linebreak>.jar files"

14:00 technomancy: spoon16: yeah, I think it's likely that there's already something to do that for you independent of leiningen on the server side

14:00 that would be my guess anyway

14:01 fdaoud: ibdknox: ah ok, I'll make sure to have something else cued up :)

14:01 gfredericks: dangit I cannot find amalloy's useful library on google due to its having too generic a name

14:02 TimMc: gfredericks: flatland/useful

14:02 gfredericks: ah ha

14:02 'flatland' is the name that escaped me

14:02 TimMc: thanks

14:02 TimMc: I debated whether to tell you.

14:02 gfredericks: :P

14:02 TimMc: It's a terrible name.

14:02 gfredericks: I know you hate it

14:02 TimMc: (OK, the name isn't bad, just the Maven coordinates)

14:03 So I guess that's unrelated to the searchability.

14:03 spoon16: technomancy: I'll spend some time looking/learning

14:04 TimMc: &(apply str "lib-" (repeatedly 4 #(rand-int 10))) would be a much better name.

14:04 lazybot: ⇒ "lib-3019"

14:04 gfredericks: now if only I could remember why I wanted the library

14:05 TimMc: :P

14:05 $google lib-2367

14:05 lazybot: [fredericksgary/lib-2367 - GitHub] https://github.com/fredericksgary/lib-2367

14:05 TimMc: yep

14:06 gfredericks: And you'll never have to rename it, even once the scope drifts.

14:06 gfredericks: good point

14:06 new scope: "functions that return the number 2368" <-- oh crap!

14:06 TimMc: (Whereas lein-uberjit -> lein-jit -> lein-otf)

14:08 frou: is the best strategy for an integration-challeneged editor to send text over a socket to a terminal repl?

14:08 gfredericks: I'm surprised useful.debug doesn't have a macro that takes a var and wraps it in input/output logging

14:08 frou: and have the output shown in the terminal somehow

14:08 TimMc: gfredericks: Patches welcome, I bet.

14:08 gfredericks: TimMc: I'm on it!

14:09 * gfredericks forks

14:10 gfredericks: dang they got some non-trivial branching techniques going on here

14:10 mefesto: technomancy: so the dev profile would include, say, {:resource-paths ["dev/resources"]} but the production profile would have {:resource-paths ["prod/resources"]} and the application code will reference a single resource myapp/db.clj with the datasource properties?

14:11 technomancy: mefesto: more or less

14:12 you could just use resources instead of prod/resources

14:13 mefesto: wouldn't it need to be either or? in dev mode would it be guaranteed that dev/resources is resolved before resources?

14:14 meaning as the resource myapp/db.clj is looked up it is first searched in dev/resources -- if not found, then searched in resources

14:14 technomancy: dev/resources should take precedence, yeah. double-check for yourself though.

14:15 TimMc: gfredericks: Open a feature branch off of develop, I guess?

14:16 mefesto: how are users of lein-ring currently dealing with different datasources per environment?

14:16 gfredericks: TimMc: I'll probably just push up my own first so I can start using it and then ask amalloy later

14:16 mefesto: im guessing environment variables?

14:17 ibdknox: mefesto: I don't use lein-ring, but with noir we just pass prod/dev to lein trampoline run or we use env vars

14:17 TimMc: gfredericks: or Raynes

14:18 gfredericks: yeah

14:18 Raynes: yo

14:21 mefesto: up until now i've been creating a main function and parsing a config that is passed on the commandline then launching the jetty adapter manually. id like to use lein-ring as the server piece but it's configuration takes a symbol to a handler so im struggling to find the best way to create the datasource in an overriddable way. i guess env variables will do

14:22 technomancy: more complicated configurations are a lot easier to handle by slurping off the classpath

14:22 ibdknox: yeah, I guess I should be clear, we use an env var to say what mode we're in

14:22 TimMc: gfredericks: Looks like development happens on 'develop', and releases are done with a version-change commit to a version branch that is then merged into 'master' and 'develop'.

14:22 *to a version branch off of 'develop'

14:22 ibdknox: we read in the specific mode's config after that

14:25 gfredericks: TimMc: you sure about the "merged into master and develop" part?

14:25 TimMc: yep

14:25 gfredericks: how do I auto-load clojure.repl for my clojure-jack-in user ns?

14:25 TimMc: gfredericks: But that's their job. I think feature branches probably get rebased into develop.

14:26 technomancy: gfredericks: nearly everything in clojure.repl has an enhanced slime equivalent

14:26 TimMc: gfredericks: Looks like they're doing this: http://nvie.com/posts/a-successful-git-branching-model/

14:27 gfredericks: technomancy: :( I have to know two ways to do everything don't I

14:27 technomancy: gfredericks: there's no good way to go back to the 1.2 model of having doc available everywhere

14:30 mabes: need some macro help.. I'm sure it is simple, but I don't know how to resolve the value I need to: https://gist.github.com/5493dccd66a0964d5509

14:30 randomizer: hi ;)

14:30 ,(clj-time.format/unparse (formatters :date-hour-minute-second) (now)))

14:30 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.PrivilegedActionException: java.lang.ClassNotFoundException: clj-time.format>

14:30 mabes: (the gist is obviously a reduced case)

14:31 randomizer: => 2012-03-13T18:23:17

14:31 tremolo: mabes: you need to unquote the name var

14:31 randomizer: How can I sort a seq with dates like that?

14:31 bhenry: hello guys. is there anything that already exists like (x (coll)) => [(first coll) (rest coll)] ?

14:32 gfredericks: (juxt first rest)

14:32 bhenry: haha juxt again!

14:32 ibdknox: ~juxt

14:32 bhenry: thanks.

14:32 clojurebot: juxt is a little hard to grok but it's the best thing ever

14:32 ibdknox: ~juxt

14:32 clojurebot: juxt is usually the right answer

14:32 cjfrisz: Oh that's awesome

14:32 That was a question I never knew I wanted the answer to

14:32 dan_b: unless the quesation is "another beer?"

14:33 gfredericks: the quesation is always "another beer?"

14:33 bhenry: (juxt first rest) is kind of like the 99 bottles of beer song

14:33 yoklov: i love doing (map (juxt :somekey :otherkey) vector-of-maps) to get columns of things

14:33 randomizer: can juxt sort my seq?

14:33 dan_b: use a lazy seq and you can have infinte beer

14:34 randomizer: mhhhh infinte beer

14:34 ibdknox: randomizer: ##(doc sort-by)

14:34 lazybot: ⇒ "([keyfn coll] [keyfn comp coll]); Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). If no comparator is supplied, uses compare. comparator must implement java.util.Comparator."

14:34 gfredericks: (def sort (comp first (juxt sort)))

14:35 randomizer: yah, the problem: string implements compare but that is not what I want to do

14:35 gfredericks: randomizer: what do you want to do?

14:35 bhenry: randomizer: i'm waiting for the irc log online to update, but your question isn't there yet. i signed in right after you asked it

14:36 randomizer: I get timestamps by (clj-time.format/unparse (formatters :date-hour-minute-second) (now)))

14:36 and store them in a seq

14:37 bhenry: you want to (sort-by parse dates)

14:37 randomizer: ({:key "todos_06e9642f0bfe4216830500193100c5fa", :value #x.y.z{:open true, :created "2012-03-13T18:23:17"}} , ....

14:38 (sort-by :value.create collection) << does not work

14:38 :value.created

14:38 bhenry: randomizer (sort-by (comp parse :created) coll)

14:39 oh

14:39 i misread value

14:39 randomizer (sort-by (comp parse :created :value) coll)

14:39 parse being whatever turns that back into a datetime

14:40 randomizer: java.lang.RuntimeException: Unable to resolve symbol: parse in this context

14:40 bhenry: yeah parse isn't real. but you're unparsing a datetime into a string, you need to parse it back to a date to actually sort it the right way.

14:41 although, sorting by those strings should work

14:41 just leave out the parse i guess

14:41 randomizer (sort-by (comp :created :value) coll)

14:42 randomizer: thx bhenry

14:42 TimMc: &(sort-by #(doto % (println)) [1 5 2 9 6])

14:42 lazybot: ⇒ 1 5 5 2 1 2 5 9 9 6 5 6 (1 2 5 6 9)

14:43 mabes: tremolo: thanks.. I did try that before but I end up with a different problem.. how do I unquote fn-name in this case?

14:43 (defmacro macro-test [name] `(let [fn-name# (symbol (str "prefix-" ~name))] (defn fn-name# [] 42)))

14:43 * gfredericks imagines a superhero comic where all the action onamonapias are "comp" "juxt" and "conj"

14:43 TimMc: &(sort-by (memoize #(doto % (println))) [1 5 2 9 6])

14:43 lazybot: ⇒ 1 5 2 9 6 (1 2 5 6 9)

14:44 randomizer: ,(comp :x :y)

14:44 clojurebot: #<core$comp$fn__3703 clojure.core$comp$fn__3703@1553d18>

14:44 raek: mabes: do you want (macro-test foo) to expand into (defn prefix-foo [] 42)?

14:44 bhenry: ,((comp :x :y) {:y {:x 1}})

14:44 clojurebot: 1

14:45 mabes: raek: yes, and I want it to be able to work with (let [my-name "foo"] (macro-test my-name))

14:45 raek: both are not possible

14:45 mabes: that is why I'm having such a hard time!

14:45 randomizer: wow,... awesome

14:46 raek: mabes: def requires the name at compile time, but (let [...] ...) requires it to be available first at run-time

14:46 TimMc: I'm dubious.

14:46 raek: mabes: if you *really* need to do this, consider using the namespace manipulation functions directly

14:46 mabes: check out 'intern'

14:46 TimMc: raek: I think you're wrong.

14:47 Oh, hmm... you're right about let vs. def, sorry.

14:48 mabes: WHy are you trying to use let to provide a symbol to def?

14:49 raek: mabes: in general, you should not modify the root binding of a var (this is what def and intern does) at runtime. consider using another language construct

14:50 TimMc: raek: (I somehow was under the impression that you were saying that def-producing-macros were impossible, instead of saying that this *technique* was impossible.)

14:50 mefesto: this is the route i was going to take for configuration. reasonable or am i doing something terrible? :) https://refheap.com/paste/1054

14:51 raek: TimMc: gotcha :)

14:51 mabes: TimMc, raek: I'm setting up a number of database connections with korma and has you do this with a defdb macro. However, I'm reading in my database config file and needing to iterate over each config and pass it to this defdb macro

14:51 mefesto: is there a way to edit a post in refheap?

14:51 mabes: s/korma and has/korma and it has/

14:52 TimMc: mefesto: Yeah, bug Raynes to fiddle with the database.

14:52 raek: mabes: it is only the arguments to the macro that are unevaluated. you can still access global vars thet you have previously defined, or call functions that look up things

14:52 gfredericks: man how often do I need to type M-x paredit-splice-sexp before I go pick a keybinding for it

14:52 TimMc: mefesto: (No, you have to have pasted while signed in.)

14:52 ibdknox: mabes: you don't have to use defdb

14:52 TimMc: gfredericks: And paredit-convolute-sexp?

14:52 mefesto: TimMc: ah i see

14:53 gfredericks: TimMc: no way does that exist

14:53 TimMc: Totally exists.

14:53 mefesto: slurping a CLJ resource seems pretty standard,yeah

14:54 * gfredericks types out paredit-splice two more times in quick succession

14:54 ibdknox: mabes: you can set the default manually, give me two seconds and I'll make that even easier

14:54 * gfredericks hates self

14:54 mefesto: here's an updated post which shows how im referring to the datasource from middleware: https://refheap.com/paste/1055

14:54 mabes: ibdknox: ok, TBH, I'm just helping a coworker out and he told me he had to use defdb (I've never really looked at korma before).. so, I guess the right thing is to tell him to configure the databases without defdb. Any documentation pointers I can pass along to him?

14:54 mefesto: just want to make sure im not doing something awful :)

14:56 mabes: ibdknox: yeah, the use case is that we have several different kinds of databases that we need to connect to and we are defining the settings in an external file (json)

14:56 raek: mabes: a rule of thumb: any macro called "defsomething" is usually a shorthand for (def ... (something ...)). if you generate thing programmatically, skip the def- stuff and use "something" directly

14:56 mabes: raek: I know that, but if you look at defdb it is in turn calling defonce

14:57 raek: I agree with your thinking though.. I would probably just use what the value of defonce is being set to and not worry about binding a root var

14:58 raek: def vs defonce is just a development convenience feature

14:58 bobhope: Do any users of vim's paredit mode find that sometimes it loses track of parens around quotes, and then you have to disable paredit to rebalance manually (since the unbalance-detector breaks)?

14:58 raek: and is probably not relevant to the db stuff

14:59 mabes: raek: the only downside to doing that is that we are now going outside of the public API and not using defdb.. although, it sounds like there might be a better public API we can use that doesn't involve macros

14:59 raek: that should normally be the case

14:59 macros are contageous... :-)

14:59 mabes: yeah..

14:59 raek: clojurebot: macro club?

14:59 clojurebot: Cool story bro.

14:59 ibdknox: mabes: hot off the press: https://github.com/ibdknox/Korma/blob/master/src/korma/db.clj#L52

15:00 mabes: korma 0.3.0-beta6

15:00 mabes: ibdknox: :) thanks! I'll pass this along and have it start using this, it will be much easier

15:02 ipostelnik: what are some good resources to bring someone new to clojure up to speed?

15:02 mabes: ibdknox: nice that it is now analogous to defentity too :)

15:03 ibdknox: :)

15:04 gfredericks: ~macros

15:04 clojurebot: Barking spiders!

15:05 robinkraft: for any cascalog junkies out there (the cascalog room is quiet today): for a simple multi-criteria filter, is there a compelling reason to use a deffilterop vs. a regular defn vs. multiple =, <, >, etc. operations?

15:05 for example: (defn ones-or-neg [val] (cond (= 1 val) true (< val 0) true :else false))

15:07 RickInGA: dnolen could you help me get a clojurescript repl working in inferior-lisp?

15:08 dnolen: RickInGA: ClojureScript wiki instructions not working?

15:08 RickInGA: when I run it I get exeption in thread main java.lang.noclassdeffounderror: clojure/main

15:09 dnolen: RickInGA: have you set CLOJURESCRIPT_HOME in your shell environment?

15:09 RickInGA: dnolen I set it up in my .profile (osx)

15:09 ibdknox: alternatively, you could start one with lein-cljsbuild

15:10 dnolen: RickInGA: and in .bashrc as well

15:10 RickInGA: I agree w/ ibdknox, hooking it up to lein-cljsbuild better

15:10 ibdknox: just add this to your project: :cljsbuild {:builds [{}]}

15:10 RickInGA: dnolen ok, how would I do that?

15:10 ibdknox: and install lein-cljsbuild

15:11 RickInGA: ibdknox add that to the project.clj file?

15:11 ibdknox: then do lein trampoline cljsbuild repl-listen

15:11 RickInGA: yep

15:11 I'm adding that to the template, so that people can start their repls that way

15:16 bsteuber: RickInGA: but start the repl with lein1, not lein2

15:16 RickInGA: bsteuber using lein 1.7, thx

15:20 bsteuber: ibdknox: just wrote a wrapper function over crate/html that removes the crateids

15:20 why do you need them, anyways?

15:20 ibdknox: bsteuber: to do more interesting things with them

15:21 bsteuber: for example delegating handlers to all things ever created by that function

15:21 bsteuber: more than being able to write ($ foo) instead of ($ :#foo) I guess ^^

15:21 ibdknox: bsteuber: oh wait, crate-id

15:21 yeah that should get removed

15:21 send a pull request

15:21 I only care about crate-group

15:22 which should only be at the defpartial level :)

15:22 bsteuber: ah I also confused both

15:22 and what is that for?

15:22 ibdknox: crate-id was there because gclosure event handling sucks

15:22 and I was needing to do some stupid things when I was cloning elements

15:23 bsteuber: ah okay

15:23 ibdknox: I'll fix, once second

15:23 bsteuber: I don't really mind about defpartial as I write (defn foo [] (h [:div ...])) instead

15:24 h being my shortcut for crate/html

15:25 daaku: is there some hook to allow the slime repl to pprint instead of print results?

15:25 bsteuber: but even with the partials, if you mean "all things ever created by this" don't you want to use a class instead?

15:26 ibdknox: I don't like adding classes to people's code

15:26 since that has other potential implication

15:26 devn: technomancy: lein 2.0 and robert-hooke is broken :\

15:26 bsteuber: sure, I rather mean relying on the user to use classes in that case ^^

15:26 Apage43: speaking of lein 2.0

15:26 if I wanted to start playing with it

15:29 bsteuber: ibdknox: or are there cases in which crate needs control of all created partials independent of what the user does?

15:29 ibdknox: nope

15:30 bsteuber: https://github.com/ibdknox/crate/commit/66f6b13f1c43a9fd2f7de0d6cc845371a207c807

15:30 bsteuber: ibdknox: nice, thanks

15:31 ibdknox: alpha2 has been pushed to clojars as well

15:32 fliebel: Where is all-difffd defined? Oh, another naming change, I guess it's distinctfd?

15:33 amalloy: robinkraft: you would probably get more attention if you pinged actual cascalog dudes like nathanmarz. a cascalog question is likely to get lost in the backlog before anyone competent reads it

15:34 RickInGA: ibdknox: when I am setting up the options for :cljsbuild , for a project I created with your new template, should the :source-path be "src"? "scr/<project name>/client"?

15:34 amalloy: gfredericks: paredit-splice-sexp? isn't that M-s?

15:35 gfredericks: amalloy: yeah urxvt captures that for some reason

15:35 robinkraft: amalloy: it can get a little quiet in there at times, so thought I'd look elsewhere. It's perked up a bit though :)

15:35 amalloy: (and paredit-convolute-sexp i bound to M-LEFT, which seems natural enough since it's kinda moving the current thing "left" an indentation level)

15:35 ibdknox: RickInGA: yeah, though that should be unnecessary I think

15:35 gfredericks: amalloy: I need to avoid the arrow keys, which I think tmux hates

15:36 amalloy: mefesto, TimMc: i think you can edit on refheap if you're signed in when you create the paste

15:36 TimMc: yep

15:37 RickInGA: ibdknox when I try to start the repl I get "no 'xpc' param provided to child iframe

15:37 TimMc: amalloy: convolute doesn't have a binding in my Emacs 23

15:38 amalloy: if you want to avoid arrow keys (which i should too, really, but for paredit i make an exception) you could use M-a. that's a key that's not used for anything useful

15:39 TimMc: Bound to backward-sentence here.

15:41 amalloy: right. nothing useful :P

15:43 TimMc: ah, yes

15:43 amalloy: during my brief period of experimentation with unicode, i made C-a my prefix key for "i'm about to type some crazy unicode stuff"

15:44 RickInGA: will fight with my configuration more later….

15:56 mefesto: in lein, is :repl-init meant to be the ns you do most of your work out of or do you typically (use 'myapp.repl) into the user ns?

15:57 devn: technomancy: disregard. i made a mistake.

16:08 gfredericks: how do I build one of these old-contrib projects with maven? 'mvn package' gave me an empty jar

16:09 clj_newb: Hi, in lamina I'm trying to create a named-channel with a creation callback, can this callback have more than one parameter ?

16:09 in the example the creation callback has only one parameter

16:10 and in the lamina code, when invoking the callback only the ch variable (channel) is passed as arguments

16:15 technomancy: Apage43: see the upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading

16:16 clojurebot: Leiningen 2 is still in a preview release, but see the upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading

16:16 clojurebot: You don't have to tell me twice.

16:16 gfredericks: clojurebot: lein2 is Leiningen 2

16:17 clojurebot: Ik begrijp

16:17 gfredericks: ~lein2

16:17 clojurebot: lein2 is still in a preview release, but see the upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading

16:17 gfredericks: what a guy

16:17 Apage43: technomancy: thanks, found it :)

16:17 technomancy: gfredericks: nice

16:17 Apage43: anyone using lein2 with vimclojure/nailgun?

16:18 dougx: @technomancy I'm having a problem running lein. Followed the instructions on https://github.com/technomancy/leiningen but lein can't find jline/ConsoleRunner. Here's the relevant gist https://gist.github.com/2031246

16:19 technomancy: dougx: you shouldn't have to set $CLASSPATH

16:19 dougx: ok, undoing that

16:19 technomancy: dougx: your best bet is to install rlwrap

16:20 jline 1 from leiningen 1.x is pretty crappy

16:24 dougx: @technomancy: made some progress - now getting this https://gist.github.com/2031246#file_error_2

16:25 after installing rlwrap

16:25 technomancy: how did you install it?

16:25 gfredericks: "made some progress - now getting this" is a good summary of development in general

16:26 ohpauleez: total side note, I'm WAY amped up for Clojure/West

16:26 gfredericks: up to 11?

16:26 technomancy: gfredericks: "now it's broken in new and unexpected ways!"

16:26 ohpauleez: gfredericks: ALL the way up to 11

16:26 technomancy: "brought to you by Windows 7"

16:26 gfredericks: technomancy: never boring

16:26 dougx: apt-get install rlwrap on ubuntu 11.04

16:26 ohpauleez: I gave a preview of my talk to Philly Lambda last night, and today to my colleagues

16:27 technomancy: dougx: oh, I mean leiningen

16:27 dougx: oh, downloaded the script, added it to ~/bin and chmod +x lein

16:27 technomancy: which script?

16:27 dougx: https://raw.github.com/technomancy/leiningen/stable/bin/lein

16:28 technomancy: hm... try "lein self-install" after clearing out ~/.lein/self-installs

16:28 could have been the download was corrupted or something

16:29 amalloy: "maybe the download was corrupted???" - developer-speak for "i dunno, man"

16:29 gfredericks: cosmic rays flipping bits

16:29 dougx: i'm trying https://raw.github.com/technomancy/leiningen/preview/bin/lein

16:29 technomancy: amalloy: the tachyon inverter array was out of alignment

16:30 * gfredericks associates "flipping bits" and "flipping burgers"

16:31 TimMc: (╯°□°)╯︵ 0100111010101001

16:31 Hmm, YMMV dpeending on font.

16:31 * gfredericks just had an idea for a library that defines two? through ninety-nine?

16:32 TimMc: &one?

16:32 lazybot: java.lang.RuntimeException: Unable to resolve symbol: one? in this context

16:32 TimMc: Whatcha got against one? ?

16:32 gfredericks: whoops I meant to start at one

16:32 technomancy: gfredericks: porting activesupport to clojure?

16:32 gfredericks: ha

16:32 TimMc: &(zero? 0N)

16:32 lazybot: ⇒ true

16:32 gfredericks: I already have a library that converts numbers to words so the rest would be a tiny macro

16:33 amalloy: he's got ninety-nine predicates, but one? ain't one

16:33 TimMc: pffft

16:33 gfredericks: or I could just cover all possible cases with (defn function-missing [fname & args] ...)

16:35 fliebel: $mail dnolen, cjfrisz I wrote a blogpost about my thoughts about generating stripboards, comments welcome: http://pepijndevos.nl/2012/03/13/thoughts-about-generating-stripboard-layouts.html

16:35 lazybot: Message saved.

16:36 TimMc: Mail one, highlight the other? :-)

16:36 amalloy: i think he mailed neither

16:36 TimMc: comma?

16:36 amalloy: yeah

16:36 TimMc: commas are whitespace, whatchoo talkin' about

16:37 gfredericks: TimMc: so if I add a comma to my nick I could be unmailable!

16:37 amalloy: yes, just checked, that mail went to nobody, fliebel

16:37 TimMc: gfredericks: I'd like to see that.

16:37 amalloy: $login

16:37 lazybot: You've been logged in.

16:37 amalloy: $unmail fliebel dnolen,

16:37 lazybot: Deleted unread messages from fliebel to dnolen,

16:37 amalloy: $logout

16:37 lazybot: You've been logged out.

16:38 gfredericks: TimMc: gfredericks, is an erroneous nickname

16:38 TimMc: yep

16:39 dougx: @technomancy: the preview release is working - thanks!

16:40 technomancy: cool

16:40 amalloy: "the stable version doesn't work, so i'm trying the bleeding-edge version. works great out of the box!"

16:41 technomancy: welcome to Clojure =)

16:42 amalloy: hah, indeed

16:42 dougx: amalloy: i'm retrying stable again now that i've removed leiningen-1.7.0-standalone.jar

16:43 gfredericks: so it's the stable releases that are bleeding?

16:43 maybe that's just too oxymoronic

16:45 dougx: hehe

16:46 cool, stable works now - the download was corrupt

16:48 technomancy: let that be a lesson: never trust curl.

16:49 TimMc: md5 that shit

16:49 dougx: yep

16:49 technomancy: actually I thought lein 1.7 did use a checksum

16:50 oh nope; it checksums clojure.jar because it puts it on the bootclasspath

16:51 TimMc: bcrypt it, just be sure

16:51 *to be

16:51 technomancy: How goes the hash migration?

16:52 technomancy: TimMc: 15% or so

16:52 TimMc: noice

16:52 technomancy: at some point I'd like to see how many who have deployed in the last N weeks are still unhashed

16:52 TimMc: technomancy: Any chance you could put a message in the scp acceptance message? :-P

16:53 A MOTD kind of thing.

16:54 technomancy: oh yeah, I forgot we have access to that output stream

16:54 goood idea

16:54 TimMc: sweet

16:55 gfredericks: "Update your account today and receive 15% off your next upload"

16:55 technomancy: "Clojars BCrypt Pro Verified account"

16:55 TimMc: "... Gold"

16:56 gfredericks: "...in bed"

16:56 TimMc: "Earn the BCrypt achievement badge"

16:56 $dec gamification

16:56 tmciver: gfredericks: Hey! this is a family channel! ;)

16:56 lazybot: ⇒ -1

16:57 gfredericks: tmciver: hey it was still a euphemism

16:57 TimMc: Anyone here hacked on Marginalia? (I don't see `fogus around.) I've got a project in mind that would involve hooking into the output generation, and I'm not sure how feasible that is.

17:00 Basically, I'd like to be able to inject some extra HTML into the doc, or otherwise control how part of a docstring is transformed into HTML.

17:03 RickInSJ: ibdknox: in your new project.clj file for the cljs template, I think you need :plugins [[lein-cljsbuild "0.1.2"]]

17:03 netrealm: If I want to run a function every minute, is an agent the right thing to use, or is there a better construct?

17:03 technomancy: netrealm: look into Executors for that

17:03 RickInSJ: when I tried lein trampoline without it, trampoline was not a supported command

17:04 fliebel: amalloy: Oh, so I should email them separately?

17:04 amalloy: indeed. i'd just /msg lazybot twice

17:04 netrealm: technomancy: Awesome, thanks.

17:16 jondot: hi guys, i'm looking for some kind of web framework in clojure that would do routing, mimetype detection, and tempating, something closest to sinatra

17:16 i've seen compojure (not sure about mimetype detection), noir (same) so far; and continuing on with compojure rather than noir

17:18 weavejester: jondot: Compojure (and, I believe, Noir) mimetype detect static files and resources by their extension

17:18 jondot: So foo.txt is reported as a text/plain and so forth.

17:19 jondot: howabout letting me write each response type such when i'm getting a POST with application/json, application/xml, or application/html ?

17:19 i'd like to serialize my entity to json, xml in the first two cases, and in the third access it from a templating engine

17:20 weavejester: jondot: I don't believe there's anything that does that yet, but it wouldn't be too hard to write.

17:20 jondot: but ofcourse, wouldn't like to switch on mime type and do a 'tojson, toxml, etc'

17:20 i see, thanks any way

17:26 netrealm: jondot: I've done something like that. I have a handler that accepts urls prefixed with either /json or /xml (so, for a normal handler that is /handler, appropriate urls to access it are /json/handler or /xml/handler).

17:28 I then strip the prefix and pass it to the appropriate handler. When the response comes back, I update :body with the correct translation of the data, and add the right Content-Type to the :headers.

17:29 jondot: yup

17:29 some would claim that /resource.json is more "correct" than /json/resource

17:29 i'm very careful not to go into that though, just if you didn't think of it, its a nice point to consider.

17:30 TimMc: agreed

17:30 It makes sense from a composition standpoint too.

17:31 netrealm: perhaps, but the cool thing is, it's a simple change of my regex and I could convert to that naming.

17:31 jondot: sure.

17:31 netrealm: TimMc: meaning?

17:32 TimMc: Different prefixes of your path may lead to different servers entirely.

17:32 jondot: also, purists claim that you dont even need /resource.json. just refer to /resource with "application/json" in your headers. in practice i found that troubling when working with CDNs. they don't like the fancy stuff yet.

17:33 netrealm: Those are both good thoughts...I'll mull them over and consider changing my naming scheme.

17:33 TimMc: You can keep scooping off the prefixes and routing forward to different sub-handlers, but if you prefix everything with optional handler types, you are spreading information intended for the end handler all over the URL.

17:33 netrealm: Ah, I see what you mean now.

17:34 jondot: netrealm, not my own. i'm just a practitioner :)

17:34 netrealm: And I'm attempting to become a practitioner :)

17:35 mrmekon: I don't know clojure, nor noir. But O

17:35 ack

17:35 I'm trying to call 'render' to render a defpage that takes a keyword

17:36 aaaaand... I don't know how to do that

17:36 mefesto: mrmekon: have some example code you can paste at refheap.com ?

17:36 mrmekon: only two lines are really relevant

17:36 (defpage "/keyword/:id" {:keys [id]}

17:36 that page works

17:37 (render "/keyword/Performance")

17:37 I want to do that, but that does not work

17:38 https://refheap.com/paste/1058

17:39 I'm not particularly surprised that it doesn't work, I'm just not familiar enough with clojure to solve it. I assume I have to pass a map as a parameter to render somehow

17:41 seanm: mrmekon: what does requesting "/" return?

17:41 mefesto: does the call to render throw an exception?

17:42 mrmekon: yes, NullPointerException

17:43 seanm: I wonder if that order's bad

17:43 mefesto: mrmekon: maybe test with (render "/keyword/Performance" {:id "Performance"}) ?

17:44 mrmekon: that doesn't work, and I also tried (render "/keyword" {:id "Performance})

17:44 which is actually closer to what I expect to be correct

17:44 mefesto: (render "/keyword/:id" {:id "Performance"}) ?

17:45 mrmekon: theere we go

17:45 that should have been painfully obvious

17:45 thanks :)

17:45 Luke: anyone know how to fold a list of lists into one list?

17:45 mefesto: Luke: flatten?

17:45 ,(flatten [[1 2 3] [4 5 6]])

17:45 clojurebot: (1 2 3 4 5 ...)

17:46 brehaut: ~flatten

17:46 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.

17:46 mefesto: oh, apply concat then?

17:46 ,(apply concat [[1 2 3] [4 5]])

17:46 clojurebot: (1 2 3 4 5)

17:47 Luke: weird I couldn't get concat to work before

17:47 let me try again

17:47 brehaut: its a big case of 'it depends'

17:47 Luke: thanks

17:48 (concat [[1 2 3] [4 5]]) in my repl didn't return the same result as it did here

17:48 mefesto: Luke: (apply concat [...])

18:47 seancorfield: i have some code like (and (f a b c) (g a b c)) - is there a cleaner way? avoiding repetition of a b c perhaps?

18:49 RickInSJ: seancorfield you could do (let [x (a b c)] (and (f x) (g x)))

18:50 aperiodic: (apply and ((juxt f g) a b c))

18:50 emezeske: seancorfield: maybe use juxt?

18:50 aperiodic: you beat me!

18:50 brehaut: and isnt a function?

18:51 aperiodic: emezeske: great minds use juxt?

18:51 brehaut: i think you might need (every? identity ((juxt f g) a b c))

18:51 amalloy: every?

18:52 (every? #(% a b c) [f g])

18:52 Iceland_jack: us

18:53 brehaut: actually, every-pred ?

18:53 seancorfield: ah, i tend to forget that juxt produces a function of any number of arguments

18:54 amalloy: mm, i like that example of every? thanx

18:55 amalloy: that's different from your and, if you care about the return value other than truthiness

18:55 &(and (+ 1 2) (- 1 2))

18:55 lazybot: ⇒ -1

18:55 seancorfield: only need truthiness

18:55 amalloy: &(every? #(% 1 2) [+ -])

18:55 lazybot: ⇒ true

18:56 seancorfield: now if i can just get a point-free version... :)

18:56 what i really want is just a function (which happens to take a b c as arguments)

19:04 doug: hm, http://clojuredocs.org/clojure_core/clojure.core/_dot_dot on http://clojure.org/cheatsheet doesn't seem to do what i'd hope for

19:04 Raynes: brehaut:

19:05 Oops.

19:05 brehaut: Raynes:

19:12 RickInSJ: I am trying to run the tests in the lein-cljsbuild advanced example, and I am erroring out because it cant find phantomjs. is that something I need to install separately?

19:13 doug: what's .. do?

19:14 technomancy: it's for when you want to do things instead of return values

19:14 side-effects

19:14 amalloy: wat. technomancy: that's a good description of doto, not of ..

19:14 .. is just a specialization of ->, making it interop-only

19:15 technomancy: oh, I thought he was pausing

19:16 I see now he had only two dots instead of three

19:16 ztellman: dramatic pause before unleashing his question

19:16 technomancy: what... is best in life?

19:17 ztellman: I want an ellipsis macro that just expands to (Thread/sleep 1000)

19:17 doug: i was doing both in the same syntactic element, actually

19:17 ztellman: timing is everything

19:18 emezeske: RickInSJ: Yes, phantomjs is an executable you have to install separately

19:19 RickInSJ: cool, thanks

19:22 pandeiro: is there a clojure lib for dealing with csv?

19:24 lstoll: pandeiro: https://github.com/clojure/data.csv ?

19:25 pandeiro: there's also https://github.com/davidsantiago/clojure-csv

19:26 pandeiro: lstoll: found those, thanks - is clojure.data.csv included with clojure?

19:27 lstoll: pandeiro: nope, you will need to include it.

19:35 RickInGA: emezeske is it possible to run the repl in the advanced example with repl-listen instead of repl-launch?

19:41 emezeske: RickInGA: Yes.

19:42 Luke: I have a list comprehension and inside, another list comprehension which generates lists. I'm using concat on the inner comprehension to just make a list of lists and then on the outer comprehension, i'm trying to do the same thing to keep a list of lists but it's not working for some reason. Anyone know why?

19:42 RickInGA: emezeske when I do repl-listen I get a message that it is listening on port 9000, but then localhost:9000/ tells me that no xpc param provided to child iframe

19:43 sorry, was localhost:9000/repl

19:44 Luke: Here's an example: http://pastebin.com/d6v2Fvsr

19:44 for some reason, that's not returning a list of lists. instead it's returning a list of lists of lists like the outer-most concat isn't applying

19:45 emezeske: RickInGA: Have you read this? https://github.com/emezeske/lein-cljsbuild/blob/master/doc/REPL.md

19:45 hiredman: Luke: read the doc string for concat

19:46 ,(doc concat)

19:46 clojurebot: "([] [x] [x y] [x y & zs]); Returns a lazy seq representing the concatenation of the elements in the supplied colls."

19:46 tran4: I'm a senior CS undergrad. I applied to a company for co-op and intern positions: http://pastebin.com/LdAH6eaZ Are they good? no reply from company yet but got a call from a recruiter for the same position. shuold i talk to him if I want the position? his ad has $14/hr listed. I live with my parents and they want me to get some work experience this summer. I havent had many replies for my applications so far.

19:46 Luke: hiredman: I have

19:46 RickInGA: emezeske yeah, it says I can connect to a repl from my clojure script code by evaluating a couple of forms, but how do I evaluate the forms when I can't get the repl running?

19:46 Luke: what about that doc string is telling me this wont work?

19:46 hiredman: the arglist

19:46 or just go read the source to concat

19:47 Luke: i still don't follow

19:47 can you be more clear?

19:47 hiredman: concat doesn't concat a list of lists, it concats 1 or more lists together

19:47 Luke: right - so it should concat the outer-most lists

19:47 it shouldn't matter if there are lists inside

19:47 hiredman: also, I suggest you read up on 'for' and look at some examples

19:48 technomancy: concat is typically called with more than one argument

19:48 Luke: hiredman: this is a simplified version with some file reading inside

19:48 hiredman: it's broken up that way to avoid reading the file more than once

19:48 hiredman: Luke: why do you make an example function that takes the same kinds of arguments as concat (you can see the arglist) and see how it behaves

19:49 don't

19:49 Luke: hiredman: what do you think that is I sent you

19:49 hiredman: do you know how to do what I'm asking or not?

19:49 hiredman: Luke: I do, and the answer is right there

19:49 ,(doc concat)

19:49 clojurebot: "([] [x] [x y] [x y & zs]); Returns a lazy seq representing the concatenation of the elements in the supplied colls."

19:49 RickInGA: emezeske thanks for the help, but I think I have gotten to the point where I have been staring at this so long it is not possible for me to see anythin

19:50 Luke: hiredman: i still don't know what you mean

19:50 can you be more direct?

19:51 hiredman: Luke: no

19:51 Luke: have you looked at some example concat usage? any moderately sized clojure project should have some

19:51 emezeske: RickInGA: The clojurescript REPL works by having a browser connect to it, doing a long-poll. When you type commands into the REPL, they end up getting sent to the browser for execution

19:51 RickInGA: So your browser has to run some clojurescript code that knows to connect to the port 9000 on the REPL, before you can type any REPL commands

19:52 RickInGA: emezeske let me seeif I can restate what you are saying to see if I understand

19:52 Luke: hiredman: i made an example that I'm looking at. I still don't know what you mean

19:52 RickInGA: when I do repl listen, it starts a repl for me to type into, but the evaluation will show up in a browser that is connected to it

19:53 hiredman: Luke: why don't you go on to github, grab an open source clojure project, grep for concat, and see how they use it?

19:53 RickInGA: so typing in the terminal looks like it is hung, when it isn't because I am looking the wrong place for the eval

19:54 hiredman: clojure.core has some uses of concat you could look at

19:55 emezeske: RickInGA: That's not quite correct :(

19:55 Luke: hiredman: how about this. can x, y, and zs in this case be lists themselves?

19:55 hiredman: Luke: do you know how to read arglists?

19:56 Luke: hiredman: no

19:56 hiredman: as an exercise, can you define a function that when you call doc on it, you get the same arglist as concat?

19:57 Luke: hiredman: depends. can you answer this question: can x, y, and zs in this case be lists themselves?

19:57 hiredman: for concat's arglist you have ([] [x] [x y] [x y & zs]), what is []?

19:57 RickInGA: emezeske I see that your repl.cljs file in the example contains the 2 forms that the wiki page says you need to run. how do I put those someplace I can call them

19:57 Luke: hiredman: can you answer the question or not?

19:57 hiredman: Luke: can you?

19:58 Luke: not until you answer mine =)

19:58 i've asked it three times

19:58 hiredman: Luke: if you can answer your own question, why are you asking it?

19:59 Luke: i can't answer it - that's why I'm asking

19:59 hiredman: so, in concat's arglist, what is []?

19:59 Luke: i'll wait for someone else, thanks

20:03 in Haskell, I can do "concat [[[1,2], [3,4]], [[5,6], [7,8]]]" and get "[[1,2],[3,4],[5,6],[7,8]]" - is there an equivalent function in Clojure?

20:03 hiredman: Luke: if you are unwilling to learn basic things, then any "help" others give will only get you to your next stumbling block, where you will be back in here asking how to fix code with easily avoidable mistakes

20:04 emezeske: RickInGA: I suggest just installing phantomjs if all you want is a REPL

20:04 RickInGA: And using the repl-launch stuff

20:04 RickInGA: emezeske ok, thanks. I will try that.

20:06 gfredericks`: does erc have an M-x command for sending private messages?

20:08 Luke: hiredman: the answer was "look at the apply function" in case you want to be useful in the future ;-)

20:08 mdeboard: yay trolls

20:14 technomancy: gfredericks`: I don't think so, just use /msg somedude stuff

20:15 gfredericks`: my bad; M-x erc-cmd-QUERY

20:15 gfredericks`: technomancy: it feels so precarious; if I forget that '/'...

20:15 TimMc: gfredericks`: /query somedude

20:15 Then type your message from there.

20:15 gfredericks`: TimMc: yes but that's not typo-friendly

20:15 technomancy: gfredericks`: query opens a new buffer

20:16 TimMc: /qu^I somedu^I

20:16 technomancy: so there's not much risk of your message spilling into a channel

20:16 gfredericks`: ooh

20:16 technomancy test

20:16 TimMc: ...

20:17 technomancy: gfredericks`: not quite

20:17 gfredericks`: hmm

20:17 oh this is still the same window

20:17 technomancy: buffer

20:17 arohner: alexbaranosky: the thunking version of =streams=> breaks previously working code: (provided (foo) =streams=> (range) :times 10)

20:17 gfredericks`: glad I didn't try to tell technomancy anything...confidential

20:18 alexbaranosky: arohner, hmmmm

20:18 TimMc: /msg gfredericks` hunter2

20:18 yoklov: i can't make (keyword "@") as a literal, can i?

20:18 arohner: alexbaranosky: though I don't know if that used to be "legal"

20:19 gfredericks`: TimMc: oh no!

20:19 alexbaranosky: arohner, could you add that to the issue, with any error messages?

20:19 TimMc: *gasp*

20:19 gfredericks`: yoklov: I don't think so

20:19 yoklov: damn.

20:19 arohner: alexbaranosky: sure

20:19 alexbaranosky: arohner, yeah.... I think it was legal, but easily changable to the new format

20:19 gfredericks`: yoklov: unless you count #=(keyword "@")

20:19 TimMc: gfredericks`: sssshhhh

20:19 gfredericks`: yoklov: don't count it! don't!

20:19 alexbaranosky: arohner, the question is whether we think it is reasonable for folks to change their facts

20:20 technomancy: some dude on the train just asked if he could take a picture of the "my other car is a cdr" sticker on my laptop to send to his MIT friend. =D

20:20 alexbaranosky: arohner, I'd wonder how many cases like that that there are in practice -- I guesstimate not a ton

20:21 pipeline: technomancy: niiice

20:21 yoklov: hahah, that's an awesome sticker.

20:21 TimMc: technomancy: If you have any more, you can send one to me and I'll, uh, I'll make sure it gets to him.

20:21 You can trust me.

20:21 technomancy: http://www.zazzle.com/my_other_car_is_a_cdr_bumper_sticker-128776132386843273 only $3.95

20:22 (if you do buy that be sure to cover it with clear tape before putting it on your laptop, otherwise it'll get all scratched up)

20:22 clojurebot: litany against cons

20:22 clojurebot: litany against cons is "I must not cons. Cons is the perf-killer. Cons is the little death that brings total obliteration. I will face my cons and permit it to pass over me and through me, and when it has gone past I will turn my GC to see its path. And where it has gone there will be nothing; only I will remain."

20:22 hiredman: "is it cool if I take your picture?" "no... it's extremely cool"

20:22 technomancy: hiredman: should have grabbed my shades

20:22 I've had a few comments on it before, but mostly just "I did lisp in college and it was crazy lol"

20:22 pipeline: if that happened to me on the long island train i might just mace the guy and run

20:23 'grats on your self restraint

20:23 * technomancy mutters something about the east coast

20:23 TimMc: pipeline: Roll with it, man.

20:24 The subway is no place for boundaries.

20:24 pipeline: true that

20:27 aperiodic: the one-star review on that bumper sticker is hilarious

20:28 TimMc: aperiodic: It's not a review of the bumpersticker.

20:28 yoklov: it's an extremely confused zazzle user, apparently.

20:28 aperiodic: ah

20:28 TimMc: "Reviews from customers who purchased: Bumper Sticker"

20:28 not "Reviews for "(my other car is a cdr) bumper stickers""

20:28 aperiodic: missed that bit

20:29 * aperiodic read good one day

20:29 TimMc: Zazzle has a terrible interface for tat.

20:29 *that

20:29 gfredericks`: TimMc: but they can list more reviews that way?

20:29 tmciver: Anyone know where this year's conj is going to be? NC again?

20:30 yoklov: probably, especailly if they sell a lot of things that are as specialized as "(my other car is a cdr)" bumper stickers

20:30 hiredman: tmciver: seems a safe bet

20:31 gfredericks`: would "(the rest of my cars are cdrs)" make more sense?

20:31 yoklov: haha, that's actually pretty good.

20:31 hiredman: uh, you can have one car and one cdr

20:31 TimMc: csr

20:31 yoklov: but your cdr is made up of cdrs.

20:32 err, has a cdr.

20:32 hiredman: I guess you could view your reference has an alist or something

20:32 tmciver: be careful: people might start to think you're a bunch of nerds.

20:32 gfredericks`: awkrap

20:32 hiredman: *shrug*

20:33 I make a decent living at being one

20:33 mdeboard: I am a brogrammer

20:33 pipeline: beats diggind ditches

20:33 * mdeboard pops his collar

20:34 pipeline: I drink beer professionally

20:34 on occasion this is mistaken for devops

20:38 gfredericks`: &(-> cdr a is car other my quote flatten)

20:38 lazybot: ⇒ (my other car is a cdr)

20:41 aperiodic: heh, took a minute for me to realize how that worked

20:41 clever

20:44 alexbaranosky: I want a T0-shirt that says, "I'd rather be at BAZNEX."

20:44 T-shirt *

20:45 but the sticker would be cool too, I'm open-minded

20:52 aperiodic: ooooooh

20:53 i didn't know toxi was into clojure

20:58 alexbaranosky: aperiodic, who's toxi?

20:59 aperiodic: alexbaranosky: he's a prominent user of processing

20:59 he's released a lot of very useful libs for it

21:00 and now it seems he's porting them to clojure!

21:00 alexbaranosky: aperiodic, it is part of Clojure world domination I guess

21:02 gfredericks`: on that note, I am curious: on a historical scale, can it be inarguably said that clojure has put a significant and unprecedented oomph into the popularity of lisp?

21:02 I was not very much into lisp prior to clojure so have little perspective

21:05 tomoj: hmm http://www.google.com/trends/?q=clojure,+lisp

21:06 hiredman: http://www.google.com/trends/?q=clojure,+common+lisp

21:06 it is hard to trend scheme

21:07 gfredericks`: man nobody cared about leiningen before 2010

21:08 okay, so unless I misunderstand the charts...the answer is no?

21:09 tomoj: eh

21:10 I didn't mean to suggest that any google trends charts could actually provide a decent answer to your question

21:11 I think it's certain that lisp is not as popular today as it once was, even with clojure? I don't know, I wasn't born yet..

21:11 gfredericks`: oh I didn't even know it used to be more popular

21:12 tomoj: I mean that I think (guess) the fraction of developers working with a lisp was once much higher

21:12 technomancy: gfredericks`: around 2005 when I started looking at CL you pretty much had to work at ITA or be very good at keeping secrets to use it professionally

21:12 cjfrisz: I don't have a good notion of that, since I mostly hang out with storied Lisper/Schemers

21:12 lazybot: mail

21:12 technomancy: fair amount of interest, but none of it for work

21:13 gfredericks`: so the answer is domain/application dependent

21:14 technomancy: let's put it this way, before Clojure, if you said lisp wasn't any good for practical stuff, CL fans would refute you by pointing to individual examples of lisp applications that had succeeded

21:14 gfredericks`: that is a good way to put it

21:15 cjfrisz: Plus the AI Winter didn't help

21:15 tomoj: decades ago, was the lisp interest mostly in academia?

21:15 technomancy: mostly viaweb and ITA matrix, now that I think of it

21:16 cjfrisz: Well, it started in academia, since it was intended for AI applications

21:16 technomancy: scheme may be different since it's commonly embedded symbiotically

21:16 cjfrisz: Which translated into expert systems into the 1980s

21:16 But...the bottom fell out on that

21:17 pandeiro: what are the major gripes with scheme?

21:17 cjfrisz: Lack of proliferation of packages

21:17 * gfredericks` bets that the java interop in scheme sucks

21:17 pandeiro: gfredericks`: big or feature?

21:17 big/bug

21:17 cjfrisz: I hold my Scheme near and dear, but hell if you can find good libraries that are portable between implementations

21:18 The Scheme community is really segmented by which implementation you use, and it makes it hard to get a good standard

21:18 pandeiro: cjfrisz: i imagined that had something to do with it, but what if you stick to one impl, eg racket

21:18 cjfrisz: Plus there's no reference implementation, so everybody does things a little differently

21:19 pandeiro: Racket is probably one of the bigger ones, and it has a decent set of packages

21:19 Though I've never had much exposure to Racket

21:19 I come from the land of Chez Scheme, and it's only been recently that I've pushed myself to write more standard-compliant Scheme

21:19 It's not easy

21:20 pandeiro: i also have little exposure but it seems like a logical clojure alternative for scripting stuff (?)

21:20 cjfrisz: pandeiro: Scheme has a ludicrously powerful macro system

21:20 clojurebot: Pardon?

21:20 TimMc: It seems like a perfectly reasonable Scheme.

21:21 (Racket, that is.)

21:21 cjfrisz: TimMc: I agree, I just never had much reason to use it

21:21 I know some of the Racket guys, and they're really cool

21:22 My only real problem with it is that it's not terribly fast

21:22 At least in comparison to Chez Scheme

21:22 gfredericks`: is there any reason for me to look at any other lisp?

21:22 cjfrisz: gfredericks: it depends

21:22 pandeiro: gfredericks`: jvm startup time?

21:22 cjfrisz: ^^^

21:22 technomancy: elisp

21:22 gfredericks`: oh right

21:23 cjfrisz: Also ^^^

21:23 I do love me some elisp

21:25 My take is that Clojure is a very nice language for implementing everyday kind of stuff

21:25 pandeiro: technomancy: is it possible to use the eshell outside of emacs, or i mean write elisp scripts with something like !#/usr/bin/env emacs ? sorry for dumb question

21:25 cjfrisz: Having access to all the Java libraries is pretty awesome

21:25 technomancy: pandeiro: yeah, but that's not eshell

21:26 you can just execute arbitrary .el files

21:26 cjfrisz: It's harder to do that kind of everyday stuff in Scheme because there's not a lot of native packages, and the alternative is calling into C binaries

21:26 technomancy: I've used it for syntax highlighting in documentation generation before

21:26 cjfrisz: But Scheme is wonderful for doing PL/compilers type of work thanks to its macros

21:27 pandeiro: is there ever going to be a bash replacement?

21:28 i mean a language that can do everything bash can do, without the cryptic syntax and weirdness

21:28 gfredericks`: ruby?

21:28 clojurebot: Chunky bacon!

21:29 tomoj: he said _without_ the cryptic syntax and weirdness..

21:29 pandeiro: gfredericks`: yeah i guess ruby and python compete for that, i just don't like either

21:29 thanks tomoj :)

21:29 gfredericks`: oh come on

21:29 bash and ruby are on two different levels

21:30 pandeiro: ruby looks like lua and c++ had a baby

21:30 tmciver: There's Scheme shell: scsh.net

21:41 TimMc: OK, if we're going to talk about scsh, there's a link I need to post.

21:43 http://www.scsh.net/docu/html/man.html

21:43 <3 Olin

21:44 His dept head gave him a talking-to after that. :-P

21:45 gfredericks`: and made him take it down promptly apparently

21:46 tmciver: TimMc: was he being serious?

21:46 TimMc: Nah.

21:46 pandeiro: "A 10 oz. Jack 'n Zac helps me get through the meetings"

21:47 TimMc: tmciver: I was talking to him about it (he taught the freshman CS class at NEU) and he said that that was when he realized it is hard to convince someone you are *not* crazy.

21:47 tmciver: Ha! Yeah, I'm not sure he isn't.

21:47 TimMc: He's a good kind of crazy.

21:48 Great prof, genuinely cares about his students.

21:48 tmciver: He should say: "Crazy? Yeah I'm crazy. Crazy like a fox!"

21:48 TimMc: you'll be happy to know I'm watching the Overtone vid.

21:49 TimMc: yessss

21:55 alex001: anyone using appengine-magic ? is :aot needed or not ? Seems like I'm having issues if I either remove it or keep it...

21:57 aperiodic: alex001: i don't know about appengine-magic in particular, but in general if you're supplying a class by name to something else, you'll need to set :aot and `lein compile`

21:58 gtuckerkellogg: embarrassing newbie question

21:59 gfredericks`: unrelated noun phrase

21:59 gtuckerkellogg: is http://pastebin.com/P3UXgbrT the best way to get a random key-value pair from a hashmap?

21:59 TimMc: tmciver: For more from Olin Shivers on guns: http://www.ccs.neu.edu/home/shivers/autoweapons.html

21:59 alex001: aperiodic, I can't use lein compile (lein appengine-prepare) is supposed to take care of that

22:00 gfredericks`: gtuckerkellogg: you can use rand-nth to avoid mucking with indices

22:00 gtuckerkellogg: and you can use a vector literal instead of calling the list function

22:01 aperiodic: alex001: ok, as long as something is compiling before the class is loaded

22:01 gfredericks`: (defn rand-pair-from-hashmap [hmap] (-> hmap keys rand-nth ((juxt identity hmap))))

22:02 ^ also you can do it that way just to prove that juxt is always the answer

22:02 gtuckerkellogg: neat. I wasn't familiar with juxt

22:03 gfredericks`: it comes in handy when you feel like being clever

22:03 ~juxt

22:03 clojurebot: juxt is a little hard to grok but it's the best thing ever

22:03 tmciver: TimMc: I like it. Sounds like he knows his guns.

22:03 TimMc: Yeah, he could fool me.

22:03 alex001: aperiodic, humm it seems that if I leave any :aot directives in project.clj, when I run lein repl I get npe's :(

22:04 xeqi: ,(rand-nth (seq {:a 1 :b 2 :c 3}))

22:04 aperiodic: alex001: could you gist/refheap your project.clj?

22:04 clojurebot: [:a 1]

22:04 gfredericks`: xeqi: crap you're right

22:04 ,(rand-nth {:a 1 :b 2})

22:04 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>

22:05 gfredericks`: gtuckerkellogg: (def rand-pair-from-hashmap (comp rand-nth seq))

22:05 gtuckerkellogg: fanstastic

22:06 thanks xeqi and gfredericks

22:07 alex001: aperiodic, sure here it is: https://refheap.com/paste/1059

22:08 aperiodic: alex001: the :aot value should be a list of regexes

22:08 alex001: any namespace that matches will be AoT compiled

22:09 pandeiro: how can i test a string for a simple substring?

22:09 gfredericks`: .indexOf should work right?

22:09 ,(.indexOf "foo and bar" "and")

22:09 clojurebot: 4

22:10 gfredericks`: clojure.string might have a function for it too

22:10 pandeiro: gfredericks`: it doesn't that i could tell

22:10 tomoj: String also has .contains

22:10 xeqi: ,(re-find (re-pattern "and") "foo and bar")

22:10 clojurebot: "and"

22:10 pandeiro: obviously i show my ignorance of the java api

22:10 gfredericks`: apparently there are exactly seven ways to do it

22:10 pandeiro: yeah i had also forgotten about the re wrappers

22:11 i was http://docs.oracle.com/javase/tutorial/essential/regex/pattern.html when i decided to cry for help

22:11 alex001: aperiodic, humm that should be fine, in this case, only the servlet is compiled

22:11 lxnch: 'topic

22:13 aperiodic: alex001: ah, i see

22:15 alex001: so the class compiles normally, but you still get NPEs when you try to launch a repl?

22:16 uvtc: It's interesting to see the number of Clojure's popping up. First ClojureScript, then clojure-py, and I recently saw on disclojure clojure-scheme.

22:17 aperiodic: i think that clojure-scheme in turn supports compiling clojure down to c

22:18 alex001: aperiodic, yeah. on the appengine-magic, it is written "Otherwise, omit the :aot directive altogether." Disabling any :aot makes the repl work, however, the final jar does not contain any compiled classes... maybe it is a bug :(

22:18 uvtc: aperiodic, Right. Using Gambit.

22:22 aperiodic: alex001: no, that's expected. if there's no :aot directive, then no compilation is done, so there are no compiled classes to stick in the jar

22:22 uvtc: Heh. Wouldn't it be interesting if the killer app for Python 3 turns out to be Clojure on PyPy. ;)

22:22 alex001: aperiodic, "The lein appengine-prepare task will take care of AOT-compiling the entry point servlet and cleaning up afterwards." I guess that command should do the AOT compiling :S

22:24 aperiodic: alex001: the appengine-prepare task seems to only generate a war; i'm not sure if it's designed to hook into the jar task

22:25 alex001: if you're just trying to get a simple appengine-magic project running, then there shouldn't be any reason to have an :aot option

22:26 alex001: if the appengine-prepare task doesn't prepare the war properly, then i'd open an issue on appengine-magic

22:26 lxnch: I get this strange error using the latest clojurescript revision http://pastebin.com/R7z3tQmS ... what's going on, can anyone also check with the latest revision?

22:27 alex001: I will have to check with the author of appengine-magic.. something is fishy there

22:27 aperiodic, thanks for helping!

22:27 aperiodic: alex001: no problem! sorry I wasn't much help

22:51 leo2007: Folks, what's new?

22:55 muhoo: uvtc: language splintering seems to be a common feature of lisps, AFAICT

22:56 leo2007: how do you mean?

22:56 muhoo: it seems like lisp people like creating languages.

22:56 maccros, DSLs are probably the gateway drug here :-)

22:56 leo2007: that's the benefit of writing in AST.

22:57 uvtc: muhoo, I don't see it as splintering though. In one way, it's taking advantage (in a good way) of a platform that has libraries you'd like to access.

22:57 In another way, it's providing an escape route for folks who are stuck on a given platform but who would like to use Clojure.

23:10 cgag: I just realized paredit lets you jump over closing curly/square brackets using close paren, that's great.

23:12 uvtc: I'd be interested to know what portion of users here use paredit. I briefly tried to get used to it, but thus far have not.

23:13 gtuckerkellogg: i use it

23:14 cgag: I'm trying to switch over to emacs from vim, sort of (using evil mode), and i'm liking paredit alot, at least since i figured out how to wrap an expression with [/{/(. I suppose i cheat though just using vim commands to delete stuff if I need to.

23:14 ferd: I use it too

23:15 uvtc: So far, I like hitting the close paren and seeing the matching one light up momentarily. Well, works for me now, while learning anyway.

23:15 Can anyone recommend a good paredit tutorial?

23:16 Or screencast?

23:17 cgag: nothing jumped out at me when I was looking for one, i've mostly been getting by reading the commands that remain after doing M-x paredit with ido

23:17 ferd: all I used to "learn it" is the reference card/cheat sheat

23:17 tomoj: same here, but I am interested in making a screencast, or in someone else making one :)

23:18 uvtc: screencast++

23:18 ferd: I'm no expert... The commands I find myself using the most are splice and forware-slurp

23:19 M-s and C-) respectively

23:19 tomoj: I feel like I still don't have movement down

23:21 alex001: after reading this, as a vim guy, I'm scared that I might end up the same route too

23:22 tomoj: specifically, repeating C-M-d C-M-n to crawl forward feels strange

23:22 cgag: using evil mode, so far the main things I miss is the nerd-commenter and nerd-tree

23:22 tomoj: well.. can just use C-M-f. hmm

23:23 cgag: i'm curious if i'm going to ever actually want to give in and use the normal bindings, i don't feel like i can give up vim's movement

23:23 aperiodic: i use paredit.vim

23:23 it's great

23:23 my only complaint is that it doesn't do curly braces

23:24 tomoj: can it at least navigate through/around curly sexps?

23:24 aperiodic: unfortunately not

23:26 but i usually use vim commands for navigation, so that doesn't really get in my way

23:26 cgag: with swank, are you supposed to have to highlight the whole expression before you can execute it (C-x C-e)? I would think I'd just need to have my cursor on the opening paren, or between the first / second paren

23:27 tomoj: C-h k C-x C-e

23:28 .. where "the expression preceding point" means you're supposed to put point on or after the closing paren

23:36 cgag: oh, preceding point

23:36 the swank clojure readme says 'under the point'

23:36 thanks

23:41 tomoj: note also C-M-x

23:41 for toplevel forms, where you can have point anywhere inside

23:43 cgag: oh, excellent, i didn't see that... or i guess i also didn't really understand what it meant to compile it vs eval it

23:49 tomoj: I don't think there is any difference for clojure

23:51 amalloy: there isn't

Logging service provided by n01se.net