#clojure logs

2012-04-23

00:01felideonI meant from Emacs/SLIME though. i open a swank server but when doing a slime-connect I get the error:
00:02felideonerror in process filter: slime-intern-indentation-spec: Wrong type argument: listp, 1\
00:02felideonmight be an issue with my slime setup?
00:13felideonyeah, i disabled slime-fancy and slime-indentation and got rid of the errors. still no repl though P)
00:32technomancyfelideon: best way to run a swank server on its own right now is to run `lein swank` inside a checkout of swank-clojure unfortunately
00:32technomancyno reason why `lein swank` couldn't work outside a project, but nobody's implemented it yet
00:55alexbaranoskyany easy way to right justify a string in Clojure?
00:56zakwilsonDo you mean pad it with spaces?
00:56alexbaranoskyzaargy, yeah
00:56alexbaranoskyI recall Java doesn't have convenient way to do so... but perhaps one of the Clojure libraries comes with a function for it
00:59technomancy,(vals (ns-publics 'clojure.string))
00:59clojurebot(#'clojure.string/trim #'clojure.string/lower-case #'clojure.string/split #'clojure.string/join #'clojure.string/upper-case ...)
01:00technomancyI'd guess no
01:03zakwilson(defn pad-left [len s] (str (apply str (repeat (- len (count s)) \space)) s))
01:03zakwilson(you should make that cleaner if you want to use it)
01:04zakwilson,(str (apply str (repeat (- 20 (count s)) \space)) "foo bar")
01:04clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: s in this context, compiling:(NO_SOURCE_PATH:0)>
01:04zakwilson,(let [s "foo bar"] (str (apply str (repeat (- 20 (count s)) \space)) s)
01:04clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
01:04zakwilson,(let [s "foo bar"] (str (apply str (repeat (- 20 (count s)) \space)) s))
01:04clojurebot" foo bar"
01:19muhoothere's always format
01:21seancorfieldI've been surprised by the (negative) reaction to LightTable in some circles...
01:21alexbaranoskywhich circles?
01:22seancorfieldAnyone read the Chronon Systems blog post? And the attendant HackerNews feeding frenzy?
01:22muhoo&&(format "%40s\n" "foo")
01:22lazybotjava.lang.RuntimeException: Unable to resolve symbol: & in this context
01:22muhooeh
01:22muhoo,(format "%40s\n" "foo")
01:22clojurebot" foo\n"
01:22muhoothere it is
01:22alexbaranoskythanks muhoo
01:22muhoo,(format "%40s" "foo")
01:22seancorfield&(format "%40s\n" "foo")
01:22clojurebot" foo"
01:22lazybot⇒ " foo\n"
01:23alexbaranosky,(format "%20s" "1")
01:23clojurebot" 1"
01:23muhoo ah ##(format "%40s\n" "foo")
01:23lazybot⇒ " foo\n"
01:23alexbaranosky,(format "%2s" "1")
01:23clojurebot" 1"
01:23muhoosoo it's ONE & for clojurebot, but TWO ##'s
01:23lazybot⇒ s
01:23muhoo*sigh*
01:23seancorfieldOne of the comments was that the LightTable demo was contrived because "real world code" wouldn't have such short functions...
01:23alexbaranoskyhow do I get it to pad with 0's though
01:23muhooseancorfield: there's an old yiddish saying: "Never show a fool a half-done job."
01:24alexbaranoskyseancorfield, I actually am not too surprised, only because the world is full of haters -- nothing that is the best is ever commonly accepted
01:24seancorfield,(format "%02s" "1")
01:24clojurebot#<FormatFlagsConversionMismatchException java.util.FormatFlagsConversionMismatchException: Conversion = s, Flags = 0>
01:24seancorfieldoops :)
01:24alexbaranoskynever commonly accepted, I mean
01:25seancorfieldIt made me look at our code at World Singles - 11.5 lines per function on average in 4Kloc
01:25seancorfieldAnd that includes some nasty functions that I wrote early on that should be refactored... my more recent code is cleaner :)
01:26seancorfieldEven my FW/1 (web framework port to Clojure) is only 8.32 lines per function - and that includes whitespace etc
01:27technomancycrazy defence/apologia for immutability on emacs-devel: sent
01:27seancorfield,(format "%05d" 1)
01:27clojurebot"00001"
01:27technomancyI think I need to blog about egal
01:27muhootechnomancy: you are fighting the good fight
01:27technomancymuhoo: thanks =)
01:27seancorfieldNot sure you can pad a string with zeros alexbaranosky
01:27alexbaranoskyChris GRanger has a lot of experience with IDEs -- I'm sure the blog author doesn't know that
01:27muhoobut... maybe it'd be better to write clojacs from scratch
01:28muhoohehehee, clojacs
01:28alexbaranoskyseancorfield, In Java I've had to use some library code to do it
01:28technomancymuhoo: they are trying to get elisp running on guile
01:28muhoohttp://upload.wikimedia.org/wikipedia/en/thumb/4/44/Kojaktelly.jpg/170px-Kojaktelly.jpg
01:28alexbaranoskygotta go, thanks for the chat
01:28technomancymuhoo: so clojure-scheme would be an option
01:28technomancyI have my doubts as to its feasibility
01:29muhooguile emacs has been discussed for many years, IIRC
01:29muhooi think even rms was behind it at one point.
01:29technomancymuhoo: most of the devs have adopted an "I'll believe it when I see it" attitude
01:29muhoothen again, much as i love emacs, i'd kind of rather put the devlopment effort into lighttable
01:31technomancyI would implement the live-tracing stuff myself except I don't want to code against swank, and the nrepl adapter for elisp doesn't exist yet.
01:32technomancybut if I could compile Clojure to elisp (or guile if that's the same runtime) then I would be a lot more likely to write nrepl.el
01:34muhooit will be fascinating what happens when clojure can run on almost any other language
01:36muhootechnomancy: by the way, side question. i was thinking about clj-python, and wondering, how will jar files and lein work with that?
01:36muhooso many libraries are distributed as jars in maven repos. what'll happen when all these other runtimes have clojure support?
01:38espeedI'm trying to pipe the output of the parts-of-speech function into the index-words function and print the resulting output using the thread macro (-> parts-of-speech index-words println). But the index-words func returns an iterator-seq, and I'm not sure how to iterate it in this context because I'm new to Clojure (see https://gist.github.com/2468965)
02:30sritchieespeed: still around?
02:30espeedyes
02:31sritchiesince you have a sequence, you probably want to print each thing --
02:31sritchieso you can map println across that iterator-seq
02:31sritchieand then call "doall" to force it to print each thing
02:31sritchie(doall (map println (index-words (parts-of-speech))))
02:31sritchieanother way to write this is with doseq:
02:31sritchie(doseq [word (index-words (parts-of-speech))]
02:31sritchie (println word))
02:35espeedsritchie: Thanks. (parts-of-speech) returns an array -- I'm trying to learn how to use the -> (thread) macro, but I'm missing something
02:35sritchie-> just rewrites the code
02:35sritchieso (-> (parts-of-speech) index-words) gets rewritten into what I had above
02:36sritchieyou could do this:
02:36sritchie (->> (parts-of-speech) index-words (map println) doall)
02:36sritchiethat's equivalent to (doall (map println (index-words (parts-of-speech))))
02:37espeedwhy would you use the ->> over the simpler -> ?
02:40replacaibdknox: you there?
02:45replacaespeed: ->> will thread through as the last arg, which will be correct for (map println) and irrelevant to all the others
02:48espeedreplaca: thanks. I changed it slightly, added (map index-words) -- this works: (->> (parts-of-speech) (map index-words) (map println) doall)
02:48replacaespeed: yup, looks good
02:49espeedis that "idomatic" clojure?
02:50replacaespeed: sure, though the decision to use -> or ->> over nested parenthesis is somewhat personal. You'll see the same programmer use both styles depending on what emphasizes their intent best in that context
02:53espeedThanks. Someone told me today that the "dot" interop macro is "outdated": (. POS values) and it's better to use (.values POS) -- is this true?
02:53replacaespeed: yeah, that's right. You never see a lone . in the wild
02:55espeedok cool, that clears things up a bit -- thanks for your help Tom and Sam
02:56replacaespeed: np
03:00muhoohmm, clojurescript views are still experimental for cloudant/couchdb, eh?
03:12laurusHow would one slice an array in Clojure-py?
03:36amalloyreplaca: well, "never". (. foo bar baz) is great for macro writers
03:37amalloyeg, (defmacro memfn [method] `(fn [obj#] (. obj# ~method))) compared to (defmacro memfn [method] `(fn [obj#] (~(symbol (str "." method)) obj#)))
05:01solarnetDoes anyone have any tips for packaging native libraries so I can push them to clojars so I don't have to embaed them in my project?
05:09fliebelsolarnet: Do tell if you find out. I'm still looking for a nice RxTx package.
05:10fliebelsolarnet: I did find a blog post describing the process...
05:10fliebelhttp://nakkaya.com/2010/04/05/managing-native-dependencies-with-leiningen/
05:11solarnetI believe that is old and outdated
05:13fliebelsolarnet: What makes you believe that?
05:24solarnetmy own insanity
05:24solarnetI think I may have this figured out
05:25Rayneshttp://en.wikipedia.org/wiki/Lunatic_asylum
05:27solarnetI 'member you >.>
05:27RaynesWe've met?
05:32RaynesI feel like I'm supposed to know who you are and feel bad because I don't.
05:32Raynes:(
05:33solarnetnah it was a while ago you probably don't remeber me
05:59solarnetdoes lein only load jars which are in dependencies?
06:00solarnet(i.e. I recently fired up an old project, and nothing that is found in jars I dropped in the lib path by hand is being used)
07:29jimpI'm wondering, given that i have a bunch of records in a list and i want to instanciate them. How do i go about that? The dot operator and new macro both want a classname, not a class so i am drawing a blank here
07:30jimpfor instance, i have these two records defined: (defrecord rec1 [one two]) (defrecord rec1 [one two])
07:30jimpnow i am trying to do something like this (map (fn [rec] (new (nametype step) 1 2 3)) [rec1 rec2])
07:31jimpsorry, like this: (map (fn [rec] (new rec 1 2 3)) [rec1 rec2])
07:33sattvikjimp: Which version of Clojure are you using?
07:34jimp1.3
07:35sattvikI think you now have a factory function you can use, let me check.
07:35jimpsattvik: cool, thanks alot
07:37sattvikjimp: Yeah, there is now ->rec1 and ->rec2 functions.
07:37sattvikSo you can do something like (map #(% 1 2) [->rec1 ->rec2])
07:38jimphmm, but how do i get the get the constructor function for an unknown record
07:39jimpi just have a list of records which all implement a protocol, but i don't know which one i am instanciating at a given time
07:39forsakendaemonHave to use a macro for that I think.
07:40sattvikThat's trickier.
07:41jimpforsakendaemon: could you give an example of that? I am not quite sure how to go about it
07:41jimpi honestly thought this would be an easy thing to do :)
07:41forsakendaemonIf you have a list of them at runtime, then a macro won't work. I was thinking of a different use case.
07:42forsakendaemonDoesn't ->rec1 delegate to something that you can call normally?
07:44jimphmm, maybe let me try to expand it
07:45sattvikjimp: Are the fields for the records all named the same?
07:45jimphmm, (macroexpand-1 '(->rec-test1 1 2 3)) just expands to (->step-test1 1 2 3)
07:46jimpsattvik: yes, and they all implement the same protocol
07:50jimpi might have found a solution
07:50jimp(clojure.lang.Reflector/invokeConstructor (resolve (symbol (typename rec-test1))) (to-array[1 2 3]))
07:51jimpthat's just crazy ugly code considering i just want to instanciate a record :(
07:51jimpand slow i expect
07:52sattvikjimp: Yeah I was thinking about reflection, too. Is there some reason why it's not just all the same record type?
07:52forsakendaemonShouldn't be any slower than the convenience form, especially if that's what it expands into.
07:54jimpsattvik: well i have this whole flow where i define the steps to be executed as records which implement a protocol with thier own specific implementation. The flow only knows the steps until runtime where it is instanciated
07:55sattvikAn alternative is that the code that calls this code, instead of passing a class name, pass a record with a default value.
07:56jimpheh, of couse i don't really need the whole resolving bit :o)
07:56jimplooks like this now: (clojure.lang.Reflector/invokeConstructor step-test1 (to-array[1 2 3]))
07:57jimpsattvik: hmm, not sure how that would look
07:58sattvikWell, in whatever code would send the record class, instead send an instance. A way to get an 'empty' record would be to do something like (map->rec1 {}). Or, you could just put in some dummy values, (rec1. nil nil)
07:59sattvikThen, your code can just treat it like a map, (map #(assoc % :a 1 :b 2) empty-records)
08:00jimpsattvik: Ahh, good point
08:01jimpsattvik: can't decide which solution is uglier :P
08:02`thomashello -- i'm getting this error with `lein deps': Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file (NO_SOURCE_FILE:0)
08:02sattvikjimp: Well, I'd go with the records as map approach. It seems less brittle.
08:03jimpsattvik: true
08:04mfex`thomas, are you trying to use the friend library?
08:05`thomasmfex: i'm trying to install overtone
08:06`thomasi was logged out of the network at some point so i wonder if lein downloaded a login page instead of a jar...
08:06mfex`thomas, I have seen that exception before for dependencies that are distributed as only a pom file, and not a jar and pom file
08:06jimpsattvik: thanks btw, i think i'll go with your solution :)
08:06xeqi`thomas: can yo upaste the full stack trace on refheap.com ?
08:07mfexi don't know anything in particular about the overtone installation process
08:07sattvikjimp: Happy to help.
08:12`thomasxeqi: here it is: https://refheap.com/paste/2305
08:13xeqiugh, I was hoping for a filename somewhere
08:14xeqiyou can `rm ~/.m2/repository` to remove all the jars that have been downloaded
08:16`thomasxeqi: thanks for the tip; trying again now...
08:45_KY_I don't understand the use of hash-map... seems that what I need is a hash table, with possibly duplicate keys
08:46_KY_I want to quickly look up some items using a search key, but there may be multiple items for a key
08:46fliebel_KY_: If duplicate keys where allowed, how would you retrieve items?
08:46_KY_I'll get multiple items, and decide which one I need (may I need them all)
08:46_KY_*maybe
08:46xeqiso a hash-map from a key to a vector of values?
08:46fliebel(get {:a 1 :a 2 :b 3} :a) ?
08:47_KY_Ah... I see
08:47_KY_Good idea =)
08:47_KY_That is the traditional idea of hash table, isn't it
08:48fliebel&(merge-with vector {:a 1 :b 2} {:a 1})
08:48lazybot⇒ {:a [1 1], :b 2}
08:48_KY_Fabulous... =)
08:53netrinoGood day. I'm new to clojure and learn web developing with noir right now. Please, can someone explain me, what the problem in the following snippet https://gist.github.com/57e7f71802294bca5ced i've got a RuntimeException with message 'No such var admin/login' and other. If I comment out the admin-links def and replace it with text-links it works
08:55dxlr8rhey. clojure noob. been writing some code in emacs at work and through ssh -X to emacs at work from home. I'm not a big emacs fan since I am not 60 years old, so I have been trying to get clojure to work in eclipse. so I installed "Counterclockwise" and it worked. now I want to connect to the repl at work. so I tried to forward the port at which my repl is at at work...
08:55dxlr8rssh -L 1337:localhost:4008 foo@foo.org
08:56dxlr8rbut eclipse hangs when I try to connect to 127.0.0.1 at port 1337
08:57dxlr8rany ideas? connecting to 4008 works in emacs through ssh -X works, so the repl is up
08:57xeqinetrino: common.clj doesn't have a require :as admin
08:59netrinoxeqi: actually it has. I didn't post all the common.clj, should I? Cause when I comment the definition which link to the admin-view module it works
09:00xeqiwell, at least the full stack trace
09:02netrinoHere it is https://gist.github.com/0e0577320214c04bd43f
09:02laurusdxlr8r, have you tried Ergoemacs?
09:03dxlr8rstill the same problem though. can't seem to connect to the repl through ssh
09:03dxlr8rso the only way I can connect to it is through ssh -X and running emacs from the server
09:03laurus(I was referring to the "I'm not 60 years old" part ;) )
09:03dxlr8rhehe :P I have a mac though
09:03laurusdxlr8r, honestly I know nothing about trying to ssh through
09:04dxlr8rhttp://asymmetrical-view.com/2009/08/20/emacs-slime-remote-repl.html
09:04laurusdxlr8r, I don't use the whole distribution of Ergoemacs, I just use the keybindings.
09:04dxlr8rthis guy has done it :/
09:04laurusWow, impressive.
09:05xeqiwhats at learning/models/admin.clj:27 ?
09:05laurusdxlr8r, if you want to try just the Ergoemacs keybindings, you can get them from http://code.google.com/p/ergoemacs/downloads/list . I would never use Emacs personally if I didn't have this.
09:05laurus(ergoemacs-keybindings-5.3.9.zip)
09:06dxlr8rwe currently all use the same user on the server, lazy-ness I guess :P haha
09:06laurusOh, sheesh, okay.
09:06dxlr8rso I can't modify the emacs config file
09:06dxlr8rdon't think the boss will be happy :P
09:06laurusdxlr8r, the layout is here: http://ergoemacs.org/i/ergonomic_emacs_layout_qwerty_5.3.4.png
09:06laurusIn case you try it someday :)
09:07dxlr8rwhy do they have the arrow keys on ijkl? why not use the arrows keys! that's why they are there
09:07dxlr8r:P
09:07dxlr8ratleast they got undo, copy/paste/cut right
09:08zerokarm1leftijkl is at the home position for typing
09:09laurusdxlr8r, you can still use the arrow keys
09:09laurusThat map doesn't show everything
09:09laurusAlso, Ctrl+O opens a file, Ctrl+N makes a new file, etc., etc.
09:10laurusGood luck with the remote repl thing.
09:12dxlr8rthx :)
09:12dxlr8ranyone else? :/ would be great to connect to the remote repl through ssh
09:39bolicIs this channel logged?
09:40beffbernardYup, http://www.raynes.me/logs/irc.freenode.net/clojure/
09:42beffbernardHey guys, I need some help with a function I'm working on.. I'm trying to merge a list of id's with a list of items… so [1,2,3] and [{:name "Trev"}, {:name "Dog"} {:name "Cat"}]
09:42beffbernardI want the end result to be [(:id 1 :name "Trev"} {:id 2 :name "Dog}}…]
09:43beffbernardassoc-in seems like the logical choice but I can't get it working :S
09:43S11001001beffbernard: fill in the f: (map f ids items)
09:45beffbernardS11001001: that's my problem, lol
09:45S11001001beffbernard: write a function that takes an id and an item and sticks the id in
09:46Bronsa,(vec (map #(assoc %2 :id %1) [1 2 3] [{:a 1} {:b 2} {:c 3}]))
09:46clojurebot[{:id 1, :a 1} {:id 2, :b 2} {:id 3, :c 3}]
09:46S11001001great.
09:46beffbernard(map #(merge %1 {:id %2}) patterns ids)
09:46beffbernardthis works too
09:46beffbernardThanks guys
09:56jamiierror: java.lang.ClassFormatError: Duplicate method name&signature in class file shackles/bounded/BoundedInteger
09:56jamiiKind of wish it would tell me what the dupe is...
09:57netrinoI think I understand what was my problem
09:59netrinocommon.clj depends on the functions, defined but not compiled at the moment from the admin.clj, but admin.clj uses partials from common.clj. Strange, that compiler didn't fail compilation with error-message, throwing NPE and different other confusing exceptions instead
10:01netrinoInteresting that if in common.clj replace admin's functions with something else before run, and then replace them back while runtime, it all works
10:40technomancymuhoo: it may be that people port Leiningen to the CLR or python runtime, but it would be a port of Leiningen rather than lein itself
10:41TimMctechnomancy: lein == lein.sh?
10:42technomancyTimMc: no, I mean it would be a different project entirely
10:43cemericktechnomancy: might not need to be given ikvm :-P
10:45technomancycemerick: ah, clever; hadn't thought of that
10:46technomancy.net library support could be just a plugin
10:46cemerickStartup time isn't helped, of course.
10:49technomancyapparently it's a pretty big complaint re: clojureCLR
10:50cemerickthat's the way it goes re: DLR
11:03dgrnbrgI have a command line program that spits out a very long classpath string (like "foo.jar:/sys/path/bar.jar:…"), and I'd like to add that to my project's class path. What's the best way to do this? Should I write a lein plugin, or can I do it at runtime w/in the project? Or can I do it w/ the project.clj?
11:04MGT1list
11:10TimMcdgrnbrg: pseudo-code: :classpath-extra #=(sh/sh "other-prog.sh") :-P
11:10TimMc(This is terrible, don't do it.)
11:11gfredericksTimMc: omg
11:12gfredericksTimMc: if that works, you could also make a project.clj self-referential by doing (sh/sh "lein ...")
11:14technomancycemerick: naming request: whoever ends up implementing an inspector middleware for nrepl; could you try to convince them to call it javert?
11:14technomancyTimMc: you can unquote inside defproject; that's cleaner
11:14cemericktechnomancy: deal :-)
11:14TimMcoh yeah
11:18technomancy"cleaner"
11:20technomancyoh wait, this is about arbitrary jars?
11:20technomancyget 'em in a repo!
11:21zerokarmaleftcemerick: ooc, what's the status on https://github.com/cemerick/raposo?
11:23cemerickzerokarmaleft: utterly neglected still :-|
11:23zerokarmalefti can understand if finishing the book got in the way of pushing the repo to GH :D
11:23cemerickheh, finishing the book got in the way of a lot of things ;-)
11:23cemerickI'm still catching up, really.
11:24cemerickRaposo isn't helped by the fact that I'm going to be afk for all of May.
11:24cemerickzerokarmaleft: Were you the fellow that asked me about it at ClojureWest?
11:26zerokarmaleftcemerick: no, i couldn't fit clojurewest into my schedule this year, sadly
11:26TimMcdgrnbrg: Can you make a pom.xml depend on all those jars? (What's the scenario?)
11:30gfredericksdoes primarily using maven preclude using all the tasty lein plugins without too much project-configuration-duplication?
11:32cemerickzerokarmaleft: Ah; anyway, yes, there are a variety of people waiting with bated breath for Raposo. "Right as soon as I can" is my best answer at the moment.
11:32cemerick(Sorry! :-|)
11:33S11001001gfredericks: yes
11:34gfredericksS11001001: okeedoke. thanks :)
11:35technomancygfredericks: I thought your boss was going to let you switch
11:35gfrederickstechnomancy: oh that was only if I stuck around
11:36gfrederickstechnomancy: I hope it doesn't offend you that his offer didn't change my mind :)
11:36technomancyhaha; no, good luck at your new place wherever that may be =)
11:37S11001001because maven builds are easier to maintain than lein ones? huh.
11:37technomancyah, abedra's team?
11:37TimMcS11001001: Easier to integrate with existing Maven projects. :-/
11:38gfrederickstechnomancy: I do not yet have precise enough expectations to answer that
11:38gfredericksask me in two weeks
11:38S11001001fair
11:39gfredericksS11001001: yeah I don't know the precise reasoning. Definitely had something to do with integrating with other stuff.
11:39gfrederickshas mostly been a big pain so far
11:39gfrederickshad to reinvent lein-cljsbuild
11:40gfredericksnot to mention I've wanted to use checkouts on like 4 separate occasions
11:40S11001001checkouts is the best
11:42gfredericksalthough mostly I just want it to check out other people's projects and insert debugging statements, and it just ocurred to me that I could do that at runtime in my own code, so maybe those aren't the most compelling use cases
11:44ambrosebsWhy doesn't ISeqable extend to nil in Clojurescript?
11:50cemerickgfredericks: congrats :-)
11:52gfrederickscemerick: thanks
12:01dgrnbrgTimMc: Sorry, I just saw your message. I've never written a pom.xml. My situation is that I am integrating my build system at work w/ lein. It's a hugely complex build system with hundreds of codebases that produce jars, and it's all Makefile based. There is a command line program that can output a class path with the closure of the dependencies for a project. I want to have lein integrate with that tool to create the classpath for the project
12:01dgrnbrgso that I can use our proprietary code w/ clojure in lein, and also use lein's dependency management to integrate w/ other 3rd party libs
12:07TimMcMakefiles. niiiiice
12:07TimMcYeah, unquoting might be your best bet. :-(
12:09dgrnbrgTimMc: what do you mean, unquoting?
12:09dgrnbrgIs there a way for a lein plugin to alter the class path of the project?
12:10dgrnbrgwith an :extra-classpath-dirs hook?
12:10TimMcHmm, a plugin would be cleaner, you're right.
12:11TimMcI'm not sure what the best approach is, given that.
12:12TimMcThe only plugin I've written uses new lein tasks that munge the project map and chain to other tasks. You'd want to adjust the behavior of existing tasks, yes?
12:13mdeboardI'll tell you what, writing Clojure has made me grow so very, very weary of big, heavy, monolithic interfaces
12:13dgrnbrgwhy doesn't "lein install lein-pprint 1.1.1" work?
12:13pipelineweary or wary
12:13mdeboardyes
12:13mdeboardmore weary than wary
12:13dgrnbrgTimMc: I think I'd need to use robert.hooke to modify the class path for everything
12:16technomancydgrnbrg: `lein plugin install`??
12:16lazybottechnomancy: Uh, no. Why would you even ask?
12:16dgrnbrgtechnomancy: I'm on lein 1.7 :/
12:17dgrnbrgi tried adding it to my dev-deps and it worked
12:17dgrnbrgtechnomancy: do you have any advice for writing a plugin that adds some stuff to the class path of a project?
12:17dgrnbrgas far as what I should hook? or the names of functiosn/vars to look at?
12:18technomancydgrnbrg: if you want to get more jars on the classpath I highly recommend getting them into ~/.m2 first
12:18technomancyanything else is going to be a nasty hack
12:18technomancythough if you're resigned to nasty hacks I can advise further
12:19TimMcHe's already in a twisty little maze of Makefiles, all alike.
12:19dgrnbrgtechnomancy: I have hundreds of jars I need to include, and they're all under heavy lockdown on isolated servers
12:20dgrnbrgI already have a bunch of hacks to get lein to work through some firewalls
12:20dgrnbrgso I'm resigned :/
12:20dgrnbrgsuppose I can get the list of class files: /path/to/foo.jar:/path/to/bar.jar:/path/to/baz.jar:…(100x more)
12:21technomancyon lein1 it might be best to add a hook to leiningen.classpath/get-classpath-string
12:22dgrnbrgcan I do that w/o writing a plugin? or is a plugin the only way?
12:22technomancyyou could just call add-hook in project.clj after defproject
12:23dgrnbrgI didn't realize that project.clj was executed--cool!
12:34nDuffgfredericks: ...as someone who recently left a top-5 player in the group buying industry, good luck.
12:42__Isaac__I completed the Clojure Koans; I'm curious if there is a more idiomatic way to call an instance method than (= ["HI" "THERE"] (map #(.toUpperCase %) ["hi" "there"]))
12:44TimMcNope.
12:44TimMcThere's memfn, but it's a little weird.
12:44raek__Isaac__: nope. you need a function objects, and java methods aren't objects (except when using the reflection features, but then they don't implement the necessary interface)
12:45raek__Isaac__: but in this particular case you can use clojure.string/upper-case
12:47__Isaac__raek: thank you
12:57hugodLicenser: vmwebadm looks very interesting
12:57hugodwe're just starting to think about smartOS support for pallet, so it is very timely
13:00dnolenCLJS users if you've got a second please clone - http://github.com/swannodette/himera
13:01dnolenuse the synonym branch, start with: lein run 8080, and point your browsers at localhost:8080/synonym.html
13:01dnolenit's basically http://synonym.dartlang.org/ for ClojureScript, curious what else people think should be added
13:08RickInGAdnolen: I keep getting a 404 when I try to go to localhost:8080/synonym.html
13:09dnolenRickInGA: did you checkout synonym branch
13:09dnolen?
13:09RickInGAthink so, let me try again
13:10ibdknoxdnolen: interesting that Dart doesn't provide the ability to modify classes.
13:10dnolenibdknox: i imagine for performance reason tho I don't see how that could matter that much given how much work they've done on V8
13:11ibdknoxdnolen: we should convince someone to write a nice string interpolation lib for CLJS :D
13:11RickInGAdnolen: you were right, checked out wrong branch
13:12hugodgfredericks: the zi plugin for maven allows you to use checkouts
13:13dnolenibdknox: heh, I think getting this up is important. A good way for people to compare what ClojureScript offers over Dart, CoffeeScript - a lot.
13:14ibdknoxdnolen: I agree, anything you need help with there?
13:14RickInGAdnolen: I would add some discussion of the different collection types. list/set/map have meaning to clj folks, but not js folks.
13:15dnolenRickInGA: yep planning on doing that, was mostly curious if people like the general idea
13:16ibdknoxdnolen: I should fix println
13:16dnolenibdknox: nah it's a pretty simple long list of examples - mostly interested in hearing what things people would like to see that perhaps isn't covered at all in the Dart synonyms
13:16RickInGAdnolen I saw the dart list when you linked it here last week. Dart's version was so imperative, wasn't sure how to translate it. yours looks great
13:17ibdknoxdnolen: looks good, definitely want to throw something in there for syntax highlighting though
13:18RickInGAdnolen: under optional parameters, it looks like neither js nor cljs support optional parameters (other than cljs multiple arity)
13:19dnolenibdknox: is there an easy brush to incorporate?
13:19ibdknoxbrehaut had one, unfortunately he's not here right now
13:19ibdknoxdnolen: I might steal whatever marg uses
13:19dnolenRickInGA: but that's true unless you do map destructuring on arguments.
13:20ibdknoxdnolen: or this: http://brehaut.net/blog/2011/clojure_brush
13:20ibdknoxdnolen: what about [a b & [c d]]
13:20ibdknoxdnolen: I do that all the time in my CLJ code
13:21dnolenibdknox: ah nice one - see that's why I'm sharing :)
13:21dnolenibdknox: I'm not sure if I like that brush.
13:21ibdknoxdnolen: marg's might work better
13:22ibdknoxex: http://fogus.me/fun/marginalia/
13:24sattvikI think Marginalia is using Brehaut's brush.
13:24dnolensattvik: ah, just different colors?
13:24ibdknoxdnolen: regex's work in CLJS don't they?
13:24dnolenibdknox: yes though there a couple of issues around the fact that JS and Java support different options
13:24sattvikdnolen: Perhaps. I think the color scheme and the highlighter/parser are orthogonal.
13:25ibdknoxsattvik: dnolen: yeah, they are
13:25RickInGAif you use an array in cljs, is it mutable?
13:25dnolenRickInGA: yes, same as arrays in Clojure
13:25eggsbymarginalia is nice, docco is cool
13:25dnolenRickInGA: necessary in fact if you want to have performant persistent data structures
13:26sattvikI've alwys wondered if a cljs-derived brush would be superior.
13:27RickInGAdnolen: that list of translations is awesome. That is going to be very useful as I try to learn cljs.
13:28dnolenRickInGA: yes, the current state of online CLJS documentation for beginners is really bad.
13:29RickInGAdnolen: I thought so too last week, then I set about trying to write some, and I realized the biggest issue I had with the documentation was me.
13:29dnolenRickInGA: ?
13:30RickInGAdnolen: when I was trying to use cljs to do animations on a canvas, the getting started documentation was awful. when I was trying to figure out how to get started with cljs and specifically lein-cljsbuild it was step by step exactly what I needed
13:31jeffdik``dnolen: looks very nice, thanks for creating it
13:31dnolenjeffdik``: no problem - will probably add a bunch of improvements later this evening and will look into incorporating a brush. thanks for the feedback all.
13:32RickInGAI did a post over the weekend that was 'hello world' in cljs, which didn't do much more than rehash what was on lein-cljsbuild, and already it has gotten more views than all but a couple of my posts.
13:33RickInGAI plan to play around with canvas over the next couple of weeks. do you want a section on using a canvas on your synonyms?
13:34dnolenRickInGA: that's a bit too specific a use case, though basic DOM interop is probably a good idea.
13:41dnolenalso made some initial progress this weekend in tracking down why rest fns in CLJS are so darn slow - that's the last crazy CLJS bottleneck that I'm aware of.
13:44ibdknoxdnolen: have you ever looked at why seqs are so slow?
13:45dnolenibdknox: seqs I don't think seqs are that slow, but chunking should help a lot when we get around to that.
13:45dnolenibdknox: if there any rest fns in your code path - your perf goes out the window - lots seq functions use rest fns.
13:46ibdknoxah
13:47dnolenibdknox: also the reason why str is unbearably slow
13:48ibdknoxyeah I noticed that one
13:53elliottwthis seems like a really lame question, but i'm just learning and am trying to see if the first character in a string is an alphabetic character
13:54elliottwfor this type of stuff i've been using re-seq #"[a-zA-Z]" and seeing if anything is in the list, but that's probably not the best way
13:54joegallo,(Character/isLetter (first "foo"))
13:54clojurebottrue
13:54_KY_(Character/isLowerCase (first x)))
13:54joegallo,(Character/isLetter (first "123"))
13:54clojurebotfalse
13:55ibdknoxlike magic the answer appears
13:56elliottwlol
13:56S11001001,(Character/isLetter (first "ábc"))
13:56clojurebottrue
13:56elliottwso do I need to load Character?
13:56joegallono
13:56S11001001relatively good locale
13:56joegalloit's java.lang.Character, it's just there.
13:56TimMc,(Character/isLetter (first "\u0639"))
13:56clojurebottrue
13:56elliottwi tried: (Character.isLetter (first "foo"))
13:57elliottwand got classnotfoundexception
13:57joegallono. the slash is important.
13:57elliottwdamnit
13:57S11001001,(Character/isLetter (first "α"))
13:57TimMcelliottw: Is it OK if Arabic letters are passed by your check? :-)
13:57clojurebottrue
13:57S11001001huh
13:57elliottwthanks, got it
13:57joegallohey, if alpha and beta aren't alphabetic characters, then i don't want to live on this planet anymore.
13:58elliottwso what if i wanted to see if a word is camelcase. I've been using re-seq to split on capitals, and then see if i end up with an empty list but that doesn't seem like the "right" way
13:58S11001001,(java.util.Locale/getDefault)
13:58clojurebot#<Locale en_US>
13:58elliottwor not split, nut you know what i mean
13:58joegalloelliotw: what would that logic look like in english? because it sounds to me like the only thing you could check is the first character...
13:59TimMc&(re-seq #"^([A-Z][a-z]*)+$" "CamelCase")
13:59lazybot⇒ (["CamelCase" "Case"])
13:59joegalloand see whether it's titlecase (or perhaps uppercase or not).
13:59TimMc&(re-seq #"^([A-Z][a-z]*)+$" "notCamelCase")
13:59lazybot⇒ nil
13:59technomancyoh, I had an awesome idea while falling asleep last night. if slamhound were implemented as a logic program, you could run it forwards and backwards... which might mean that you could say "given the state of the project, calculate the ns form" but also "given the state of this ns form, calculate and insert the defns needed to make it compile
13:59joegalloright, but isn't Camelcasethisiscrap also camelcase?
13:59technomancyany core.logic fans want to make it happen? =)
13:59joegalloi mean, all you're checking is the first letter...
14:00TimMctechnomancy: Wake up, it's time to make sense.
14:00elliottwsorry, so i want to check to see if the first char is a letter, then check to see if i have any capitals in the rest of the word
14:00technomancyTimMc: but, but... logic!
14:00TimMcyou're still dreaming
14:00joegalloelliotw, is that second part allowed?
14:00S11001001,(Character/isLetter (first "ǽ"))
14:00clojurebottrue
14:00technomancyI don't want to wake up; everything is wonderful here
14:01elliottwi don't see 7up or 7Up at camelcase
14:01joegalloyou're saying FooBar is camelcase, but Foo is not. right?
14:01technomancyI also dreamed that typed clojure would make NPEs impossible
14:01elliottwjoegallo: correct
14:01TimMctechnomancy: I *am* intrigued, though -- do you have an example I/O?
14:02joegallofilter the string for uppercase characters and check that the result is greater than length two, i suppose, then.
14:02technomancyTimMc: you'd just write the ns form as if the namespaces/defns you want already existed, then run M-x slamhound-ex-nihilo or whatevs
14:03elliottwthat's what i've been doing. (empty? (re-seq #"[A-Z] (subs "fooBar" 1)) or something like that
14:03technomancythen it populates your src/ directory with all the empty functions needed to make your namespace compile
14:03joegallok, seems reasonable, i guess
14:03elliottwi just htought it was kind of hacky to create a list of capitals and then look to see how long that list is
14:03technomancyI wonder if it would be possible to get arities that way
14:03ibdknoxtechnomancy: TimMc: there's such a features in VS
14:04technomancyibdknox: yeah, much easier in a static language I'm sure
14:04S11001001elliottw: yes, you can write a regex that will only match at all if you match it against a camelcase word
14:04technomancyslamhound as it currently exists is straight out of eclipse
14:04ibdknoxtechnomancy: still really hard lol
14:04technomancyI really don't understand why Clojure doesn't perform arity checking at compile time though
14:04technomancyibdknox: not if you have the Power of Logic!
14:05TimMctechnomancy: OK, so this would generate other namespaces in your current project.
14:05ibdknoxtechnomancy: I think the cljs compiler might check arity at compile time now
14:05ibdknoxtechnomancy: dnolen would know ^
14:05technomancyibdknox: I guess that's probably a good indicator that we might see it in Clojure some day
14:06ibdknoxmhm :)
14:06timvishertechnomancy: why would I be able to install a plugin using :dev-dependencies while trying to install via lein plugin install fails with not-found errors?
14:06Borkdudewhat is the canonical way to run tests (using clojure.test) in Eclipse?
14:06elliottwS11001001: i guess that's just beyond my regex skills :-(
14:07technomancytimvisher: very strange; no idea. what's the plugin?
14:07timvisherrather, I get connection refused from the plugin install path but not from the other
14:07timvishereastwood
14:07timvisheri'm on windows
14:07sattviktimvisher: Do you use a proxy?
14:08Licenserhugod cool, what is pallet?
14:08timvisherwe have historic issues from within our firewall of dealing with maven, but I consistently can run deps after using dev-dependencies but I've never successfully gotten an install to work
14:08timvisheralmost as if they're using separate backends
14:08timvisherand yes, on the proxy
14:08timvisherhad to configure that via .m2/settings.xml
14:08sattviktimvisher: I have that same issue, too.
14:09timvisherno problem whatsoever on my mac at home
14:09dgrnbrgtechnomancy: is it possible to package lein into an uberjar? I need to have a single jar solution for leiningen
14:09timvishersattvik: I'm not alone! ;)
14:09technomancydgrnbrg: you've already got it =)
14:09technomancyls ~/.lein/self-installs
14:09technomancytimvisher: sorry, proxy support is not great. it should be better in lein2 though
14:09timvisherand the plugin in question is eastwood
14:09timvisherbut all plugins behave the same way
14:09dgrnbrgtechnomancy: I can't run lein w/ the lein.sh script--I need to use some shitty java runner to integrate in another environment
14:09timvisherat least that i've tried to use
14:10technomancyhave you tried it with lein2?
14:10timvisherdgrnbrg: seen ,,lein-exec ?
14:10timvisher,lein-exec
14:10clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: lein-exec in this context, compiling:(NO_SOURCE_PATH:0)>
14:10timvisherbah, i'm thinking of #emacs
14:10dgrnbrgisn't that for scripts?
14:11sattviktimvisher: What I usually end up doing is just adding the plug-in as a dev-dependency temporarily. It's not just Leiningen, other JVM tools have issues with proxies, too.
14:11dgrnbrgI need to run a lein project and develop it, but I must use a crazy environment that uses native libs linked in w/ LD_PRELOAD, among other things
14:11timvishersorry. :)
14:11technomancytimvisher: lein2 should put all downloads (except search indices) through the same settings
14:12timvishersounds like lein2 might solve my problems
14:12timvishersattvik: it's not that i don't have that workaround. The question was more why the discrepancy
14:12technomancyactually search indices use proxies, just not mirrors
14:12timvisheri tried upgrading to lein2 this morning and i couldn't figure out where to go to get a windows bat file for it
14:12timvisheram i missing something obvious?
14:12timvisherthe bat file linked from master is for 1.7.1
14:12TimMc&(re-seq #"^([A-Z][a-z]*){2,}$" "Notcamelcase")
14:12lazybot⇒ nil
14:12TimMc&(re-seq #"^([A-Z][a-z]*){2,}$" "CamelCase")
14:12lazybot⇒ (["CamelCase" "Case"])
14:13TimMcelliottw: ^ there you go
14:13technomancytimvisher: https://github.com/technomancy/leiningen/blob/master/bin/lein.bat
14:13technomancyoh, I guess the readme hasn't been updated yet
14:13timvisherso that's a yes, i was missing something obvious... facepalm. :(
14:13timvisherlol
14:14dnolentechnomancy: ibdknox: yes it warns at compile time now
14:14elliottwTimMc: interesting
14:14dnolentechnomancy: ibdknox: pretty nice too - caught some easy miss bugs in the new persistent data structures.
14:14technomancydnolen: great. any idea if it's coming to Clojure proper?
14:14elliottwTimMc: i would also say iPhone is a camelcase-ish thing
14:15TimMcelliottw: How about USSR?
14:15TimMcAnd URLDecoder?
14:15elliottwTimMc: not camel case… you raise an interesting point
14:15timvisheron a mildly related note, anyone know why my java processes don't seem to respect HOME in my environment on Windows?
14:15technomancytimvisher: oh man... the bugs I get over the fact that the Windows JVM can't keep its notion of HOME straight...
14:15elliottwthere has to be a mix of upper and lowercase, probably avoid strange things with numbers, dots, hyphens… like La-La is probably not camel
14:16TimMcAnd there's always sTuPiDcApS
14:16dnolentechnomancy: seems like a simple warning to add if somebody comes up with a patch.
14:16technomancydnolen: cool; I guess that means it's not an intentional omission
14:17dnolentechnomancy: yes it needs to be a warning since redef means arities can change.
14:18technomancysure
14:19timvisherit's not my fault! I swear! :)
14:20TimMctimvisher: Need an export somewhere? (grasping for straws...)
14:21TimMcOr is that only a UNIXy thing?
14:22timvisherTimMc: unixy thing. it's a pretty common issue
14:22timvisheryou set HOME in the System settings panel and something like Emacs just works but you run a java process and ask it about the environment variable HOME and it returns the default (c:/documents and settings/<username>), sometimes...
14:23hugodLicenser: http://palletops.com/
14:24Licenserhugod just found it :)
14:24TimMctimvisher: How about under Cygwin?
14:24LicenserI'd gladly support you with the integration if you're interested, I'm building a GUI right now so I've some experience with the client side by now too
14:24TimMctimvisher: Do other env vars have this problem? You could do FOO=$HOME java -jar ...
14:26hugodLicenser: hey thanks - we're not too advanced yet, but several people in #pallet are actively interested in working with smartOS in combination with pallet.
14:27elliottwthanks for all the help all.
14:28timvisherTimMc: don't remember having any issues under cygwin but for other reasons that's not feasible here
14:28LicensersmartOs is very nice
14:28timvishercygwin runs _dog slow_ on our boxen
14:28pipelinecygwin is insanely slow on every box
14:28pipelinespeed is kind of a secondary concern for them
14:28pipelinewant speed? use interix/sfu/sua
14:29timvisherpipeline: i ran cygwin very happily on a windows box for years at my previous position and when I got here, i'm talking (very scientifically of course) orders of magnitude slower
14:29timvisherit's obviously never going to be as fast as native, but it was quite tolerable at my old job
14:33dnolen`fogus: you're probably busy, but just checking you saw my Himera pull request.
14:34`fogusdnolen: I did. I will check it out first chance I get. Thanks!
14:40dnolen`fogus: thx!
14:42Licenserhugod so if you've any questions feel free to hit me up, I'm hanging out here and on #SmartOS :)
14:43hugodLicenser: thanks, will do :)
14:46Licenserhugod also look at this: https://github.com/Licenser/erllibcloudapi
14:46Licenserit's a client implementation (not clojure but erlang) but it shoudl give you the basic idea
14:51juhu_chapahi guys!, perhaps this is a common one. I can't read from console using (read-line) from REPL, any docs explaining this?
14:51mstumpIn clojurescript I'm trying to call a method which is on a property of an object 'npm' is this the correct syntax: https://gist.github.com/2472982 I'm getting stack size exceeded.
14:52technomancyjuhu_chapa: there are issues with stdin and jvm process handling; how are you launching your process?
14:52hugodLicenser: should help, assuming my erlang is up to par ;)
14:52juhu_chapatechnomancy: lein run
14:52Licenserheh
14:52technomancyjuhu_chapa: try lein trampoline run
14:53LicenserI propably also could hack together a simple clojure library it'd help
14:56juhu_chapatechnomancy: it works!, thank you.
14:56technomancysure
14:57dnolenmstump: you need to js/npm to prevent Closure mangling your names.
15:01acheng`hello. i have a lein question -- i think i'm missing something obvious. i've run lein install in one of my projects foo, added a line for it in the project.clj :dependencies of another project bar, run lein deps for bar, i see the foo jar in bar's lib/, and now i'm trying to (use 'foo.core)... but it says Could not locate foo/core__init.class or foo/core.clj on classpath: [Thrown class java.io.FileNotFoundException] ... does
15:01acheng`foo/project.clj need :aot or something else?
15:02technomancyacheng`: maybe you need to restart your repl?
15:03acheng`tried that. i can try again.
15:03technomancycheck if `lein classpath` includes the jar you expect
15:04acheng`lein classpath does include foo-0.0.0.jar
15:04technomancyand does the jar contain the .clj file you expect?
15:05acheng`the last file in the jar's manifest (as viewed in emacs) is foo/core.clj
15:05acheng`and has some length (non-zero)
15:06technomancythere must be something else going on then
15:06acheng`leiningen 1.7.1 on java 1.7.0 java hotspot
15:07technomancyacheng`: if you can provide a repro case I can look further, but what you're describing works fine here
15:08TimMcacheng`: Does foo have any hyphens or underscores in it?
15:08acheng`ah. yes foo is actually raw-elk
15:08acheng`and is on a windows machine
15:10acheng`"why hypens? aren't they our friends now?"
15:10hxiaoif there are hyphens in the namespace i think you need underscores in the source file's path instead of the hyphens
15:10raekacheng`: hyphens in namespace names corresponds to underscores in filenames
15:10hxiaosrc/raw_elk/core.clj
15:11acheng`ok. will try. thanks for all the help!
15:14emezesketechnomancy: The hyphen/underscore issue seems to come up somewhat frequently. I wonder if leiningen could issue a warning during some tasks (e.g. jar) if it noticed that there were any fishy filenames. Is that something you might accept a pull request for?
15:15technomancyemezeske: we've just been discussing an extensible check mechanism that could do linty-type things
15:15emezesketechnomancy: ah, cool!
15:15emezeskeI need to pay more attention to the ML
15:16xeqiseems like most discussion happens in the irc chan
15:16technomancyemezeske: #leiningen actually
15:17emezesketechnomancy: that too :)
15:18technomancyshould get better about posting plans to the list though
15:21sattvikCongrats to Clojure's Google Summer of Code students!
15:22alexyakushevsattvik: Thank you!
15:26devnwoo!
15:26devnlucky kids with their paid code summers...
15:26gfredericksif only there were a way for us grownups to exchange work for money...
15:28muhooi would love to be able wrap my brain around ths whole nosql thing. i can't stop thinking in terms of data structure, and i keep running into the sneaking suspicion that something is very wrong with pretending that relational data isn't relational.
15:29muhoofp didn't take me very long to get. nosql, is just a struggle.
15:29dnolenmuhoo: you should take a look at datomic
15:29samaaroni wish someone would pay for me to hack on overtone
15:30acheng`TimMc/hxiao/raek/technomancy: you were right about the hyphens and it works for me now. movie quote was from terminator 2
15:30samaaroni had to pay for myself for a year - which was awesome fun but not sustainable
15:31gfrederickssamaaron: gave yourself a sabbatical?
15:31muhoodnolen: thanks, will do.
15:32samaarongfredericks: yup, i did
15:33samaarongfredericks: and worked harder and was more productive than ever before
15:33gfredericksI oughta start saving for one of those...
15:33samaarongfredericks: it's well worth it
15:34gfredericksI'd probably just end up enrolling in a phd program
15:34samaarongfredericks: i did one of those first :-)
15:34gfredericksoh I've agonized over that option for years now
15:35samaarongfredericks: don't do one unless you *really* *really* want to
15:35samaaronor if you think a life in academia is your calling
15:35samaaronyou'd be better off hacking on your own cool project(s) for a few years
15:35ibdknoxthe last one is the important bit I think
15:35ibdknoxeveryone I've ever talked to has said don't do it unless you want to be in academia
15:35gfrederickssamaaron: I think I'd consider it a calling if I was more confident about the future of academia :/
15:36ibdknoxheh
15:36samaaronibdknox: yup, i'd generally agree with that
15:36ibdknoxI looked into it for a while
15:36samaarongfredericks: and I also agree - academia is going to get a serious shake-up soon
15:36muhooacademia is a bubble atm
15:36samaaronespecially with the internet delivering so much quality material these days
15:37jedmtnman1gfredericks: my wife did a phd and i had to join (AA) Academics Annon. to recover
15:37samaaronhahaha
15:37ibdknoxlol
15:37samaaronmy PhD nearly destroyed me
15:37samaaronand I was spat out the other end in not particularly good shape
15:37samaaronphysically, mentally or skill-wise
15:37gfredericksbetween the lots-of-money-for-a-degree-you-don't-use bubble and the internet-induced-free-learning-identity-crisis I have a hard time giving up a dev salary for years just in case it'll be awesome
15:38samaaronone thing it did do was to teach myself a lot about myself
15:38samaaronin a zen-like way
15:38ibdknoxMy problem with academia is that there isn't enough doing
15:38muhooor a neitzche-like way
15:38samaaronibdknox: they have a different definiteion of doing :-)
15:39samaaronbut in general I would agree
15:39samaaronthere is not enough emphasis played in building stuff
15:39samaaronhave people looked into the Bauhaus?
15:39ibdknoxyeah, which in my opinion is the only way to prove anything
15:39gfredericksibdknox: proofs can also prove things :P
15:39samaaronibdknox: unless it's purely theoretical
15:40mdeboardgfredericks: tautologies are tautologies!
15:40ibdknoxpure theory isn't very useful ;)
15:40ibdknoxIt has to be applied at some point
15:40samaaronibdknox: i don't know about that...
15:40gfredericksibdknox: now THAT sounds like a tautology
15:40ibdknoxhaha
15:40gfredericksis not useful till you use it
15:40samaaron:-)
15:40ibdknox:D
15:41gfredericksibdknox: there's a lot of pure math that I enjoy for its own sake
15:41samaaronbut seriously, I think we should be studying the Bauhaus model
15:41ibdknoxenjoy != useful (necessarily)
15:41ibdknoxsamaaron: Bauhaus?
15:41samaaroni think those guys did a lot of stuff right
15:42samaaronibdknox: A German design 'institute'
15:42ibdknoxach so
15:42samaaronthey did huge amounts of innovation
15:42samaaronthe whole Ikea style is rooted in their work
15:42ibdknoxsamaaron: this one http://www.cs.umb.edu/~alilley/bauhaus.html ?
15:43samaaronibdknox: http://en.wikipedia.org/wiki/Bauhaus
15:43ibdknoxyeah, not sure why I passed over that one
15:43muhoodatomic looks pretty interesting. though i'm a little lost because there's no project.clj in it :-)
15:44samaaronthe cool thing about Bauhaus was that they taught through studying theory AND working on REAL industry projects
15:44ibdknoxsamaaron: that sounds right up my alley :)
15:44samaaronibdknox: I thought it would be :-)
15:45samaaronI really think it's an important education model to study
15:45TimMcUrgh, can't figure out querystring destructuring in Noir. {:keys [foo]} seems to expect :foo in the route itself.
15:45ibdknoxTimMc: it doesn't
15:45ibdknoxTimMc: just that a field named foo was submitted
15:45TimMc:-(
15:45ibdknoxTimMc: post or get request?
15:45TimMcget
15:46ibdknox /someurl?foo=blah
15:46ibdknoxwould fill that in
15:46TimMcAh!
15:46mdeboardTimMc: Did you ever get your answer about the schema
15:46ibdknoxor alternatively
15:46mdeboardfrom last night
15:46mdeboard(or this morning?)
15:46TimMcmdeboard: Not really.
15:46ibdknox /someurl/:foo => /someurl/blah
15:47TimMcAll the Java forums talk about writing SQL parsers. >_<
15:47ibdknoxwould be another way to do it :)
15:47mdeboardOh, awesome
15:47mdeboardseems weird, but I know nothing about jdbc muckery
15:48TimMcibdknox: I'm writing a pre-route, actually, so I don't want to restrict the inputs.
15:48ibdknoxTimMc: gotcha
15:48felideonTimMc: why did you find Lobos unsuitable?
15:48ibdknoxTimMc: pre-routes give you the whole request, since they are often used for filtering on headers and such
15:48TimMcfelideon: Can't figure it out.
15:48ibdknoxTimMc: that might be the issue
15:48jeffdikmuhoo: http://datomic.com/company/resources/integrating-peer-lib
15:48felideonI guess it's like Rails migrations, but if you haven't used those...
15:49ibdknoxTimMc: {{:keys [foo]} :params}
15:50TimMcibdknox: That's the one!
15:50TimMcfelideon: I've only seen one Lobos example, and it was horrifying.
15:50muhoojeffdik: yyep, reading that now
15:50felideonTimMc: you just want to be able to execute raw SQL which contains your db boot script? or do you want a wrapper so you can write such a script in a lispy way?
15:51TimMcfelideon: As far as I can tell, in Lobos the "uppermost" schema is not represented as a single thing you can read all at once, it is scattered across a bunch of migrations.
15:51muhoolooks like it's aot compiled :-0
15:51TimMcfelideon: I want any reasonable way of initing a DB with a schema. Splitting on semicolons is sort of not OK.
15:51felideonTimMc: yeah that's what it seems like. which is different than a "db boot" type of DSL
15:52felideonTimMc: splitting on semicolons?
15:52ibdknoxTimMc: there's some rough stuff in korma.incubator for that stuff
15:52ibdknoxlots of "stuff" going on there lol
15:52TimMcfelideon: (apply jdbc/do-commands (.split (slurp "foo.sql") ";"))
15:53muhooso funny how all these things end up basically reinventing sql with different syntax
15:53TimMcThis should be a solved problem, right?
15:53felideonTimMc: oh, right.
15:53felideonTimMc: it's been solved in Real Lisps.
15:54amalloyTimMc: oh man. i hope you never have any semicolons in your strings
15:54TimMcamalloy: Right.
15:54felideonbut that just means no one has done it for Clojure, it seems.
15:54TimMcOr Java, apparently?
15:55felideonTimMc: well... what can I say.
15:55muhoofelideon: how do other lisps solve it?
15:55felideonibdknox: so what are the current limitations of the schema stuff in korma.incubator
15:56ibdknoxfelideon: I have no idea, I threw it together in an hour to see what it would be like. It's annoyingly vendor specific
15:56felideonibdknox: postgres?
15:56ibdknoxTimMc: I think exec-raw will let you execute multiple statements in one call
15:56ibdknoxTimMc: in korma, but I haven't tested that theory
15:56TimMcibdknox: Not DDL.
15:56ibdknox:(
15:56TimMcSilently fails.
15:57ibdknoxjdbc sucks :/
15:57felideonmuhoo: http://marijnhaverbeke.nl/postmodern/postmodern.html#tabledef
15:57ibdknoxTimMc: easier would be to just shell out and run the damn sql file lol
15:57TimMc:-(
15:57felideonmuhoo: http://clsql.b9.com/manual/ch02s02.html
15:57felideonibdknox: that is -not- the lisp way! :P
15:57ibdknoxfelideon: that's what I was writing it against
15:58sadgercemerick: Got my copy of the clojure programming today, great so far!
15:58TimMcI like the general idea behind Lobos, but the current version of the schema should be explicit. Like, a list of migrations followed by the current schema.
15:58TimMcSome duplication, but that's life.
15:59gfredericks"Life is some duplication" -- TimMc
16:00TimMc -- gfredericks
16:02felideongranted in Lisp the benefit is that you are also defining your models with the same DSL, which is very OOP-ish I guess?
16:02dnolennice http://himera.herokuapp.com/synonym.html
16:03dnolenwill add more goodies later
16:03felideonibdknox: so jdbc was what caused you to 'hit a wall' ?
16:04ibdknoxfelideon: no, it can be done, someone just needs to care enough :)
16:04felideoneven with jdbc
16:04felideon?
16:04ibdknoxfelideon: It wasn't a problem I needed to solve, people just kept asking about it
16:04ibdknoxfelideon: sure
16:04felideonright, sounds like a fun thing for me to do
16:04felideonto learn me some clojir
16:04ibdknoxthat's why I put it in incubator :)
16:06dnolen`fogus: thx!
16:07Bronsa`fogus: missing closing paren on "Assign a function to a variable" example
16:07ibdknoxdnolen: ^
16:07felideondoes anyone know why swank-clojure depends on an old slime version? does there need to be more support from the slime side for things to work a bit better?
16:08dnolenBronsa: it's a Github project, fork and submit pull request.
16:09dnolenif anyone else wants to improve please do - at the moment it's just a simple HTML file.
16:09Bronsaoh ok!
16:10BorkdudeI guess "lein test" is the most practical way of running tests, even if I have an Eclipse project?
16:11Borkdude(not that I want to use Eclipse, I'm just trying to see it from the perspective of my students)
16:13amalloyfelideon: because slime devs don't do releases at all - your code has to work with CVS HEAD, which is constantly changing
16:14amalloyso technomancy (or someone) just picked a revision and said "Here. This is the version we're going to use."
16:15felideon"screw the lispers who want to keep a nice slime-enabled REPL side-by-side" :)
16:15felideonamalloy: but yeah, i see what you mean.
16:15amalloyfelideon: volunteering to publish and maintain a version of swank that keeps up with the constantly-breaking slime revision?
16:15the-kennyLet's face it: Slime has a horrible codebase. Desparately needs a re-write.
16:16felideonamalloy: i might, if thrush operators, square brackets, and ()-is-not-nil doesn't drive me crazy enough to drop Clojure :P
16:18ambrosebs@technomancy: mmm nice dream :) (typed clojure preventing NPE)
16:18muhooit is tragic how set in our ways we get. i.e. ()-is-not-nill driving feliedon crazy, no joins in nosql db's driving me crazy.
16:19felideonthe-kenny: I almost thought you were kenny tilton for a second. but that's physically impossible.
16:19the-kennyfelideon: Nah :)
16:20llasrammuhoo: I'm not sure those are comparable... Maybe this is my bias, but I think ()-nil in/equality is something you'd just get used to and get over, while annoyance at the lack of joins in your NoSQL datastore of choice perhaps suggests a problem-datastore match?
16:20felideonhe's not a slime fan either :P
16:20llasrams,match,mis-match,
16:21texnomancythe-kenny: I really want someone who isn't me to make nrepl.el awesome
16:21texnomancyhttps://github.com/technomancy/nrepl.el <- fork and have at it
16:21the-kennyThere was some other programming related channel where people were rude to me, thinking I was making fun of some guy with a nickname which also contained "kenny".
16:21texnomancyTimMc: I don't think the dream of "declare your migrations in one backend-agnostic format" is ever going to deliver; databases just vary too for you to be able to swap them out cleanly as an abstracted-away implementation detail
16:21texnomancydespite what activerecord claims
16:22the-kennytexnomancy: Hm, I'll add it to my 'Someday' list
16:22TimMctexnomancy: I'm not even looking for DB-agnostic.
16:22muhoollasram: that's entirely possible, thanks.
16:22texnomancyTimMc: sure; I'm saying that's my beef with lobos
16:22muhooactually, migrations and activerecord/orms are what drive me crazy about sql
16:22texnomancyI think its goal is unrealistic
16:22TimMcI'm not seeing the problem with migrations.
16:23llasramYeah. A *lack* of any coherent way of doing migrations is one of the biggest problems I'm facing with the NoSQL datastores my company is using
16:24jtoyhow would I turn this function into a function that returns true/false ? (re-find #"^http://&quot; word)
16:24llasramI agree on ORMs though :-)
16:25felideontechnomancy: nrepl.el is something that could be used instead of SLIME, for instance?
16:25daniel_vening all, im trying to learn clojure by writing a chess computer. Have started to realise
16:25metellusjtoy: there's probably a better way but you could wrap it in (not (nil?
16:25amalloyjtoy: well, first why do you care if it returns true/false? you can just use the string/nil in a boolean context
16:26Bronsajtoy: (boolean (re-find #"^http://&quot; word))
16:26amalloybut if you really want a boolean, you can just call (boolean ...)
16:26daniel_that i have a lot of functions (get-piece, move-piece, valid-move?) that all take the current board as an argument
16:26muhootexnomancy: moved to the lone-star state, have you?
16:26jtoyamalloy: it is expected for other methods I call,
16:26jtoyt
16:26jtoyhx
16:26daniel_i think im missing a functional programming technique here, how should i keep a running state of the current board
16:27muhoodaniel_: atom?
16:27amalloydaniel_: taking the current board as an argument is probably the best way. alternatively you can introduce either mutability or monads, both of which sound pretty unpleasant to me
16:28daniel_i didnt really want to introduce mutability, but it also seems a bit daft and repetitive having all my functions taking the current board as an argument
16:28amalloydaniel_: it's only daft if you imagine that such a thing as the "current board" exists and can change
16:28technomancyfelideon: that's the idea
16:28felideontexnomancy: why did you lose interest in nrepl.el?
16:29felideonhmm twins.
16:29technomancyfelideon: I don't have time for it and don't enjoy writing elisp since Clojure has spoiled me
16:29technomancyfelideon: if I ever got a clojure->elisp compiler working I'd be much more likely to work on it
16:29felideonyeah I don't blame you.
16:30amalloythe idea is that your functions can operate on any board, and you can have multiple boards in existence at once. perhaps you're searching the problem space for the "right" move, so you speculately create a new board then want to go back, then...it's much easier if you just pass a board explicitly
16:30felideonso what's a good clojure dev setup right now? (i came from emacs/SLIME spoilage) pretty much clojure-jack-in ?
16:30daniel_i suppose amalloy, muhoo ill look at atoms aswell. Not too familiar with them atm
16:31felideons/came/come
16:31technomancyfelideon: until nrepl.el is written, yeah =)
16:31daniel_amalloy: good point about searching for the right move with multiple boards
16:31amalloydaniel_: i strongly recommend against using an atom to hold the current board. it makes backtracking, multitasking, and lots of other things you would want to do with a chess board so much harder
16:31technomancyfelideon: GNU emacs 24, lein-swank plugin, clojure-mode, and M-x clojure-jack-in
16:32felideons/nrepl.el/light table
16:32technomancydaniel_: take a look at the reduce approach here: https://github.com/technomancy/swarm-go/blob/master/src/swarm/go.clj
16:32technomancyfelideon: sure, if you don't like SSH
16:32felideonwhy emacs 24? elpa?
16:32felideontechnomancy: heh true
16:34amalloydaniel_: my first clojure project was a minimax solver for contract bridge. you might be interested in some of what's going on at https://github.com/amalloy/ddsolve/blob/master/src/ddsolve/ai.clj
16:34cemericktechnomancy: not to rain on it, but isn't nrepl.el just the tip of the iceberg? i.e. supporting swank is a long way from offering SLIME
16:34muhoodaniel_: hmm, amalloy is right. atom might be too blunt an instrument depending on what you're doing.
16:34felideontechnomancy: elpa/built-in elpa
16:34daniel_thanks all
16:34amalloymultithreading and backtracking in the minimax solver to improve performance (which was still awful), enabled because i didn't have a notion of the current game
16:35daniel_might be hard for me to understand that one, not only because im not too familiar with clojure, but because i havent a clue how bridge is played :p
16:36daniel_i'
16:36daniel_ll take a look though
16:36technomancyfelideon: 24 is just more stable/better overall
16:37technomancycemerick: depends how much can be implemented server-side
16:37amalloyyeah, i'm not sure it makes sense to me anymore either. like i said, my first clojure project so it's a bit of a mess
16:37technomancyI'm not sure
16:41muhoollasram: wow you are right. i've wasted so much time trying to shove this rather square, mundane business problem into a round nosql hole, that perhaps i could do in postgres/korma in 30 minutes what has taken me days to try to grok in bigtable/couchdb/mongo
16:42llasrammuhoo: Glad to help...? I was worried that'd come off as too condescending, but I guess forest, trees, etc sometimes
16:44muhoollasram: you were very polite. but perhaps sometimes condescension can the correct tool for the job :-)
16:46patchworkHow do I call a java method from clojure that has variable arguments?
16:46amalloypass it a java array
16:46patchworkmethod(ClassThing… args)
16:46patchworkSo to-array?
16:47patchwork(Class/method (to-array args))
16:47amalloyinto-array is usually more convenient
16:47amalloybut yes
16:47patchworkI tried that and it failed on a class cast exception
16:47amalloyspecify the type of the array
16:47patchworkAha
16:47amalloy&(into-array ["X" 2])
16:47lazybotjava.lang.IllegalArgumentException: array element type mismatch
16:47amalloy&(into-array Object ["X" 2])
16:47lazybot⇒ #<Object[] [Ljava.lang.Object;@ab0220>
16:48patchworkGot it, thanks
16:48patchworklet me try that
16:49patchworkSame error, it just says "No message." and under that [Thrown class java.lang.ClassCastException]
16:49patchworkHere is my code: (Scalr/resize vvv 200 (into-array BufferedImageOp []))
16:50patchworkwhere vvv is a BufferedImage
16:50felideonthe-kenny: so do you have any experience writing elisp?
16:50solussdanyone here use lobos? I'm getting a cryptic error when I try to perform a migration: [SQLITE_ERROR] SQL error or missing database (near "lobos": syntax error).
16:50the-kennyfelideon: Not much
16:50muhoopatchwork:: also, is it a static method? if not, then maybe (.method instance (to-array args)) . also, the items in the array all have to be the same typ
16:50patchworkmuhoo: It is a static method
16:50patchworkAlso, I am passing it an empty vector, so there are no items in the array
16:51felideonthe-kenny: i'll add that to my 'someday' list too then :P
16:51the-kenny:D
16:51the-kennyLet's see whose someday comes first
16:52technomancyyou don't need elisp experience, you need a compiler that targets elisp
16:53technomancyor alternately an emacs implementation on another multi-language runtime
16:53hiredmansource->source is an option too
16:53hiredman(no need to restrict the target to elisp bytecode)
16:54technomancydefinitely
16:55technomancyhiredman: did you see my post to emacs-devel?
16:55technomancyStefan was slightly more receptive than I expected
16:56hiredmanno, I am not on any emacs lists
16:56technomancydon't blame you
16:57technomancyhttp://lists.gnu.org/archive/html/emacs-devel/2012-04/msg00684.html if you're interested; apparently immutable strings are not as unrealistic as I'd expected
16:58hiredmantechnomancy: I would really hope that people don't go around mutating them as a matter of course
17:02llasramI
17:02llasramI mutate every string I get my hands on, just to confuse other libraries
17:03gfredericksllasram: every noun in that sentence has a non-technical sense, which makes the sentence a lot weirder
17:03huangjsis there a lein-swank 1.5.0-SNAPSHOT that I can use?
17:04kastermaI am wondering if there is a more idiomatic way to do what I do in https://gist.github.com/2473791
17:05kastermatt is a vector that determines if we update the map mm at value of as by va.
17:05kastermaI know my variable naming is not optimal, but this is as small as I can get the example to be.
17:05huangjsanyone using lein-swank 1.5.0?
17:06technomancyhuangjs: there is no lein-swank 1.5.0
17:06technomancyyou can use lein-swank 1.4.4 with swank-clojure 1.5.0; just add it to :dependencies
17:06gfrederickskasterma: the first/rest stuff can be done with destructuring in the update-mm arg list
17:06huangjstechnomancy: ah, ok
17:07kastermagfredericks: Indeed. What about the recursion to use assoc to update the map.
17:07kastermaAny better ideas for that?
17:07gfrederickskasterma: having trouble understanding what the algorithm is doing
17:07dnolenyoklov: so what state did you game end up in?
17:07huangjstechnomancy: works like perfect, thanks for the help!
17:07technomancyno problem
17:08kastermaStart with some map (mm) if tt[idx] is not nil, set mm[idx] to be mm[idx] + va[idx].
17:08kastermaRun through all idx in the domain.
17:08amalloythis looks like a reduce over the tuple [t a b] accumulating in m, or something
17:08yoklovdnolen: still in progress, i have 3 hours left. it's very good so far
17:08kastermaOops, set mm[idx] to be mm[as[idx]] + mm[as[idx]] + va[idx]
17:09gfrederickskasterma: yeah 96% of the time you don't need recursion
17:09kastermaThe recursion does look a little ugly to me, but I don't know how to rid myself of it.
17:10kasterma(the actual context is trying to update a factor in a probabilistic graphical model to take some evidence into account).
17:10gfrederickskasterma: also, if you want a map with keys of (0...n-1), a vector can be that
17:10gfredericksthough I see you're using (1..3)
17:10dnolenyoklov: awesome! still a 1st person thing?
17:11kastermaI didn't find an assoc for vectors.
17:11yoklovdnolen: no, you're not supposed to use existing code. it's mostly paths with the canvas, which is a large reason it tool longer than I though. figuring those out is tough.
17:12dnolenyoklov: gotcha, looking forward to trying it out! :)
17:12mmarczykkasterma: assoc is assoc for vectors
17:12gfredericks&(assoc [100 101 102 103] 2 :foo)
17:12lazybot⇒ [100 101 :foo 103]
17:12yoklovdnolen: awesome! I'll post here and probably on twitter too
17:12mmarczykyoklov: ^ as am I :-)
17:14kastermammarczyk: Thanks, I'll update that too in the code. It's getting better already. Now to get rid of the recursion.
17:15TimMc&(associative? [1 2 3])
17:15lazybot⇒ true
17:15gfredericksthere oughta be a dissociative? too
17:16TimMc(def dissociative? associative?)
17:16gfredericksmaybe (def dissociative? map?)
17:16gfrederickssince not vectors
17:16TimMcOh right, vectors only append and replace.
17:17huangjstechnomancy: i have another problem, when i do swank-connect, emacs reports "can't find suitable coding-system". I've set slime-net-coding-system to 'utf-8-unix. do I need to specify any options to lein swank?
17:17huangjs
17:17gfredericksand pop
17:17technomancyhuangjs: very strange; I haven't seen that one
17:17raekhuangjs: lein swank uses UTF-8 by default
17:17huangjsstrange
17:17raekso it's only the slime side you may need to configure
17:18huangjsraek: my locale is also utf-8
17:19raekhuangjs: are you using slime-connect or clojure-jack-in? did you install slime yourself, and if so, from where?
17:20raekhuangjs: if you type M-: slime-net-coding-system <RET> do you see utf-8-unix or 'utf-8-unix?
17:22raek(also: if you use clojure-jack-in, that variable should be set to the right thing (utf-8-unix) automatically)
17:34solussdis there a way to get a map of all keyvals passed to a page in noir, rather than explicitly naming the ones you want?
17:37jtoyany of you guys deal with url unrolling on a massive scale?
17:37jtoyall these url shorteners cause so many probems
17:38solussdnever mind.. I'm assuming I can use {:keys [a b c] :as allkeys}
17:38ivanjtoy: what do you mean by url unrolling?
17:39jtoybit.ly/blah -> real url
17:39emezeskegod url shorteners are stupid
17:39emezeskethanks, twitter
17:39ivanurlteam has massive databases of shortened URLs and probably tools
17:40jtoyI'm trying to get stats on about a million urls, so i have to resolve them all to find what the real urls are, 1 at a time is too slow, i was doing a 100 at a time and that was flooding t.co
17:41technomancyjtoy: map/reduce over amqp! =)
17:41jtoyivan: this one http://urlte.am/ ? cool, that is really useful, i was trying to find something like this
17:41ivanyes
17:41technomancyhttps://github.com/technomancy/die-roboter
17:41ivanthey're on efnet #urlteam but minimal activity
17:41ivanalso #archiveteam
17:42jtoyhmm, it looks like the don't do t.co
17:43jtoywhich 90% of twitter goes through t.co, and even if the url was already shortened, twitter adds another layer of t.co !!!!!
17:44jtoysuch a waste of bandwidth too
17:44technomancysuch nonsense
17:44jodaroyo dawg, i heard you liked your urls shortened so i shortened your shortened urls
17:44amalloyjtoy: t.co just uses url shortening as an excuse; the reason is to collect usage/click statistics
17:44sattvikamalloy: Exactly. And I hate it.
17:44jtoyamalloy: yeah i know
17:45amalloyjtoy: i did some large-scale url following in php, but it's all closed-source and i don't have it anymore
17:45technomancyI bet nathan marz loves it though =)
17:45jtoyyeah
17:45huangjstechnomancy: the reason is (slime-connection-coding-systems) returns nil instead of ("utf-8-unix" "iso-latin-1-unix")
17:47drewrwhy does (-> (node/require "optimist") (.boolean "v") .-argv) compile to cljs.nodejs.require.call(null, "optimist").boolean$("v").argv?
17:47drewrthat dollar is throwing a wrench in my plans
17:48jtoytechnomancy: was this for me? https://github.com/technomancy/die-roboter
17:48dnolendrewr: it's known bug
17:49dnolendrewr: we shouldn't munge property access names.
17:49jtoyTo paraphrase James Dennis, ØMQ is like Git (essentially distributed) whereas AMQP is like SVN (essentially centralized).
17:50technomancyjtoy: just throwing it out there as an easy way to distribute a bunch of calls like that
17:50drewrdnolen: is it special to `boolean`?
17:50dnolendrewr: any JS reserved word.
17:50technomancyØMQ sounds a lot like git before github; very roll-your-own.
17:50drewrdnolen: right
17:52drewrdnolen: no workarounds I'm trying seem to work
17:52dnolendrewr: nothing will work
17:52drewroh
17:52dnolendrewr: patch to complier required.
17:52drewrI see
17:54dnolendrewr: if you provide one I'll happily apply it.
17:54nDuffIs it possible to provide explicit constructors for a class generated with deftype or defrecord?
17:54mebaran151is there a verion of the arrow operator that halts processing if anything result comes up nil
17:55mebaran151something like -nil?>
17:55amalloythere's one in contrib
17:55amalloy-?>
17:55mebaran151I know I could pull out a maybe monad, but it seems like overkill
17:55amalloyif you're already comfortable with monads then maybe wouldn't be the worst solution either
17:56mebaran151I just hate to add one more dependency
17:56mebaran151in this case I could do a quick null check inline, but was thinking maybe core had something for me
17:56huangjstechnomancy: raek: more problems lol, if i set the return value to be ("utf-8-unix" "iso-latin-1-unix"), clojure reports "Wrong number of args (3) passed to: basic$eval1254$create-repl", it's called from swank-clojure 1.4.0 instead of 1.5.0, maybe I should not mix lein-swank with swank-clojure?
17:56jtoytechnomancy: cool, I might use it, how does it compare to storm? in regards to remote rpc, it is the same?
17:56mebaran151also has anyone here every worked with OrientDB
17:57technomancyjtoy: it's several orders of magnitude simpler than storm
17:57mebaran151I was looking for an embedded Mongo and it looked a little promising
17:58technomancyjtoy: the clojure part is about 100 LOC
17:58jodarojtoy: i'm late to the conversation ... are you trying to do some distributed processing of urls?
17:58technomancystorm bends over backwards to avoid the need for a centralized server and to work around some of the shortcomings of cassandra
17:58jtoyjodaro: yes,i want to "unroll" ~ 1.5 M urls
17:58technomancyif you don't need data locality, amqp is far simpler
17:59jtoytechnomancy: i haven't played with storm yet, but am thinking of using it , i don't think its tied to cassandra?
17:59jtoyjodaro: have you done this before?
17:59jodarojtoy: i played around with the 0mq majordomo pattern stuff a few months ago
18:00jodarojtoy: https://github.com/joshrotenberg/md-clj
18:00technomancyjtoy: it's not tied to cassandra, but the reason it avoids the much simpler queued workers model is due to a shortcoming of cassandra.
18:00technomancyaccording to the strangeloop talk I saw on storm
18:00jodarojtoy: may or may not be what you want but its pretty straightforward and simple
18:00jodarobasically just client/broker/worker
18:00dnolenibdknox: yowza, daringfireball
18:00technomancyhttps://github.com/technomancy/die-roboter/blob/master/src/die/roboter.clj <- I guess it's almost up to 200 LOC now
18:00ibdknoxdnolen: yeah :D
18:01ibdknoxthat should... help
18:01jtoyibdknox: nice job!
18:01ibdknoxI had nothing to do with it
18:01ibdknoxlol
18:02jtoywould love to know how much traffic daring fireball drives
18:02technomancyhuangjs: very little has changed in swank-clojure 1.4 -> 1.5, but you could try falling back to see if the problem goes away
18:02ibdknoxI wish I could tell you
18:02ibdknoxhe sent them directly to the kickstarter
18:02huangjstechnomancy: sure
18:03ibdknoxand I haven't found any analytics there
18:03ibdknoxnm
18:03jodaroif only he had used t.co
18:03ibdknoxI can find out how many pledges were referred from there
18:03ibdknoxbut not the actual traffic
18:04jtoyso you guys wouldn't recommend storm? i didn't know the architect was not good
18:04technomancyjtoy: if you can't use the standard workers-on-a-queue approach and need realtime results, storm looks really great
18:05technomancyjtoy: I just don't see a need to jump to a complicated tool for a simple workflow
18:06jtoytechnomancy: I could use standard workers, from reading the docs of storm, what is supposed to be good about it is that you don't have to deal with all the infrastructure piees
18:06technomancystorm has a huge mental surface area
18:06ibdknoxlol Jason Fried just pledged
18:06jtoyJason Fried doesn't code ?!?
18:07jtoytechnomancy: what does that mean? upfront cost to get started?
18:08technomancyconceptual cost, sure. your use case seems like a great fit for the 200-line approach.
18:08technomancyfor your consideration: https://github.com/technomancy/bludgeon
18:09ibdknoxlol
18:09mebaran151I like the project name
18:09ibdknoxtechnomancy: great name
18:09technomancythanks
18:09jtoytechnomancy: haha,nice
18:09jodaroheh
18:11jtoytechnomancy: what do you think of cascalog? I've been playing with that library
18:11technomancyjtoy: if you need data locality, it seems like the best way to achieve it
18:12technomancynot a good fit for the problem you described though
18:13jtoytechnomancy: I've been using it for some other data processing, but yeah, not for the url stuff
18:14huangjstechnomancy: latest slime added some keyword parameters to swank:create-repl so in basic.clj it should be (defslimefn create-repl [target & ignore] '("user" "user"))
18:15technomancyhuangjs: oh, latest slime is definitely going to break
18:15technomancyneed to use the version that comes with swank
18:15huangjstechnomancy: ah, ok
18:16huangjstechnomancy: i might try to fix that since i need to use sbcl as well :)
18:16technomancyhuangjs: if you can do it in a backwards-compatible way that would be nice, but there are lots of other issues with CVS slime as well
18:16technomancyI won't break compatibility with the snapshot everyone is using
18:17huangjstechnomancy: ah i see. i'll try the old slime
18:18technomancyyou could also try ritz; I think it might work better with new slime
18:18huangjstechnomancy: oh i didn't know that. i'll try. thanks!
18:19technomancynot sure about that, but it might be worth a shot
18:20hugodI haven't tested slime head with ritz recently...but would be open to updating to support it
18:21technomancysrsly, somebody plz write nrepl.el so I can deprecate this thing already =)
18:22felideonritz might give me a better chance to have slime work with both CL and Clojure?
19:13yoklovif you do (def foo), what should the value of foo be?
19:14yoklovnil, right?
19:14tmcivermy repl gives IllegalStateException: Var user/foo is unbound.
19:15yoklovoh, hm
19:15tmciverYou must give it a root binding (nil if you want)
19:16yoklovif you do (def ^:dynamic foo) it works though, right? or am I just insane for thinking that I remember that
19:16tmciverNope, not for me.
19:16tmciverSame exception
19:17yoklovweird.
19:17yoklovthat makes sense then.
19:17tmciverMaybe you have old bindings leftover?
19:19brehautare you thinking of declare ?
19:20yoklovyeah, i think i'm thinking of declare
19:20brehautso declare creates an unbound var, which is different to one bound to nil
19:20yoklovoh
19:20yoklovhuh.
19:20brehaut(because derefing it throws the above exception)
19:21amalloy(declare foo) is identical to (def foo)
19:21brehautim pretty sure you can declare a non dynamic var too
19:21gfredericksoh man how do I open a directory in dired while ido-mode is on?
19:21technomancyC-d should do it
19:22gfredericks(inc technomancy)
19:22lazybot⇒ 23
19:22gfredericksoooooh
19:23gfredericksoh there's a fun phrase to google
19:24brehautwow, technomancy has almost caught up to emacs
19:24gfredericksnevermind it wasn't fun
19:24brehautthe singularity is imminent
19:26gfredericksso there's a movie about P=NP I just found out today
19:30mjreedHello. Trying to read from a JMS queue; (reify MessageListener (onMessage [msg]...)) gives me "Can't define method not in interfaces: onMessage", even though the method is clearly in the interface....
19:31mjreedwhat am I doing wrong?
19:31gfredericksmjreed: do you need to make 'this' an explicit first arg?
19:33mjreedgfredericks: d'oh! the Java class that I was using as an example has a static class, and for some reason I was thinking that meant no "this". Too many languages in the pot.
19:33mjreedThanks!
19:36gfredericksyeah for static methods I'd think there'd be no need for reify
19:36mjreedmethods aren't static..
19:36mjreedclass is.
19:36mjreedthat's where I got confused.
19:37gfredericksstatic inner class?
19:37mjreedright.
19:37gfredericksgotcha
19:43mjreedAnd it works. Woot!
19:43mjreedThanks again, gfredericks.
19:44gfredericksrich hickey at railsconf??
19:44lazybotgfredericks: What are you, crazy? Of course not!
19:45hiredmanI think he is keynoting
19:45hiredmanI thought I heard that somewhere
19:45gfrederickshe is
19:45gfredericksjust finished up probably
19:45gfredericksI did not expect that. That's a terribly interesting pairing.
19:46scottj_anyone know what he talked about?
19:46gfrederickshttps://twitter.com/#!/deadprogram/status/194556427627536384
19:47gfredericksthere's a few others under the #railsconf hashtag
19:47technomancyhuh; I didn't know rich knew about bludgeon
19:49mdeboardMan that's a great quote.
19:49mdeboardbecause it's true.
19:51mdeboardThat was a tautology, wasn't it.
19:51gfredericksno
19:51LuminousMonkeyIs it?
19:51LuminousMonkeyI don't think it is..
19:52mdeboard"Not all great quotes are true." -- Matt DeBoard
19:52mdeboard#railsconf
19:53scottj_https://github.com/newhavenrb/railsconf2012/wiki/Rich-Hickey-Keynote
19:53gfredericksscottj_: good link
19:56gfredericks"Programmer convenience =~ Programmer replaceability" oh wow
19:58technomancyI want to hear more about the Kazoo Fighters
19:59muhoo"What if the Foo Fighters became the Kazoo Fighters?" -- wtf??
19:59lazybotmuhoo: Definitely not.
19:59gfredericksmy only guess was that "foo" -> X symbolizes code changing
20:00amalloya lot of people are asking for lazybot's opinion today
20:00mdeboardreally??
20:00lazybotmdeboard: Definitely not.
20:00brehauthes very knowledgable
20:00mdeboardoh
20:01gfredericksman did he basically just go there and tell them that rails and ruby are terrible?
20:01technomancysure; why waste an opportunity?
20:01mdeboardlolirl
20:01technomancy=D
20:02gfredericksI wonder if he had to submit a proposal
20:04muhoorhickey is a new yorker. it was fun watching his nyc lisp group presentation in the early days of clojure.
20:05technomancyI wonder if we'll see an uptake of rubyists joining the channel to see what the fuss is about
20:05gfredericks"What do you guys think about making '=>' whitespace?"
20:06technomancyhaha!
20:06brehautgfredericks: i think we should make functions only be allowed to take a single ifn arg
20:07gfredericksbrehaut: do you think we could work out a macro for blocks?
20:07gfredericksone requirement is you have to be able to call (yield)
20:07brehautbest potential abuse of of map literals ever
20:07gfrederickslol!
20:08gfredericks(foo bar baz do |okay| (+ 1 2) end)
20:08muhooactually, this presentation looks a lot like stuart hollaway's conj presentation on simplicity
20:09brehautactually, i think it'd need to be a set literal
20:09gfredericksmuhoo: and also rich's later talk @strangeloop?
20:09gfredericksbrehaut: dang we'd lose the order of the expressions either way
20:09gfredericksdo small sets come out in the same order?
20:10gfredericks,(= [3 4 5 6] (seq #{3 4 5 6}))
20:10brehautgfredericks: lack of ordering will just emphasis the problems of concurrent programming. its a benefit
20:10clojurebottrue
20:10gfredericks,(= [6 5 4 3] (seq #{6 5 4 3}))
20:10clojurebotfalse
20:10gfredericksaw crap
20:10brehautlol
20:11brehauti know! line numbers!
20:11gfrederickso_O
20:11muhoolike basic?
20:11brehautlike basic
20:11muhooGOTO 12
20:11gfrederickscode is just a map from labels to commands
20:12gfredericks{:label1 (goto :label2) :label3 (noop) :label2 (println "I'm label 2")}
20:12septominautomatic semicolon insertion, but semicolons still introduce comments
20:12gfredericksmaybe rename :label1 to :main
20:12muhooyou guys... are implementing basic as a DSL in clojure? um.. ok.
20:12brehautno, ruby blocks
20:12brehautbasic is just a seasoning
20:12muhoohaha
20:13amalloy$google fogus baysick
20:13lazybot[fogus: Baysick: A Scala DSL Implementing BASIC] http://blog.fogus.me/2009/03/26/baysick-a-scala-dsl-implementing-basic/
20:13brehaut(that way fogus will will implement it for us)
20:13brehautdamn. sniped
20:13gfredericksit's the new zealand lag
20:13muhootoo kinky for me.
20:13muhoodamn, i have spent the entire day procrastinating, and now i hate myself.
20:14gfrederickscorrelation does not imply causality
20:14gfredericksperhaps you procastinated because you hate yourself
20:19muhooi'll have to run it backwards through core.logic and see
20:20brehautcareful, core.logic might produce an unbounded set of ways to procrastinate if you do that
20:22kyle_wmhi guys, i was wonderinng if there a more idiomatic way to say (map #(if (pred %) (f %) %) coll) ? looking for something sort of like SQL's UPDATE WHERE
20:23gfredericksI bet flatland/useful has a fn that does that
20:23amalloykyle_wm: well, if you don't mind pulilng in useful (https://github.com/flatland/useful/blob/develop/src/useful/fn.clj), you can write (map (to-fix pred f) coll)
20:23gfredericksBAM
20:23amalloywell done, sir
20:24mdeboardlol
20:24kyle_wmthanks again Alan (you helped me on SO the other day too :) )
20:24technomancyto-fix?
20:24amalloyarguably the name sucks
20:24brehauti believe haskell calls it @^$$>
20:24clojurebotGabh mo leithscéal?
20:25technomancyamalloy: so named because there's a ";; TO FIX: name this function" comment above the defn? =)
20:25amalloythe idea was that (to-fix x string? read-string coll? first) reads kinda like "if x is a string, fix it by calling read-string; if it's a collection fix it by calling first"
20:25amalloyer, drop the x
20:25gfredericksoh it takes multiple pairs?
20:25technomancyhm; maybe "coerce"?
20:26amalloyyeah, it has loads of flexibility nobody ever really needs
20:26amalloyalthough i did use two clauses for a postwalk a while ago
20:26amalloyoh, for a tree-seq
20:27amalloyto see all the values stored in the leaves of a nested collection of map/seqs: (tree-seq (any map? sequential?) (to-fix map? vals, sequential? seq) the-big-map)
20:27gfredericksso it short-circuits?
20:28amalloyyeah
20:31gfredericks(= useful.fn/any some-fn)
20:32technomancyso the egal paper has all this stuff about how to compare functions, but it only works if you have the source
20:33technomancyI wonder if an appeal to Baker would help the plea to get serializable-fn mainlined
20:33gfrederickscomparing functions? wouldn't that be the halting problem?
20:33amalloygfredericks: well (a) any is way older, and (b) some-fn does some crazy nonsense if you pass more than one argument
20:34technomancygfredericks: not if you're happy with lots of false negatives
20:34amalloy&((some-fn even?) 1 2 3 4)
20:34lazybot⇒ true
20:34gfrederickstechnomancy: well okay
20:34gfredericksas long as that's in the contract
20:34technomancyright; operational equivalence is obviously not feasible
20:34technomancybut you should read the paper! =)
20:35gfredericks$google the egal paper
20:35lazybot[The Eagle - Bryan/College Station, Texas | News, Weather ...] http://www.theeagle.com/
20:35amalloyIMO any and all are still way better than some-fn and any-pred
20:35gfredericksthanks google
20:35amalloyer, every-pred
20:36technomancyclojurebot: equal rights for functional objects?
20:36clojurebotEqual Rights for Functional Objects is Baker's paper on equality and why it's impossible to define sensible equality in the presence of mutable data structures: http://www.pipeline.com/~hbaker1/ObjectIdentity.html
20:36gfredericksamalloy: if you're talking about naming then I agree
20:36amalloygfredericks: i'm talking about what they do
20:37amalloy((any = not=) x y) => (or (= x y) (not= x y))
20:37amalloy((some-fn = not=) x y) => (or (= x) (= y) (not= x) (not= y))
20:37gfrederickstechnomancy: I will read this paper.
20:38gfrederickso_O
20:38gfrederickscartesian product?
20:39amalloyyes, completely useless. it's easy to derive some-fn or every-pred from any/all, but to go the other direction you have to rewrite the whole thing
20:39muhoo&(doc any)
20:39lazybotjava.lang.RuntimeException: Unable to resolve var: any in this context
20:40amalloymuhoo: it's in useful
20:40muhooah
20:56buduhi, does someone here is good with core.logic?
20:58amalloy~anyone
20:58clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
20:58budui'd like to know if it's possible for some goals to be applied only in the case where another set of goals fails
20:59dnolenbudu: there is no general negation support if that's what you're looking for.
21:00budufor example, say i have a 'cousin' goal that also returns the siblings would there be a way to prune them?
21:00buduin a family tree example app
21:02dnolenbudu: there's condu and conda for pruning - but those operators are non-relational.
21:03dnolenbudu: good books of Prolog applicable here.
21:03buduyeah, i've tried them, but i couldn't find a way to prune enough!
21:03budustill need more practice to use them
21:04gfredericksokay. I think I need to buy a book on all this cool stuff. Is "The Reasoned Schemer" the thing to do? or does it have prereqs?
21:04dnolengfredericks: no besides a little Scheme knowledge.
21:04buduthere's not much examples on conda and condu out there (on the web)
21:05dnolenbudu: there's not enough core.logic examples period :)
21:05buduyep, working on that
21:05dnolenbudu: excellent!
21:05budui'll do a talk on core.logic tomorrow at the montreal clojure user group
21:05dnolenbudu: I try to avoid conda / condu, so I can't speak that much on their usage.
21:06dnolenbudu: that's great
21:06buduanyway i think i've got enough material for a introduction
21:06dnolenbudu: I'm sure you do
21:07bududon't want to make frighten people (again)
21:07dnolenbudu: the moment you should anything running backwards people will be scratching their heads.
21:07dnolens/should/show
21:07budu@dnolen: btw, i've found a small mistake in a docstring
21:08budu@dnolen: in lvaro, i think it should read 'non-ground'
21:09dnolenbudu: thx
21:11Frozenlo`For the Noir users: Is there a way to redirect to the "previous page" when doing a login?
21:12Frozenlo`(or compojure users)
21:14ibdknoxFrozenlo`: store the page you redirected from in the session, then when they login check if there's a stored page and redirect to that instead
21:15amalloyFrozenlo`: 4clojure does that, if you want to take a look
21:15Frozenlo`ibdknox: How do you get the page you are redirected from?
21:16Frozenlo`amalloy: 4clojure uses Noir?
21:16gfredericksFrozenlo`: should be the current page right?
21:16amalloycompojure
21:16Frozenlo`Close enough :P
21:16gfredericks(:uri req)?
21:16_atoI prefer passing it to the login page as a query/post parameter when doing the redirect. storing it the session behaves confusingly if you open things up in multiple tabs
21:18Frozenlock_ato: Good point. In addition someone could simply leave the login page and come back later, being redirected then.
21:22Dr_Zorg24Any reccomendations for a clojure tutorial/book (pregerably free or inexpensive)?
21:24Dr_Zorg24anyone?
21:24clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
21:25Dr_Zorg24I'd like a reccomendation for a good clojure tutorial/book (preferably free or inexpensive)?
21:25gfredericksDr_Zorg24: clojurebot did not mean what he said
21:26cemerickDr_Zorg24: http://java.ociweb.com/mark/clojure/article.html is a popular introduction.
21:26amalloyDr_Zorg24: irc is not a realtime protocol. if someone hasn't answered your question within a minute, the right response is to wait. if it's been half an hour, then it's okay to repeat it
21:26Dr_Zorg24amalloy, ok fair enough
21:26dnolenDr_Zorg24: not free, but the new O'Reilly one looks awesome.
21:27Dr_Zorg24thanks dnolen I'll look at that
21:27rhcdoes clojure have any notations or conventions for pure/impure functions?
21:27mdeboardI can confirm overenthusiastically that the new O'Reilly book is amazing.
21:27Dr_Zorg24oh thanks cemerick too
21:28Dr_Zorg24ok I'll definitely look into that O'Reilly book then
21:28cemerickDr_Zorg24: http://clojurebook.com will give you an idea if it's right for you.
21:28Dr_Zorg24are we talking the latest edition or a specific one?
21:28Dr_Zorg24If what's right for me? Clojure?
21:29cemerickDr_Zorg24: No, the book.
21:29mdeboardthe book--
21:29Dr_Zorg24oh ok
21:29rhchere's the first chapter http://cdn.oreilly.com/oreilly/booksamplers/9781449394707_sampler.pdf
21:29Dr_Zorg24rhc thanks
21:29rhc(from cemerick 's link)
21:31Dr_Zorg24which of these is the right book?
21:31Dr_Zorg24http://books.google.com/books?id=nZTvSa4KqfQC&amp;lpg=PR15&amp;dq=o'reilly%20clojure%20book&pg=PP1#v=onepage&q&f=false
21:31Dr_Zorg24or http://books.google.com/books?id=p7uyWPcVGZsC&amp;lpg=PP1&amp;dq=o'reilly%20clojure%20book&pg=PP1#v=onepage&q&f=false
21:32cemerickDr_Zorg24: the latter is not about Clojure
21:32cemerickGoogle Closure is an unrelated javascript technology.
21:32Dr_Zorg24oh ok
21:33gfredericksgood thing it's unrelated or it would be difficult to have conversations that involved both.
21:34emezeskeIt's sure confusing to talk about the clojurescript compiler, which uses google closure
21:34emezeskegfredericks: I see that you agree :)
21:34gfredericksemezeske: golly that's three things you could mean by the time you've gotte the syllables of "clojure" out of your mouth
21:34Dr_Zorg24so by using the JVM am forced to use the same ridiculousness that java does
21:34Dr_Zorg24am I*
21:35gfredericksDr_Zorg24: some of the ridiculousnesses
21:35Dr_Zorg24like everything being a class?
21:35gfredericksonly underneath
21:35Dr_Zorg24yay
21:35Dr_Zorg24that's fine I guess
21:36gfredericksprobably the biggest sore is just the startup time
21:36Dr_Zorg24how bad is it?
21:36gfredericksand people who like doing low-level system stuff can have gripes about what they don't have access to
21:36Dr_Zorg24I've never done low level stuff
21:36gfredericksDr_Zorg24: eh...a second or so? it probably varies a lot but it is a pain if you use it to do a task that is itself only a second or less
21:37Dr_Zorg24ok, then I can stick to python for really fast stuff
21:38eggsbyDr_Zorg24: I come from python and I love clj
21:38Dr_Zorg24eggsby, thanks for that, its encouraging to here (I started on java, then python, now I plan to learn clojure)
21:39gfredericksDr_Zorg24: aside from what I said previously, I think the jvm part of clojure is only awkward if you haven't used java before, so you should be fine
21:40mdeboardDr_Zorg24: If you are coming from Java and Python, I *STRONGLY* recommend "Clojure Programming" book
21:40Dr_Zorg24so does it use JIT compiling?
21:40gfredericksI think that's a jvm feature, so implicitly yes?
21:41mdeboardDr_Zorg24: Lots of great intro on what makes lisps lisps, i.e. what makes them unique/different, as well as explanation & overview of functional programming concepts and their implementation in Clojure. Plus along the way they compare idioms in Clojure to their analogs in Ruby/Python/Java. It's very effective.
21:41zakwilson_Clojure can be compiled to JVM bytecode JIT or AOT. Bytecode *may* be compiled to machine code JIT if the runtime decides it's a good idea.
21:42budu@dnolen: where could i find your solution to the zebra puzzle?
21:44Dr_Zorg24gfredericks, how would the JVM part be awkward?
21:44Dr_Zorg24mdeboard, do you have a link please?
21:44mdeboardDr_Zorg24: Same one linked earlier http://www.clojurebook.com/
21:45gfredericksDr_Zorg24: clojure has lots of excellent java interop capabilities; the flipside of that is that often the java world leaks through, and so if you don't know anything about java/jvm it can be confusing to try to learn about both worlds at once
21:46Dr_Zorg24gfredericks, oh that makes sense
21:47kastermamdeboard: how does it compare to The Joy of Clojure?
21:47Dr_Zorg24mdeboard, so that's the O'Reilly book right?
21:47mdeboardDr_Zorg24: Yeah
21:47Dr_Zorg24k cool
21:48dnolenbudu: it's in the core.logic repo
21:48Dr_Zorg24Oh cool O'Reilly on their site does print and ebook for $5 more than print
21:48dnolenbudu: it can be cleaned up a bit symbol-macrolet
21:49dnolenfor demonstration purposes
21:49mdeboardkasterma: It's been awhile, tbh. Joy of.. and Practical Clojure both have strengths and are written by very smart guys who are way way way more talented than me. But I believe the latest one is the best intro to Clojure book available.
21:50kastermamdeboard: thx. I have both of these in front of me now. :-)
21:50budu@dnolen: found it, thx for your work, it's inspiring!
21:50dnolenbudu: no problem
21:51Dr_Zorg24wow if anyone wants the O'Reilly book get it on amazon, they a great price
21:51Dr_Zorg24they have*
21:51budui'm out, good night everyone
21:55muhooi have found personally that reading the o'reilly clojurebook reduced my stupid-question output by an order of magnitude
21:57muhoomy short-circuiting algorithm for answers goes (comp clojurebook google irc), and almost always gets a hit on the first one
21:58echo-areamuhoo: Do you mean Clojure Programming? I find it a great book as well
21:58gfredericksmuhoo: I'm not sure that function does what you think it does
21:58cemerickmuhoo: you mean (comp irc google clojurebook) ;-)
21:58gfredericksmaybe you should read the clojurebook about comp
21:59gfrederickswell google first, since we're already discussing it on irc so we must be going in that order
22:04yoklovheh, http://www.ludumdare.com/compo/ludum-dare-23/?action=preview&amp;uid=7728
22:04yoklovthat was intense to make.
22:06gfrederickshow do I move
22:06gfredericksoh that must be a png
22:07gfrederickspngs make terrible games
22:07yoklovyup, all the links at the top except source lead here: http://thomcc.github.com/ld23/ and you click to move
22:07yoklovbut the main image is a png
22:08ivanyoklov: heh, I won without collecting some things I needed
22:08ivanI want to keep playing though
22:09yoklovyeah you don't actually need the radar
22:10dnolenyoklov: neat! seems like a fairly small amount of code?
22:10gfredericksI guess I shouldn't have inferred based on the red highlight of "glass-like substance" that I should go stand in the red zones
22:10sritchie_can anyone here successfully use division on http://himera.herokuapp.com/index.html
22:10sritchie_?
22:10yoklovdnolen: looks like about 1000
22:10yoklovand about half of it is rendering
22:11sritchie_when I try (/ 1 2), I get Compilation error: RangeError: Maximum call stack size exceeded
22:11ivannow I am really curious about function Wf() in the compiled code was compiled from
22:11gfrederickssritchie_: I think it's a himera bug; dunno what to do about it
22:12dnolensritchie: I think the CLJS on himera is old.
22:12gfrederickssritchie_: it was doing that for me back when it was first deployed
22:12sritchie_got it
22:12sritchie_I'll file a bug
22:15dnolenyoklov: yeah I was looking at the advanced output and it looked really compact.
22:16yoklovoh, really?
22:16yoklovHuh, yeah.
22:18yoklovlooks like basically all of my rendering functions got inlined
22:18yoklovwhich is good.
22:19dnolenyoklov: nice! yeah GClosure is pretty good about that if you're justing calling a function from only one place.
22:33yoklovdnolen: by the way, is there an idiomatic way to create a javascript object initialized with some values in cljs yet?
22:33yoklovi guess (doto (js-obj) (aset "key" val)…) works
22:36mmarczykyoklov: goog.object/create
22:37yoklov:/
22:37yoklovThat is how I feel about that.
22:37mmarczykwhy's that?
22:38mmarczykI was thinking of adding a variadic overload to js-obj
22:38mmarczykcalling gobject/create
22:38mmarczykso you could write (js-obj "key" val ...)
22:39mmarczykbut haven't got 'round to it yet
22:39mmarczykwould you feel better about that? :-)
22:39yoklovyeah, thats probably enough better
22:40yoklovoverall though, I still feel like clojurescript's interop isn't really good enough.
22:40mmarczykactually I guess I have a better idea for "literals"
22:40yoklovcallbacks suck as much as they do in js
22:40dnolenyoklov: yeah that could be better
22:40mmarczyk(that is, objects with fixed number of key-val pairs, as opposed to (apply gobject/create ...) time stuff)
22:41dnolenyoklov: I think the new reader literals could help but I'm not sure.
22:41yoklovdnolen: in general, or in terms of callbacks?
22:41dnolenyoklov: no, I only meant JS object creation
22:41dnolenyoklov: callbacks is another thing entirely.
22:41yoklovyeah
22:42yoklovokay
22:42yoklovwell no the first thing then
22:42yoklovfirst thing is much more common
22:43yoklovand I don't think it's just the canvas api which requires setting lots of values awkwardly
22:43yoklovin general whenever it needs to be done it feels awkward
22:44dnolenyoklov: yeah not sure what else can be done except cleaning it up with a little macro sugar.
22:45yoklovdnolen: yeah, me neither. It's a bummer, clojure's java interop is so consistent and so awesome, but clojurescripts JS interop is just… not quite as good.
22:45dnolenyoklov: many Java APIs are just as imperative, I'm not sure how this is different.
22:46yoklovdnolen: having to break up dotos, for one
22:46dnolenyoklov: Penumbra is a good example of the kind of thing you encounter w/ stuff like Canvas.
22:46dnolenyoklov: why do you have to do that? because you have some intermediate logic?
22:47yoklovsetting values, though I guess you can do "aset", though I feel like I've had that work weird when closure compiled, but maybe i'm thinking of something else
22:48yoklovhonestly though I've just been doing (do (set! (.-foo bar) baz)) in the middle
22:48yoklovas hacky as it is.
22:51dnolenyoklov: I thought you used a simple sets! macro?
22:52yoklovno, it ended up not working well with anything else
22:53dnolenyoklov: I kind of see what you mean.
22:53dnolenyoklov: in Java you have setters
22:53dnolenyoklov: in JS it's an assignment.
22:53yoklovdnolen: yeah, exactly
22:54yoklovthe interop is basically the same as clojures
22:54yoklovbut, java and javascript are only really superficially similar
22:55yoklovmuch of it is more-or-less ignorable though
22:56dnolenyoklov: hmm, I wonder if (set! ...) should support
22:56dnolen(set! o property v)
22:56dnolenyoklov: would that address the issue?
22:57yoklovhm
22:57yoklovyou know, that actually might
22:58dnolenyoklov: I think it would, then doto could work.
22:58yoklovright
22:58mmarczykohhh, that's very nice
22:59mmarczykdoes this seem useful? https://github.com/michalmarczyk/clojurescript/tree/js-obj-init
22:59FrozenlockIf I've intercepted a request using the (noir.request/ring-request) function, can I resend it? Something like (render [(:request-method XX) (:uri XX)] (:params XX)) ??
22:59lazybotFrozenlock: What are you, crazy? Of course not!
22:59mmarczyk(variadic js-obj + compiler macro)
22:59dnolenyoklov: http://dev.clojure.org/jira/browse/CLJS-198
23:00FrozenlockSometimes these bots seems alive..
23:00Frozenlock/s/seems/seem
23:01dnolenmmarczyk: that is kind of nice and in line with the implementation of array, create a tickt and a patch.
23:01mmarczykdnolen: cool, off to create right now
23:02yoklovmmarczyk: so would the ks be symbols? or…
23:02mmarczykyoklov: strings
23:03yoklovokay, and it would die horribly if they werent?
23:03mmarczykyoklov: well, the JS engine would try to convert
23:03dnolenyoklov: let's stick w/ strings for now, no validation.
23:04mmarczykyoklov: (js-obj 1 2) -> (js* "{1: 2}") -> (js* "{'1': 2}")
23:04dnolenyoklov: if you're using js-obj that explicit interop, JS expects strings.
23:05yoklovdnolen: right, i'm not judging, just trying to figure out what exactly it did
23:05yoklovmmarczyk, yeah okay, that makes sense
23:05mmarczykhttp://dev.clojure.org/jira/browse/CLJS-199
23:06dnolenyoklov: mmarczyk: with that patch + the fact that array emits literals - I think that should remove some pain around JS interop.
23:07dnolen(js-obj "foo" (array 1 2 3)) compiles doesn to {"foo": [1 2 3]}
23:07dnolencompiles down
23:07mmarczykdnolen: yeah, hopefully
23:07yoklovoh, that would be very nice
23:07mmarczykI mean, hopefully will remove some pain
23:08mmarczykdnolen: I believe there are a few spots in TwitterBuzz which could take advantage of this, I'll submit a separate patch for that later
23:13dnolenyoklov: mmarczyk: CLJS-199 resolved
23:13mmarczykdnolen: thanks!
23:13dnolenyoklov: I look into improving set!
23:13mmarczykdnolen: I've been looking into TransientVector and at first glance it seems that pvector nodes might need to become wrappers around arrays instead of arrays to support it; do you see any problems with that?
23:14mmarczykdnolen: btw, about CLJS-198 -- how about (set! object -property val) (rather than .-property)
23:14dnolenmmarczyk: oh yeah because they were Nodes before.
23:14dnolenmmarczyk: oops my mistake, yes that's right
23:14dnolenmmarczyk: ticket updated.
23:14mmarczyk:-)
23:15dnolenmmarczyk: I see no problem w/ that. V8 should be able to optimize that just fine.
23:15dnolenmmarczyk: I suppose you need methods on those Nodes?
23:15mmarczykdnolen: actually I need a field -- "edit" -- true or false
23:15mmarczykdnolen: so yeah, an XY problem here
23:16dnolenmmarczyk: oh right, yeah seems fine to me.
23:17yoklovOh, I meant to mention: I dunno what causes it, but there are definitely times when chrome runs a page great in whitespace and advanced comp. mode, and firefox runs it great in advanced, but firefox in whitespace-only compilation mode runs absolutely terribly.
23:17mmarczykdnolen: great. in that case, I'll be back with a patch sometime soon.
23:18yoklovsomething about big closurey conditionals, i think.
23:28mmarczykdnolen: yoklov: just implemented hash code caching for CLJS collections, what do you think? https://github.com/michalmarczyk/clojurescript/tree/hash-caching
23:29kovasbanyone know of an api-compatible replacement for clojure.contrib.string?
23:29dnolenmmarczyk: excellent idea
23:31mmarczykdnolen: cool, I need to fix one corner case (hash might be 0 -- should check (coercive-= nil)), then I'll create a ticket
23:31kovasbclojure.string is like a totally different thing
23:31yoklovmmarczyk: yeah, i was definitely concerned about repeatedly hashing some vectors in my game
23:33mmarczykyoklov: :-)
23:35mmarczykdnolen: http://dev.clojure.org/jira/browse/CLJS-200
23:39spjtWhat is more difficult learn, Clojure or Emacs?
23:42eggsbyheh
23:42eggsbygonna go on a limb and say clojure
23:44mdeboarddo what, how can you even --
23:44mdeboardWhat's more difficult to learn, golf or sewing?
23:44mdeboardthe mamba or spanish?
23:45xeqigolf, mamba
23:45mdeboardcheckmate