#clojure logs

2011-11-02

00:12spoon16how do I make an anonymous function call itself?
00:12spoon16(fn [i] (lazy-seq (cons i (self-call-here (inc i)))))
00:13nappingyou can use recur
00:13brehaut,((fn fn-name [a] (if (odd? a) (fn-name (inc a)) (str a))) 1)
00:13clojurebot"2"
00:13brehautor you could bust out the y combinator :P
00:14napping,((fn [i] (if (> i 0) (recur (dec i)) 12)) 10)
00:14clojurebot12
00:14nappingonly good for tail calls, though
00:14dnolencore.logic 0.6.5 out the door. now easier to use!
00:14brehautdnolen: congrats :)
00:15dnolennot a big change really, stopped overloading anything except ==, and all the useful functions are now in one namespace.
00:15dnolen(ns foo.bar (:refer-clojure :exclude [==]) (:use clojure.core.logic))
00:26tcjI've got a matrix (2-d vector) of maps. I want to update maps contained in the cells of the matrix given a sequence of maps and a sequence of x/y coordinates. I'd like to have a function (defn update-matrix [matrix maps coords] ...) that updates the matrix. I'm getting stuck, I think because I'm trying to update the non-persistent collections in clojure. I've tried using transient, but it's...
00:26tcj...tricky with nested sequences. Any advice?
00:27brehautwow. thats dense
00:28brehauttcj: what non persistent collections are you using, and why?
00:28tcjbrehaut: aren't persistent collections the default in clojure?
00:29brehauttcj: yes; and you said "I think because I'm trying to update the non-persistent collections in clojure"
00:29tcjSo if I update a map using (assoc), it'll return a new map
00:29tcjAhh
00:29tcjI mis-typed
00:29tcjI meant "... persistent collections in clojure"
00:30brehautok, so lets start at the top. you are using a collection of vectors of vectors of maps ?
00:30brehauts/collection of vectors/vectors/
00:30tcjMaybe...
00:31tcjIt's like this [[{} {} {}] [{} {} {}]]
00:31tcjSo a vector of vectors of maps
00:31spoon16(defn ^File file… is that a type hint on the return?
00:32tcjAnd I want to update the maps
00:32brehauttcj. ok, _how_ do you want to update the maps?
00:32tcjI want to add key/values
00:33brehautto every map ?
00:33brehautor a particular map
00:33tcjJust a particular map
00:34brehaut,(assoc-in [[{} {} {}]] [0 0 :a] 1) ; <- tcj
00:34clojurebot[[{:a 1} {} {}]]
00:34brehaut(doc assoc-in)
00:34clojurebot"([m [k & ks] v]); Associates a value in a nested associative structure, where ks is a sequence of keys and v is the new value and returns a new nested structure. If any levels do not exist, hash-maps will be created."
00:35tcjGreat, I think that'll work
00:35tcjbrehaut: Thanks!
00:36flognikrtcj: might also want to check update-in
00:37flognikrdepending on how you want to modify the maps.
00:37flognikr(doc update-in)
00:37clojurebot"([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."
01:41tolstoyIf I have a bunch of dynamic vars I want to set in sequence, rather than parallel, is it acceptable style to use let instead of binding?
01:44tolstoyHm. Doesn't work. I guess that answers that. ;)
02:09spoon16can you annotate a defmulti with documentation or a defmethod?
02:10tolstoyspoon16: You mean, to they take doc strings?
02:10spoon16yeah, I'm trying to figure out when it's appropriate to use ^{ :doc "hi" }
02:11tolstoyUsage: (defmulti name docstring? attr-map? dispatch-fn & options)
02:11tolstoyLooks like defmulti takes a doc string. defmethod doesn't seem to according to the API page.
02:14ibdknoxthat makes sense right?
02:14Raynes&(doc defmulti)
02:14lazybot⇒ "Macro ([name docstring? attr-map? dispatch-fn & options]); Creates a new multimethod with the associated dispatch function. The docstring and attribute-map are optional. Options are key-value pairs and may be one of: :default the default dispatch value, defaults t... https://gist.github.com/1333013
02:14spoon16yeah
02:14ibdknoxhow would you get the docstring of the defmethods?
02:14RaynesThe docstring comes after the name.
02:14ibdknoxthe only symbol you have is that defined by defmulti
02:15Raynesibdknox: It also kill the point of multimethods in the first place. You don't use them just so you can name things the same -- you use them for things that do generally the same thing but in different ways.
02:15RaynesIt'd*
02:15RaynesExcuse me, on my way to English class. ._.
02:15ibdknoxright
02:16tolstoyHow come plain old def doesn't take a doc string?
02:16RaynesIt does in 1.3
02:16Raynes&(doc def)
02:16lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
02:16tolstoyOh, really? Hm.
02:16RaynesWell, you get the point.
02:16tolstoyI get "too many arguments."
02:17tolstoyWell, wait. lein repl may not be 1.3.
02:17ibdknoxit's not
02:17Raynestolstoy: (def x "foo"­ 0)
02:17RaynesGo type that into tryclj.com
02:17ibdknoxif you're outside of a 1.3 project
02:18tolstoyHm. clj (which announces itself that it's 1.3) doesn't seem to work either.
02:18RaynesDude. tryclj.com.
02:18RaynesI've used this in my own code. It definitely works.
02:18ibdknoxRaynes: pfft who uses that crappy site? :p
02:18RaynesI know, right?
02:18tolstoy,(def "this­ is x" x 23)
02:19clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: def  in this context, compiling:(NO_SOURCE_PATH:0)>
02:19RaynesBots don't do def.
02:19ibdknoxtolstoy, you have them out of order
02:19RaynesBut yes, out of order.
02:19Raynes(def x "foo"­ 0) <--
02:19tolstoyAh. Sheesh.
02:19ibdknoxalways name then docstring
02:19ibdknoxor at least I can't think of any counter examples
02:19tolstoyWell! That's handy.
02:22tolstoy(def ^:dynamic *foo* 23)
02:22tolstoyThat cuts down on the verbosity.
02:55callenthis kills the crab.
03:07callenanyone interested in a dark theme for github? I just finished updating mine.
03:10aperiodiccallen: how is it apllied?
03:10aperiodic*applied
03:10callenaperiodic: user styles, most browsers have a plugin for "user styles"
03:10callenaperiodic: in the case of google chrome / chromium the plugin, "Stylish"
03:10callenaperiodic: you just tell it the domain/url/regex you want to apply it to, then copy and paste the CSS hack I wrote.
03:11aperiodiccallen: got screens?
03:11callengood question, h/o
03:13callenaperiodic: uploading a couple, give me a moment.
03:13callenaperiodic: I made it because there aren't any remotely decent ones out there. Mine isn't perfect, but suffices.
03:14aperiodicuser styles is sane, just wanted to make sure it's not some crazy proxy server thing
03:14callenaperiodic: lol no.
03:14callenaperiodic: I'm not that much of an asshole.
03:15aperiodicthat's actually one thing i don't like about github
03:15aperiodichaha, good to hear
03:15aperiodicthe rest of the code i look at is light-on-darj
03:15aperiodic*dark
03:16callenhttp://imgur.com/a/FAA0r imgur album.
03:16callenaperiodic: my whole desktop is light on dark
03:16callenaperiodic: I have three monitors of white on black urxvt in xmonad.
03:17aperiodicgod i wanna run xmonad
03:17aperiodicit looks like it's not possible to get good text rendering in X11 on OS X
03:18aperiodici'd like to be mistaken
03:18callenaperiodic: nah you're right. I have a macbook pro on my desk sitting unused.
03:18callenaperiodic: I only use it when I leave the house.
03:18callenI keep it and the code it contains updated, that's the extent of it.
03:20callenaperiodic: what do you think?
03:21aperiodicmight tweak saturation a bit myself, but looks solid
03:22callenaperiodic: if you tweak it, post the changes and a screenshot comparing them!
03:22callenaperiodic: I'd love to see it. :)
03:22callenaperiodic: I just didn't want my retinas scorched by the fucking site.
03:23aperiodiccallen: for sure
03:23aperiodicthanks!
03:24callennp, always glad to help.
03:45aperiodiccallen: you should put the screenshots in the readme of the repo
03:45aperiodiccallen: then you'll b
03:45aperiodice able to see 'em on gh
04:04callenokay.
04:06callenaperiodic: done
04:06callenhttps://github.com/bitemyapp/github-dark-theme
04:08aperiodicnice!
04:16leo2007Is leiningen in ubuntu fixed?
04:21clgvleo2007: whats the problem with leiningen in your ubuntu system? it's running smoothly here.
04:21callenleo2007: http://victorjcheng.wordpress.com/2011/10/18/fix-for-broken-leiningen-in-ubuntu-11-10/
04:21callenclgv: look at the link.
04:21callenleo2007: use Google d00d.
04:22clgvI wouldnt install leiningen via apt ;)
04:22callenI wouldn't either, but all the same.
04:23clgvit's still developing faster than ubuntu can keep track I guess....
04:28leo2007ok, I'll install it myself.
04:34R4p70rIs there a function that return the number of items in a collection where a predicate returns true? like (count (filter f coll)) ?
04:35opqdonutno, but that is a reasonably efficient implementation
04:37R4p70ropqdonut, I know. Laziness. But I though maybe I could do it in one call. Thanks
04:38opqdonutwell all you've got to do is say (def count-when (comp count filter)) :)
04:45R4p70ropqdonut, Yeah. I'm using this all over the place.
04:50leo2007How to use lein to start swank?
05:17leo2007Any idea how to fix this error while starting swank-clojure? http://paste.pound-python.org/show/14579
05:31clgvleo2007: reading its manual - since there is obviously a param missing.
05:34licenserhmm somewhere I read something about an alternative to swank when it come to clojure/emacs anyone remembers that?
06:40apexi200sxhas anyone got any experiences to share of moving to clojure from python ( sorry for spamming a bit but there have been shed loads of connects/disconnects to the channel)
06:41apexi200sxthe advantages disadvantages, what productivity benefits there are etc.
06:41apexi200sxor things to watch out for
07:05llasramapexi200sx: I don't know where you are physically, but this is probably about the worst time-of-day to get responses from people in the US :-)
07:07apexi200sxllasram: yeah it would seem that if you want to use IRC and you have to wait till the states wakes up :)
07:08apexi200sxllasram: Are you a java guy who moved to clojure ?
07:10llasramapexi200sx: Haha! No. Still learning the Java stuff, actually. Python was my favorite language personally, but am still doing mostly Ruby professionally. Currently trying get my team to bless Clojure as our default language for contexts where Ruby isn't appropriate
07:12llasramSo I don't really have much to say about "moving from" another language to Clojure, since I haven't done more than shift to it for green-field personal projects. No idea what the difficulties will be integrating existing code, getting team members up to speed, etc
07:25clgvapexi200sx: I don't know what to answer - I think you have to be more specific.
07:40fliebelAnyone remember the name of that visual programming language with these truth tables?
07:41kephaleapexi200sx: well for one, hooking up to C/C++ is a bit more annoying with Clojure. Clojure's REPL trumps ipython IMO.
07:49apexi200sxI don't care about backwards compatibility really. I am just looking around for a new language/environment that may help productivity. Currently my favourite general purpose language is Python, I am just interested in anyone who has been using clojure who has had experience with Python also. The reason behind this is, if say, you asked an (open minded) c++ programmer to use c# who had never seen it before the
07:51apexi200sxbasically what are the killer features. Also, Clojure is not an OOP language. OOP was once touted as a help to programming, how do Clojure programmers feel with losing OOP in place of Clojure's way of doing things
07:51apexi200sxare there any trade offs, what are the pros cons ? just throwing a few Questions out there for feedback thats all
07:53algernonI had a couple of python projects, some large, some small (still have a few of these left at work), but started to move to clojure a few months ago
07:54algernonloosing "oop" wasn't a big deal. clojure's namespaces, prototypes and whatnot actually make more sense to me
07:54kephalefliebel: subtext?
07:54clgvapexi200sx: do you have the time to try clojure or read one of the introductory books? you'd get an idea if clojure suits you. interestingly, when using clojure it never felt like "loosing oop".
07:59fliebelkephale, I'll have a look, thanks
07:59moominActually, you can OOP in Clojure very easily. Just create a hash-map with a bunch of functions in it.
08:00moominAfter a while you'll probably decide it wasn't such a great idea, though.
08:00moominOnce you stop seeing things as "oop" it feels like an object method is just function closed over its first parameter. (which it is)
08:01kephaleFWIW Carnegie Mellon stopped teaching OOP to incoming CS students
08:03fliebelkephale, it was subtext, but it doesnt seem like you can actually use it.
08:03moominInteresting... :) I read a remark by someone much smarter than me (maybe swanodette) that you can't have a sensible type system with objects.
08:04fliebelmoomin, So what is there to type beyond primitives?
08:05hoeck1apexi200sx: I switched from clojure to python because of a new job a year ago, I had no former exposure to python
08:05apexi200sxto all, I am interested to hear experiences of not using OOP, as it has been so ingrained for a long time that OOP is the way for code re use and encapsulation and code organisation. I
08:05hoeck1apexi200sx: my python scripts now look more like clojure, for example, I try to avoid deep class hierarchies and encapsulated state, avoid complex functions, break/continue/return in loops etc.
08:05apexi200sxhoeck1: do you find you are worse off using Python
08:06apexi200sxdo you dream of the day you can go back to Clojure ?
08:06apexi200sx:)
08:06fliebelapexi200sx, Rich Hickey has a few talks whre he explains his vision.
08:06hoeck1apexi200sx: I'm missing some convenient things, I *really* miss immutable data structures
08:07fliebelhoeck1, There are libraries, they I heard their use is awkward.
08:07hoeck1apexi200sx: I hate some of pythons design decisions, for example, that dictictionary access defaults to raising Exceptions for missing keys, clojure is more sound regarding those things
08:08hoeck1fliebel: actually, I'm looking forward to port the clojure ones to python :)
08:09apexi200sxhoeck1: Not trying to promote python or anything, but this page can be helpful in writing idiomatic python code... http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html
08:10hoeck1apexi200sx: I'm currently working on an age-old cgi CRUD application, so our code is pretty functional, though my predecessor did built a lot of imperative OO-spaghetti code
08:10hoeck1oh and I miss -> and ->>
08:12apexi200sxhoeck1: are you saying that some of the stuff you learned from using Clojure have helped you write code better in other languages like Python even though the language is very different.
08:12apexi200sxhoeck1 had you programmed in an OOP language before Python and Clojure
08:12hoeck1apexi200sx: thanks, I'm actually glad I was forced to learn python, its not a bad language, I don't (currently) see python and clojure competing, for example, I would never use clojure to write shell scripts
08:13fliebelhoeck1, http://packages.python.org/pysistence/
08:13hoeck1apexi200sx: no real OO language experiences, though I wrote my bachelors thesis project in clojure
08:15hoeck1apexi200sx: clojure had a huge influence on me, I would say that my python code is way better now than it would be if I had started using python before being exposed to clojure
08:16apexi200sxhoeck1: I assume you have looked at the code of your colleagues who may not have had Clojure exposure. do you find you structure the code differently from them and what do they think of the code you write :)
08:18hoeck1apexi200sx: well, about 80% of my work is fixing bugs and adding small features to existing code
08:21hoeck1apexi200sx: I'd say that I'm more keen about having nice clean and readable code (according to my standards) than others, but that may be just my age
08:22apexi200sxhoeck1: you may be talking more about the skills/care you have/take while programming than the benefits of Clojure knowledge though
08:23hoeck1apexi200sx: hard to identify the role that clojure played in that
08:23kzarIs there a way to return a lazy sequence of data from inside a with-open block in a way that keeps the file open until the sequence has been realised? (I know one way is to use do-all inside the with-open)
08:24kzarWell one way to avoid the problem I should say
08:24wtfcoderhow would you associate behaviour with data in clojure. lets say we have defined a struct with :firstName and :lastName from my understanding we would not make the function part of the object otherwise it depends on state and not pure. where should we place the fn for reuse
08:26kzarwtfcoder: Well you would probably have a namespace to deal with people, a person would be a map (just data) and there would be functions to do what you needed to a person map
08:27apexi200sxhoeck1: thanks for your comments, appreciated. I think I am going to have to have a go at converting something i created in Python into clojure and see from there
08:27wtfcoderkzar, makes sense kind of like a static fn in OO, CustomerClass.fullName(customerStruct)
08:28wtfcoderso generally with clojure we dont verify that we are operating on a customer, if it has a firstname and lastname it is a customer, walks like a duck etc..
08:29wtfcodera more general question, is clojure well suitable to working with asyncronous apis?
08:29clgvwtfcoder: you can verify in cases where you want to report errors and such. 'instance? is handy there
08:29kzarwtfcoder: Well I can't comment on the static fn bit. The bit about verifying something's a customer - if it has a name and the right attributes that makes it one. I suppose this is applicable http://en.wikipedia.org/wiki/Bundle_theory
08:34clgvwtfcoder: clojure has functions that you can pass around as callbacks, so it should be suited for asyncronous apis.
08:38wtfcoderafter working with node.js for a while i was wondering does clojure too suffer from pryamid symdrome with nested callbacks when working with async apis. I guess those working with clojurescript have more experience on this. Would I still need to use helper libs like async.js or
08:48leo2007would knowing Java help one learn clojure?
08:50archaicin general should i be derefing atoms/data before saving to file? it seems to work either way
08:52cemerickleo2007: It's not necessary, but it helps. You do need to understand how the JVM works in certain ways (e.g. classpath and such).
08:53leo2007cemerick: any reference for that? I would like to read-up the minimal required.
08:54cemerickleo2007: I came from knowing the JVM very well prior to using Clojure, so I never sought out such materials.
08:55cemerickleo2007: We did try to provide a reasonable grounding and introduction to the necessary basics here: http://oreilly.com/catalog/0636920013754/ (sorry for the self-plug)
09:00leo2007cemerick: no worries. what does rough cuts mean? I'd prefer a full-version.
09:00llasramcemerick: BTW, got the Rough Cuts edition to check it out for wooing my co-workers to Clojure. Looks pretty good so far!
09:01clgvleo2007: Programming Clojure or Pragmatic Clojure are also an option for starters.
09:01cemerickleo2007: It's the same concept as Manning's MEAP: pre-publication versions are put out online for you to use/comment on/whatever, and then you get the final version when it's ready.
09:01cemerickllasram: Glad to hear it. The final rev of it will be hitting very shortly, lots and lots of improvements and additions. :-)
09:03llasramkzar: you may have figured this out already, `with-open' itself works entirely lexically because it uses `try'. The old clojure.contrib.io has some functions like `read-lines' which will open a reader and keep it open until the entire file is read, but
09:04llasramI believe they are considered problematic -- they don't seem to have made it into the new libraries, and I know I had problems with too many open files when trying to use them
09:07llasramActually, lexically is wrong, isn't it? Dynamically? Hmm. Either way, file closes when you leave the scope `with-open' :-)
09:08leo2007clgv and cemerick: thanks.
09:08llasramcemerick: When's the official publication date? Will there still be time for comments after the next rev?
09:09cemerickllasram: I think the official line from O'Reilly is "by the end of the year"; I have no idea what the production process is like. In any case, the earlier your comments get in, the more likely they are to affect the final result.
09:13clgvllasram: using reader + read-lines can replace the old read-lines
09:15llasramclgv: Hmm. I can't seem to find a `read-lines' except in old clojure.contrib
09:15llasramWhich one are you talking about?
09:16clgvargs failure^^ reader + line-seq
09:18llasramAh, right. Except line-seq doesn't automatically close the file, like read-lines did. You still need to arrange for the reader to be closed at some scope, and ensure that your lazy sequence is done using the file before you leave that scope. (As it should be.)
09:20clgvno, when using 'reader you'll always have to put it in a 'with-open or close it manually
09:20kzarIs there something like select-keys that lets you rename the key? (Or a function I can run after select-keys to rename some of the keys?)
09:21raek_yeah, it's not very good to _only_ rely on that the stream is closed when the lazy-seq is fully traversed. (what happends if the whole seq is not consumed, or when an exception is thrown?)
09:22raek_kzar: rename-keys in clojure.set
09:23simardis there a shortcut for this ? (= (type {}) clojure.lang.PersistentArrayMap)
09:23clgvsimard: ''(doc instance?)
09:23clgv&(doc instance?)
09:23lazybot⇒ "([c x]); Evaluates x and tests if it is an instance of the class c. Returns true or false"
09:24simardthank you
09:24dnolensimard: in general map? is preferred, unless you're doing something special.
09:24simardhum, map? would do
09:24simardmaybe
09:25raek_map? matches everything that implements clojure.lang.IPersistentMap
09:25clgvoh hehe, didnt check the type^^ map? for the special case^^
09:25dnolensimard: checking for concrete types is bad practice since there are many types. You generally only care if something satisfies an interface / protocol. Not whether it's a particular type.
09:25simardhum then that wouldn't do
09:25simardany record does that, right ?
09:25dnolensimard: for example {} with > 32 keys / values will become PersistentMap, not PersistentArrayMap
09:26raek_,(class {})
09:26dnolensimard: map doesn't check type, it checks interface
09:26clojurebotclojure.lang.PersistentArrayMap
09:26raek_,(class (zipmap (range 20) (range 20)))
09:26clojurebotclojure.lang.PersistentHashMap
09:26simard,(class (zipmap (range 200) (range 200)))
09:26clojurebotclojure.lang.PersistentHashMap
09:26simardhum
09:27simardI see
09:27raek_simard: also, you can implement protocols for types other people have defined
09:27raek_(extend-type clojure.lang.IPersistentMap MyProtocol (my-method ...))
09:28simardso what is the function to test if a type implements a given protocol ?
09:28raek_IPersistentMap is basically equivalent to "all kinds of clojure maps"
09:28raek_also, why do you need to check the type?
09:28dnolensimard: you can check interfaces with instance?, you can check protocols w/ satisfies?
09:28kzarraek_: Thanks
09:29simardraek: I want to filter a flattened tree based on the type of object contained in it
09:29raeksimard: one way is to define the filter function as a protocol method
09:30raek(defprotocol Filterable (filter-node [this x])) (extend-type clojure.lang.IPersistentMap Filterable (filter-node [m x] ...))
09:31raekyou'd then have one extend-type per "case"
09:31simardyes, well that function will be part of my 4 alraedy existing defrecords then
09:31raekprotocols are great for assigning new meaning to existing types
09:31simard(I already implement protocols in them for some other reasons)
09:31simardI'm simply going to add one more :)
09:38simard(-> this :properties :aperture) or (get-in this [:properties :aperture]) ?
09:38simardis there a real difference I should care about ?
09:40raeksimard: IMHO, not really. you might get different error messages if (:properties this) is not a map though...
09:41raekwait, maybe not...
09:42raeksimard: one differece is that the -> approach only works when the keys are keywords (which is the absolutely most common case)
09:43simardyes, that I understand, they need to be functions
09:43simardthat would be the main difference probably..
09:45raekboth are fine in this case. just pick one and don't spend too much time with this choice :-)
09:45fdaoudsimard: I remember someone smart on here giving two examples, one with -> and one without, and saying they are both the same and you pick the style you prefer
09:45clgvsimard: get-in is a better match with update-in
09:46simardor assoc-in
09:47clgvyou can also do (->> this :properties :aperture) then it also works for non-keywords^^
09:47simardthere are so many functions in that language
09:47fdaoudclojure?
09:47clojurebotclojure is not scheme
09:47simardyes, clojure :)
09:47fdaoudyes, 100 functions on 1 data structure :)
09:48fdaoudinstead of 10 functions on 10 data structures
09:48fdaoudthank you Alan Perlis
09:49clgvoh wait forget about the ->> thingy. I got it mixed up ;)
09:49simardclgv: I was trying to figure it out and about to ask you about it .. :)
10:01WelcomeBotWelcome to #clojure, WelcomeBot!
10:03WelcomeBotWelcome to #clojure, rahul!
10:04WelcomeBotWelcome to #clojure, wilkes!
10:04clgv that thing is starting to be annoying
10:05robbe-s/starting to be//
10:05clgvrobbe-: add it to iggy list^^
10:05clgvI hope my client ignores it now
10:12cemerickwho runs this WelcomeBot?
10:19TimMcDid it get killed?
10:21cemerickseems like it
10:27clgvoh, and I thought my client ignores it completely.
10:28simardhum I've added a third protocol to a defrecord, but when I call a function of that protocol on an instance of that record, I get an error: No implementation of method: :extract-apertures of protocol: #'cpcb-server.pcb/Extracteur found for class: cpcb_server.pcb.Pcb-Object [Thrown class java.lang.IllegalArgumentException]
10:28simardhowever, when I create a new defrecord with only that protocol, it works....
10:28simardI've killed swank and retried evaluating all over again, still the same error
10:29simardany idea ?
10:35clgvsimard: you also tried "lein clean" inbetween?
10:36simardno
10:37simardclgv: thank you, that worked
10:37simardbut, why ?
10:38clgvsometimes it seems that the classes for defrecords and deftypes are not rewritten - I always do the clean then^^
10:49jcromartieclgv: are those classes actually AOT compiled?
10:49jcromartieclgv: as in, into a .class file?
10:50clgvjcromartie: good question. both cases. I did not investigate further
10:50pandeirowhat would be the idiomatic way to randomly resort a vector?
10:51TimMcpandeiro: shuffle it, that is?
10:51pandeiroyeah
10:51TimMc,(doc shuffle)
10:51clojurebot"([coll]); Return a random permutation of coll"
10:51TimMc:-)
10:51pandeiroah great, is that avail in clojurescript?
10:51TimMcWouldn't have a clue.
10:52pandeironope
10:52pandeiroi will take a look at the source, thanks for the tip
10:54gfredericksdoes clojurescript have sort-by? (partial sort-by rand) should work I would think
10:55TimMcgfredericks: bad bad bad
10:55pandeirowhy is that bad?
10:56TimMcIn the best case it will be a shitty sort, in the worst case it will run forever.
10:56TimMc s/sort/randomization/
10:57pandeiroTimMc: shuffle is taken straight out of Java so there's no JS equivalent... i think gfredericks' solution wfm
10:57TimMcI really doubt it.
10:58clgvpandeiro: shuffle can be implemented as randomly drawing two positions and exchange them.
10:58clgvand you repeat as often as you like. or you iterate through all positions and draw a random position to exchange with
10:59TimMcpandeiro: http://sroucheray.org/blog/2009/11/array-sort-should-not-be-used-to-shuffle-an-array/
10:59pandeiroclgv: yeah that's how i would've done it in pure JS, thanks
11:00clgvpandeiro: if you have no strong mathematical requirements you can safely use one of them
11:01TimMcJust don't use sort.
11:02pandeiroTimMc, you mean the sort-by?
11:03TimMceither
11:03TimMcDid you look at the link? You won't get anything even resembling a random distribution.
11:03pandeiroyeah it's not loading unfortunately, but you're right, the dist isnt very random
11:04pandeirogot a cached version, checking it out
11:07fdaoudTimMc: that's a nice post, thanks for the link
11:08TimMcpandeiro: In cljs, you don't have transients, right?
11:08pandeiroTimMc: embarrassed to say i dont know
11:09pandeiroi'm new to clojure
11:09TimMcIt probably doesn't, it is very young. But it would be appropriate for the Fisher Yates algorithm.
11:09pandeirobut i am trying to implement the fisher-yates algo mentioned in the article now... thanks for the link
11:09TimMcIt's probably fast enough for your needs.
11:11gtrakalex is a madman, you guys see this? http://clojurewest.org/news/2011/11/2/clojurewest-is-launched.html
11:15zerokarmaleftdang, he's setting up franchises
11:15gtrakstamping them out
11:19clgvpandeiro: you could as well use sort() for the shuffle. just assign each element of your array a random number and sort the elements related to the random number ^^
11:32TimMcpandeiro, clgv: Sorting indices by fixed random numbers: https://gist.github.com/1333940
11:32TimMcplease golf this, somebody
11:33zippy314why is there every?, not-every? and not-any? but no any?
11:33TimMczippy314: Bad name choice. See some.
11:33clgvTimMc: the Fisher-Yates or Knuth shuffle is simpler and pretty well suited - I would implement that one
11:33zippy314TimMc: cool, thanks.
11:34TimMcclgv: Agreed, but I've always wanted to try writing the sort-indices-by-random trick.
11:35clgvTimMc: ok ;)
11:36clgvTimMc: looks working to me
11:36simardis this still the best way to have default values on records https://gist.github.com/504861 ?
11:38clgvsimard: probably. I dont know of a core-change to defrecord in 1.3
11:39raekanyone know if there is something this neat for Clojure (or Java)? https://developer.mozilla.org/en/JavaScript_typed_arrays
11:40dnolenraek: which part, views?
11:40clgvraek: there are Buffers in java.nio
11:40raekyes
11:41raekthe java.nio classes are a bit weird... they contain iteration state
11:41clgvbut they pretty much allow those multiple views
11:43cemerickraek: There's also the gvec stuff if you're looking for a nicer way to work with primitives.
11:45raekI like how typed arrays makes it simple to access the data of arrays and structs in binary data formats
11:45dnolencemerick: gvec stuff is a bit incomplete, main advantage at this point is just less memory consumption.
11:45cemericksure
11:45cemericksimard: the map->Foo factory function produced by defrecord can help
11:46cemericksimard: https://gist.github.com/504861#comments
11:49clgvcemerick: ah, nice 1.3 feature
11:51cemerickclgv: Yeah; I probably wouldn't write defrecord+ today. Given the generic map factory fn, you can easily define multiple sets of defaults using the same base record type.
11:52cemerickcomplecting a record type with its defaults is not necessarily the right path ;-)
11:57simardcemerick: I agree for not complecting things, but I'd have to understand you code first :)
11:59cemericksimard: In short: it merges a map (or in the second case, a map built from a seq of keys and values) with a map of defaults for a particular record type, providing the result to the map->Foo function that yields a Foo.
12:00clgvsimard: you could say (def default-A (comp map->A (partial merge {:x 5})))
12:00simardhum ok makes sense
12:00simardso that map->Foo function, generated by defrecord, is that documented ?
12:01cemerickRight, I left clgv's addition as an exercise for the reader ;-)
12:01simardcan't see anything about it in doc defrecord
12:01cemericksimard: mmm, no. http://dev.clojure.org/jira/browse/CLJ-833 Feel free to vote that issue up. :-)
12:01simard:)
12:04simardcemerick: done
12:06jaleysomebody help! :) I have '([1 2] [3 4]) and want to add [5 6] to the end, thus '([1 2] [3 4] [5 6]). cons, conj, into... what is it I'm looking for? :s
12:07simard(conj [[1 2] [3 4]] [5 6]) ?
12:08jaleysimard: hmm ok, so I need to convert the list to a vector first?
12:09clgvjaley: you can use concat as in ##(concat '([1 2] [3 4]) '([5 6]))
12:09lazybot⇒ ([1 2] [3 4] [5 6])
12:09simarddefault-Aperture
12:09simardoops
12:10jaleyclgv: oh ok, so that way around the vector i'm adding has to be wrapped in a list?
12:10clgvjaley: yes, for adding to the end you are using the wrong datatype
12:10simardjaley: which is why you should be using vectors all the way in this case
12:11jaleyclgv: well... it's the return value from a map
12:12clgvjaley: maybe you restructure your algorithm so that you dont need to add to the end? otherwise use one of the above solutions
12:13jaleyclgv: ok yeah that would make the code ugly... intuitively this is a list of [x y] coordinates and i'm just interpolating two points. so I guess I'll just convert to a vector of vectors and use conj
12:13jaleyclgv and simard, thanks for the help
12:43aartistFirst time here. What is good about clojure?
12:44bluezenixwhat isnt?
12:44bluezenix;D gtg
12:45technomancystartup time, regexes, and the contains? function
12:45technomancynext question?
12:45technomancy=)
12:45TimMchaha
12:45aartistI am coming from Perl background. Please englighten me.
12:45carkwhy are you looking into clojure?
12:46fdaoudaartist: to be it's A) a great Lisp and B) that runs on the JVM.
12:46carkand it's fast
12:46fdaoud(of course combined that it has traction and a great community)
12:46aartistWhat it is used for in production? I know for example , that LISP is used in Emacs.
12:47TimMcaartist: http://clojure.org/ is the best place I know of to find out.
12:47technomancyin particular http://clojure.org/state or http://clojure.org/rationale
12:47carki think people use it mostly on the server side
12:47TimMcright
12:47cemericktechnomancy: regexes? 0.o No interpolation, you mean.
12:47technomancycemerick: and the fact that they're not ifn?
12:48TimMctechnomancy is trolling a bit
12:48cemericktechnomancy: would their ifn find or match?
12:48cemerick(TimMc: yeah, I know :-)
12:48carkaartist: clojure is nothing like emacs lisp
12:49TimMc s/^/aartist: /
12:49technomancycemerick: I don't particularly care as long as I can use it as a predicate
12:49technomancy75% of my regex uses are (re-find #"foo" ...)
12:50cemerick(partial re-find #"foo")?
12:50carkactually if you consider that the emacs language and clojure are both lisps, then you might say that lisp is only syntax. What's really interesting about clojure is semantics
12:51TimMc(def refinder [re] (partial re-find re))
12:51TimMcdefn, rather
12:51technomancycemerick: sure, but it's noise
12:51carkimmutable data structures, reference data types, that's what make clojure what it is
12:51TimMcOne more thing to worry about.
12:51carkand the jvm bit of course
12:52cemerickthe jvm bit is incidental for many
12:52TimMcaartist: Akamai uses it for some sort of mobile web browsing compression proxy.
12:52simardis the hash of a map unique enough for general identification purpose ?
12:52fdaoudwhen you define a function that takes a collection, [coll] seems to be standard. what is the standard for a map? since "map" is already a function.
12:53simardsay.. is it as good as md5 ?
12:53fdaoudcemerick: yes but also a plus for many others
12:53cemericksimard: don't expect it to be stable across clojure or jvm versions
12:53cemerickor, perhaps even clojure/jvm runtimes
12:53cemerickfdaoud: certainly for me, yes
12:54TimMcfdaoud: m
12:54simardcemerick: I don't need that much, as long as it's the same on the same runtime
12:54fdaoudTimMc: really? I was hoping for more than one character.
12:54cemericksimard: should be fine then; plan on collisions though, of course
12:54TimMcLook, some of us can only afford one character.
12:54TimMcwe are the 99%
12:54aartistI am still looking for few examples of real-world apps.
12:55fdaoudaartist: are you interested in web apps?
12:55dnolencemerick: chicken scheme? why not a Clojure language module for Racket?
12:55cemerickfdaoud: there's no harm in shadowing the map fn if (a) you're not using it, or (b) if you're happy enough using clojure.core/map
12:55TimMcaartist: Here's a raytracer I wrote for a HW assignment: https://github.com/timmc/CS4300-hw6
12:56dnolenaartist: why Clojure - you can do all the crazy Perl stuff and them some.
12:56cemerickdnolen: or whatever; chicken is the only scheme I've actually deployed to do real work, I know it compiles to C, and it's got gobs of libraries.
12:56technomancyclojurebot: clojure success stories?
12:56cemerickRacket or gambit may very well be a better "host"
12:56clojurebotExcuse me?
12:57technomancyclojurebot: clojure success stories is http://dev.clojure.org/display/community/Clojure+Success+Stories
12:57clojurebot'Sea, mhuise.
12:57technomancyaartist: plenty of material there ^^
12:57aartistI also like language for learning, but real-world app example will help. I got that you can use Java libs and that's great plus.
12:57dnolenaartist: or target JavaScript
12:58dnolenaartist: what kind of real-world app example
12:58fdaoudcemerick: thanks for the clarification.
13:00aartistdnolen: well, coming from Perl background, is there comparision between these 2?
13:00dnolenaartist: between what 2?
13:01babilenIs there any library that allows me to parse command line arguments *and* support subcommands? It looks as if I have to hack on tools.cli and incorporate some of leiningen's subcommand logic. But I wanted to ask first
13:01dnolenaartist: what do you use Perl for?
13:01aartistdnolen: I use Perl for many thing including Web Application, Data Parsing and Transformation.
13:02dnolenaartist: well you can do all that with Clojure.
13:02aartistIs there CPAN equivalent for Clojure?
13:02mdeboardLeiningen
13:02dnolenaartist: clojars and Maven
13:02mdeboardClojars
13:02technomancybabilen: most of the subcommand stuff in lein is pretty ad-hoc. I'm interested in generalizing it in 2.0 but would welcome input on this
13:03technomancymaybe it could just be delegated to tools.cli
13:03babilentechnomancy: I've seen it -- I am considering working on subcommand support for tools.cli -- Just started to develop some ideas and then 0.2.0 of it is released :)
13:04babilentechnomancy: I like some aspects of it, but it is pretty ad-hoc. It would be nice to have good support for subcommands in tools.cli -- just wasn't sure if there isn't a suitable library available already.
13:04aartistThank you guys/girls.
13:05fdaoudgirls?
13:09seancorfieldvery exciting to see a second clojure conference on the calendar (esp. one right in my back yard)
13:10TimMcfdaoud: Women? In my channel? It's more likely than you think.
13:15fdaoudTimMc: in your channel?
13:16TimMcMine, as in the one I am in.
13:17TimMcDo you know the meme I am referencing?
13:17fdaoudNo, I don't know what that means.
13:17fdaoudall I'm saying is, there aren't (m)any women here.
13:19TimMcfdaoud: http://knowyourmeme.com/memes/x-in-my-y
13:19TimMcfdaoud: That may or may not be true, but it's not a welcoming attitude either way.
13:20fdaoudTimMc: I understand what you're saying, but you misread me.
13:22fdaoudI was not saying it like that.
13:23kephalei know of women that come in here regularly that would probably stop coming if they were here and read those comments
13:24fdaoudkephale: what comments exactly?
13:25kephalethe (m) on the any i think, so not comments plural
13:26kephalesuggesting that there aren't many is probably acceptable due to the general demographics of CS/programmers these days
13:26kephalebut you never know, lisps might be more seductive to the ladies
13:27fdaoudkephale: ok. so all I'm saying is that there are probably many more men than women here. that is all. I would certainly be glad to know I was wrong about that. How is that offensive?
13:29kephalewell, just to put it to rest, i think the thing that might be taken offensively is the suggestion that there wouldn't be "any'" women here. what you just said doesn't sound offensive.
13:29kephalethats all
13:29fdaoudkephale: I agree, you're right. I should not have suggested "any".
13:30kephaleheh, i can't blame you, i slip up as well
13:30clojurebotNo entiendo
13:30kephaleclojurebot: do you identify with a gender?
13:30clojurebotgender is irrelevant
13:31fdaoudkephale: you know what it is? I'm not used to the sheer number of people here. the other channel I frequent has 6-7 people -- so it *is* quite possible that they are all men.
13:31fdaoudso, my mistake. apologies.
13:33TimMc~clojurebot
13:33clojurebotclojurebot is amazing
13:33TimMc~clojurebot
13:33clojurebotclojurebot is a cold unfeeling genderless mechanism
13:33TimMcthere we go
13:33kephalelol
13:33gfredericksand likes football.
13:35fdaoud,(repeatedly #(str "sorry for the misunderstanding"))
13:35clojurebot("sorry for the misunderstanding" "sorry for the misunderstanding" "sorry for the misunderstanding" "sorry for the misunderstanding" "sorry for the misunderstanding" ...)
13:35ibdknoxlol
13:42jweissanyone know how to get emacs to indent comments (eg, putting them at the end of the line and have the next line of the comment align with the first one)
13:42jweissi read something about the meaning of ; vs ;; vs ;;; vs ;;;; but none seem to indent right
13:44jweissdurr... don't know why previous searches didn't turn this up: http://www.gnu.org/s/libtool/manual/emacs/Comment-Commands.html
13:50TimMcfdaoud: Wasn't trying to hammer on you, sorry if it came across that way. Yes, there is undoubtedly a large gender imbalance in CS, but I think it is best left unmentioned most of the time. (Obviously it is fine to discuss in the context of a discussion on trying to make the community more welcoming to women!)
13:51fdaoudTimMc: agree with you 100%.
13:52TimMcso... how 'bout them sexprs!
13:52sridcan't gender imbalance in particular professions be naively explained away with difference in motivation (as opposed to ability)? that's what this guy argues for - http://www.psy.fsu.edu/~baumeistertice/goodaboutmen.htm
13:54sridnobody takes offense at the former, only at the later.
13:56TimMcYes, I am definitely leaning in that direction recently. I've heard that women are (statistically) more drawn to professions and hobbies that have a social impact, so that programming-for-the-fun-of-it draws fewer women.
13:57TimMcBut there's a third factor, which is cultural pressure -- a combination of social gender roles and how communities present themselves.
13:59TimMcHell, I wouldn't be surprised to learn that there are innate (statistical) differences in ability in various arenas, although I can't imagine they'd be *too* dramatic. Wrong political climate for that research, though.
14:01chouserTimMc: yup. I was about to say that just because people find something offensive doesn't prevent it from being true.
14:02chouserThough if there really were a statistical difference in ability, it would make me sad.
14:02TimMcAlso, evolution hates us. :-P
14:03jweisschouser: you mean inborn ability or actual
14:03TimMcInborn, presumably.
14:03chouserhm, I guess I meant in-born, but either would be sad (though for different reasons)
14:03jweissthat would be pretty tough to prove
14:03TimMcActual ability is affected by such silly and transient things as cultural context.
14:03jweissyeah, that's what i was getting at
14:05jweissi don't know that you can separate ability from interest
14:06TimMcHard to measure.
14:06chouserI think interest (perhaps factored with personality) has more impact on actual ability in any intellectual area than just about anything else.
14:06jweissi would agree
14:07chouserI factor in personality because I have three kids and various natural approach to failure is *so* different from each other.
14:07gfredericksI'm surprised that nobody has yet brought up the point that boys go to jupiter to get more stupider, while girls go to college to get more knowledge.
14:07chousergfredericks: excellent point.
14:08gfredericksalso something about waffles and spaghetti.
14:08RaynesI want spaghetti.
14:10TimMc(This would be a good time for me.panzoo/spaghetti to have an update pushed to clojars)
14:12fdaoudchouser: that's interesting, do you mean each of your three kids react differently to failure? if so, how so?
14:14chouserfdaoud: yes. We have one for whom even small failure is almost overwhelming emotionally. This one is maturing and learning to fight through hard things, but this is very difficult. Their favorite activities are ones where success and failure are more subjective.
14:15jcromartieoh boy, boys vs girls?
14:15TimMcjcromartie: Welcome to #genderstudies!
14:15TimMcIt's my fault, basically.
14:16chouserAnother also get frustrated with failure (they're all young still) but tends to rapidily re-attack the problem and persist either until success, or they become convinced it's not possible in which case they tend to totally detach.
14:17jodaroi have two boys
14:17jodaroone is totally persistent
14:17jodaroand the other gives up really easily
14:17chouserThe third is still too young for me to reach conclusions, but may be more likely to dissemble than to either attack or avoid failure.
14:17jodaropretty amazing how different they are
14:18chouserjodaro: that's been a big surprise for me.
14:18chouserbefore I had my own kids, I assumed at least half of what we call personality was "nurture". Now I'd say it's more like 10%
14:18fdaoudchouser, jodaro: I'm seeing the same kind of difference here. oldest daughter (4.5 y/o) when something doesn't go her way, stands up and starts whining and crying. youngest daughter (2.5 y/o) just plows forward and finds a way through.
14:18TimMcMy psych prof said she was both distressed and relieved when she realized that her parenting had very little effect on her kid's personality.
14:18jodarowhat's most fascinating is how similar they can be to each other, and by extension, to me in some ways
14:19jodaroand how different in other ways
14:19jodarofdaoud: same with me. older one is way more of a whiner.
14:19chouserfdaoud: I think birth order may have a stronger correlation there than gender.
14:19TimMctrue
14:19chouserditto here
14:19jweisschouser: my kid is very calm and relaxed, people try to give me credit, i assure them my parenting has nothing to do with it
14:19fdaoudyes, I think it's normal
14:20TimMcI wonder how much of that variation coudl also be due to random formative experiences.
14:20fdaoudsecond-born always had to compete
14:20fdaoudfirst-born had 2 years of "it's all me"
14:20jodaroright, same here
14:20jweissi was gonna ask about birth order (since i only have 1) - would assume the first born is accustomed to everything going his way
14:20jodaro"its all me and i can do no wrong and everyone loves me the best"
14:20jodarojweiss: i think thats often the case
14:21jodarobut i do have some friends that have somewhat the opposite situation
14:21jodarothough of course its the usual parenting "science": anecdotal evidence
14:21TimMcjodaro: Only child here. I actually have a bit of fear-of-failure perhaps *because* I was used to everything going my way.
14:21fdaoud"with 3 kids, often what happens is first-born and baby get all the attention, middle child is ignored. I have 3 kids. I am determined not to do that to little..what's-her-name."
14:21jodaroTimMc: i'm an only as well.
14:22jodaroplayed by myself a lot
14:22jodaromy boys play together all the time
14:22TimMcyup
14:22jodarowhich is great
14:22ibdknoxI'm a bit unique in that I have a brother, but our age gap is 7 years
14:22TimMcbruncle!
14:22ibdknoxhaha
14:22jodarobut sometimes i think its at the expense of knowing how to have fun without expecting someone else to help
14:23ibdknoxI was fiercely independent as a child, never really whined
14:23ibdknoxmy brother on the other hand, ended up with a massive inferiority complex
14:23fdaoudsome days they play together beautifully, it's so awesome, other days they can't be 2 minutes together without screaming and fighting
14:23ibdknoxand is prone to give up very quickly
14:23jodarofdaoud: totally.
14:24TimMcibdknox: Oh, you're the older one?
14:24ibdknoxTimMc: yeah
14:24jodaroibdknox: did you get to/have to babysit a lot?
14:24chouseryet first children are the ones who end up as presidents, ceos, etc. [I am not a first child]
14:24ibdknoxso a bit opposite of the general trend we've discussed
14:25fdaoudjodaro: how old are your boys?
14:25sridchouser: fdaoud you attribute only 10% to nurture? wait till they grow up and get acculturated to an extent so remarkable that cultural conditioning takes over the stage, so to speak. :)
14:25jodaro8 and 11
14:25ibdknoxjodaro: yeah, I essentially did a lot of the raising. My parents got divorced when he was about 4
14:25chousersrid: Hm, interesting.
14:25jodaro3rd and 6th grade
14:25fdaoudsrid: ?
14:26jodarospeaking of parenting, i had a shitty parenting morning
14:26jodarowife leaves early for work on some days so its all me
14:26jodarothey pissed me off to no end today
14:26fdaoudthe boys give you trouble?
14:26sridand perhaps that's why some parents are interested in school-at-home
14:27jodaroi finally blew up and gave them the old "i do everything for you and still you don't listen!"
14:27fdaoudand you thought you'd never say that ;)
14:27jodaro no "screen time" tonight
14:27jodaroyeah heh
14:27jodarothey've both been really into a couple games on the ipad
14:27jodaroso that hits em where it hurts
14:27jodarobut
14:28fdaoudjodaro: each age has its stage, right? I'm still at the stage where I wish we could have dinner without constantly worrying about the 2-year-old falling off her chair and breaking her face
14:28jodaroi can't help but feel like a dick afterwards
14:28jodarofdaoud: hahah yeah
14:28jodarothey are both way more independent now (usually) with that kind of thing
14:28jodaroit gets easier in some areas and then harder in others
14:28jodaroolder one just started middle school
14:28jodarowhich is a whole new world
14:29jodaroin that he has to be on top of his shit or else
14:29fdaoudyeah, I am fully aware that one thing less to worry about will be replaced by another
14:29jodarobut the flip side is that he can walk around the neighborhood by himself, go to a friends house, walk up to the store
14:30jodaromake a snack (and periodically do it without making a huge mess)
14:30fdaoudI just hope that my thinking that My Life Will Be Better Once They Sleep Through The Night is correct
14:30jodarofdaoud: i'd say yes.
14:30fdaoudjodaro: I think everything else falls apart from the lack of sleep
14:30jodaromy older one is a voracious reader
14:31jodarowhich helps a lot
14:31sridfantasy fiction?
14:31jodarohah of course
14:31fdaoudthey have less ability (i.e. are clumsy, fall down, get hurt), we have less patience, it's all bad when we don't sleep
14:32Squee-Dantares_ would you have (resources on/examples of) a complete reactive program using rabbit? I'm looking to shortcut understanding agents and threading to hack an existing example to show off and work back from.
14:32Squee-Dfdaoud you talking toddlers?
14:33chouserfdaoud: yes. The lack of sleep gets better, and that can make a huge difference in all areas of life. :-)
14:33mtm_is there an idiomatic way to find out a symbol has been bound in a namespace? I can see if it's been interned, but I don't see an obvious way to see if it's bound.
14:33chouser(doc bound?)
14:33clojurebot"([& vars]); Returns true if all of the vars provided as arguments have any bound value, root or thread-local. Implies that deref'ing the provided vars will succeed. Returns true if no vars are provided."
14:34mtm_:P
14:34mtm_how obvious
14:34Squee-DI learned to work with less sleep, and how to powernap.
14:34chouser:-) It was new in version 1.2
14:34chousermtm_: no worries.
14:35fdaoudSquee-D: yes, 4.5 and 2.5 y/o
14:35jodaroi remember how hard those years were
14:36jodarobut i rememebr how awesome they were too
14:36Squee-Dfdaoud i decided i don't want to hate it, so i learnt to call it normal. I know NLP is a soft science, but convincing yourself not to get hung up on sleeplessness did help me
14:36jodaroenjoy it while it lasts </old man>
14:37fdaoudSquee-D: you're right. it's just normal now and the occasional uninterrupted night is A Real Treat.
14:37Squee-Dmy girl 'sleeps through' now. that is i only have to get up 3 times a night most nights, just to reassure her, let her go potty, etc.
14:37Squee-Dfdaoud totally :D
14:37fdaoudmy wife and I laugh about when we didn't have kids and we'd get up at 9:58 on saturdays only because there was a show on at 10:00 that we liked to watch while eating our cereal.
14:38Squee-Dfdaoud I love when she goes to nannas and me and the missus and I are left alone.. but when she comes home i wonder why i needed it. s wierd
14:38fdaoudnow we're up and at 'em at 6:30
14:38Squee-DI'm a latecomer, and my wife and I are both debauched, deviant and hedonists.
14:38Squee-Dwe lauch at absolutely every change in our lives :D
14:39fdaoudSquee-D: totally! sometimes they drive us nuts but when they're not here, we miss them
14:39Squee-D6:30.. dude 6:00 am is a sleep in for me :(
14:39Squee-Dlaugh*
14:39fdaoudwhat time do they go to bed?
14:39Squee-Dused to be 7:pm
14:39antares_Squee-D: using langohr, you mean?
14:39Squee-Dbut with daylight savings, hard to get her to sleep before 8:30
14:39fdaoudyeah 9:30pm here, so it's just moved over ;)
14:39Squee-Dantares_ sure
14:40Squee-DOh i wake up for work
14:40antares_Squee-D: yes, I want to put together an example. I am working on doc sites for two other projects (one of them is a Clojure library) at the moment so I don't know yet when that may happen.
14:40fdaoudSquee-D: I was talking weekends
14:40Squee-Dfdaoud i sneak out of the house in the morning to miss traffic, means i leave for home earlier too
14:40Squee-Dfdaoud oh yeah fair, i get to about 6:30 too
14:41fdaoudsure in the week we're up early even before we had kids
14:41fdaoudbut we took it easy on the weekends
14:41seancorfieldthose are early mornings... i'm rarely up before 9am (but then i'm in california!)...
14:41Squee-Dantares_ is there anything you can feed me from your own usage that wont break disclosure?
14:41Squee-Dseancorfield i used to be an LD for dance parties and clubs :D
14:42Squee-DIts so strange to be "normal", it's like being a wierdo all over again
14:42Squee-Dbut i'm amazed at how awesome having a kid is.
14:42clojurebotexcusez-moi
14:45fdaoudI was sad the day the little one stopped saying "oh gin" and started saying "orange" :_(
14:47seancorfieldheh, my wife & i made the decision early on to not have kids but we have lots of cats instead (no college fund, you can lock them up if they're naughty, etc :) )
14:47seancorfield,(clojure-version)
14:47clojurebot"1.3.0"
14:47seancorfieldah, good, the bot got an upgrade
14:47Squee-Dfdaoud i get in trouble when i try to improve my girls language :D
14:47seancorfield,(doc realized?)
14:47clojurebot"([x]); Returns true if a value has been produced for a promise, delay, future or lazy sequence."
14:48fdaoudSquee-D: I did everything to prevent it! ;)
14:48fdaoudit was so adorable, I didn't want it to end
14:48Squee-Dyeah my wifes like that :D
14:49fdaoudSquee-D: but now I have to be more careful of what I say. apparently my 4-year-old said to the teacher, "which part of 'no' don't you understand?"
14:49ibdknoxlol
14:49jodarohahah nice one
14:50tolstoyCan you include clojure code (clj-http.client, for instance), when running in script mode? (use '[clj-http.client :as http]) gets me some sort of not found error even though I have the lib on the class path.
14:51tolstoySeems like the script can't find clojure code in the jar file.
14:51tolstoyOh, wait.
14:52tolstoyHm. Still broken even when jars are absolute pathed.
14:52amalloytolstoy: i don't think "script mode" is a thing that exists
14:52ibdknoxwoah
14:53ibdknoxlook who it is
14:53RaynesYou can't run it in skynet mode either, fyi.
14:53ibdknoxRaynes: damnit.
14:53tolstoyclj file.clj
14:53ibdknoxamalloy: Raynes told me you were in a bridge tournament? How'd it go?
14:53tolstoyI guess I probably have the whole terminology off base. I'll start reading and ask again if things don't get cleared up. Sorry!
14:54RaynesThat's a random Clojure startup script that doesn't have anything to do with Clojure itself officially and will only put Clojure on the classpath. You'll want to use Leiningen or cake.
14:54amalloyibdknox: he was just guessing, actually. non-bridge vacation, for a change
14:55TallAdamhi guys - I'm having trouble getting 'eldoc' to work with cocoa-emacs 24. it works fine for .el files, but not for .clj files (in fact, it suggests lisp eldocs for stuff like 'assoc', where there is a definition in both CL and Clojure). Has anyone else had this problem?
14:55technomancyat the conj can we round up all the clojure rabbitmq authors in a room and have them duke it out until there's only one standing?
14:55ibdknoxamalloy: ah, well welcome back :)
14:55Raynesamalloy: That was what ninjudd told me.
14:55RaynesBut he wasn't sure either.
14:55amalloythanks! good to be back
14:55RaynesSaid "probably a bridge tournament".
14:55tolstoyRaynes: Thanks. I just have a test script to get some stuff right, but I do indeed use leiningen most of the time. I think I just have some path issues.
14:56RaynesDefinitely path issues.
14:57TallAdamanyone? :)
14:58TallAdamI have moved off Aquamacs as its too flaky and I'm sick of stuff not working
14:58antares_technomancy: not sure if I should wipe out my recent, well maintained RabbitMQ client from github after hearing this ;)
14:58technomancyantares_: depends. is it the best? =)
14:59ibdknoxmine is totally the best. *goes to create a new repo*
14:59ibdknox:p
14:59technomancyibdknox: zero bugs!
14:59antares_technomancy: to me of course it is :)
14:59ibdknoxtechnomancy: absolutely none. Who else can claim that
14:59technomancyantares_: maybe some kind of "Here's what makes it different" in the readme would help?
14:59tolstoytechnomancy: That would be awesome! RabbitMQ needs some help….
15:00gfredericksI'm getting an "attempting to call unbound fn" error when my java calls my clojure class, but I can't see why any NS wouldn't be loaded...
15:00gfredericksis there some other cause for that error?
15:00antares_technomancy: one nice thing about https://github.com/michaelklishin/langohr is that it has 3 years of experience using & now maintaining Ruby amqp gem mixed with 2 years of experience with the Java driver
15:00amalloygfredericks: you have to load the namespaces manually
15:00gfredericksamalloy: I added a (require 'the-ns-my-class-is-defined-in) to the beginning of the method
15:01antares_technomancy: and the README mentions that, for sure. We are working on the doc site now before releasing 1.0. Unfortunately, travis-ci.org eats most of my spare time these days.
15:01gfredericksamalloy: the var causing the error is only called indirectly; are you suggesting I need to require every single ns in my project manually?
15:01technomancyantares_: that's cool; I hadn't read the readme actually, sorry.
15:02antares_technomancy: I do not actively "market" it yet because there is next to no documentation, so that's expected that you never heard of it ;)
15:02technomancysome of the other ones give a "we wrote this because we didn't realize any other ones existed" impression
15:02amalloygfredericks: you should only need to require the top one, which requires the others
15:02gfredericksamalloy: it's weird because this has generally been working; I thought I was familiar with this setup.
15:03antares_technomancy: sure, that's why when we started using Clojure very actively first thing I did was writing Langohr.
15:04gfredericksalso I'm supposed to demo this stuff in 3 minutes and it looks like it's not going to work :(
15:04amalloyouch. maybe there's some general RT.startLoadingStuff()?
15:04amalloyi'm not familiar with it myself
15:04technomancyantares_: any reason in particular you're not targeting 1.2 compatibility?
15:04antares_technomancy: so, if RabbitMQ clients question does come up and the Conj, feel free to mention Langohr. I won't be at the conj so someone has to do it for me :)
15:05antares_technomancy: no, no real reason. I won't mind working on 1.2 compatibility in the future.
15:05technomancyok, just curious
15:05antares_I guess instead of numerics everything should work on 1.2
15:05technomancywould you mind if I submitted a patch to use a RABBITMQ_URL environment variable by default if it's set?
15:06antares_technomancy: sure. You would need to add URI parsing for that, I was going to do that, too.
15:06simardI'm looking for an into function that would return a map even if the first argument is nil.. say.. (into (:a {:a 1}) {:b 2}) => {:a 1, :b 2} AND (into (:a {:b 1}) {:b 2}) => {:b 2}
15:06technomancyyeah, it's pretty easy. I'll put together a pull request
15:06antares_technomancy: amqp gem supports both options & amqp:// URIs, I feel langohr should, too
15:06technomancyI just added the same thing to java.jdbc
15:06antares_technomancy: thanks!
15:07technomancyafter lunch maybe
15:07lazybotjava.lang.RuntimeException: EOF while reading
15:10seancorfieldtechnomancy: i applied your patch for jdbc-22 which was defaulting the driver class name based on the subprotocol but i don't remember a patch for accepting a full URI?
15:11seancorfieldoh, my bad, you have submitted a patch... sorry
15:12seancorfieldjira hadn't notified me of the follow-ups since you'd said to hold off on the patch
15:13antares_seancorfield: hi. A quick java.jdbc question: what's the best way to convert a result set row into a map? (I know they can be used as maps but I need to serialize it)
15:13cgrayin clojurescript, does a javascript object become a clojure map? (i.e., can i get the property bar in object foo by saying (foo :bar)?)
15:14seancorfieldantares_: they are maps now (in 0.1.0)
15:14seancorfieldi removed the dependency on struct recently
15:15antares_seancorfield: ah, that's why they can be used as maps. Thank you! and thanks for picking up clj-time maintenance.
15:15seancorfieldtechnomancy: that patch has a lot of changes in it... :)
15:15seancorfieldantares_: heh, another library i needed at world singles so it made sense to take it over from mark et al
15:22amalloysimard: merge
15:22amalloy&(merge nil {:a 1 :b 2})
15:22lazybot⇒ {:b 2, :a 1}
15:22amalloy&(merge {:b 5} {:a 1 :b 2})
15:22lazybot⇒ {:a 1, :b 2}
15:22simardamalloy: thank you
15:29seancorfieldtechnomancy: patch applied... once it passes the matrix test i'll cut 0.1.1
15:47ibdknoxHey folks, I am officially releasing 0.2.0 of Korma today: http://news.ycombinator.com/item?id=3188609
15:48ibdknoxProject website here: http://sqlkorma.com
15:51jcrossley3technomancy: do i have any degree of control over the contents of the pom.xml leiningen creates?
15:51seancorfield0.1.1 of clojure.java.jdbc is heading to maven central - thanx technomancy
15:52amalloyjcrossley3: an unhelpful aside: you can influence the pom.xml by changing what your dependencies are :P
15:53jcrossley3amalloy: yes, unthanks for that, indeed. :)
15:53jcrossley3in fact, i'd prefer to manage those deps in project.clj, but would still require certain elements in the pom for other maven plugins.
15:54jcrossley3just wondered if there was any merging capability
15:55Squee-Dis there an obvious link between noir and korma? sites look a bit the same
15:55brehautSquee-D: same creator?
15:55Squee-Dno dude, i said OBVIOUS
15:56ibdknoxhaha
15:57brehautand what do you mean 'look a bit the same' ones gill sans, the other is helvetica!
15:57ibdknoxyeah dude
15:57ibdknoxtotally different
15:57ibdknoxI actually intentionally made them mostly the same
15:57Squee-Ddunno how i missed that
15:57ibdknoxthat layout seemed to work well for this kind of stuff
15:57ibdknoxobvious code examples, a little text
15:58Squee-Dyeah im pinching it
15:59Squee-Di love the curry colors
15:59Squee-Dneeds a favicon
15:59ibdknoxfigured I'd do warm this time
15:59ibdknoxoh damn
15:59ibdknoxforgot that
16:05chouseribdknox: why {:email [like "*foo"]} instead of (like :email "*foo")?
16:05ibdknoxyou can do either :)
16:06chouserah, ok.
16:07chousermultiple where's are anded?
16:07ibdknoxyessir
16:07Bronsacool
16:07hiredmanibdknox: looks interesting
16:08ibdknoxhiredman: :)
16:08Squee-DLooks like a very elegant dsl
16:08Squee-DI'm a fan of Arel in ruby.
16:08chouseribdknox: why . instead of / for :account.name ?
16:09Squee-Dhow long does the first index of repo1 usually take?
16:09Squee-DMy internet connection isnt hot (im in NZ) but its been going for 5 minutes now
16:09ibdknoxchouser: I wanted to keep those closer to SQL, though there's no strong reasoning either way for me
16:10brehautSquee-D: what part of NZ?
16:10Squee-Dakl
16:10chouseribdknox: fair enough
16:11Squee-Dbrehaut sorry i said that assuming you were local. Auckland
16:11brehautSquee-D: i am; im in the tron
16:11Squee-Dthe hell is a clojurian doing in hamilton?
16:12brehautwhat the hell kind of question is that :P
16:12technomancyjcrossley3: there's not much in there yet, but I wouldn't rule it out as a future feature
16:12Squee-Di didnt think there were enough brain cells in the whole town
16:12chouseribdknox: looks interesting. Hope I have a chance to try it out.
16:12Squee-Ddo perhaps borrow them from aucklanders that are passing through?
16:12Squee-D:P
16:13brehautive never heard of an aucklander going south of the bombays
16:13ibdknoxchouser: if you do, I'd love to hear feedback.. I'm sure there are issues in there still
16:13Squee-Dbrehaut well no point is there? really..
16:14Squee-DWhat i really meant, is, how do you remain gainfully employed?
16:14technomancyseancorfield: thanks for cutting that release; lookin' good.
16:15brehautSquee-D: i build websites for a design firm in chch
16:15Squee-Doh aye. with which tech platforms, typically?
16:16technomancyibdknox: korma looks great, except for the indentation of -> forms in the samples. =P
16:16ibdknoxtechnomancy: blame vimclojure :p
16:16brehautSquee-D: Python/Django
16:16Squee-Doh thats right i remember you bitching about python yesterday
16:16Squee-D;)
16:16brehauthah
16:17PPaulhello guys. i'm having problems with my multimethod https://gist.github.com/1334752
16:17brehauti prefer 'offering unwanted critique'
16:17PPauli can't use (swank.core/break) in it for some reason
16:17Squee-Di'm principal here: http://www.vworkapp.com/
16:21technomancyndimiduk: what are the haps?
16:21Squee-Dok so lein search is hung on getting the index. can i get it manually somehow?
16:22ndimiduk@technomancy heya!
16:22jodaroSquee-D: your main office is right near me in sf
16:22jodarowell
16:22jodaroa few blocks
16:22Squee-Dmain office :D Thats how we look more american in America
16:23jodarooh sorry
16:23Squee-DAll good
16:23jodaroi meant us office.
16:23jodarothought i read "hq" somewhere
16:23Squee-Dyes, thats how we advertise it :D
16:23PPaulanyone can help me with my multi method?
16:23PPaulhttps://gist.github.com/1334752
16:23jodarojust says north american office
16:23Squee-Dthe substance of the team is in NZ tho.
16:23jodaromy bad
16:24jodarohow american of me!
16:24Squee-D:D
16:24zerokarmaleftbut now we know the truth...muahaha
16:24PPaulhow do i reinitalize a defmulti? (for developing)
16:24Squee-Dits ok, you're allowed ot be that way, until the country sinks into an econimic rut so deep it makes the great depressions look good.
16:24jodaroyeah
16:24Squee-Ddepression*
16:25jodarothen i'll be on the first plane to NZ
16:25jcromartiehm, interesting... Korma looks similar to ClojureQL
16:25jcromartiebut... nicer
16:25jcromartie:)
16:26brehautjcromartie: my hope is less magical :)
16:26Squee-Dlein repl says i should install rlwrap for optimum experience, no such clojure project.. is this some Java thing?
16:26jcromartiebrehaut: are you ibdknox too?
16:26simardis it possible that in this: (binding [*my-var* (some-stuff)] [(more stuff) *my-var*]), (more stuff) doesn't get to see the new value of *my-var* ?
16:26jcromartieor are you saying you have hopes as a user
16:26technomancySquee-D: rlwrap is a C program
16:27brehautjcromartie: lol. no
16:27Squee-Doh so probably in brew :D
16:27technomancyyup
16:27Squee-Dta
16:27ibdknoxjcromartie: I'm the only real ibdknox ;)
16:28Squee-DI don't fear magic. so long as magic is implemented idiomattically..
16:29Squee-D"rational magic"
16:30brehautSquee-D: well, clojureql is a relational algebra -> sql compiler. its a bit more idealised than sql and doesnt really have a 1:1 mapping. hence, it can seem a bit magical and surprising
16:31ibdknoxyeah I replied to a comment talking about clojureql
16:31ibdknoxmy problem is that I think it's the wrong abstraction and that as a result it produces pretty inefficient sql
16:32technomancykorma doesn't do schema manipulation yet, does it?
16:32ibdknoxtechnomancy: not yet
16:32technomancyplanned?
16:32tolstoyHave any of you had problems with memory leaks when you create and discard a lot of java.nio.ByteBuffers?
16:32ibdknoxI think it should probably happen, but I'm SQL'd out for the moment
16:32ibdknoxlol
16:33technomancyhah; understandable
16:33technomancythe lack of that was one of my main pain points in my experimental port of clojars to postgres.
16:33ibdknoxtechnomancy: yeah, I don't think it'll be too bad to add in
16:33Squee-Dimho, Korma is clearly better than clojureql for two specific, undeniable reasons. 1. the website, 2. the name
16:33brehautscience
16:34ibdknoxI mean, you can't argue with science
16:34Squee-Dit works, bitches.
16:35Squee-Dhttp://xkcd.com/54/
16:37jcromartietechnomancy: do you mean like migrations?
16:37technomancyjcromartie: yeah
16:41PPaulhow do i reset my defmulti?
16:41PPaulor multimethod?
16:43Squee-DPPaul i'd tell you, but I can't
16:43PPaulhmmm
16:43brehautPPaul: ns-unmap
16:43PPaulgreat!
16:44PPaulhmmm
16:45PPauli tried that with my namespace, and with my multimethod, i get errors in both cases
16:45brehautare you quoting syms?
16:45PPaulno
16:45brehauteg (ns-unmap 'user 'mymulti)
16:45PPauli did that, though
16:45PPauli'll try again
16:46brehautwell, use whatever namespace your multi is defined in, if its not user, dont specify user
16:46PPauloh, i need to pass the ns and multimethod...
16:46technomancyI think migrations would be worse than general SQL operations simply because individual databases vary a lot more in that regard.
16:46brehauttechnomancy: for some reason i recall seancorfield talking about supporting migrations in future clojure.jdbc release?
16:47ibdknoxI would love not to have to write that from scratch
16:47technomancyhuh... well the two of them should definitely coordinate on that
16:47ibdknoxlol
16:47technomancythere is also lobos, but I haven't looked at that
16:47brehauti could be miles of base on that ;)
16:48technomancybrehaut: is that a kiwi idiom? =)
16:48ibdknoxlol
16:48brehauts/of/off/ ; geez
16:48technomancyheh... for some reason it made me think of Ace of Base.
16:48brehautand for that im truly sorry
16:48ibdknoxtechnomancy: doesn't everything?
16:48ibdknoxlol
16:48ejacksonibdknox: I like your korma stuff :)
16:49technomancytried to think if the lead singer was named Miles or something
16:49ibdknoxejackson: :)
16:49ejacksonI've been working quietly on something similar, atop clojureQL to deal with the joins, ala has-many, belongs-to etc: https://github.com/ejackson/relation
16:49PPaulthanks a lot
16:49ejacksonits not ready for public consumption, but it'd be interesting to compare notes
16:51brehauttheres always someone on HN with 'whats wrong with writing raw SQL like a real man. you kids and your toys should get off my lawn' on threads about libs like korma
16:51ejacksonthe main idea is to maintain a hierarchy (using clojure's hierarchy functions) of the relationship between the tables, so that you can do longwinded and complicated joins and it figure out the correct SQL
16:51ibdknoxbrehaut: yeah, I always think that's funny
16:51ibdknoxI've written tons of raw sql
16:51ibdknoxit blows
16:52brehautyes
16:52brehautand i understand that thats a technical term
16:53ejacksonits a term the technical have to deal with frequently, that's for sure :)
16:53scottjbrehaut: I was about to post your exact quote for fun but searched first and saw jwr's already there :)
16:53brehautlol
16:53brehautthats what i was referring too ;)
16:57jkkrameribdknox: does korma handle many-to-many relationships?
16:58ibdknoxjkkramer: not explicitly, though you can do the joins yourself. The next version will to it as just another relationship
17:01jkkrameribdknox: gotcha. seems you'll need a special syntax, or support for forward declarations, given clojure's top-to-bottom compilation
17:01ibdknoxjkkramer: hm? queries are just a map with parts added to them
17:01ibdknoxjkkramer: you can add the parts however and whenever you want
17:02jkkrameribdknox: i mean as part of of the defentity: (defentity foo (has-many ??)) (defentity bar (has-many foo))
17:02ibdknoxah
17:02ibdknoxindeed
17:02ibdknoxthere are a few reasons why I didn't do has-manys this go around
17:03Squee-Dyou can declare a symbol for later definition no?
17:04technomancySquee-D: yep, declare
17:04brehautsurprisingly enough, with the declare macro
17:04Squee-Dso would that be so bad?
17:05Squee-Di get that the beuty of a dsl is that you design it so the dev doesnt have to think it, but thats not so bad
17:05jkkramerSquee-D: depending on how defentity is implemented, it may depend on the value of the related entity's var
17:05Squee-Doic because its a macro not a fn?
17:06Squee-Dbecause the fn wouldnt run till it runs.. right?
17:06Squee-Di mean that's what i was basing my ignorance on :P
17:07ejacksonibdknox: you must really not have liked clojureQL to go to the effort to replace it !
17:07seancorfieldbrehaut: don't think it was me talking about migrations... at least, not as part of c.j.jdbc
17:07jkkrameri haven't looked at the implementation, so not sure
17:07brehautseancorfield: aight, sorry about that then
17:08seancorfieldat world singles, we write migrations in sql and apply them as part of our build so maybe that was the connection?
17:08brehautseancorfield: it could well have been
17:08ibdknoxejackson: I don't like the abstraction, it's a cool idea, but it doesn't map correctly for me. It also generates queries that I would *never* write
17:08ejacksonit would be great to use lobos to figure out the schema to generate the has-manys and the belongs-tos. Fever dreams.
17:09jkkrameribdknox: I'm not enamored with clojuresql's abstractions either. looking forward to seeing how korma develops
17:09ejacksonibdknox: yeah, I've had at least a few odd queries come out of it, that's for sure.
17:09seancorfieldibdknox: is there stuff that c.j.jdbc could do for you to make korma easier to develop / use?
17:10ibdknoxseancorfield: I'm somewhat confused by returning things
17:10ibdknoxseancorfield: I was going to talk to you about it tomorrow
17:11seancorfieldsure!
17:11seancorfieldin amongst all the emacs goodness :)
17:11dnolenoof, ibdknox kora site is down
17:11ibdknoxhaha indeed
17:12dnolenkorma i mean.
17:12ibdknoxdnolen: try again?
17:12dnolenibdknox: nice
17:13ibdknoxI think it might be time to get off this micro instance :p
17:13brehautibdknox: what web server are you running?
17:13ibdknoxjetty
17:14brehautno gateway server?
17:14technomancyibdknox: for a static site?
17:14ibdknoxah sorry
17:14ibdknoxnginx in front of it
17:14ibdknoxI didn't set it up to cache though, which was dumb
17:14brehautyou should be able to handle HN with a static sight and nginx on a wrist watch
17:14ibdknoxyeah, easily
17:14brehautah, thats a mistake
17:14brehautsite
17:15brehauti suck at english. sorry
17:15ibdknoxme too, it's ok
17:15ibdknox:)
17:26ejacksonwhat's all this ->R thing on twitter right now ? I seem to have missed the origin.
17:26amalloyejackson: clojure 1.3
17:27amalloydefrecord creates constructor functions now
17:27ejacksonoh nice
17:27ejacksonthanks
17:34cemerickejackson: yeah, few know about it, unfortunately
17:34ejacksonwhere is it tucked away ?
17:37ejacksonsearching ->R and record constructor in google, jira and github have not helped me *sniff*
17:37cemerickejackson: ->Foo and map->Foo are two factory functions implicitly defined by defrecord and deftype
17:38cemerickvery undocumented
17:38ejacksonaaaaaaah, the R is a placeholder :)
17:38ejacksonfacepalm
17:38ibdknoxoooo map->Foo?
17:38cemerickejackson: or, relatively undocumented: http://dev.clojure.org/display/design/defrecord+improvements
17:39ejacksonthanks cemerick
17:39ibdknoxfinally
17:39cemerickibdknox: you didn't know about this either?
17:39ibdknoxcemerick: not at all
17:39ibdknoxand I've wanted it
17:39cemerickibdknox, ejackson: vote it up / comment: http://dev.clojure.org/jira/browse/CLJ-833
17:40cemerickAs soon as I saw "self-documenting" in conjunction with that feature, I knew this would happen. :-/
17:40ejacksonI''m not a registered voice yet.... any day now :)
17:40ibdknoxcemerick: done
17:41cemerickejackson: you can sign up for jira and watch/vote without having a CA in IIRC
17:41ejacksonright you are, ok, I'm going to shut up now, its seems to be the only way to avoid saying stupid things.
17:43brehautself-documenting \n noun | selvz ˈdäkyəməntING | The developer knows what a piece of code means at the time he or she wrote it.
17:43ibdknox(inc brehaut)
17:43lazybot⇒ 6
17:43cemerickbrehaut: fess up, you used a tool for that ;-)
17:44brehautcemerick: i copied and pasted a bunch of stuff from the builtin dictionary on the mac ;)
17:44ibdknoxWOAH now, you're using computers to help you do things?
17:44ibdknox(dec brehaut)
17:44lazybot⇒ 5
17:44cemericklol
17:44brehautlol
17:44cemerickbrehaut: right, one of my favorite tools. So sad it only works in cocoa apps.
17:45brehautyeah :(
17:45brehautin this particular case i used the dashboard widget
17:46cemerickI gave up on the dashboard years ago.
17:47brehauti mostly have too. mine is just full of sticky notes and the dictionary :P
18:11sridkorma.db has no sqlite yet?
18:11ibdknoxI didn't write a little helper for it, but it works just fine if you supply the normal jdbc map
18:12sridok, its only a macro. and i can retain my existing db map
18:13ibdknoxyeah (postgres) and all those are just helpers for those maps
18:14sridin the examples, `db` is not used anywhere.
18:14sridwith clojureql, I use `open-global`. for korma?
18:14ibdknoxthe text explains that defdb sets it as the default connection
18:15ibdknoxyou can then tell entities to use specific ones
18:15sridah, defdb
18:15ibdknoxsince it's a pool, there's no need to handle individual connections
18:15sridibdknox: in my project, db's :subname is a function. to be invoked later, when the path to sqlite file will be know.
18:15sriddefdb won't work with this data, would it?
18:16ibdknoxit's a delay
18:16srid{:subname #(get-sqlite-path %)} ;; something like that
18:17ibdknoxno I guess
18:17ibdknoxnot
18:17ibdknoxyou can always just create it later and set it:
18:17sridusing defdb? ok
18:17ibdknoxor creating a connection and using: http://sqlkorma.com/api/0.2.0/korma.db-api.html#korma.db/default-spec
18:18ibdknox(defualt-spec (delay-pool my-spec))
18:18ibdknoxthat's all defdb does basically
18:19lancepantzdoes anyone know if there is a maven repo that snapshot builds from http://build.clojure.org/ are pushed to?
18:19mabesibdknox: do you use korma to manage DB migrations or another tool (e.g. lobos)?
18:20ibdknoxmabes: I haven't done any migration stuff yet at all with Korma
18:20lancepantzi'm trying to use [org.clojure/data.priority-map "0.0.2-SNAPSHOT"] as a dependency, but neither lein nor cake resolve it
18:20ibdknoxmabes: since we used to be built on django, we're still using python to handle schema changes
18:20ibdknoxthat's likely to be something coming in the future though
18:20mabesibdknox: ah, makes sense
18:21mabesibdknox: I haven't needed migrations in clojure yet either, but last time I took a survey lobos seemed the best: https://github.com/budu/lobos
18:21brehautibdknox: south in particular?
18:21ibdknoxbrehaut: yep
18:22lancepantzwe have a project we are working on for migrations at work https://github.com/flatland/sqleton
18:22ibdknoxmabes: yeah, I wonder if I can just make these two work together seamlessly and call it a day :)
18:22lancepantzi'm very opposed to sql dsls, so it will always be straight sql for the migrations
18:22ibdknoxlancepantz: or that :)
18:23ibdknoxlancepantz: out of curiosity, why?
18:23lancepantzit's not really usable yet, aside from some connection utils we use
18:23lancepantzRaynes is supposed to help out with it this week
18:23lancepantzibdknox: i just feel like if you're writing sql, you should know sql
18:23lancepantzthat's something that you can't fuck up in production
18:23ibdknoxsure
18:24lancepantzif you don't know sql, you should either not be writing migrations, or learning sql
18:24lancepantzconsidering you need it that is
18:24lancepantzi do like the composability that things like clojureql provide
18:24ibdknoxso would you use a DSL outside of migrations?
18:24Rayneslancepantz: Speaking of that, we *really* need to talk about sqleton tomorrow. Like, definitely.
18:24lancepantzbut even then, i get pissed off wheneve i have to use clojureql, it's full of strange compiler bugs
18:25lancepantzthat you would never be able to debug if you did not indeed know sql
18:25lancepantzRaynes: sure
18:25lancepantzibdknox: i don't like it, but i do :)
18:25mabeslancepantz: the argument (granted, largely hypothetical) for DSLs is to act as a translation layer between different SQL variants
18:25lancepantzbeing the gist
18:25ibdknoxlol
18:25ibdknoxmm
18:26lancepantzlike i said, i dig the composability
18:26lancepantzwe already started using clojureql before my hate for it grew
18:26lancepantzin a new project, i would not use
18:26ibdknoxlancepantz: well, should you feel the need for something again, check out korma :)
18:27brehautlancepantz: thats the established path ;)
18:27lancepantzibdknox: did you write it?
18:27ibdknoxlancepantz: yessir
18:27lancepantzi saw the post to the list, i'll take a look at it tonight
18:27lancepantzyou did noir as well, correct?
18:27ibdknoxyep
18:28lancepantzgood work, you clearly know what you are doing, dont take my hate the wrong way :)
18:28ibdknoxhaha not at all, I think people fall on different sides of this one for good reason :)
18:28lancepantzi'm also a huge fan of readyforzero, so maybe i should just start a fan club
18:28ibdknoxlol
18:28srid(defentity apps (has-one users {:fk :owner_id})) ;; here "owner_id" is a column in apps table referring to "id" in the users table. but it does't work.
18:29ibdknoxsrid: belongs-to
18:29lancepantzanyways, any of the core guys around?
18:29sridibdknox: ah, right.
18:29lancepantzor anyone that's familiar with build.clojure.org
18:30sridibdknox: just curious - does noir support running on netty? my project uses aleph/websockets that require netty
18:30ibdknoxyes
18:30ibdknoxit'll run anywhere a ring handler works
18:30ibdknoxsrid: https://gist.github.com/1257857
18:31sridibdknox: not all parts of noir work in that example. for example, does code reloading work? i noticed that you are using aleph's http server
18:32ibdknoxsrid: yes they do.
18:32ibdknoxthe only part of noir that is dependent on jetty is start/stop/restart
18:33lancepantzring handlers are abstractions on top of the servlet spec though right? which netty does not support
18:34ibdknoxring maps are independent of that, I think they used to be more coupled to servlets
18:34ibdknoxbut if you look at the spec now
18:34ibdknoxthere isn't a single key for servlets in it
18:34brehautlancepantz: its an abstraction on HTTP, that happens to have implementations for servlet s
18:34lancepantzalright, just wanted to be sure
18:34ibdknoxalso, wrap-ring-handler does the magic necessary to work on netty's channel abstraction
18:35lancepantzvery cool
18:35lancepantzyeah, the last time i looked it proxied the servlet class and overrode the service method
18:39srid(select foo (with bar baz moo) ...) ;; this doesn't work "No relationshiop defined for table: moo" - but the relationship is indirect/associative
18:39ibdknoxone level only for now.
18:39sridfoo -> baz -> moo
18:40sridibdknox: any workaround?
18:40ibdknoxsrid: join?
18:42srid(fields ...) cannot be renamed? just found a conflict
18:43sridtrial and error - (fields [:foo :foo2])
18:43ibdknoxsrid: all of that is in the docs
18:58lancepantztechnomancy: are you around?
18:58amalloylancepantz: fun fact: you can say "technomancy: ping?" and lazybot will /msg you next time technomancy does something
18:58lancepantzhah
19:12sridtechnomancy: ping?
19:13sridamalloy: does it work when priv msg'ing lazybot?
19:13amalloyyes
19:13amalloythat's Stalker Mode
19:18brandelanyone here doing health informatics by any chance?
19:18thirddogClojure newbie here: have tried detailed instructions at http://dev.clojure.org/display/doc/Getting+Started+with+Emacs for setting up clojure/emacs on winxp and getting nowhere ... can anyone help?
19:20brandelit might help thirddog if you state which bit you're stuck on
19:20tolstoythirddog: Don't know about windows, but I had much better luck with: https://github.com/technomancy/swank-clojure
19:20thirddoghave set up as per instructions, but clojure-jack-in gives Exception in thread \"Main Thread\" java.lang.RuntimeException: java.lang.IllegalArgumentException: Cannot open <#<io$fn__7428$G__7382__7435 clojure.java.io$fn__7428$G__7382__7435@20d4d01>> as an OutputStream. (NO_SOURCE_FILE:0)
19:20tolstoythirddog: With the instructions on that page (though I use .emacs, not .emacs.d/init.el).
19:20ibdknoxseancorfield has some post somewhere talking about getting emacs + clojure on windows
19:21thirddogalso, lein swank-clojure starts repl, but slime-connect from emacs says it has conncted but gives no prompt
19:21tolstoyI had better luck doing "lein swank" in a terminal, then "M-x slime-connect".
19:21thirddogmy .emacs.d/init.el contains only code to install required packages, all else is in starter kit
19:22tolstoythirddog: You also have to install slime-repl.el
19:25thirddogwoo hoo! got a repl from emacs! at least slime-connect works now ... thx tolstoy
19:26tolstoyno prob.
19:27technomancyohai ppl
19:28ibdknoxOMG it's technomancy!!
19:28technomancyhow are you gentlemen
19:28thirddogstrangely, clojure-jack-in has also changed ... now shows "error in process filter: opening input file: no such file or directory <winxp user home>/.emacs.d/swank/slime-cdf283b4.el
19:29thirddogthe <xp user home> direcory is wrong through, it's showing as C:/Documents and Settings<username> instead of c:/Documents and Settings/<username> ... wtf?
19:30technomancythirddog: windows home handling is not what you would call coherent
19:30thirddogreeeaaalllllly ... no kidding
19:30technomancylancepantz: what's up?
19:31thirddoglooks like I'll be using slime-connect instead of clojure-jack-in then ... still, all seems to work according to the instructions online so not sure where my problem lies
19:31technomancyalways up for a patch if you figure out what's going on
19:32thirddognot an emacs lisp person but I'll see what I can find .. maybe good practice for clojure :-)
19:34lancepantztechnomancy: dude, i am having a hell of time getting lein to resolve data.priority map, as in: https://gist.github.com/7ab2b9a1c1b19efe6770
19:35lancepantztechnomancy: meanwhile, it's definitely there... https://oss.sonatype.org/content/repositories/snapshots/org/clojure/data.priority-map/0.0.2-SNAPSHOT/
19:37technomancycurious
19:39technomancylancepantz: it's resolving fine here. what lein version?
19:39lancepantzreally? as i gisted it? i'm on lein 1.5.2
19:40technomancylemme see if I can repro on 1.5.2
19:40lancepantztechnomancy: thanks man :)
19:40technomancystill works here.
19:40technomancysomething spooky going on
19:40lancepantzhmm
19:41technomancytwo days late for hallow'een no less
19:41lancepantzalright, well thanks for check for me man
19:41lancepantz*ing
19:41technomancyif you can repro on the latest feel free to open an issue
19:41technomancyyou're on a mac?
19:41lancepantztechnomancy: will do
19:41lancepantzand yes
19:41lancepantzshould that matter?
19:42technomancynah, "write once, run anywhere", remember?
19:42technomancy=)
19:42technomancy(I have no idea, just good to have more data)
19:42lancepantzgotcha,
19:42TimMcThat defproject gets deps just fine on lein 1.6.1
19:42lancepantzi'm trying on amalloy's box now
19:42TimMcon Ubuntu 11.04 x64
19:43lancepantzworks on amalloy's box too
19:43lancepantzso i've isolated it to me :)
19:44TimMcWhat platform are you on?
19:45lancepantzos x
19:46ibdknoxworked on OS X Lion for me just now
19:46lancepantzk, all else has failed, time to blow away my m2
19:46ibdknoxwith latest lein
19:47TimMclancepantz: That's what I always try first. >_<
19:47ibdknoxlol
19:47ibdknoxapply the hammer.
19:47lancepantzit worked!
19:47TimMchaha
19:47lancepantzhahaha
19:47ibdknoxhaha it's like me doing lein clean all the time :p
19:48lancepantzwell, thanks for the help dudes
19:50technomancyouch
19:50technomancyI wonder what could cause that
19:50TimMcMaven.
19:50ibdknoxhaha
19:50ibdknoxfact.
19:52amalloyibdknox: outside of this room, most people would answer "Java"
19:53ibdknoxamalloy: haha, a year ago, I would have ;)
21:04leo2007does swank-clojure support java7?
21:04leo2007Iam getting this error: http://paste.pound-python.org/show/14579
21:36wiseenIs there a way to (reset! atom nil) and get the current atom value not the nil value assigned ?
21:38hugodwiseen: I believe you have to use loop and compare-and-set!
21:38wiseenI'm thinking about looping while dereferencing and attempting compare-and-swap
21:38wiseenhugod, :)
21:41leo2007damn, I was on the 1.3.x and the build have bugs. Switching to the master branch fixes all the errors.
21:41wiseenOK tnx, just wanted to make sure I'm not missing anything, tough it might be nice to have something more low-level like clear! because this is fairly low-level like reset!
21:42wiseen*tho
21:43leo2007Does C-c C-m in slime macroexpand clojure macros?
21:43leo2007I am getting "Evaluation aborted on java.lang.Exception: unknow swank function swank/swank-expand-1."
21:44llasramleo2007: It's supposed to, yeah
21:44llasram(Meaning, when working normally -- works for me)
21:46leo2007I tried to expand (when 1 2) but failed.
21:46callenleo2007: swank version?
21:46callenleo2007: how'd you bring the session up?
21:46leo2007callen: swank-clojure-1.4.0-SNAPSHOT.jar
21:47leo2007callen: I run the swank-clojure script which is this http://paste.pound-python.org/show/14636
21:47leo2007callen: I just want to bring up the repl and follow through Joy of Clojure.
21:48llasramleo2007: Which version of SLIME? I gather you aren't using clojure-jack-in ?
21:48leo2007llasram: no, I am using upstream slime.
21:50llasramOk. In that case I'm not sure there are many people other than technomancy who can help you out, and he started bundling SLIME specifically to avoid these incompatibilities introduced upstream
21:50llasram(assuming that's the problem)
21:51leo2007llasram: I slightly modified swank-clojure to work with upstream slime: http://paste.pound-python.org/show/0cDo11do4hnDSxtSEiT9
21:51leo2007do you see any problems with that change? Sorry I am not yet familiar with clojure.
21:52llasramEr. I've poked around the swank-clojure source code a bit, but haven't really hacked on it. I'm afraid I have no idea if those changes are right, esp in the context of upstream SLIME changes. Sorry :-/
21:57leo2007llasram: no worries. Packaging an old version of slime.el is annoying because that one version ruins all my slime setups for Common Lisp and scheme.
22:15mefestotechnomancy: ping
22:48goodieboyI'm attempting to understand macros better, and can't figure out why this doesn't work... anyone wanna give me a hint? https://gist.github.com/1335646
22:48goodieboyI get "Unable to resolve symbol: phrase in this context"
22:50brehautgoodieboy: because phrase isnt defined in your '(query… )' expression
22:50brehautwait, no
22:51brehautgoodieboy: (macroexpand '(query (phrase "test"))) expands to (clojure.core/apply (phrase "test"))
22:52brehautgoodieboy: at which point apply it is evaluated, and phrase is not a bound symbol at that point
22:53goodieboybrehaut: hmm ok, so even though the let is setting it up, it's too late?
22:53amalloygoodieboy: the let is not helping
22:53brehautgoodieboy: let is lexicaly scoped; its not going to effect anything provided outside its scope
22:53amalloybecause it is being evaluated inside of the query macro, not inside of the code produced by the query macro
22:54goodieboy... thinking
22:54brehautgoodieboy: how about you explain what you want that macro to do?
22:54goodieboyok i think i understand
22:54goodieboyok sure
22:55goodieboyI was hoping it would call phrase, which is a function that wraps its argument in quotes. So (query (phrase "test")) => "\"test\""
22:56goodieboyreally ... just experimenting to see if I could call let-ed anonymous functions
22:56amalloygoodieboy: i would clarify your intent as: "i want this macro to introduce a function named phrase for use in the body". fair?
22:57goodieboyyes exactly
22:57amalloyin that case, the code you produce has to have a let in it
22:57goodieboyyou mean, the code that is calling the macro?
22:58amalloyno
22:58amalloyyou wrote (let [...] `(...))
22:59goodieboyyes
22:59amalloythat is creating a variable at *compile time* for the internal use of query, and not putting it in the code that query expands to
22:59goodieboyahh i see
22:59amalloyif you want to return code with a let in it, you need to write `(let [...] (...))
23:00goodieboygot it, but then... I get the "can't let qualified name..." error
23:00amalloyright
23:00amalloy&`(let [x 1] x)
23:00lazybot⇒ (clojure.core/let [clojure.core/x 1] clojure.core/x)
23:01amalloy&`(let [x# 1] x#)
23:01lazybot⇒ (clojure.core/let [x__8715__auto__ 1] x__8715__auto__)
23:01amalloy&`(let [~'x 1] ~'x)
23:01lazybot⇒ (clojure.core/let [x 1] x)
23:01goodieboyhmm
23:01goodieboyoh ok
23:05brehautgoodieboy: next thing: why call apply if you are splicing together an sexp ?
23:05amalloy~' doesn't do any magic if you understand what's going on, but it also probably wouldn't hurt you to think of it as magic for a while if you have other things to learn
23:06goodieboybrehaut: yes i'm starting to see that now
23:06clojurebottwo things are more than one thing
23:06goodieboyyow, my brain is hurting
23:07brehautgoodieboy: also, you can use destructuring for your macros argument. id replace [& form] with [[f & body]] and then ditch first and rest.
23:07goodieboyamalloy: i *think* i get it, will understand more after playing with it a bit
23:07amalloyclojurebot: thanks for the tip
23:07goodieboybrehaut: right ok
23:07clojurebotthanks for your suggestion, but as usual it is irrelevant
23:07goodieboyhehe
23:08brehautgoodieboy: i presume that you are wanting to split up the form for some additional reason, otherwise you could just use [form] and ~form
23:09brandelis anyone working on a clojurescript book atm by any chance?
23:10goodieboybrehaut: yes, at some point... the query macro could take as many different types of query sexps as needed. But that's a long way off :)
23:41Raynesbrehaut: ping?
23:41brehautRaynes: pong