#clojure logs

2012-03-13

00:08devnaperiodic: all the time, just for fun. :)
00:08devnno one ever said whether premature optimization was bad when used only as an exercise
00:09devnbesides, 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?
00:11devnalek_b: are you around?
00:11aperiodicdevn: i've been guilty of my fair share of microbenchmarks
00:12devnaperiodic: it used to be a bit more en vogue in this channel to bench things i think
00:12devnmaybe im just getting old
00:12aperiodicdevn: just as long as everyone recognizes when it's premature
00:13aperiodici haven't seen many benchmarks in here, but i haven't been around here very long
00:13devn*nod* -- totally agree, but if someone says: "hey how do i transform this to this?"
00:13devnthen why not give them options
00:13devny'know?
00:15aperiodiccan't argue with that
00:16devnaperiodic: so, whatcha hackin' on?
00:17aperiodicright now, finishing up some stuff at work. gonna start porting some of my processing sketches over to quil once i'm home, though
00:18aperiodicdevn: you?
00:18yoklovif i have a function which needs to io and i want it to be configurable, what's the perferred way to have that happen?
00:19yoklovjust use *in* and *out*?
00:20devnaperiodic: 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
00:20devni 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
00:20aperiodichave you played around with enlive at all?
00:21devnand finally i have sort of a dream of an interactive clojure explorer library
00:21devnyeah i really dont like enlive
00:21devni 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.
00:21devnit feels like it's missing pieces, and also feels overly complex for what i want to do
00:22devni loved mustache, but enlive just feels... i dont know... weird.
00:23devni 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
00:23aperiodici haven't done much besides kick the tires with it
00:23devnive heard a dozen or so people say the same thing. i think we need a better scraping lib.
00:24devnaperiodic: this is what i'm working on at the moment -- very, very early days: https://github.com/devn/yokogiri
00:24devninspired by yoko harada's work on doing the pure java port of nokogiri
00:26devnaperiodic: there's also this: https://github.com/devn/indiana/tree/master/src/walton
00:26devnit's an old project im reworking
00:26devnhttps://github.com/devn/clj-xpath that too
00:26devnjust a big old refactor, hope the authors don't hate me for it
00:27devnbut it's like reading clojure from...well, a year or two ago, not a big surprise given the age of the lib
00:29aperiodici wonder if you couldn't get what you want with some macros on top of enlive
00:32aperiodicthat'd let you write things like (for [node (select-css root > h2 a)] ..)
00:32aperiodicat least, that's my first instinct whenever i feel like i'm fighting with some code i'm writing
00:44jkdufair2if, 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
00:51devnaperiodic: it just feels like too much cake to eat
00:51devnaperiodic: cool, automaton generators and all of this stuff
00:51devnthere's a reason that multiple tutorials exist for enlive
00:52devnit'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.
00:52devnit feels wrong. it hurts to use it.
00:54devnthat 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.
00:54ibdknoxI'm not going to really cover it in my class
00:54devn(yikes. i love cgrand.)
00:54devnbut i can't pretend it's just dandy
00:54devnit's terrible to use
00:55ibdknoxyes it is
00:55ibdknoxit's not what we should be promoting for Clojure
00:55ibdknoxit is neither simple nor easy
00:55devnno. not at all. we really need a better story
00:55devnit is clever as fuck
00:56matadonQuestion: 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.
00:56ibdknoxstencil, comb, and hiccup are the ones I'm directing people to these days
00:56devnibdknox: wanna help me with a nokogiri port :)
00:56devnibdknox: im not familiar with stencil or comb
00:56ibdknoxdude, I have less time than none :p
00:56ibdknoxstencil = mustache
00:56ibdknoxcomb = something like erb templates
00:56devnhaha, well hey, it was worth a try
00:56devnibdknox: i really, really want to do haml for clojure
00:57devni know people puke at that
00:57devnbut i swear it would be good for the community
00:57matadondevn: I'd use it.
00:57technomancymatadon: check out the upgrade guide linked to from http://leiningen.org
00:57devnwe need a better templating library. am i down to use hiccup? you bet.
00:57devnis a designer? nope. is a rubyist who is checking out the clojure webstory? hell no.
00:58technomancyI would have a hard time recommending something other than hiccup for HTML
00:58technomancyit's just so obvious
00:58devntechnomancy: unless you're new and it isnt!
00:58devnit looks like primitive hell
00:58devnit is everything parenophobes are afraid of out of the gate
00:59technomancywell they need to learn how functions work
00:59devnthey do, but time is time
00:59devnthey need to take some
00:59technomancylearning how to template before you know how to do abstractions is silly
00:59devntechnomancy: i dont think it'd hurt anyone to provide something like haml for newbs
00:59devnit's an entry point
01:00ibdknoxwe have a couple of sensible entry points for those people
01:00devnthey can use hiccup in a little bit, it won't tarnish the community or ruin clojure
01:00technomancyI'm pretty suspicious of code targeted explicitly at newbs
01:00ibdknoxmustache is a great solution for designers
01:00technomancyif it's not intended for its own author, there's not much hope for it
01:00ibdknoxcomb is great for the ruby crowd
01:00devnim not. half of the ruby gems ive used are targeted at newbs
01:00ibdknoxtechnomancy: I am as well
01:00ibdknoxvalid abstractions span the skill gap
01:00devni think there's a /balance/
01:00technomancyif you go down that path you end up at sweet-expressions
01:01devnif you want to be hardcore and be all like: "totally functional, bro"
01:01devnthen you can use enlive
01:01devnbut that's not how people tick
01:01matadonThere's a lot to be said for making an environment newbie-friendly.
01:01devnthere's a balance to be had here. a middle ground
01:02devnand being opposed to one extreme or the other is wrong on its face
01:02devnit's the middle
01:02technomancymatadon: that's fine; I'm saying don't target newbies primarily
01:02devncompromise your clever lib that has a totally crazy interface in order to let people do things with it
01:03ibdknoxmatadon: absolutely, and I do tons of work to make that true - but it also isn't some watered down thing for "newbs"
01:04technomancyfocus on getting the abstraction right, then you can make it palatable to newcomers
01:04ibdknoxyep
01:04technomancyif you try to do it in the other order you'll end up with a mess
01:04devnor not
01:04devnwhat if you're a newcomer?
01:04devnand you write a library?
01:04ibdknoxI was
01:04ibdknoxI was new when I wrote noir
01:05devnso you did it exactly the opposite of what is being prescribed there
01:05ibdknoxno
01:05devnyou wrote a lib for a newcomer
01:05devnbecause you wrote it for yourself
01:05ibdknoxI wrote a lib that worked at every level of the stack
01:05technomancythe abstractions were already there
01:05technomancywith noir
01:05ibdknoxyep
01:05devn(not like ice cube)
01:06devntechnomancy: ibdknox: I don't think I'm advocating libs for newbs as par for the clojure course.
01:06devnbut i also think this community has a tendancy to be arrogant, holier-than-thou, etc.
01:06ibdknoxI'm arguing that the notion of a lib for newbs doesn't exist :)
01:06ibdknoxthere are just good and bad libraries
01:07ibdknoxa good lib will work for anyone of any skill level
01:07devnpeople can write god-awful interfaces and be praised for years
01:07devnenlive is case and point
01:07devnit's still a standard, and it is terrible
01:07ibdknoxis it?
01:07ibdknoxI've not seen a single open source project that uses it
01:07ibdknoxlol
01:07ibdknoxthat was a big problem Raynes had with it
01:08devnibdknox: im on several lists, someone recently said: "So what do I use from screen scraping?"
01:08devn5 people replied with enlive
01:08devnno other suggestions
01:08ibdknoxsure, it's actually pretty good at that
01:08ibdknoxnot so great for templating
01:08devnwhat?
01:08clojurebotwhat is short for ,(doc ...)
01:08devndude, that's ridiculous
01:08devnit's terrible for scraping
01:09devnit was built for templating, and scraping is an afterthought
01:09devnthat's how bad it is at scraping
01:10technomancydevn: 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
01:11devnmeh, 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
01:11technomancyif 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
01:11devntechnomancy: yeah, honestly i agree with hiccup. i really do like it
01:11devnand i dont think it's scary for newbs, despite what i was saying before
01:11devnit was obvious to me when i found it
01:11technomancyobviousness is tops
01:11devnyeah, absolutely.
01:12technomancyanyway, gotta head off
01:12devntake care phil
01:13matadonI'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.
01:13matadons/SASS/SCSS/
01:13ibdknoxI thought most people just used the compass watcher?
01:14devnibdknox: they can, but it bones you if you want to deploy to heroku
01:14ibdknoxah true
01:14devna gemfile means you get treated as a ruby deploy on cedar
01:15devnmatadon: im pulling for you, buddy. we'll get you sass and haml, i promise. :)
01:15devnive been working on a better haml-ish solution for clojure than haml-macro
01:15devnhaml-macro is decent, but it's buggy and incomplete
01:16matadondevn: I'd like that. I've just started playing with Clojure, and while I love the language, the tooling is *incredibly* frustrating.
01:17ibdknoxas requested: https://github.com/ibdknox/cljs-template
01:17ibdknox:D
01:17devn:)
01:18devnmatadon: honestly, it gets better, and honestly, if you're coming from Ruby the tooling is "easy" while it simultaneously ruins your life
01:18devnnothing is perfect. there is room for improvement, but i have a hard time looking at rvm and bundler and thinking it's magically delicious
01:19matadondevn: 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.
01:20devnlein 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.
01:20matadondevn: RVM is crap, Bundler was horrific for the first few releases, but the current Bundler works fairly well.
01:20devnyes, but even recently there was bundler hell to deal with
01:20devn0.9.2 rake + bundler => /me pukes blood
01:21devni stil find myself needing to randomly use bundle exec
01:21devnit'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
01:22devnim not trying to make excuses, that's just anecdotal evidence
01:22devnbut that's how i've felt lately
01:22dnolenmatadon: I wouldn't mess w/ lein2 just yet if you just want to get things done.
01:23devndnolen: i havent had a chance to read up -- what does lein 2 bring to the table?
01:23devnbe my rss feed. XD
01:24matadondnolen: Good to know; installing 1.0 still shows missing dependencies when trying to have a go with Compojure.
01:24devnbtw 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
01:24dnolendevn: cleaner design, faster REPL start, REPLy
01:24devnthanks for that.
01:24robinkraftcan 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.
01:24dnolennp, hopefully something comes of it.
01:24matadonAnybody in here actually successfully using Compojure, and if so, what do your deps look like?
01:25ibdknoxmatadon: you should give noir a go
01:25dnolenmatadon: 1.0 of what?
01:25ibdknoxmatadon: if you're new, it'll give you everything you need. http://webnoir.org
01:25amalloymatadon: https://github.com/4clojure/4clojure/blob/develop/project.clj
01:25devnim sure it will! dnolen: just let me interview them. i was part of the plan9 project and had a terrible experience.
01:25hiredmanrobinkraft: there aren't really any as far as I can tell, people tend to just attach a local profiler to the remote process
01:26devnill make sure we dont get any riffraff
01:26matadondnolen: 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.
01:26matadonamalloy: Thanks.
01:26matadonibdknox: Will check out Noir as well; I'm just exploring today. :)
01:26devnmatadon: how new to clojure?
01:26dnolenmatadon: you mean 1.7 right?
01:26amalloythough 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
01:27robinkrafthiredman: hmmm I'm not sure how that would work. Is that something I could do with jvisualvm?
01:27devnmatadon: have you checked out how cool the ns-* functions are? metadata? I remember those things blowing my mind.
01:27hiredmanyou can it, it takes some port forwards and some chicken blood
01:28devn&(map #(:doc (meta %)) (take 5 (map second (ns-publics 'clojure.core))))
01:28lazybotjava.lang.SecurityException: You tripped the alarm! ns-publics is bad!
01:28devnawwwww
01:28matadonmatadon: 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.
01:28hiredmanyou might also consider moving to "metric gathering" approach when deployed
01:29devnmatadon: why so heavy on JRuby? self study or for work?
01:29robinkraftI'm low on chicken blood, so maybe metric gathering is the way to go
01:29devnrobinkraft: no. never. err on the side of chicken blood.
01:29devn(this is important)
01:30robinkraftdevn: haha ok.
01:30devn,(ns-publics 'clojure.core)
01:30clojurebot{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, ...}
01:31devntwo bots in here...
01:31devni tell ya
01:31devn,(map #(:doc (meta %)) (take 5 (map second (ns-publics 'clojure.core))))
01:31matadondevn: Both? I often find myself needing to drop down into POJOs for performance, and really like having both proper threads and decent profiling.
01:31clojurebot("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.")
01:32hiredmanrobinkraft: 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
01:32robinkraftis 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!
01:33hiredmanoh, no
01:33devnperfstats hiredman?
01:33hiredmanyes for memory leaks you'll want a profiler, or to get good at reading code
01:33hiredmanhttps://github.com/sbtourist/nimrod
01:33devnJMeter + levand's perfstats is a nice combination, FWIW
01:34devn(for load and perf testing)
01:34devnit's a hook into incanter via jmeter
01:35matadonOkay, 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.
01:35matadonThere's no way the repos are that broken; it's got to be on my end.
01:35matadonThanks for the help, guys. :)
01:35devnmatadon: where are you trying to get them from?
01:36robinkraftok, 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
01:36hiredman:(
01:36hiredmanhadoop is not fun
01:36devnrobinkraft: lots of differences between a laptop and VMs, no?
01:36robinkraftoh man it's so true!
01:37matadondevn: Whatever the defaults with Lein1 are?
01:37hiredmanhttp://tech.backtype.com/the-dark-side-of-hadoop
01:37hiredmanthe forking oom can be a killer
01:37devnheh, great article
01:38robinkraftgood stuff hiredman, I'm glad I'm not alone
01:39robinkraftdevn: 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
01:39devnrobinkraft: binary search time.
01:39devn:)
01:40robinkrafteeeeek!
01:41robinkraftthought I'd nailed it last week - I thought there's no way my puny laptop could handle the code, but it does ...
01:49TEttingerIceland_jack, you wouldn't happen to write a blog called The Oblong, would you?
02:08muhoowhat's a good way to break out of a doseq loop, from the repl?
02:08muhoostart it in a separate thread maybe?
02:28TEttingeris there any way of leaving a message (using a bot) for someone who isn't here?
02:34hiredman /win 15
02:42amalloy$mail TEttinger here's a message for later
02:42lazybotMessage saved.
02:42TEttingerthanks
02:43TEttinger$mail snut Is your Clojure roguelike in LWJGL open source?
02:43lazybotMessage saved.
02:52forsakendaemonHey guys, probably a silly question, but is there any way to find out the signature of a function after it's been defined?
02:54forsakendaemonJust discovered clojure.reflect. Thanks!
02:56daakuis there an easy way to pipe clojure.tools.logging output to emacs?
02:56daakus/easy/any/
03:03forsakendaemonSpoke too soon, that doesn't seem to do what I need.
03:43dbushenkohi all!
03:43dbushenkodoes anyone use marginalia?
03:51y3didoes anyone know of a good emacs set up for new clojure hackers?
04:00raeky3di: try https://github.com/technomancy/emacs-starter-kit
04:00sritchieibdknox: good luck on the class tomorrow!
04:01raekit's also very easy to install clojure-mode with it (M-x package-install <RET> clojure-mode)
04:05y3dithanks raek
04:06fliebelAre there any examples of n-queens in core.logic around? Minikanren also acceptable :)
07:09jaleydoes 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
07:16clgvjaley: you can check whether it has a branch 1.3 with a recent commit
07:29jaleyclgv: can't see any obvious branches or tags. I'm guessing the code just hasn't been pushed to git yet
08:01tdrgabiIf I'd like to contribute to some clojure osource projects, where can I find one who needs a beginners help?
08:10gtrak``tdrgabi, what kind of stuff do you like?
08:11tdrgabigtrak``: 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.
08:11tdrgabibut I don't know what kind of stuff I like
08:11gtrak``web, games, etc.?
08:11tdrgabimaybe you could put some names of projects
08:12tdrgabigames is ok, web (but not too frontendy), would be nice to learn something hard like nlp or form recognition
08:12clgvtdrgabi: maybe you should first start to learn the language
08:12tdrgabiclgv: true, but there is no milestone on that. I can write some clojure already
08:13tdrgabibut I haven't learned it yet, probably won't happen in years
08:13clgvtdrgabi: ok, next step would be to use it for some of your tasks.
08:13tdrgabidid for some, got stuck in others.
08:13tdrgabithis will sound bad'ish, but even if I like to code, there's not much I want to do
08:13gtrak``tdrgabi, maybe play around with overtone, i made my first OS contribution this way :-)
08:14clgvI am currently adjusting incanter to my needs since I need to display properites of datasets
08:14tdrgabigtrak``: did you have an interest in music before?
08:14gtrak``yes
08:14gtrak``i wrote a bit of code to interface with a grid controller
08:15gtrak``tdrgabi, but I'm like you, I like learning more than doing
08:18tdrgabibesides incanter and overtone, anything else comes up?
08:18gtrak``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.
08:18clgvtdrgabi: what do you do in your "day job"?
08:19tdrgabiclgv: coding erlang for a financial company
08:19tdrgabiit's ok but not terribly interesting
08:19clgvok. if there were spots you always wanted to do better - you could have shot for that ;)
08:20tdrgabigtrak``: thanks, I'll try that
08:20tdrgabiclgv: yes, it's not such a bad idea
08:21tdrgabibut it's erlang
08:21clgvtdrgabi: learning new algorithm concepts and implementing them could be nice as well
08:21gtrak``upstream guys generally listen to use-cases more than accept code that might break stuff anyway
08:21tdrgabianyway, thanks guys
10:06deo__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:06deo__i tried (.method obj)
10:08deo__as in (.toString (js/Date.))
10:18mefestodeo__: i don't know much about clojurescript but have you tried (. obj method) ?
10:20mefesto(. (js/Date.) toString)
10:20gtrak`i think there's a dash syntax now
10:21gtrak`http://dev.clojure.org/jira/browse/CLJS-89
10:40fliebelAny minikanren pros around?
10:41gtrak`I'd like to be one someday :-), up to page 25 of reasoned schemer
10:47fliebelgtrak``: I read it, but I'm trying to play with cKanren, and I fail.
10:48cjfriszfliebel: what are you wondering about?
10:48fliebelI mean, == not found, what is that nonsense... http://pastebin.com/pJPD3Gz7
10:48cjfriszI actually have one of the implementers of cKanren right here
10:49Sebhi fellows
10:49fliebelcjfrisz: I'm trying to implement a stripborad layout generator... little bit like n-queens ;)
10:49fliebel*stripboard
10:49Sebwondering what's wrong with the 2nd test at https://gist.github.com/2029234
10:50SebI was trying, just for kicks, to "factorize" the call to 'count
10:50Sebeven 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:50fliebelSeb: your list is not quoted
10:51cjfriszfliebel: I take it you've read the n-queens example in the cKanren paper?
10:51fliebelit tries to call a with b
10:51vijaykiran(a b) means you are calling function a
10:51Sebhmm, but quoting that list yields "count not supported on this type: Symbol"
10:51Sebfliebel, vijaykiran: ^^^
10:51fliebelcjfrisz: Yea, but it's a little more complicated. However, now I'm just running into silly problems.
10:52cjfriszfliebel: what's going on?
10:52cjfriszIs there something for me to go look at?
10:52Sebso I'm not sure what the right way to do this actually is
10:52fliebelSeb: (list a b) or [a b] should work.
10:52dnolenfliebel: what's the issue?
10:52vijaykiranSeb: you may want to add a b to a list and try again
10:53fliebeldnolen, cjfrisz: Right now, this silly thing: http://pastebin.com/pJPD3Gz7
10:53cjfriszOh that
10:53Sebfliebel, vijaykiran: ok, got it
10:53Sebfliebel, vijaykiran: thanks guys, makes perfect sense now
10:53Sebcheers !
10:54dnolenfliebel: are you using the calvis cKanren repo from GitHub?
10:54vijaykiranSeb: the gist syntaxh highlighting is giving you a hint 'a' in bold :)
10:54Sebvijaykiran: well, yeah, I sorta knew why the 1st version wasn't working, I should have pasted the '(a b) one ;)
10:54fliebeldnolen: yes. The weird thing is, once I remove the connectedo... wait I know
10:54fliebelIt's not *that* == that is not found.
10:55fliebelIs there a listo in minikanren, or do I have to conso them all together?
10:56fliebelI can't remember if (== q (list w1 w2 w3)) is okay.
10:56dnolenfliebel: it is ok
10:56cjfriszThat should be okay
10:57dnolenfliebel: 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:58fliebeldnolen: yea, it's in minikanren.scm
10:58fliebelI'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:59fliebelRight 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:01yoklovif 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:01yoklove.g. should i just be using *in* and *out* or should i take params for the reader and writer
11:01@rhickeycompiler-options and disable-locals-clearing pushed, please try if interested
11:03fliebeldnolen, cjfrisz: victory! http://pastebin.com/ZbKZyf9e
11:03cjfriszCool cool
11:03TimMcSweet.
11:04fliebelIs there a way to expect a failed goal? To express 2 lanes should not be connected.
11:05cjfriszfliebel: short answer: yes
11:05cjfriszYou might have to write a not-connectedo
11:06TimMcSo *elide-meta* has been replaced with *compiler-options*.
11:06fliebelcjfrisz: Ok, it's not nearly as simple as... (== f# (connectedp)), or something like that.
11:07cjfriszfliebel: I doubt it
11:07jlongsterdoes Clojure have anything like `loop` that allows non-TCO calls, or are you supposed to just use recursive functions?
11:07cjfriszThat kind of relation is the reason that they added the constraint system
11:08devnjlongster: loop/recur
11:08jlongsterdevn: 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:09clgvjlongster: if you can bound recursion depth a priori then you are safe to use plain recursion otherwise there is trampoline for mutual recursion
11:10jlongsterclgv: yep, just curious if people ever ran into wanting to do mutual recursive inline inside a function
11:10clgvjlongster: 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:10TimMcjlongster: I'm trying to imagine a looping construct that *doesn't* map to tail position calls.
11:11TimMcI mean, isn't that the definition of a loop?
11:11jlongsterTimMc: I don't have a strong argument for them, but I come from the Scheme world
11:11yoklovletfn lets you do mutual recursion
11:11yoklovthats as best as i've got :/
11:12clgvyoklov: but with all the downsides of missing tail call optimization in the jvm ;)
11:12yoklovright
11:12cjfriszjlongster: I'm a Clojure-come-Schemer, too. You'll probably want to use letfn
11:12jlongster(let loop ((i 0)) (foo (loop (+ i 1)))) ; stopping condition omitted for brevity
11:12yoklovyou 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:12cjfriszI miss let loops, too
11:12yoklovi'm coming to clojure from scheme also :)
11:13jlongstercjfrisz: thanks! I'll look into it
11:13jlongsterI'm just doing research, not actually writing code right now
11:13Iceland_jackcjfrisz:
11:13Iceland_jackcjfrisz: fn can be named
11:14devntrampoline?
11:14clojurebottrampoline is http://groups.google.com/group/clojure/browse_thread/thread/6257cbc4454bcb85/3addf875319c5c10?#3addf875319c5c10
11:14devnsomeone mentioned mutual recursion
11:14yoklovtrampoline can be frustruating to use.
11:15yoklov(but on the whole it rules)
11:16cjfriszIceland_jack: that's true
11:18RobertLJhi fogus .. if you are around I have a question for you .... about core.cache
11:19RobertLJI have been working on porting a few od the clojure contrib libs to use on clojureCLR .. and I have a question or two
11:24RobertLJThe error I am seeing is: "Unhandled Exception: clojure.lang.Compiler+CompilerException: clojure.lang.CljCompiler.Ast.ParseException: Must hint overloaded method: assoc
11:24RobertLJ"
11:26cjfriszQuestion 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:26cjfriszAnd is there a known solution for this?
11:26RobertLJcode and the error is: https://gist.github.com/2029389
11:29clgvRobertLJ: maybe you have a name conflict between clojure.core/assoc and that protocol-method
11:30clgvRobertLJ: you can use :refer-clojure to :exclude 'assoc
11:31TimMccjfrisz: Give an example, like (foo [bar|]) + \] = (foo [bar])|
11:31RobertLJhuum ok .. clgv .. will take a look at that .. thanks
11:32fliebelcjfrisz: Hm, I'll leave it for now, or I'll break my mind. To many unsolved problems at once.
11:32cjfriszTimMc: That's exactly it
11:34TimMcUnfortunately, I don't have SLIME set up...
11:35cjfriszI 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:39tmcivercjfrisz: yes, that happens for me too. I just usually C-f through the closing square bracket so that doesn't happen.
11:40cjfrisztmciver: That's probably a better solution than mine, but still...ugh
11:40cjfriszThere's got to be a way to fix that
11:41cjfriszLooks like I'm digging in on some Emacs Lisp in the near future.
11:41tmcivercjfrisz: yes, I agree. I've long wished you could just TAB through the closing bracket/paren.
11:41pandeiroi'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:42TimMcpandeiro: Do you need coordination between multiple documents?
11:42pandeiroTimMc: the long-term answer is possibly yes, right now for this simple prototype, no
11:42TimMcIf updates are independent, use atoms.
11:43pandeirogotcha
11:46pandeiroTimMc: 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:49TimMcpandeiro: Why not a collection of atoms?
11:50pandeiroTimMc: ah ok, so the collection itself doesn't need to be an atom
11:56TimMcIt could be!
11:56TimMcYou could manage collection membership with an atom, and the members could be atoms as well.
12:03dnolenfliebel: did you get your problem sorted out?
12:03fliebeldnolen: I let it rest, there is to much stuff i have no solution for at present.
12:04dnolenfliebel: around describing the problem?
12:04fliebeldnolen: How to express the many constraints and how to represent the data.
12:06dnolenfliebel: as in, the example in the paper didn't shed any light on how to best describe the constraints for you?
12:06fliebeldnolen: The example? You mean n-queens?
12:07dnolenfliebel: n-queens, send-more-money - I think they have another in the tests?
12:07fliebeldnolen: It helps, but there are 2 things that make the problem a bit more involved.
12:08dnolenfliebel: which 2 things?
12:08fliebeldnolen: 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:09fliebeldnolen: So 2 parts on the same lane can be disconnected, and 2 parts on a different lane can be connected.
12:09dnolenfliebel: ah so the issue is you think you need to be able to remove a constraint?
12:10fliebeldnolen: I don't know.
12:11dnolenfliebel: are you trying to implement something that is described somewhere that I can read?
12:12fliebeldnolen: You could read about stripboards and schematics, but this is not some exercise that has its own wikipedia page.
12:13fliebeldnolen: I could explain the problem in more detail in an appropriate place.
12:14dnolenfliebel: you've got a blog don't you ;)
12:15TimMcfliebel: Does this have anything to do with breadboards?
12:15fliebeldnolen: I usually blog about things that already work, but I guess I could describe the problem.
12:16fliebelTimMc: Yea, a stripboard is like a breadboard with coper strips on its back, i guess.
12:17fliebelTimMc: I want to translate this schematic graph to a stripboard layout.
12:17TimMcOh, I see -- you actually solder to it, it's like PCB.
12:18dnolenfliebel: 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:19TimMchurrrkkk https://upload.wikimedia.org/wikipedia/commons/d/d1/Computerplatine_Wire-wrap_backplane_detail_Z80_Doppel-Europa-Format_1977.jpg
12:19dnolenfliebel: would be useful to see how you would do it in plain 'ol Clojure as well.
12:19fliebeldnolen: Ok, I'll describe the problem as best as I can.
12:20cjfriszTimMc: And the problem is? :-|
12:20fliebeldnolen: I guess that knowing how to do it in plain Clojure helps doing it in minikanren... but... I don't know.
12:22dnolenfliebel: heh, well that makes two of us ;)
12:24fliebeldnolen: It's good to remember computers never think for you, which is secretly what I hope for when using minikanren.
12:56ibdknoxA bunch of folks here were asking for this, so in case you missed it last night: https://github.com/ibdknox/cljs-template
12:56ibdknoxI think that's about as simple as I can make starting a clojurescript project
12:56RickInGAwow, cool
12:58technomancyibdknox: "Copyright (C) 2011 FIXME" in the readme
12:58ibdknoxoh no's
12:58technomancyyeah, shame on you for not using unicode. =)
12:58TimMcOHNOSE
12:59technomancyibdknox: also: adding :url "http://example.com/FIXME&quot; to the project.clj would be great
12:59ibdknoxRickInGA: we'll use it in the class :)
12:59technomancytrying to encourage folks to add more metadata to their project.cljs
13:00RickInGAhow does one get lein2?
13:00ibdknoxtechnomancy: done
13:01ibdknoxRickInGA: I'd stick with 1.7 for now
13:01technomancyibdknox: cool
13:01pandeirowill lein2 be available via lein upgrade?
13:01technomancypandeiro: yeah
13:01TimMclein dist-upgrade
13:01TimMc:-P
13:01RickInGAah, looks like the script on the git page pulls version 2
13:02RickInGALEIN_VERSION="2.0.0-preview2"
13:02technomancyhm; I should make the distinction more clear in the readme
13:05ibdknoxtechnomancy: yes please :) It seems to be a current source of confusion
13:10RickInGAibdknox: that looks pretty cool! amazing how quick it is to get up and running
13:10ibdknoxthe magic of computers :)
13:11RickInGAabout 15 min ago I finished the example from programming clojure that has you upload an app to heroku, again simple
13:12RickInGAmy 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:12ibdknoxRickInGA: what did the example use?
13:12ibdknoxcompojure?
13:12clojurebotcompojure is http://github.com/weavejester/compojure/tree/master
13:12ibdknoxlol
13:12ibdknoxthanks clojurebot :p
13:12RickInGAibdknox noir.
13:12ibdknoxoh cool
13:13ibdknoxI forgot about that. I should probably pick up a copy of the book, huh?
13:13RickInGAI got bought the pdf from the publisher, not sure if the hardback is out yet
13:13RickInGAI will have it with me in class if you want to look at it tomorrow
13:14ibdknoxtechnomancy: I think those readme changes will remove a lot of confusion :)
13:14RickInGAShould I have a database installed for class? I have mongo already
13:14ibdknoxRickInGA: yeah, that'd be great :)
13:14ibdknoxRickInGA: nope
13:14ibdknoxwe'll run it off my machine
13:14ibdknox /heroku if we need to
13:15technomancyibdknox: on the other hand now that lein-ring and lein-midje are upgraded, the number of incompatibilities should be quite small
13:15ibdknoxtechnomancy: 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:16ibdknoxat 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:17technomancytrue
13:17technomancyI'll add a stub plugin task that points people to the upgrade guide
13:17technomancythat seems to be the most common hang-up
13:17ibdknoxgood idea
13:21tmciveribdknox: what is this class you mentioned above? When/where is it taking place?
13:21ibdknoxtmciver: ClojureWest tomorrow and thursday
13:22tmciverAh yes. Too bad I'm not going.
13:22ibdknoxif there's interest, I'd considered doing another one at some point
13:26spoon16anyone know how to use leiningen with an Ivy repository?
13:27RickInGAibdknox how do I get to a repl from my new cljs app? (I use emacs)
13:28technomancyspoon16: ivy repositories are just maven repositories, right?
13:29ibdknoxRickInGA: you just need to uncomment the repl/connect line in main.cljs
13:29RickInGAthx
13:29ibdknoxafter that I'm not sure how to start a clojurescript repl in emacs
13:29ibdknoxsince I use vim
13:37jaleyhow 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:37spoon16technomancy, except that they don't necessarily have pom files
13:37spoon16we have a massive ivy repository that has only .xml files
13:37technomancyspoon16: oh, ok. that's not going to work.
13:38jaleytechnomancy: 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:38dnolenjaley: new habits are hard to form?
13:39ibdknoxpre and post are also extremely ugly
13:39spoon16technomancy: would you be interested in providing me some guidance on how to make it work?
13:39jaleydnolen: well if that's the only reason i'm going moderately and carefully nuts with them
13:39ibdknoxdrives me crazy
13:39dnolenjaley: 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:39technomancyspoon16: I've never used ivy, but I can try to help
13:40jaleydnolen: well i was thinking at public interface level for a namespace it might help make api usage errors less cryptic
13:41jaleydnolen: i.e. "must have a :id field" is easier to debug than NPE from Integer/parseInt?
13:41spoon16technomancy: 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:42dnolenjaley: definitely
13:42cemerickFYI: Mostly λazy Episode 0.0.5: @chouser at Clojure Conj 2011 http://wp.me/p1Y10D-1g
13:43ibdknoxjaley: I kinda wonder if there's library waiting to make api-level errors easier
13:43technomancyjaley: part of it is that AssertionErrors are kind of weird IIRC
13:43ibdknoxit's something that we don't do a great job of
13:43RickInGAcemerick I really like those podcasts… keep em coming!
13:43ibdknoxI tried making some of them a lot better in Noir
13:44ibdknoxso there's at least some sensible explanation
13:44cemerickRickInGA: Thanks; the queue is empty now, though I'm sure it'll fill up at ClojureWest again.
13:44clojurebotOk.
13:44cemerickI didn't mean for it to be a confererence podcast, but time is short for recording stuff otherwise :-(
13:44jaleytechnomancy: presumably they're RuntimeException-derived?
13:45technomancyjaley: they are not
13:45technomancy,(ancestors AssertionError)
13:45clojurebot#{java.lang.Throwable java.lang.Error java.io.Serializable java.lang.Object}
13:46jaleytechnomancy: ah. so... how?
13:46ibdknoxyeah, I've found pre/post doesn't really give you the right level of error message
13:46ibdknoxit's better than nothing
13:46ibdknoxbut still not what we should shoot fo
13:46ibdknoxr
13:47technomancyjaley: (catch Exception ) won't catch them
13:47ibdknoxcemerick: 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:47dnolentechnomancy: you should be catching pre/post as far as I can tell anyhow.
13:48technomancydnolen: you mean catching Error?
13:48dnolentechnomancy: I just mean pre/post assertions shouldn't be caught
13:48fdaoudibdknox: noir comes with hiccup but what if one wants to use a more recent version of hiccup?
13:49spoon16technomancy: 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:49technomancydnolen: right, it's just that the distinction is not well-understood
13:49jaleydnolen: well I guess a failing contract is an indication of programmer error and should be treated as fatal?
13:49dnolenjaley: defintely
13:49ibdknoxfdaoud: you can exclude hiccup from noir I think
13:49dnolenjaley: pre/post is for development
13:49dnolenjaley: there's a flag to turn them off.
13:49technomancyspoon16: that's an option, though I suspect you could find existing tools to convert it to a maven repo
13:49fdaoudibdknox: ah, exclude it and then add a dep on the version I want, as in maven?
13:49jaleydnolen: yeah, *assert*?
13:49dnolenjaley: yes
13:50ibdknoxfdaoud: 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:50jaleydnolen: would be quite useful to set that in the dev profile with lein i guess
13:50cemerickibdknox: 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:51jaleydnolen: well, maybe not as a default for everyone, but for me personally I mean :)
13:51ibdknoxcemerick: ah
13:51fdaoudibdknox: thanks! btw I watched your cljs/noir/music screencast, that was cool. thanks for posting that.
13:51technomancyjaley: it's already on by default
13:51technomancyit's turning it off in production that you'd need to do
13:51ibdknoxfdaoud: np :) noir-cljs makes some of that stuff less of an issue
13:51jaleytechnomancy: ah yeah]
13:51ibdknoxfdaoud: also the game thing is way cooler than the overtone controller one
13:51ibdknox:)
13:51technomancyI'm hesitant to include a production profile by default since everyone's needs will vary
13:52dnolenso it looks you can now configure locals clearing and you can elide metadata in 1.4.0
13:52jaleytechnomancy: well I guess it's common to want multiple production profiles anyway
13:52technomancyjaley: semi-common
13:52fdaoudibdknox: which one is that?
13:52dnolen~max
13:52clojurebotMost users ever in #clojure: 404
13:53ibdknoxfdaoud: http://www.chris-granger.com/2012/02/26/connecting-to-your-creation/
13:54cemerickdnolen: that response was hardcoded some weeks ago
13:54cemerickthe max command in both bots has been broken ~forever
13:54fdaoudibdknox: thx, I'll check it out
13:55dnolencemerick: heh
13:55fdaoudI 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:56ibdknoxfdaoud: that one is just 5 minutes demoing
13:58mefestowhen 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:59spoon16technomancy: 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:59spoon16.jar files.
13:59technomancymefesto: that's what profiles in lein2 are for
13:59spoon16technomancy: I haven't worked in any other Java shops, but this must be a pretty normal tool used by larger orgs
14:00TimMcspoon16: "a bunch of actu<linebreak>.jar files"
14:00technomancyspoon16: yeah, I think it's likely that there's already something to do that for you independent of leiningen on the server side
14:00technomancythat would be my guess anyway
14:01fdaoudibdknox: ah ok, I'll make sure to have something else cued up :)
14:01gfredericksdangit I cannot find amalloy's useful library on google due to its having too generic a name
14:02TimMcgfredericks: flatland/useful
14:02gfredericksah ha
14:02gfredericks'flatland' is the name that escaped me
14:02gfredericksTimMc: thanks
14:02TimMcI debated whether to tell you.
14:02gfredericks:P
14:02TimMcIt's a terrible name.
14:02gfredericksI know you hate it
14:02TimMc(OK, the name isn't bad, just the Maven coordinates)
14:03TimMcSo I guess that's unrelated to the searchability.
14:03spoon16technomancy: I'll spend some time looking/learning
14:04TimMc&(apply str "lib-" (repeatedly 4 #(rand-int 10))) would be a much better name.
14:04lazybot⇒ "lib-3019"
14:04gfredericksnow if only I could remember why I wanted the library
14:05gfredericksTimMc: :P
14:05gfredericks$google lib-2367
14:05lazybot[fredericksgary/lib-2367 - GitHub] https://github.com/fredericksgary/lib-2367
14:05TimMcyep
14:06TimMcgfredericks: And you'll never have to rename it, even once the scope drifts.
14:06gfredericksgood point
14:06gfredericksnew scope: "functions that return the number 2368" <-- oh crap!
14:06TimMc(Whereas lein-uberjit -> lein-jit -> lein-otf)
14:08frouis the best strategy for an integration-challeneged editor to send text over a socket to a terminal repl?
14:08gfredericksI'm surprised useful.debug doesn't have a macro that takes a var and wraps it in input/output logging
14:08frouand have the output shown in the terminal somehow
14:08TimMcgfredericks: Patches welcome, I bet.
14:08gfredericksTimMc: I'm on it!
14:10gfredericksdang they got some non-trivial branching techniques going on here
14:10mefestotechnomancy: 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:11technomancymefesto: more or less
14:12technomancyyou could just use resources instead of prod/resources
14:13mefestowouldn't it need to be either or? in dev mode would it be guaranteed that dev/resources is resolved before resources?
14:14mefestomeaning as the resource myapp/db.clj is looked up it is first searched in dev/resources -- if not found, then searched in resources
14:14technomancydev/resources should take precedence, yeah. double-check for yourself though.
14:15TimMcgfredericks: Open a feature branch off of develop, I guess?
14:16mefestohow are users of lein-ring currently dealing with different datasources per environment?
14:16gfredericksTimMc: I'll probably just push up my own first so I can start using it and then ask amalloy later
14:16mefestoim guessing environment variables?
14:17ibdknoxmefesto: I don't use lein-ring, but with noir we just pass prod/dev to lein trampoline run or we use env vars
14:17TimMcgfredericks: or Raynes
14:18gfredericksyeah
14:18gfredericksRaynes: yo
14:21mefestoup 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:22technomancymore complicated configurations are a lot easier to handle by slurping off the classpath
14:22ibdknoxyeah, I guess I should be clear, we use an env var to say what mode we're in
14:22TimMcgfredericks: 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:22TimMc*to a version branch off of 'develop'
14:22ibdknoxwe read in the specific mode's config after that
14:25gfredericksTimMc: you sure about the "merged into master and develop" part?
14:25TimMcyep
14:25gfrederickshow do I auto-load clojure.repl for my clojure-jack-in user ns?
14:25TimMcgfredericks: But that's their job. I think feature branches probably get rebased into develop.
14:26technomancygfredericks: nearly everything in clojure.repl has an enhanced slime equivalent
14:26TimMcgfredericks: Looks like they're doing this: http://nvie.com/posts/a-successful-git-branching-model/
14:27gfrederickstechnomancy: :( I have to know two ways to do everything don't I
14:27technomancygfredericks: there's no good way to go back to the 1.2 model of having doc available everywhere
14:30mabesneed 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:30randomizerhi ;)
14:30randomizer,(clj-time.format/unparse (formatters :date-hour-minute-second) (now)))
14:30clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.PrivilegedActionException: java.lang.ClassNotFoundException: clj-time.format>
14:30mabes(the gist is obviously a reduced case)
14:31randomizer=> 2012-03-13T18:23:17
14:31tremolomabes: you need to unquote the name var
14:31randomizerHow can I sort a seq with dates like that?
14:31bhenryhello guys. is there anything that already exists like (x (coll)) => [(first coll) (rest coll)] ?
14:32gfredericks(juxt first rest)
14:32bhenryhaha juxt again!
14:32ibdknox~juxt
14:32bhenrythanks.
14:32clojurebotjuxt is a little hard to grok but it's the best thing ever
14:32ibdknox~juxt
14:32clojurebotjuxt is usually the right answer
14:32cjfriszOh that's awesome
14:32cjfriszThat was a question I never knew I wanted the answer to
14:32dan_bunless the quesation is "another beer?"
14:33gfredericksthe quesation is always "another beer?"
14:33bhenry(juxt first rest) is kind of like the 99 bottles of beer song
14:33yoklovi love doing (map (juxt :somekey :otherkey) vector-of-maps) to get columns of things
14:33randomizercan juxt sort my seq?
14:33dan_buse a lazy seq and you can have infinte beer
14:34randomizermhhhh infinte beer
14:34ibdknoxrandomizer: ##(doc sort-by)
14:34lazybot⇒ "([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:34gfredericks(def sort (comp first (juxt sort)))
14:35randomizeryah, the problem: string implements compare but that is not what I want to do
14:35gfredericksrandomizer: what do you want to do?
14:35bhenryrandomizer: 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:36randomizerI get timestamps by (clj-time.format/unparse (formatters :date-hour-minute-second) (now)))
14:36randomizerand store them in a seq
14:37bhenryyou want to (sort-by parse dates)
14:37randomizer({:key "todos_06e9642f0bfe4216830500193100c5fa", :value #x.y.z{:open true, :created "2012-03-13T18:23:17"}} , ....
14:38randomizer(sort-by :value.create collection) << does not work
14:38randomizer:value.created
14:38bhenryrandomizer (sort-by (comp parse :created) coll)
14:39bhenryoh
14:39bhenryi misread value
14:39bhenryrandomizer (sort-by (comp parse :created :value) coll)
14:39bhenryparse being whatever turns that back into a datetime
14:40randomizerjava.lang.RuntimeException: Unable to resolve symbol: parse in this context
14:40bhenryyeah 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:41bhenryalthough, sorting by those strings should work
14:41bhenryjust leave out the parse i guess
14:41bhenryrandomizer (sort-by (comp :created :value) coll)
14:42randomizerthx bhenry
14:42TimMc&(sort-by #(doto % (println)) [1 5 2 9 6])
14:42lazybot⇒ 1 5 5 2 1 2 5 9 9 6 5 6 (1 2 5 6 9)
14:43mabestremolo: thanks.. I did try that before but I end up with a different problem.. how do I unquote fn-name in this case?
14:43mabes(defmacro macro-test [name] `(let [fn-name# (symbol (str "prefix-" ~name))] (defn fn-name# [] 42)))
14:43TimMc&(sort-by (memoize #(doto % (println))) [1 5 2 9 6])
14:43lazybot⇒ 1 5 2 9 6 (1 2 5 6 9)
14:44randomizer,(comp :x :y)
14:44clojurebot#<core$comp$fn__3703 clojure.core$comp$fn__3703@1553d18>
14:44raekmabes: do you want (macro-test foo) to expand into (defn prefix-foo [] 42)?
14:44bhenry,((comp :x :y) {:y {:x 1}})
14:44clojurebot1
14:45mabesraek: yes, and I want it to be able to work with (let [my-name "foo"] (macro-test my-name))
14:45raekboth are not possible
14:45mabesthat is why I'm having such a hard time!
14:45randomizerwow,... awesome
14:46raekmabes: def requires the name at compile time, but (let [...] ...) requires it to be available first at run-time
14:46TimMcI'm dubious.
14:46raekmabes: if you *really* need to do this, consider using the namespace manipulation functions directly
14:46raekmabes: check out 'intern'
14:46TimMcraek: I think you're wrong.
14:47TimMcOh, hmm... you're right about let vs. def, sorry.
14:48TimMcmabes: WHy are you trying to use let to provide a symbol to def?
14:49raekmabes: 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:50TimMcraek: (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:50mefestothis is the route i was going to take for configuration. reasonable or am i doing something terrible? :) https://refheap.com/paste/1054
14:51raekTimMc: gotcha :)
14:51mabesTimMc, 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:51mefestois there a way to edit a post in refheap?
14:51mabess/korma and has/korma and it has/
14:52TimMcmefesto: Yeah, bug Raynes to fiddle with the database.
14:52raekmabes: 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:52gfredericksman how often do I need to type M-x paredit-splice-sexp before I go pick a keybinding for it
14:52TimMcmefesto: (No, you have to have pasted while signed in.)
14:52ibdknoxmabes: you don't have to use defdb
14:52TimMcgfredericks: And paredit-convolute-sexp?
14:52mefestoTimMc: ah i see
14:53gfredericksTimMc: no way does that exist
14:53TimMcTotally exists.
14:53TimMcmefesto: slurping a CLJ resource seems pretty standard,yeah
14:54ibdknoxmabes: you can set the default manually, give me two seconds and I'll make that even easier
14:54mefestohere's an updated post which shows how im referring to the datasource from middleware: https://refheap.com/paste/1055
14:54mabesibdknox: 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:54mefestojust want to make sure im not doing something awful :)
14:56mabesibdknox: 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:56raekmabes: 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:56mabesraek: I know that, but if you look at defdb it is in turn calling defonce
14:57mabesraek: 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:58raekdef vs defonce is just a development convenience feature
14:58bobhopeDo 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:58raekand is probably not relevant to the db stuff
14:59mabesraek: 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:59raekthat should normally be the case
14:59raekmacros are contageous... :-)
14:59mabesyeah..
14:59raekclojurebot: macro club?
14:59clojurebotCool story bro.
14:59ibdknoxmabes: hot off the press: https://github.com/ibdknox/Korma/blob/master/src/korma/db.clj#L52
15:00ibdknoxmabes: korma 0.3.0-beta6
15:00mabesibdknox: :) thanks! I'll pass this along and have it start using this, it will be much easier
15:02ipostelnikwhat are some good resources to bring someone new to clojure up to speed?
15:02mabesibdknox: nice that it is now analogous to defentity too :)
15:03ibdknox:)
15:04gfredericks~macros
15:04clojurebotBarking spiders!
15:05robinkraftfor 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:05robinkraftfor example: (defn ones-or-neg [val] (cond (= 1 val) true (< val 0) true :else false))
15:07RickInGAdnolen could you help me get a clojurescript repl working in inferior-lisp?
15:08dnolenRickInGA: ClojureScript wiki instructions not working?
15:08RickInGAwhen I run it I get exeption in thread main java.lang.noclassdeffounderror: clojure/main
15:09dnolenRickInGA: have you set CLOJURESCRIPT_HOME in your shell environment?
15:09RickInGAdnolen I set it up in my .profile (osx)
15:09ibdknoxalternatively, you could start one with lein-cljsbuild
15:10dnolenRickInGA: and in .bashrc as well
15:10dnolenRickInGA: I agree w/ ibdknox, hooking it up to lein-cljsbuild better
15:10ibdknoxjust add this to your project: :cljsbuild {:builds [{}]}
15:10RickInGAdnolen ok, how would I do that?
15:10ibdknoxand install lein-cljsbuild
15:11RickInGAibdknox add that to the project.clj file?
15:11ibdknoxthen do lein trampoline cljsbuild repl-listen
15:11ibdknoxRickInGA: yep
15:11ibdknoxI'm adding that to the template, so that people can start their repls that way
15:16bsteuberRickInGA: but start the repl with lein1, not lein2
15:16RickInGAbsteuber using lein 1.7, thx
15:20bsteuberibdknox: just wrote a wrapper function over crate/html that removes the crateids
15:20bsteuberwhy do you need them, anyways?
15:20ibdknoxbsteuber: to do more interesting things with them
15:21ibdknoxbsteuber: for example delegating handlers to all things ever created by that function
15:21bsteubermore than being able to write ($ foo) instead of ($ :#foo) I guess ^^
15:21ibdknoxbsteuber: oh wait, crate-id
15:21ibdknoxyeah that should get removed
15:21ibdknoxsend a pull request
15:21ibdknoxI only care about crate-group
15:22ibdknoxwhich should only be at the defpartial level :)
15:22bsteuberah I also confused both
15:22bsteuberand what is that for?
15:22ibdknoxcrate-id was there because gclosure event handling sucks
15:22ibdknoxand I was needing to do some stupid things when I was cloning elements
15:23bsteuberah okay
15:23ibdknoxI'll fix, once second
15:23bsteuberI don't really mind about defpartial as I write (defn foo [] (h [:div ...])) instead
15:24bsteuberh being my shortcut for crate/html
15:25daakuis there some hook to allow the slime repl to pprint instead of print results?
15:25bsteuberbut even with the partials, if you mean "all things ever created by this" don't you want to use a class instead?
15:26ibdknoxI don't like adding classes to people's code
15:26ibdknoxsince that has other potential implication
15:26devntechnomancy: lein 2.0 and robert-hooke is broken :\
15:26bsteubersure, I rather mean relying on the user to use classes in that case ^^
15:26Apage43speaking of lein 2.0
15:26Apage43if I wanted to start playing with it
15:29bsteuberibdknox: or are there cases in which crate needs control of all created partials independent of what the user does?
15:29ibdknoxnope
15:30ibdknoxbsteuber: https://github.com/ibdknox/crate/commit/66f6b13f1c43a9fd2f7de0d6cc845371a207c807
15:30bsteuberibdknox: nice, thanks
15:31ibdknoxalpha2 has been pushed to clojars as well
15:32fliebelWhere is all-difffd defined? Oh, another naming change, I guess it's distinctfd?
15:33amalloyrobinkraft: 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:34RickInGAibdknox: 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:34amalloygfredericks: paredit-splice-sexp? isn't that M-s?
15:35gfredericksamalloy: yeah urxvt captures that for some reason
15:35robinkraftamalloy: it can get a little quiet in there at times, so thought I'd look elsewhere. It's perked up a bit though :)
15:35amalloy(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:35ibdknoxRickInGA: yeah, though that should be unnecessary I think
15:35gfredericksamalloy: I need to avoid the arrow keys, which I think tmux hates
15:36amalloymefesto, TimMc: i think you can edit on refheap if you're signed in when you create the paste
15:36TimMcyep
15:37RickInGAibdknox when I try to start the repl I get "no 'xpc' param provided to child iframe
15:37TimMcamalloy: convolute doesn't have a binding in my Emacs 23
15:38amalloyif 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:39TimMcBound to backward-sentence here.
15:41amalloyright. nothing useful :P
15:43TimMcah, yes
15:43amalloyduring 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:44RickInGAwill fight with my configuration more later….
15:56mefestoin 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:57devntechnomancy: disregard. i made a mistake.
16:08gfrederickshow do I build one of these old-contrib projects with maven? 'mvn package' gave me an empty jar
16:09clj_newbHi, in lamina I'm trying to create a named-channel with a creation callback, can this callback have more than one parameter ?
16:09clj_newbin the example the creation callback has only one parameter
16:10clj_newband in the lamina code, when invoking the callback only the ch variable (channel) is passed as arguments
16:15technomancyApage43: see the upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading
16:16technomancyclojurebot: Leiningen 2 is still in a preview release, but see the upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading
16:16clojurebotYou don't have to tell me twice.
16:16gfredericksclojurebot: lein2 is Leiningen 2
16:17clojurebotIk begrijp
16:17gfredericks~lein2
16:17clojurebotlein2 is still in a preview release, but see the upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading
16:17gfrederickswhat a guy
16:17Apage43technomancy: thanks, found it :)
16:17technomancygfredericks: nice
16:17Apage43anyone using lein2 with vimclojure/nailgun?
16:18dougx@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:19technomancydougx: you shouldn't have to set $CLASSPATH
16:19dougxok, undoing that
16:19technomancydougx: your best bet is to install rlwrap
16:20technomancyjline 1 from leiningen 1.x is pretty crappy
16:24dougx@technomancy: made some progress - now getting this https://gist.github.com/2031246#file_error_2
16:25dougxafter installing rlwrap
16:25technomancyhow did you install it?
16:25gfredericks"made some progress - now getting this" is a good summary of development in general
16:26ohpauleeztotal side note, I'm WAY amped up for Clojure/West
16:26gfredericksup to 11?
16:26technomancygfredericks: "now it's broken in new and unexpected ways!"
16:26ohpauleezgfredericks: ALL the way up to 11
16:26technomancy"brought to you by Windows 7"
16:26gfrederickstechnomancy: never boring
16:26dougxapt-get install rlwrap on ubuntu 11.04
16:26ohpauleezI gave a preview of my talk to Philly Lambda last night, and today to my colleagues
16:27technomancydougx: oh, I mean leiningen
16:27dougxoh, downloaded the script, added it to ~/bin and chmod +x lein
16:27technomancywhich script?
16:27dougxhttps://raw.github.com/technomancy/leiningen/stable/bin/lein
16:28technomancyhm... try "lein self-install" after clearing out ~/.lein/self-installs
16:28technomancycould have been the download was corrupted or something
16:29amalloy"maybe the download was corrupted???" - developer-speak for "i dunno, man"
16:29gfrederickscosmic rays flipping bits
16:29dougxi'm trying https://raw.github.com/technomancy/leiningen/preview/bin/lein
16:29technomancyamalloy: the tachyon inverter array was out of alignment
16:31TimMc(╯°□°)╯︵ 0100111010101001
16:31TimMcHmm, YMMV dpeending on font.
16:32TimMc&one?
16:32lazybotjava.lang.RuntimeException: Unable to resolve symbol: one? in this context
16:32TimMcWhatcha got against one? ?
16:32gfrederickswhoops I meant to start at one
16:32technomancygfredericks: porting activesupport to clojure?
16:32gfredericksha
16:32TimMc&(zero? 0N)
16:32lazybot⇒ true
16:32gfredericksI already have a library that converts numbers to words so the rest would be a tiny macro
16:33amalloyhe's got ninety-nine predicates, but one? ain't one
16:33TimMcpffft
16:33gfredericksor I could just cover all possible cases with (defn function-missing [fname & args] ...)
16:35fliebel$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:35lazybotMessage saved.
16:36TimMcMail one, highlight the other? :-)
16:36amalloyi think he mailed neither
16:36TimMccomma?
16:36amalloyyeah
16:36TimMccommas are whitespace, whatchoo talkin' about
16:37gfredericksTimMc: so if I add a comma to my nick I could be unmailable!
16:37amalloyyes, just checked, that mail went to nobody, fliebel
16:37TimMcgfredericks: I'd like to see that.
16:37amalloy$login
16:37lazybotYou've been logged in.
16:37amalloy$unmail fliebel dnolen,
16:37lazybotDeleted unread messages from fliebel to dnolen,
16:37amalloy$logout
16:37lazybotYou've been logged out.
16:38gfredericksTimMc: gfredericks, is an erroneous nickname
16:38TimMcyep
16:39dougx@technomancy: the preview release is working - thanks!
16:40technomancycool
16:40amalloy"the stable version doesn't work, so i'm trying the bleeding-edge version. works great out of the box!"
16:41technomancywelcome to Clojure =)
16:42amalloyhah, indeed
16:42dougxamalloy: i'm retrying stable again now that i've removed leiningen-1.7.0-standalone.jar
16:43gfredericksso it's the stable releases that are bleeding?
16:43gfredericksmaybe that's just too oxymoronic
16:45dougxhehe
16:46dougxcool, stable works now - the download was corrupt
16:48technomancylet that be a lesson: never trust curl.
16:49TimMcmd5 that shit
16:49dougxyep
16:49technomancyactually I thought lein 1.7 did use a checksum
16:50technomancyoh nope; it checksums clojure.jar because it puts it on the bootclasspath
16:51TimMcbcrypt it, just be sure
16:51TimMc*to be
16:51TimMctechnomancy: How goes the hash migration?
16:52technomancyTimMc: 15% or so
16:52TimMcnoice
16:52technomancyat some point I'd like to see how many who have deployed in the last N weeks are still unhashed
16:52TimMctechnomancy: Any chance you could put a message in the scp acceptance message? :-P
16:53TimMcA MOTD kind of thing.
16:54technomancyoh yeah, I forgot we have access to that output stream
16:54technomancygoood idea
16:54TimMcsweet
16:55gfredericks"Update your account today and receive 15% off your next upload"
16:55technomancy"Clojars BCrypt Pro Verified account"
16:55TimMc"... Gold"
16:56gfredericks"...in bed"
16:56TimMc"Earn the BCrypt achievement badge"
16:56TimMc$dec gamification
16:56tmcivergfredericks: Hey! this is a family channel! ;)
16:56lazybot⇒ -1
16:57gfrederickstmciver: hey it was still a euphemism
16:57TimMcAnyone 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:00TimMcBasically, 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:03RickInSJibdknox: in your new project.clj file for the cljs template, I think you need :plugins [[lein-cljsbuild "0.1.2"]]
17:03netrealmIf I want to run a function every minute, is an agent the right thing to use, or is there a better construct?
17:03technomancynetrealm: look into Executors for that
17:03RickInSJwhen I tried lein trampoline without it, trampoline was not a supported command
17:04fliebelamalloy: Oh, so I should email them separately?
17:04amalloyindeed. i'd just /msg lazybot twice
17:04netrealmtechnomancy: Awesome, thanks.
17:16jondothi 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:16jondoti've seen compojure (not sure about mimetype detection), noir (same) so far; and continuing on with compojure rather than noir
17:18weavejesterjondot: Compojure (and, I believe, Noir) mimetype detect static files and resources by their extension
17:18weavejesterjondot: So foo.txt is reported as a text/plain and so forth.
17:19jondothowabout letting me write each response type such when i'm getting a POST with application/json, application/xml, or application/html ?
17:19jondoti'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:20weavejesterjondot: I don't believe there's anything that does that yet, but it wouldn't be too hard to write.
17:20jondotbut ofcourse, wouldn't like to switch on mime type and do a 'tojson, toxml, etc'
17:20jondoti see, thanks any way
17:26netrealmjondot: 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:28netrealmI 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:29jondotyup
17:29jondotsome would claim that /resource.json is more "correct" than /json/resource
17:29jondoti'm very careful not to go into that though, just if you didn't think of it, its a nice point to consider.
17:30TimMcagreed
17:30TimMcIt makes sense from a composition standpoint too.
17:31netrealmperhaps, but the cool thing is, it's a simple change of my regex and I could convert to that naming.
17:31jondotsure.
17:31netrealmTimMc: meaning?
17:32TimMcDifferent prefixes of your path may lead to different servers entirely.
17:32jondotalso, 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:33netrealmThose are both good thoughts...I'll mull them over and consider changing my naming scheme.
17:33TimMcYou 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:33netrealmAh, I see what you mean now.
17:34jondotnetrealm, not my own. i'm just a practitioner :)
17:34netrealmAnd I'm attempting to become a practitioner :)
17:35mrmekonI don't know clojure, nor noir. But O
17:35mrmekonack
17:35mrmekonI'm trying to call 'render' to render a defpage that takes a keyword
17:36mrmekonaaaaand... I don't know how to do that
17:36mefestomrmekon: have some example code you can paste at refheap.com ?
17:36mrmekononly two lines are really relevant
17:36mrmekon(defpage "/keyword/:id" {:keys [id]}
17:36mrmekonthat page works
17:37mrmekon(render "/keyword/Performance")
17:37mrmekonI want to do that, but that does not work
17:38mrmekonhttps://refheap.com/paste/1058
17:39mrmekonI'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:41seanmmrmekon: what does requesting "/" return?
17:41mefestodoes the call to render throw an exception?
17:42mrmekonyes, NullPointerException
17:43seanmI wonder if that order's bad
17:43mefestomrmekon: maybe test with (render "/keyword/Performance" {:id "Performance"}) ?
17:44mrmekonthat doesn't work, and I also tried (render "/keyword" {:id "Performance})
17:44mrmekonwhich is actually closer to what I expect to be correct
17:44mefesto(render "/keyword/:id" {:id "Performance"}) ?
17:45mrmekontheere we go
17:45mrmekonthat should have been painfully obvious
17:45mrmekonthanks :)
17:45Lukeanyone know how to fold a list of lists into one list?
17:45mefestoLuke: flatten?
17:45mefesto,(flatten [[1 2 3] [4 5 6]])
17:45clojurebot(1 2 3 4 5 ...)
17:46brehaut~flatten
17:46clojurebotflatten 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:46mefestooh, apply concat then?
17:46mefesto,(apply concat [[1 2 3] [4 5]])
17:46clojurebot(1 2 3 4 5)
17:47Lukeweird I couldn't get concat to work before
17:47Lukelet me try again
17:47brehautits a big case of 'it depends'
17:47Lukethanks
17:48Luke(concat [[1 2 3] [4 5]]) in my repl didn't return the same result as it did here
17:48mefestoLuke: (apply concat [...])
18:47seancorfieldi 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:49RickInSJseancorfield you could do (let [x (a b c)] (and (f x) (g x)))
18:50aperiodic(apply and ((juxt f g) a b c))
18:50emezeskeseancorfield: maybe use juxt?
18:50emezeskeaperiodic: you beat me!
18:50brehautand isnt a function?
18:51aperiodicemezeske: great minds use juxt?
18:51brehauti think you might need (every? identity ((juxt f g) a b c))
18:51amalloyevery?
18:52amalloy(every? #(% a b c) [f g])
18:52Iceland_jackus
18:53brehautactually, every-pred ?
18:53seancorfieldah, i tend to forget that juxt produces a function of any number of arguments
18:54seancorfieldamalloy: mm, i like that example of every? thanx
18:55amalloythat's different from your and, if you care about the return value other than truthiness
18:55amalloy&(and (+ 1 2) (- 1 2))
18:55lazybot⇒ -1
18:55seancorfieldonly need truthiness
18:55amalloy&(every? #(% 1 2) [+ -])
18:55lazybot⇒ true
18:56seancorfieldnow if i can just get a point-free version... :)
18:56seancorfieldwhat i really want is just a function (which happens to take a b c as arguments)
19:04doughm, 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:04Raynesbrehaut:
19:05RaynesOops.
19:05brehautRaynes:
19:12RickInSJI 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:13dougwhat's .. do?
19:14technomancyit's for when you want to do things instead of return values
19:14technomancyside-effects
19:14amalloywat. technomancy: that's a good description of doto, not of ..
19:14amalloy.. is just a specialization of ->, making it interop-only
19:15technomancyoh, I thought he was pausing
19:16technomancyI see now he had only two dots instead of three
19:16ztellmandramatic pause before unleashing his question
19:16technomancywhat... is best in life?
19:17ztellmanI want an ellipsis macro that just expands to (Thread/sleep 1000)
19:17dougi was doing both in the same syntactic element, actually
19:17ztellmantiming is everything
19:18emezeskeRickInSJ: Yes, phantomjs is an executable you have to install separately
19:19RickInSJcool, thanks
19:22pandeirois there a clojure lib for dealing with csv?
19:24lstollpandeiro: https://github.com/clojure/data.csv ?
19:25lstollpandeiro: there's also https://github.com/davidsantiago/clojure-csv
19:26pandeirolstoll: found those, thanks - is clojure.data.csv included with clojure?
19:27lstollpandeiro: nope, you will need to include it.
19:35RickInGAemezeske is it possible to run the repl in the advanced example with repl-listen instead of repl-launch?
19:41emezeskeRickInGA: Yes.
19:42LukeI 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:42RickInGAemezeske 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:43RickInGAsorry, was localhost:9000/repl
19:44LukeHere's an example: http://pastebin.com/d6v2Fvsr
19:44Lukefor 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:45emezeskeRickInGA: Have you read this? https://github.com/emezeske/lein-cljsbuild/blob/master/doc/REPL.md
19:45hiredmanLuke: read the doc string for concat
19:46hiredman,(doc concat)
19:46clojurebot"([] [x] [x y] [x y & zs]); Returns a lazy seq representing the concatenation of the elements in the supplied colls."
19:46tran4I'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:46Lukehiredman: I have
19:46RickInGAemezeske 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:46Lukewhat about that doc string is telling me this wont work?
19:46hiredmanthe arglist
19:46hiredmanor just go read the source to concat
19:47Lukei still don't follow
19:47Lukecan you be more clear?
19:47hiredmanconcat doesn't concat a list of lists, it concats 1 or more lists together
19:47Lukeright - so it should concat the outer-most lists
19:47Lukeit shouldn't matter if there are lists inside
19:47hiredmanalso, I suggest you read up on 'for' and look at some examples
19:48technomancyconcat is typically called with more than one argument
19:48Lukehiredman: this is a simplified version with some file reading inside
19:48Lukehiredman: it's broken up that way to avoid reading the file more than once
19:48hiredmanLuke: 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:49hiredmandon't
19:49Lukehiredman: what do you think that is I sent you
19:49Lukehiredman: do you know how to do what I'm asking or not?
19:49hiredmanLuke: I do, and the answer is right there
19:49hiredman,(doc concat)
19:49clojurebot"([] [x] [x y] [x y & zs]); Returns a lazy seq representing the concatenation of the elements in the supplied colls."
19:49RickInGAemezeske 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:50Lukehiredman: i still don't know what you mean
19:50Lukecan you be more direct?
19:51hiredmanLuke: no
19:51hiredmanLuke: have you looked at some example concat usage? any moderately sized clojure project should have some
19:51emezeskeRickInGA: 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:51emezeskeRickInGA: 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:52RickInGAemezeske let me seeif I can restate what you are saying to see if I understand
19:52Lukehiredman: i made an example that I'm looking at. I still don't know what you mean
19:52RickInGAwhen 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:53hiredmanLuke: why don't you go on to github, grab an open source clojure project, grep for concat, and see how they use it?
19:53RickInGAso typing in the terminal looks like it is hung, when it isn't because I am looking the wrong place for the eval
19:54hiredmanclojure.core has some uses of concat you could look at
19:55emezeskeRickInGA: That's not quite correct :(
19:55Lukehiredman: how about this. can x, y, and zs in this case be lists themselves?
19:55hiredmanLuke: do you know how to read arglists?
19:56Lukehiredman: no
19:56hiredmanas an exercise, can you define a function that when you call doc on it, you get the same arglist as concat?
19:57Lukehiredman: depends. can you answer this question: can x, y, and zs in this case be lists themselves?
19:57hiredmanfor concat's arglist you have ([] [x] [x y] [x y & zs]), what is []?
19:57RickInGAemezeske 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:57Lukehiredman: can you answer the question or not?
19:57hiredmanLuke: can you?
19:58Lukenot until you answer mine =)
19:58Lukei've asked it three times
19:58hiredmanLuke: if you can answer your own question, why are you asking it?
19:59Lukei can't answer it - that's why I'm asking
19:59hiredmanso, in concat's arglist, what is []?
19:59Lukei'll wait for someone else, thanks
20:03Lukein 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:03hiredmanLuke: 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:04emezeskeRickInGA: I suggest just installing phantomjs if all you want is a REPL
20:04emezeskeRickInGA: And using the repl-launch stuff
20:04RickInGAemezeske ok, thanks. I will try that.
20:06gfredericks`does erc have an M-x command for sending private messages?
20:08Lukehiredman: the answer was "look at the apply function" in case you want to be useful in the future ;-)
20:08mdeboardyay trolls
20:14technomancygfredericks`: I don't think so, just use /msg somedude stuff
20:15technomancygfredericks`: my bad; M-x erc-cmd-QUERY
20:15gfredericks`technomancy: it feels so precarious; if I forget that '/'...
20:15TimMcgfredericks`: /query somedude
20:15TimMcThen type your message from there.
20:15gfredericks`TimMc: yes but that's not typo-friendly
20:15technomancygfredericks`: query opens a new buffer
20:16TimMc/qu^I somedu^I
20:16technomancyso there's not much risk of your message spilling into a channel
20:16gfredericks`ooh
20:16gfredericks`technomancy test
20:16TimMc...
20:17technomancygfredericks`: not quite
20:17gfredericks`hmm
20:17gfredericks`oh this is still the same window
20:17technomancybuffer
20:17arohneralexbaranosky: the thunking version of =streams=> breaks previously working code: (provided (foo) =streams=> (range) :times 10)
20:17gfredericks`glad I didn't try to tell technomancy anything...confidential
20:18alexbaranoskyarohner, hmmmm
20:18TimMc/msg gfredericks` hunter2
20:18yoklovi can't make (keyword "@") as a literal, can i?
20:18arohneralexbaranosky: though I don't know if that used to be "legal"
20:19gfredericks`TimMc: oh no!
20:19alexbaranoskyarohner, could you add that to the issue, with any error messages?
20:19TimMc*gasp*
20:19gfredericks`yoklov: I don't think so
20:19yoklovdamn.
20:19arohneralexbaranosky: sure
20:19alexbaranoskyarohner, yeah.... I think it was legal, but easily changable to the new format
20:19gfredericks`yoklov: unless you count #=(keyword "@")
20:19TimMcgfredericks`: sssshhhh
20:19gfredericks`yoklov: don't count it! don't!
20:19alexbaranoskyarohner, the question is whether we think it is reasonable for folks to change their facts
20:20technomancysome 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:20alexbaranoskyarohner, I'd wonder how many cases like that that there are in practice -- I guesstimate not a ton
20:21pipelinetechnomancy: niiice
20:21yoklovhahah, that's an awesome sticker.
20:21TimMctechnomancy: If you have any more, you can send one to me and I'll, uh, I'll make sure it gets to him.
20:21TimMcYou can trust me.
20:21technomancyhttp://www.zazzle.com/my_other_car_is_a_cdr_bumper_sticker-128776132386843273 only $3.95
20:22technomancy(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:22technomancyclojurebot: litany against cons
20:22clojurebotlitany 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:22hiredman"is it cool if I take your picture?" "no... it's extremely cool"
20:22technomancyhiredman: should have grabbed my shades
20:22technomancyI've had a few comments on it before, but mostly just "I did lisp in college and it was crazy lol"
20:22pipelineif that happened to me on the long island train i might just mace the guy and run
20:23pipeline'grats on your self restraint
20:23TimMcpipeline: Roll with it, man.
20:24TimMcThe subway is no place for boundaries.
20:24pipelinetrue that
20:27aperiodicthe one-star review on that bumper sticker is hilarious
20:28TimMcaperiodic: It's not a review of the bumpersticker.
20:28yoklovit's an extremely confused zazzle user, apparently.
20:28aperiodicah
20:28TimMc"Reviews from customers who purchased: Bumper Sticker"
20:28TimMcnot "Reviews for "(my other car is a cdr) bumper stickers""
20:28aperiodicmissed that bit
20:29TimMcZazzle has a terrible interface for tat.
20:29TimMc*that
20:29gfredericks`TimMc: but they can list more reviews that way?
20:29tmciverAnyone know where this year's conj is going to be? NC again?
20:30yoklovprobably, especailly if they sell a lot of things that are as specialized as "(my other car is a cdr)" bumper stickers
20:30hiredmantmciver: seems a safe bet
20:31gfredericks`would "(the rest of my cars are cdrs)" make more sense?
20:31yoklovhaha, that's actually pretty good.
20:31hiredmanuh, you can have one car and one cdr
20:31TimMccsr
20:31yoklovbut your cdr is made up of cdrs.
20:32yokloverr, has a cdr.
20:32hiredmanI guess you could view your reference has an alist or something
20:32tmciverbe careful: people might start to think you're a bunch of nerds.
20:32gfredericks`awkrap
20:32hiredman*shrug*
20:33hiredmanI make a decent living at being one
20:33mdeboardI am a brogrammer
20:33pipelinebeats diggind ditches
20:34pipelineI drink beer professionally
20:34pipelineon occasion this is mistaken for devops
20:38gfredericks`&(-> cdr a is car other my quote flatten)
20:38lazybot⇒ (my other car is a cdr)
20:41aperiodicheh, took a minute for me to realize how that worked
20:41aperiodicclever
20:44alexbaranoskyI want a T0-shirt that says, "I'd rather be at BAZNEX."
20:44alexbaranoskyT-shirt *
20:45alexbaranoskybut the sticker would be cool too, I'm open-minded
20:52aperiodicooooooh
20:53aperiodici didn't know toxi was into clojure
20:58alexbaranoskyaperiodic, who's toxi?
20:59aperiodicalexbaranosky: he's a prominent user of processing
20:59aperiodiche's released a lot of very useful libs for it
21:00aperiodicand now it seems he's porting them to clojure!
21:00alexbaranoskyaperiodic, it is part of Clojure world domination I guess
21:02gfredericks`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:02gfredericks`I was not very much into lisp prior to clojure so have little perspective
21:05tomojhmm http://www.google.com/trends/?q=clojure,+lisp
21:06hiredmanhttp://www.google.com/trends/?q=clojure,+common+lisp
21:06hiredmanit is hard to trend scheme
21:07gfredericks`man nobody cared about leiningen before 2010
21:08gfredericks`okay, so unless I misunderstand the charts...the answer is no?
21:09tomojeh
21:10tomojI didn't mean to suggest that any google trends charts could actually provide a decent answer to your question
21:11tomojI 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:11gfredericks`oh I didn't even know it used to be more popular
21:12tomojI mean that I think (guess) the fraction of developers working with a lisp was once much higher
21:12technomancygfredericks`: 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:12cjfriszI don't have a good notion of that, since I mostly hang out with storied Lisper/Schemers
21:12cjfriszlazybot: mail
21:12technomancyfair amount of interest, but none of it for work
21:13gfredericks`so the answer is domain/application dependent
21:14technomancylet'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:14gfredericks`that is a good way to put it
21:15cjfriszPlus the AI Winter didn't help
21:15tomojdecades ago, was the lisp interest mostly in academia?
21:15technomancymostly viaweb and ITA matrix, now that I think of it
21:16cjfriszWell, it started in academia, since it was intended for AI applications
21:16technomancyscheme may be different since it's commonly embedded symbiotically
21:16cjfriszWhich translated into expert systems into the 1980s
21:16cjfriszBut...the bottom fell out on that
21:17pandeirowhat are the major gripes with scheme?
21:17cjfriszLack of proliferation of packages
21:17pandeirogfredericks`: big or feature?
21:17pandeirobig/bug
21:17cjfriszI hold my Scheme near and dear, but hell if you can find good libraries that are portable between implementations
21:18cjfriszThe Scheme community is really segmented by which implementation you use, and it makes it hard to get a good standard
21:18pandeirocjfrisz: i imagined that had something to do with it, but what if you stick to one impl, eg racket
21:18cjfriszPlus there's no reference implementation, so everybody does things a little differently
21:19cjfriszpandeiro: Racket is probably one of the bigger ones, and it has a decent set of packages
21:19cjfriszThough I've never had much exposure to Racket
21:19cjfriszI 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:19cjfriszIt's not easy
21:20pandeiroi also have little exposure but it seems like a logical clojure alternative for scripting stuff (?)
21:20cjfriszpandeiro: Scheme has a ludicrously powerful macro system
21:20clojurebotPardon?
21:20TimMcIt seems like a perfectly reasonable Scheme.
21:21TimMc(Racket, that is.)
21:21cjfriszTimMc: I agree, I just never had much reason to use it
21:21cjfriszI know some of the Racket guys, and they're really cool
21:22cjfriszMy only real problem with it is that it's not terribly fast
21:22cjfriszAt least in comparison to Chez Scheme
21:22gfredericks`is there any reason for me to look at any other lisp?
21:22cjfriszgfredericks: it depends
21:22pandeirogfredericks`: jvm startup time?
21:22cjfrisz^^^
21:22technomancyelisp
21:22gfredericks`oh right
21:23cjfriszAlso ^^^
21:23cjfriszI do love me some elisp
21:25cjfriszMy take is that Clojure is a very nice language for implementing everyday kind of stuff
21:25pandeirotechnomancy: 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:25cjfriszHaving access to all the Java libraries is pretty awesome
21:25technomancypandeiro: yeah, but that's not eshell
21:26technomancyyou can just execute arbitrary .el files
21:26cjfriszIt'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:26technomancyI've used it for syntax highlighting in documentation generation before
21:26cjfriszBut Scheme is wonderful for doing PL/compilers type of work thanks to its macros
21:27pandeirois there ever going to be a bash replacement?
21:28pandeiroi mean a language that can do everything bash can do, without the cryptic syntax and weirdness
21:28gfredericks`ruby?
21:28clojurebotChunky bacon!
21:29tomojhe said _without_ the cryptic syntax and weirdness..
21:29pandeirogfredericks`: yeah i guess ruby and python compete for that, i just don't like either
21:29pandeirothanks tomoj :)
21:29gfredericks`oh come on
21:29gfredericks`bash and ruby are on two different levels
21:30pandeiroruby looks like lua and c++ had a baby
21:30tmciverThere's Scheme shell: scsh.net
21:41TimMcOK, if we're going to talk about scsh, there's a link I need to post.
21:43TimMchttp://www.scsh.net/docu/html/man.html
21:43TimMc<3 Olin
21:44TimMcHis dept head gave him a talking-to after that. :-P
21:45gfredericks`and made him take it down promptly apparently
21:46tmciverTimMc: was he being serious?
21:46TimMcNah.
21:46pandeiro"A 10 oz. Jack 'n Zac helps me get through the meetings"
21:47TimMctmciver: 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:47tmciverHa! Yeah, I'm not sure he isn't.
21:47TimMcHe's a good kind of crazy.
21:48TimMcGreat prof, genuinely cares about his students.
21:48tmciverHe should say: "Crazy? Yeah I'm crazy. Crazy like a fox!"
21:48tmciverTimMc: you'll be happy to know I'm watching the Overtone vid.
21:49TimMcyessss
21:55alex001anyone using appengine-magic ? is :aot needed or not ? Seems like I'm having issues if I either remove it or keep it...
21:57aperiodicalex001: 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:58gtuckerkelloggembarrassing newbie question
21:59gfredericks`unrelated noun phrase
21:59gtuckerkelloggis http://pastebin.com/P3UXgbrT the best way to get a random key-value pair from a hashmap?
21:59TimMctmciver: For more from Olin Shivers on guns: http://www.ccs.neu.edu/home/shivers/autoweapons.html
21:59alex001aperiodic, I can't use lein compile (lein appengine-prepare) is supposed to take care of that
22:00gfredericks`gtuckerkellogg: you can use rand-nth to avoid mucking with indices
22:00gfredericks`gtuckerkellogg: and you can use a vector literal instead of calling the list function
22:01aperiodicalex001: ok, as long as something is compiling before the class is loaded
22:01gfredericks`(defn rand-pair-from-hashmap [hmap] (-> hmap keys rand-nth ((juxt identity hmap))))
22:02gfredericks`^ also you can do it that way just to prove that juxt is always the answer
22:02gtuckerkelloggneat. I wasn't familiar with juxt
22:03gfredericks`it comes in handy when you feel like being clever
22:03gfredericks`~juxt
22:03clojurebotjuxt is a little hard to grok but it's the best thing ever
22:03tmciverTimMc: I like it. Sounds like he knows his guns.
22:03TimMcYeah, he could fool me.
22:03alex001aperiodic, humm it seems that if I leave any :aot directives in project.clj, when I run lein repl I get npe's :(
22:04xeqi,(rand-nth (seq {:a 1 :b 2 :c 3}))
22:04aperiodicalex001: could you gist/refheap your project.clj?
22:04clojurebot[:a 1]
22:04gfredericks`xeqi: crap you're right
22:04gfredericks`,(rand-nth {:a 1 :b 2})
22:04clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>
22:05gfredericks`gtuckerkellogg: (def rand-pair-from-hashmap (comp rand-nth seq))
22:05gtuckerkelloggfanstastic
22:06gtuckerkelloggthanks xeqi and gfredericks
22:07alex001aperiodic, sure here it is: https://refheap.com/paste/1059
22:08aperiodicalex001: the :aot value should be a list of regexes
22:08aperiodicalex001: any namespace that matches will be AoT compiled
22:09pandeirohow can i test a string for a simple substring?
22:09gfredericks`.indexOf should work right?
22:09gfredericks`,(.indexOf "foo and bar" "and")
22:09clojurebot4
22:10gfredericks`clojure.string might have a function for it too
22:10pandeirogfredericks`: it doesn't that i could tell
22:10tomojString also has .contains
22:10xeqi,(re-find (re-pattern "and") "foo and bar")
22:10clojurebot"and"
22:10pandeiroobviously i show my ignorance of the java api
22:10gfredericks`apparently there are exactly seven ways to do it
22:10pandeiroyeah i had also forgotten about the re wrappers
22:11pandeiroi was http://docs.oracle.com/javase/tutorial/essential/regex/pattern.html when i decided to cry for help
22:11alex001aperiodic, humm that should be fine, in this case, only the servlet is compiled
22:11lxnch'topic
22:13aperiodicalex001: ah, i see
22:15aperiodicalex001: so the class compiles normally, but you still get NPEs when you try to launch a repl?
22:16uvtcIt'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:17aperiodici think that clojure-scheme in turn supports compiling clojure down to c
22:18alex001aperiodic, 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:18uvtcaperiodic, Right. Using Gambit.
22:22aperiodicalex001: 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:22uvtcHeh. Wouldn't it be interesting if the killer app for Python 3 turns out to be Clojure on PyPy. ;)
22:22alex001aperiodic, "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:24aperiodicalex001: 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:25aperiodicalex001: 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:26aperiodicalex001: if the appengine-prepare task doesn't prepare the war properly, then i'd open an issue on appengine-magic
22:26lxnchI 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:27alex001I will have to check with the author of appengine-magic.. something is fishy there
22:27alex001aperiodic, thanks for helping!
22:27aperiodicalex001: no problem! sorry I wasn't much help
22:51leo2007Folks, what's new?
22:55muhoouvtc: language splintering seems to be a common feature of lisps, AFAICT
22:56leo2007how do you mean?
22:56muhooit seems like lisp people like creating languages.
22:56muhoomaccros, DSLs are probably the gateway drug here :-)
22:56leo2007that's the benefit of writing in AST.
22:57uvtcmuhoo, 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:57uvtcIn 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:10cgagI just realized paredit lets you jump over closing curly/square brackets using close paren, that's great.
23:12uvtcI'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:13gtuckerkelloggi use it
23:14cgagI'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:14ferdI use it too
23:15uvtcSo far, I like hitting the close paren and seeing the matching one light up momentarily. Well, works for me now, while learning anyway.
23:15uvtcCan anyone recommend a good paredit tutorial?
23:16uvtcOr screencast?
23:17cgagnothing 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:17ferdall I used to "learn it" is the reference card/cheat sheat
23:17tomojsame here, but I am interested in making a screencast, or in someone else making one :)
23:18uvtcscreencast++
23:18ferdI'm no expert... The commands I find myself using the most are splice and forware-slurp
23:19ferdM-s and C-) respectively
23:19tomojI feel like I still don't have movement down
23:21alex001after reading this, as a vim guy, I'm scared that I might end up the same route too
23:22tomojspecifically, repeating C-M-d C-M-n to crawl forward feels strange
23:22cgagusing evil mode, so far the main things I miss is the nerd-commenter and nerd-tree
23:22tomojwell.. can just use C-M-f. hmm
23:23cgagi'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:23aperiodici use paredit.vim
23:23aperiodicit's great
23:23aperiodicmy only complaint is that it doesn't do curly braces
23:24tomojcan it at least navigate through/around curly sexps?
23:24aperiodicunfortunately not
23:26aperiodicbut i usually use vim commands for navigation, so that doesn't really get in my way
23:26cgagwith 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:27tomojC-h k C-x C-e
23:28tomoj.. where "the expression preceding point" means you're supposed to put point on or after the closing paren
23:36cgagoh, preceding point
23:36cgagthe swank clojure readme says 'under the point'
23:36cgagthanks
23:41tomojnote also C-M-x
23:41tomojfor toplevel forms, where you can have point anywhere inside
23:43cgagoh, 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:49tomojI don't think there is any difference for clojure
23:51amalloythere isn't