#clojure logs

2011-07-27

00:31schemer999how would a clojure master go about "architecting" a multi-player game like dwarf fortress clone?
00:49Blackfootif i want my macro to return multiple statements, do i need to wrap them in a do?
00:54technomancyBlackfoot: a macro can only compile into a single form. if you need a side-effect along with a return value, do is good for that.
01:01Blackfoottechnomancy: sweet, thanks
01:17amalloyi wonder if he knows dwarf fortress is single player
01:19technomancyI'll dwarf your fortress.
01:19amalloyi've been hanging out in #clojure for a year hoping you would one day say that
01:19technomancyI forget, did I meet you at the conj?
01:19ahriman`÷¸
01:20amalloynah, i had just started with clojure
01:20amalloydidn't go
01:20technomancybecause I was going to say, if you've met me in person you'd know that I dwarf a lot of things.
01:20amalloy*ponder*
01:20technomancythat is to say, I'm tall.
01:21amalloythat was one possible interpretation, but not the most interesting one
01:21technomancyyou were thinking maybe http://ecx.images-amazon.com/images/I/51R6Y4MMKNL._SL500_AA300_.jpg
01:21technomancy?
01:22amalloymore like http://www.gumgod.com/images/andre_dvd.jpg
01:23technomancymostly due to spaceballs
01:24amalloybut! you will damn well meet me at this conj
01:24bprgosh dang it! I find myself typing "lein clein" more often that I'd like ...
01:24bprlol
01:25technomancybpr: really? I only use it when I switch branches.
01:25bprwell, i'm modifying protocol definitions, and the changes aren't being picked up by the repl (even after a restart)
01:26technomancyoh yeah... well I don't use protocols
01:26bprbut, I was mainly talking about the type-o "clein"
01:26bprlol
01:26technomancyhah; I didn't even catch that
01:26amalloytechnomancy: next new lein feature: autocorrection of tasks?
01:26bprhaha
01:27hiredmanbpr: that doesn't track, if you are defining the protocols at the repl then you can re-def them no problem
01:27technomancybpr: (swap! aliases assoc "clein" "clean") ; in ~/.lein/init.clj
01:27technomancyamalloy: überjar is an alias for uberjar
01:28bprhiredman: i'm not defining them directly at the repl. I'm using clojure-mode to send the definitions
01:28amalloyi wish überjar were an alias for jar. i make that mistake all the time: just trying to convince the computer to do X really well by prepending über
01:29technomancyamalloy: that's what test! is for
01:29bprbut, i have found that for w/e reason I need to clean and restart the repl after that. Otherwise, the clojure compiler will bark at me for not having defined methods in the protocol... I didn't really do a deep look at why
01:30amalloytechnomancy: shouting is a totally different technique
01:30bprwell, s/defined methods/implemented methods/
01:30amalloy!?clean
01:30eipitenhi
01:31amalloybpr: you've redefined the protocol, but you still have objects around that satisfy the old version
01:31amalloyprobably
01:31bprwell, that would seem true if a simple repl restart fixed it
01:31technomancyamalloy: test! is (comp test clean deps)
01:32amalloysure sure. i'm just saying i like to keep my loud discussions between me and the history-expander
01:33bprso here's what occuring: 1) change protocol Foo, 2) modify my record that implements Foo to track the changes, 3) send the new (defrecord ...) form to the repl, 4) bang!
01:38amalloyi wish more workflows involved "bang!". programming would be more exciting to the kids
01:39technomancyI think someone is actually working on a test!! plugin for leiningen
01:39devnamalloy: (go-go-go!)
01:39technomancywhich sounds pretty gripping.
01:40devntechnomancy: time to one up that person!
01:40devntest!!!
01:40technomancywhoa; let's not get carried away
01:40amalloytechnomancy: i implemented a handy ?! macro for debugging
01:40technomancyamalloy: surely you mean ‽
01:40devn(defn -=el1t3=- [x] (+ 1 x))
01:41amalloyi have enough unicode just trying to talk in #clojure
01:41amalloyain't none of that foreign stuff getting in my code
01:41technomancyyou gotta admit, interrobang is really handy when it comes to naming predicate functions that have side-effects.
01:42devnmeh, I remember being annoyed by TextMate wanted to use that weird sign for the [Enter] key on OSX.
01:42devns/by/when/
01:42lazybot<devn> meh, I remember being annoyed when TextMate wanted to use that weird sign for the [Enter] key on OSX.
01:42devnI recently dug around in some APL and then the other day tried J. I prefer J.
01:42devnHunting for UTF is *annoying*.
01:43devnIf you produce a keyboard for your language, I'm with you.
01:43technomancyInsufficientKeyboardException
01:43devn:)
01:44devnAPL is the extreme, and we know not to take it that far. I think in general though we can take it further in the direction of special characters and so on.
01:44devnwe have ? and !, . would be nice. I really like being able to (defn foo->bar [])
01:44devnetc.
01:48devnstop. vs stop! vs stop? vs stop!? vs stop->go?, etc.
02:40thorwilmoin!
02:41thorwilapparently 2 arguments after & in a fn signature doesn't work
02:42thorwili then tried ... & [a b] and changed the call accordingly
02:43thorwilbut that changes the outcome, i.e. is not like making none of the args optional
02:45thorwilfrom the point of view of the function body, what is the difference between args that appear in the fn signature separately, to args that are in a []?
02:45amalloy&((fn [a b] (+ a b)) 1 2)
02:45lazybot⇒ 3
02:45kumarshantanuthorwil: what args are you passing?
02:45amalloy&((fn [[a b]] (+ a b)) [1 2])
02:45lazybot⇒ 3
02:47thorwilkumarshantanu: functions. hiccup defhtmls to be used inside another defhtml
02:48thorwilwhich works fine as long as i only have one of them as optional arg
02:48amalloythe first version takes two arguments; the second takes a single argument, a seq, and pulls it apart into two separate elements
02:48kumarshantanuif you want to optionally pass several functions maybe just "& fns" would work
02:49kumarshantanufns would be a list of additional args passed
02:50kumarshantanuthorwil: I am not familiar with the Hiccup API
02:50kumarshantanuso maybe an example will help
02:50thorwilkumarshantanu: that's either what i tried that doesn't compile, or please show me the syntax for signature and call
02:51hiredmanTCO!!!!!!
02:51kumarshantanu(defn foo [arg1] ) -- (foo "whatever")
02:52kumarshantanu(defn foo [arg & more] ..) -- (foo "whatever" "and" "more") -- more becomes '("and" "more")
02:54kumarshantanu(defn foo [arg & [m1 m2 & more]] ...) -- (foo "whetever" [:foo :bar :baz :quux]) -- arg = "whatever", m1 = :foo, m2 = :bar, more = '(:baz :quux)
02:55kumarshantanuthorwil: it's all about de-structuring
02:55amalloythorwil: instead of "i tried x and it doesn't work", an actual example of something you've tried would make it clearer what you're actually trying to do (which i don't think either kumarshantanu or i have figured out)
02:55thorwilkumarshantanu: but shouldn't taking apart more in the body be equivalent to doing it right in the signature like i tried?
02:56kumarshantanuthorwil: de-structuring in the signature or in the body should work the same way -- feel free to share the code example you are trying
02:59thorwilwell, the current state is http://paste.pocoo.org/show/447260/
03:00thorwilexcept for one ) missing at the end
03:01kumarshantanuthorwil: which lines have the problem?
03:01kumarshantanuwhich defhtml?
03:02thorwilkumarshantanu: the first, in combination with the call in the last fn
03:02amalloythere are three args to article-content* all named "option-foo", but only the last two are optional
03:02thorwilas pasted, i get rubbish for option-slug-for-admin and option-aloha-for-admin
03:03thorwilamalloy: that's just bad naming
03:04thorwilshould be maybe-linked-title, not option-...
03:04amalloythorwil: you probably don't mean to wrap the last two args (when you call the function) in a [vector]
03:05amalloybut i think you should do a little more studying on what destructuring forms *mean*, rather than trying combination after combination till you find something that works
03:06kumarshantanuthorwil: article-content* signature is quite unusual/complex -- it's generally not advisable
03:06kumarshantanubut again, only things after '&' are optional
03:07kumarshantanuif you pass a collection as optional arg, then it will be de-structured correctly
03:07thorwiloh dang, calling with no [] works, so i really misunderstood how this works
03:07amalloyi think thinking of things after the & as "optional" hinders understanding
03:08kryftamalloy: What's a good reference for destructuring forms, btw?
03:08thorwilthanks!
03:08kumarshantanuI guess it's more apt to say that & means collection
03:08amalloy(fn [x & more] ...): "Give me at least one argument. I'll bind the first one to x, and the rest to a (possibly-empty) sequence named more"
03:08kumarshantanunow, the rest is de-structuring
03:08kryftamalloy: (If you recommend something apart from what I'd find at clojure.org, that is)
03:09amalloykryft: IIRC JoC covers it well
03:09kumarshantanukryft: read up the Clj books
03:10amalloybut it's hard to soak in, in the abstract. i was baffled by that section anyway, until i'd tried a number of interesting things myself
03:10kumarshantanuand this -- http://blog.jayfields.com/2010/07/clojure-destructuring.html
03:10kryftamalloy: Ok, that's what I'm reading, actually. :)
03:10kryftamalloy: But I didn't come away feeling like I'd really understood them completely.
03:11amalloysame here. just try some crazy things, see what happens
03:11kryftkumarshantanu: Thanks, that's the kind of thing I had in mind.
03:11thorwilkumarshantanu: article-content* is basically a template with slots for optional content and the sig, now that it is correct, is a direct result of that. i'm all ears if you know a more elegant way to the same result ;)
03:12kryftJoC implied that destructuring was a bit basic compared to "pattern matching" facilities in other languages that I don't know, and that there's a contrib library for pattern matching in clojure. How lacking is destructuring really?
03:12amalloythorwil: take a map argument
03:13kumarshantanuthorwil, it may be more idiomatic if you put the *required* args first, followed by an optional map of keyword to argument
03:13amalloy(defn content [basic-stuff {:keys [optional-1 optional-2]}] ...) (content "whatever" {:optional-2 "test"}) ;; now the user can pass option 2 without optiion 1 if he wants
03:13kumarshantanu(defn foo [arg1 arg2 & {:keys [p1 p2] :as opt}] ...)
03:14kumarshantanu(foo "arg1" "arg2" :p1 p1-value :p2 p2-value)
03:15thorwili see
03:15amalloykryft: pattern-matching is pretty cool
03:15kumarshantanuthorwil: you can use 'opt' to determine that the consumer doesn't pass in an unwanted argument
03:15kumarshantanuthorwil: helpful in the case of typos, you know
03:17amalloyi'm not very comfortable with any languages that contain it, but (among other things) it lets you define functions as a set of cases rather than a "mess" of nested ifs
03:18thorwilcomapring destructuring to pattern matching, isn't the first all about sequence and names, where the second adds the ability to check types and ranges?
03:20amalloythorwil: equality too. you can match the pattern [x x]: two args which are identical
03:37negaduckis there smth like assoc-in, but that works on lists that are values of hash-map?
03:37negaduckor on vectors
03:37amalloyassoc-in works on vectors
03:38negaduckok. I'll try that
03:49Pupeno_Any recommendation of something to read on Clojure to get refreshed? I haven't used Lisp or Clojure in quite a while, so I find myself getting stuck on simple things.
03:49Pupeno_I mean, for free, online... otherwise I suppose I just need to buy a book.
03:51_bathow about this? https://github.com/relevance/labrepl
03:53tufflaxPupeno now about the documentation on clojure.org?
03:53tufflaxhow about
03:53kryftamalloy: Sounds fancy.
03:54Pupeno_tufflax: the problem with that is that it's not ordered in a way you can read one part after the other and get a good overview of everything. You can easily miss stuff and when I tried to re-learn things, like how to write macros or work with sequences, it was very sparse.
03:57winkI agree
03:57winkI'm only starting and while the docs are quite good, it certainly would be quicker to be guided a bit
03:58winkbut.. it works at least :P
03:58tufflaxI agree that it does not teach how to write macros, but the rest is good. But I found that it gave a very good overview because it was compact.
03:58Pupeno_wink: last time I was coding on common lisp and I moved to clojure, so clojure.org was enough to re-adapt... this time I'm coding in leaser languages.
03:58winkI'm reading "Expert C Programming" right now, it's awesome
03:59kumarshantanuPupeno_: this? http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Learning_material_available_online
04:00Pupeno_Is labrepl running somewhere or running it local is the only way?
04:00Pupeno_Ah... I didn't expect it to be so much done: http://thinkrelevance.com/blog/2008/09/16/pcl-clojure.html
04:00Pupeno_:)
04:01kumarshantanuPupeno_: there's also a section called Clojure for Common Lisp Programmers
04:01Pupeno_kumarshantanu: I'm not a CL programmer anymore.
04:01kumarshantanuah, okay
04:01winkis there a "Clojure for people who hated OCaml"?
04:02Pupeno_Now I'm remembering I learned a lot with tech talks.
04:02kryftwink: What's awesome about it?
04:03winkkryft: it's nicely written, it's funny, it's exact, it's a very good followup after K&R
04:03kumarshantanuYou can read this Clojure book online -- http://clojure-notes.rubylearning.org/
04:04winkjust found that one as well. seems I need to get reading even more
04:04Pupeno_I presume this is still relevant, right: http://blip.tv/clojure/clojure-data-structures-part-1-714056
04:14negaduckI can do the following: (def *map* {:a [1 2] :b [3 4]}) (assoc-in *map* [:b 1] 5) => {:a [1 2], :b [3 5]} Is there a way to add a value to that list rather than to change it's values?
04:17raeknegaduck: (update-in *map* [:b] conj 5) => {:a [1 2], :b [3 4 5]}
04:17negaducki've just thought about that.
04:17negaduckraek: thanks
04:29kjeldahlwTricky question; I've got a "core" module with a log method in it, that stores *out* in a closure, binding to it when somebody calls log. But when I "use mod.core" from another module "repl.helper", it seems *out* is different from the *out* in repl.helper, so log output disappears. Any idea why, and/or workarounds?
04:46kjeldahlwFunny thing though, when doing a (def my-out *out*) in my mod.core module, it gets bound to a java.io.OutputStreamWriter, but when I check the values of *out* in repl, it's a java.io.PrintWriter
04:51negaduckwhich is faster: (conj vec item) or (cons lst item)? I need to frequently add elements to collection. I guess list should be faster for that.
04:54Chousukelists are faster I guess
04:54Chousukethey're simpler
04:54Chousukebut of course you don't get random access then
04:55volton,(doc rational?)
04:55clojurebot"([n]); "
04:55volton,(source rational?)
04:55clojurebotSource not found
04:56volton,(doc rationalize)
04:56clojurebot"([num]); returns the rational value of num"
04:56voltonWhy doesn't it show the docstring for rational? ?
05:00teromThere seems to be a little "bug" in the implementation of 'rational?. The docstring should be before the argument list and not vice versa.
05:02voltonterom: should I open an issue?
05:03voltonterom: and there is another problem with it: if (rational? x) is true it is not guaraneed that numerator and denominator work
05:05kjeldahlwHmm, my *out* challenges seems emacs related, works fine in a console window repl.
05:06teromvolton: I would check if that's already fixed in the latest version before opening an issue.
05:06voltonterom: what do you think about numerator and denominator?
05:07teromvolton: I don't have an opinion on that yet. Can you provide an example case where that problem occurs?
05:10voltonterom: sure, https://gist.github.com/1108979
05:11teromBased on docs numerator and denominator work on Ratios, but rational? returns true for integers, Ratios and decimals. One could use ratio? to check if the number is a Ratio.
05:11volton(frac-pp 3) fails because numerator does not work for Integer
05:13voltonterom: Oh I see, then this is not explained very well in THe Joy of Clojure
05:14TobiasRaederMorning
05:16TobiasRaederI got a question about map destructuring considering
05:16TobiasRaeder(defn do-stuff
05:16TobiasRaeder [request & {:keys [continue] :or {continue (extract-continue-url-from-request request)}]
05:16TobiasRaeder ;; do some stuff
05:16TobiasRaeder (redirect continue))
05:16TobiasRaederworks fine (as in extracts the url from the request)
05:16TobiasRaederwhen called (do-stuff request)
05:16TobiasRaederbut when you call (do-stuff request :continue nil) continue is set to nil and the :or doesn't seem to work
05:16TobiasRaederClojure 1.2.0 here. Is that the way it is supposed to work?
05:17teromTobiasRaeder: please don't paste code here, use gist/pastebin or something
05:17TobiasRaederyeah makes sense, sorry
05:18TobiasRaederhttps://gist.github.com/1108995
05:19teromvolton: hmm, could be, but maybe you have missed a point; in JoC it says (p. 67, section 4.2.2) that "you can use rational? to check whether a given number is one and then use rationalize to convert it to one". Your code seems to be doing the opposite.
05:19voltonterom: I changed the function accordingly, now when I call (frac-pp2 3) I get java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.Ratio (NO_SOURCE_FILE:0) https://gist.github.com/1108979
05:20voltonterom: you are right
05:20teromBut I think (numerator (rationalize 3)) still does not work. Probably because it's coerced to Integer again...
05:21voltonterom: that's exactly my problem
05:26voltonterom: do you think this behavior is correct and is there an elegant way around it?
05:26teromvolton: I don't have an easy answer for that. There could be a better way, but it seems that you might need to have a special case for integers (maybe using integer?).
05:28teromvolton: it could be either one, correct or not. Maybe this is something which could be brought up in the mailing list (if it's not discussed there already)...
05:29voltonterom: I will have a look. The Docstring issue has been fixed on head at least
05:29teromIt makes sense that numerator and denominator only work for Ratio type, but on the other hand...
05:30voltonterom: no wait, it hasn't: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L3186
05:31voltonterom: yes, but this is not the behavior I expect:
05:31volton;(class (rationalize 3))
05:31volton,(class (rationalize 3))
05:31clojurebotjava.lang.Long
05:39voltonterom: is that change ok? https://github.com/pcomans/clojure/blob/master/src/clj/clojure/core.clj#L3186
05:41teromvolton: looks good to me
05:49teromTobiasRaeder: I think the :or only kicks in if there is no value for that key in the map. Now there is a value (nil).
05:53terom(Meant to say actually that only when the key exists.)
05:53TobiasRaederyeah
05:53terom(Argh, I mean when the key does not exist.)
05:54TobiasRaederi figured as much, was expecting an if like behaviour
05:54TobiasRaederwhat i really wanted to know if it is supposed to be that way
06:00teromTobiasRaeder: I don't know if there is another authoritative source besides the, hmm, well, source code itself, but I think it's supposed to be a default value in case of missing key, not if like.
06:00TobiasRaederOkay :)
06:00teromMaybe the keyword :or is a bit misleading (and better would be :default or something like that?).
06:01TobiasRaedermaybe default yeah
06:01TobiasRaederand :or atleast gave me the feel it would behave like the regular or
06:01TobiasRaederor maybe even
06:01TobiasRaeder:missing-keys
06:02TobiasRaeder{:keys [continue] :missing-keys {continue (get-stuff-from-reqeust request)}
06:03teromCould be. Though I guess :or is so rarely used that it does not pay off to change that...
06:04TobiasRaederatleast i really like it (apart from that)
06:04TobiasRaederbut might be true
06:04voltonterom: https://github.com/clojure/clojure/pull/9
06:06raekvolton: Clojure does not use the github issue and pull request systems
06:06raek(there seems to be no way to turn of pull requests)
06:07raekvolton: see http://clojure.org/contributing
06:07raekand http://clojure.org/patches
06:08voltonraek: thank you, in this case I will have to do this later
06:20tufflaxI've not heard much about defrecord and protocols... what is a typical use case in idiomatic clojure code without java interop. Is it a good idea, for example, to make a "Character" protocol and a "Player" record or something in a game. It feels a bit too much like OOP for me to be comfortable with it, but on the other hand records are immutable and so on, right?
06:24jonasenI'm trying to use ComboBox from goog.ui and I'm unable to write an
06:24jonasenns-form which would allow me to drop the namespace part of the
06:24jonasenconstructors. i.e., I have to write (goog.ui/ComboBox.) instead of
06:24jonasen(ui/ComboBox.) or just (ComboBox.)
06:25jonasenhttps://gist.github.com/1109097
06:46kjeldahlwOk, narrowing down my emacs/slime/swank trouble with output. Using a "console" repl ("lein repl"), then a (.print System/out "hello") works fine, but it does not if run in Emacs after clojure-jack-in . Ideas? The funny thing is I believe it worked on my home computer last night (I'm at work now)...
06:46kjeldahlwSorry, that should have been (.println System/out "hello")
06:47kjeldahlwSame with System/err ...
07:06teromjonasen: I'm not that familiar with ClojureScript (which I guess that code is), but if you'll require [goog.ui :as ui] in addition to [goog.ui.ComboBox :as ComboBox] then I guess you should be able to write (ui/ComboBox.)
07:07terom(And honestly I don't know anything about that, I'm just mimicking from http://code.google.com/p/jngmisc/source/browse/clojure/geom/convex-hull.cljs this example.)
07:21jonasenterom: I've looked at similar code in the twitterbuzz demo but I keep getting 'required "goog.ui" namespace not provided yet' errors. I'll try to compile the convex-hull example and see if I can get that to work. Thanks
07:56raekkjeldahlw: in swank, System/out is connected to the terminal of the swank server, not the slime repl
07:57raekit probably shows up in a buffer called *swank* or something
07:57raekkjeldahlw: you propably want to use *out* rather than System/out
07:57kjeldahlwraek: Thanks. See my recent posting to the clojure users list...
07:58kjeldahlwraek: My venture into System/out etc was like a blind man in a maze; just blindly poking around.
08:29Leonidasis there some kind of partition-with-overlap?
08:30dnolen_,(doc partition)
08:30clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
08:30dnolen_,(partition 2 1 [1 2 3 4 5])
08:30clojurebot((1 2) (2 3) (3 4) (4 5))
08:31jcromartie,(partition 2 1 [1 2 3 4 5 6])
08:31clojurebot((1 2) (2 3) (3 4) (4 5) (5 6))
08:31ejacksondnolen: beat meto the draw again !
08:31jcromartieI remember something about placeholders
08:31jcromartie,(partition 2 1 nil [1 2 3 4 5 6])
08:31clojurebot((1 2) (2 3) (3 4) (4 5) (5 6) ...)
08:31jcromartienot sure
08:31Leonidasoh, ok, that was too simple
08:31jcromartieAre there any guidelines on argument ordering for functions?
08:31dnolen_,(partition 3 3 nil [1 2])
08:31clojurebot((1 2))
08:31jcromartielike, what goes first?
08:32dnolen_,(partition 3 3 (repeat nil) [1 2])
08:32clojurebot((1 2 nil))
08:32Leonidas,(partition 3 1 (range 10))
08:32clojurebot((0 1 2) (1 2 3) (2 3 4) (3 4 5) (4 5 6) ...)
08:32Leonidasmost excellent
08:32ejacksonoften the col/seq goes last so you can use the function in HOF and bind the parameters
08:34jcromartieejackson: what do you mean by that?
08:35jcromartielike using partial?
08:35ejacksonzakly
08:35jcromartieI see
08:35jcromartieI will continue this discussion later
08:36jcromartie(commute self metro (hours 2))
08:36ejacksonouch
08:36ejacksongood luck
08:38mdrogalisThat's a long trip..
08:54Leonidas,(doc rand-int)
08:54clojurebot"([n]); Returns a random integer between 0 (inclusive) and n (exclusive)."
09:14tsdhHi
09:15tsdhIs there some sequence creating function that returns nil if nil was given to it?
09:16tsdh(vec nil) ==> [], but I'd like to have (foobar nil) ==> nil, (foobar 17) ==> (17)
09:16ejacksonseq
09:17ejacksonbut you'd have to (seq [17])
09:17tsdhejackson: (seq 17) ==> Exception
09:17tsdhejackson: (seq [nil]) ==> (nil)
09:18tsdhMaybe I should mention the usecase. I want to be able to do: (or (foobar arg) (some-other-seq))
09:19mdrogalis,(rant-int 5)
09:19clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: rant-int in this context, compiling:(NO_SOURCE_PATH:0)>
09:19tsdhSo if arg was provided, I want a seq containing it. Else, it should be logical falso.
09:19ejacksonand foobar returns a seq of a primitive arg, or nil if arg is nil
09:19mdrogalisIt's kind of frustrating to always have to run java -jar clojure.jar to start a repl. Has anyone come up with a quicker solution?
09:20ejacksonmdrogalis: leiningen ?
09:20ejacksonlein repl
09:20tsdhejackson: Yes, so basically (and arg (vector arg))
09:20mdrogalisI thought that was just for use in a single project. You can just use it for.. Anything?
09:20ScriptorM-x clojure-jack-in :D
09:21mdrogalisejackson: lein has made Clojure so much more friendly since I started. Such an awesome tool.
09:21ejacksontsdh... well then (and arg (vec (list arg))) should do it
09:21ejacksonmdrogalis: its groovy stuff indeed.
09:22tsdhejackson: Is there anything better with (vec (list arg)) than (vector arg)?
09:22ejacksonno
09:22tsdhI'd assume the contrary...
09:22tsdhOk. :-)
09:22ejacksonsorry, i mislead you
09:27mdrogalisSo how's the market for Clojure jobs?
09:40fhdmdrogalis: Almost nothing here in Germany, all guys from the user group are hobbyists.
09:40mdrogalisfhd: That's too bad. :/
09:40fhdmdrogalis: Tell me how to convince clever people to learn yet another language and I'll tell you about a clj job :)
09:40fhdmdrogalis: Haven't found a way to convince my colleagues yet. We have a lot of languages in the mix, so they're reluctant.
09:41mdrogalisfhd: I think Lisp for the JVM just kind of says it all. ;)
09:41fhdmdrogalis: Yeah, but people who don't get Lisp are usually afraid of it :)
09:41mdrogalisfhd: I'm not out of school yet though. Maybe it'll catch on it America.
09:41mdrogalisfhd: It's okay. We don't need them anyway! Haha.
09:42fhdmdrogalis: I used to be like that, before I started to use Emacs and Emacs Lisp intensively
09:42fhdmdrogalis: But the popularity is skyrocketing ATM, so I guess we'll get more and mor ejobs :)
09:42ejacksonpish, quit your job to code clojure. that's what i did :)
09:42mdrogalisfhd: I'm not really out to convince anyone. If they check it out, they'll see that people like it.
09:42fhdmdrogalis: I'm mostly worrying about how to introduce it at my company, because I like my team and don't want to leave
09:43mdrogalisfhd: Bloodless overflow. Take the power back!
09:43fhdmdrogalis: I have plans… :)
09:44thorwili have a map that resembles {:form-params {"from" "from-val" "to" "to-val"}}. i wonder if there's a better solution to take that apart as argument, than http://paste.pocoo.org/show/447441/ ?
09:50chouserthorwil: destructuring nests
09:52manutter,(let [{{:strings [from to]} :form-params} {:form-params {"from" "from-val" "to" "to-val"}}] (str "From is " from ", and to is " to))
09:52clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: :strings>
09:52manutter,(let [{{:strs [from to]} :form-params} {:form-params {"from" "from-val" "to" "to-val"}}] (str "From is " from ", and to is " to))
09:52clojurebot"From is from-val, and to is to-val"
09:52manutterThere
09:53manutterWoo, that means I *am* finally beginning to understand destructuring :)
09:53thorwiland here i started to think it doesn't nest :/
09:54thorwilthanks! :)
09:55chouseryou can't nest anything inside the :keys, :strs, or :syms parts, which may have thrown you off
10:11tsdhDoes anyone have some simple function that shows an image in a swing frame?
10:20eipitenis there someone who can help me with a bit of basic moustache?
10:20thorwileipiten: state your issue as clear as you can and see ;)
10:21raektsdh: (doto (JFrame. "Pretty Picture") (.add (ImageIcon. <image filename or URL>)) (.show) (.pack))
10:21Fossieipiten: don't shave
10:21Fossieasy as that
10:21tsdhraek: Thanks.
10:21Fossialthough for a bit more advanced moustache it involves only shaving in part
10:22eipitenI have a hello world set up w/ working routes, but I can't seem to get anything other than plain text responses to work
10:23eipitenso (def handler (app ["hi"] "hi")) works fine but (def handler (app ["hi"] (response "hi"))) or anything like it pukes
10:23raektsdh: it is common to load images from the classpath. if you have an image in your-project-dir/resources/foo/bar.png you can get an URL for it with (io/resource "foo/bar.png")
10:24raek(where io = clojure.java.io)
10:24raekeipiten: you generally don't write handlers inline in the app form. literal strings are one exception used for debugging
10:24tsdhraek: Nope, I have some java lib that generates an ImageIcon without saving it to the fs.
10:25raekeipiten: the form to the right oof the path vector shall in the general case evaluate to a handler function
10:26raek(defn my-handler [request] (respose "hi")) (def handler-dispatcher (app ["hi"] my-handler))
10:26raekMoustache differs from compojure in this way
10:26raekbut IMHO the Moustache way is more modular
10:27eipitenwell, I wanted to get my example to the most bare bones I could
10:27eipitenif I call a function, I end up w/ a 500 error, the example I gave throws a 404 and if I pass a map with the values response should return, it throws a 405
10:28raekwell, the most basic case would be to use "my-handler" as the handler you give to ring
10:28raekapp is a macro, so the meaning of code literals are different from standard clojure
10:29eipitenah
10:29raekeipiten: I really recommend looking at the syntax description: http://moustache.cgrand.net/syntax.html
10:29eipitenthanks
10:29raekif you are comfortable reading it, it will explain everything
10:29thorwileipiten: also have a look at https://gist.github.com/109955
10:31raekeipiten: a small demo web app I made once: https://github.com/raek/lcug-guestbook/blob/master/src/se/raek/lcug/guestbook/controller.clj
10:32eipitenI think those examples and the syntax description are just what I need - thanks so much
10:32eipitenApparently, my Google-fu needs a good bit of work as well :(
10:33raekand for everything else, I would like to point to this: http://brehaut.net/blog/2011/ring_introduction
10:33raeka great overview by brehaut
10:34eipitenThat really helped to understand how the stack works, but... perhaps I'm making typos that I'm not catching.
10:34eipiten*helped me
11:02pdk(doc juxt)
11:02clojurebot"([f] [f g] [f g h] [f g h & fs]); Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"
11:07cemerickmdrogalis: If you're good, you shouldn't have a problem getting a Clojure job in the U.S.
11:08mdrogalisI'll keep that in mind, cemerick :)
11:08Scriptorcemerick: how good is good? :p
11:09technomancyyou have to be Clojure Certified
11:10technomancycemerick: only to prevent someone else from actually doing it, right? =)
11:11cemerickScriptor: "smart and gets things done" is a good but unfortunately co-opted characterization
11:11cemericktechnomancy: $250 will get you an authentic personalized "Clojure Certified" credential.
11:12cemerickThe Enterprise needs to know who to hire, etc.
11:12technomancythey seem to be doing all right with montgomery scott and mr. laforge.
11:12ejacksoncemerick: NCC-1701 ?
11:13cemerickejackson: 1701-D, please.
11:13ejacksoni wanted to keep it open
11:14cemerick-A through -C were lemons.
11:14ejacksondon't want to get into trekkie vs trekker
11:14ejackson:)
11:14cemerickBTW, if someone can get emacs to look like LCARS, I'll switch this afternoon. :-P
11:15pdkis this certificate in crayon
11:16technomancyit's distressing to think that in the 24th century they still haven't figured out tactile feedback for touch-based interfaces.
11:17technomancyreal-life lcars would be as useless as an ipad =\
11:17cemerickpdk: No, this is a serious endeavor.
11:17cemerickThe certificate will be masterfully typeset in Comic Sans.
11:18Hodapptechnomancy: I'd settle for any kind of feedback at all on some interfaces.
11:18ejacksontechnomancy: imagine the malware, eep.
11:19Hodappyou...
11:25pdkawesome
11:25pdkis the title gonna be in wordart
11:26raekor in "Web 0.1" style? http://thedailywtf.com/Articles/Web_0_0x2e_1.aspx
11:27Hodapppdk: howzacome you never hang out in #zdoom anymore :(
11:27pdkmaybe i should poke in again
11:27Hodappit's still a big trollfest
11:27HodappBBG still talks about guns
11:28pdkbut in a land where folks take themselves seriously as fuck on an irc channel for doom...
11:28pdkis he still dreaming of being the world's most toked up gunsmith
11:29Hodappidk, something like that
11:30pdkand the rest of the gang?
11:30HodappI can't even remember who was around when you were
11:31pdkfaint and nxn were certainly using it like their blog then
11:31Hodappthey're still around
11:31Hodappjust idle there awhile
11:33pdkand is bs still serious mode
11:44Hodapppdk: yup
11:44pdksome things never change
11:54Leonidasclj markov.clj -n 250 < pg11.txt 4.45s user 0.10s system 235% cpu 1.933 total
11:54Leonidascan anyone explain to me how I got 235% CPU?
11:54Leonidascode is here: https://github.com/Leonidas-from-XIV/sandbox/blob/master/markov.clj
11:54manuttermulti-core machine?
11:54Leonidasyeah, 2 cores + HT
11:55Leonidasbut I didn't write any parallelization code
11:55Leonidasnot even pmap or something implicit
11:55pjstadigLeonidas: where'd you get the 235% number?
11:55manutterI haven't got a clue, so I'll just blame an undetected Higgs boson.
11:55Leonidaspjstadig: 'time'
11:56pjstadighmm
11:56pjstadigi know load numbers also include I/O, but i'm not sure if that's true with time
11:56pjstadigdoesn't seem like it
11:57Leonidasmaybe i should run visualvm on it, but i am surprised how well clojure performs in this case :)
11:58Hodappyaaay, I got Clojure running on my piece-o-crap Eeeeeee PC (albeit off of a flash drive) so I'll be able to play around with it if I'm awake during a red-eye flight
12:45voltonare there any Clojure contributers around?
12:46cemerickQuite the existential question.
12:47volton:-D
12:47cemerickvolton: What are you looking for specifically?
12:47voltonwell I need to get a patch into clojure core: https://github.com/pcomans/clojure/commit/45153721098ae47c1df272514f226dce37a7803b
12:48technomancygood luck!
12:48voltonbut I don't feel like signing the CA and sending it to Rich just to swap 3 lines of code ;-)
12:48technomancyvolton: then what's to stop you from suing when the patch is applied?
12:49cemerickvolton: just a message to clojure-dev will likely do it — someone will slip something that minor into another unrelated commit.
12:49voltontechnomancy: Threshold of originality
12:49technomancyvolton: I didn't say it was reasonable, but that's the policy.
12:49technomancyyou and I know that it's impossible to copyright a patch like that
12:49technomancybut that's the policy.
12:50wjlroeAnybody here know Noir? I want to know how to access the request - the content-type in fact
12:50dakronevolton: is there a jira issue for that? I have a CA, I'll poke the patch up there for you if you like
12:50voltonI'll send a message to clojure-dev, it's a stupid bug and it should get fixed
12:51fmwin clojurescript, is there a way to make the provider to produce a function call without adding ".call(null)"? i.e. editor__1963.makeEditable() instead of editor__1963.call(null)
12:51cemerickdakrone: I already have a couple of patches that should get into 1.3; I can slip it in there.
12:51dakronecemerick: cool
12:51voltoncemerick: that would be great
12:51voltondo I still have to send the message?
12:52cemerickvolton: no; but if it's not fixed in the next beta release, bug me again
12:52voltoncemerick: okay I will, thank you
12:57fmws/provider/compiler
12:57lazybot<fmw> in clojurescript, is there a way to make the compiler to produce a function call without adding ".call(null)"? i.e. editor__1963.makeEditable() instead of editor__1963.call(null)
12:59dnolenfmw: any particular reason you want that?
13:00fmwdnolen: calling with .call(null) behaves differently (i.e. breaks it) than calling it normally
13:01fmwdnolen: http://closure-library.googlecode.com/svn/docs/class_goog_editor_Field.html the .makeEditable function has an optional argument that seems to get triggered somehow with .call(null)
13:01fmwwhile .makeEditable() works fine
13:01dnolenfmw: don't see how's that possible given what call does.
13:02dnolenfmw: in anycase sounds like a bug with makeEditable.
13:03fmwdnolen: yes
13:05dnolenfmw: that code looks wrong - should be editor_1963.makeEditable.call(null)
13:05fmwdnolen: editor__1963.makeEditable(); works fine, editor__1963.makeEditable.call(null); gives: Uncaught TypeError Object [object DomWindow] has no method 'getOriginalElement'
13:06fmwdnolen: how do you mean wrong? ethe only difference with what you wrote is the double underscore in editor__1963 (which is what the var is called by the compiler)
13:08fmwthe TypeError basically means it somehow ditches the Field object and tries to call stuff on the iframe (wich is a DomWindow)
13:08fmws/wich/which
13:08lazybot<fmw> the TypeError basically means it somehow ditches the Field object and tries to call stuff on the iframe (which is a DomWindow)
13:09dnoleneditor__1963.makeEditable.call(editor_1963)
13:09dnolenfmw: ^
13:09fmwdnolen: that works fine
13:09fmwdnolen: I tried that too, but when I pass editor to the function it still does .call(null, editor__1963)
13:10fmwI tried that by manually editing the outputted javascript
13:11fmwdnolen: ah nvm, seems like I can call it like that from cljsc too
13:12fmwdon't know why that didn't work when I tried that before, must've made a typo
13:12fmwdnolen: thanks for your help!
13:14fmwit is still broken, though, because you shouldn't be providing the Field instance as an argument but either no argument or a string with the iframe src attribute. but that is a bug in goog.editor, I suppose and at least it works like this
13:21dnolenfmw: np
13:24ibdknoxIs there still interest in a repl that drives the browser instead of rhino? Or has someone already got that working?
13:25duck1123What about MozRepl?
13:25duck1123couldn't that be used?
13:26ibdknoxI think ClojureScript would have to be able to emit itself
13:26ibdknoxwhich I don't think it can do yet
13:26hiredmanthats not true
13:27ibdknoxwhich part?
13:27hiredmanyou just need a jvm and js repl somewhere
13:27jcromartiequick poll: how many core.clj<n> do you have in Emacs :)
13:27hiredmanthe jvm passes forms into the js repl and reads the result
13:27technomancyjcromartie: uniquify, dude
13:27hiredmantechnomancy: word
13:27jcromartieoooh?
13:27ahriman`jcromartie eclipse is not a choice?
13:27ohwow_hello
13:27ahriman`only emacs?
13:28jcromartieheh, any editor, fine :)
13:28ahriman`0!
13:28Scriptor0 :p
13:28ahriman`core sucks :P
13:28scottjdoes ccw have any refactorings?
13:30duck1123Is there any sort of script where I can connect to my swank session and eval forms from the command line?
13:30scottjibdknox: have you seen swank-js? if there were a clojurescript function that could take some forms and output the translation as a string you could send that over swank-js to your browser.
13:30duck1123I'm looking to have a script force a namespace to reload
13:31scottjI have a function that takes scriptjure and sends it via mozrepl to the browser using C-x C-S-e
13:31technomancyduck1123: you need a socket repl for that. easy to do with netcat though.
13:32ibdknoxscottj: I assume swank-js is tied to emacs?
13:32ibdknoxscottj: ideally, it'd be editor agnostic (especially since I use VIM) :D
13:33ibdknoxI'm looking through the compiler, and it seems it would be fairly easy to catch all the emitted stuff
13:33ibdknoxthen I was just going to send it over a websocket to the server
13:34ibdknoxerr
13:34ibdknoxto the browser, rather
13:34jcromartietechnomancy: thanks... all set up now :)
13:36scottjibdknox: I think there are a lot of people that want that.
13:37ibdknoxlet's see if my assumptions hold up then :) I'll report progress my progress. Hopefully by tonight we can all send alerts from our repls :D
13:37scottjI'd hope though that the repl were improved over the stock one in that it didn't exit when an exception is thrown
13:37ibdknoxscottj: haha, baby steps :)
13:38amalloytechnomancy: man, uniquify. that one goes straight to .emacs
13:39technomancyamalloy: the infuriating thing about it is that it's not on by default.
13:41duck1123since he's not going to suggest it, I will for him. Get the emacs-starter-kit
13:41duck1123so many good defaults
13:44HodappSigh, banned from #java.
13:45amalloyhahaha, good old ##java
13:45amalloyi've been banned from #git at least once. never figured out why
13:45Hodapptjsnell called me an idiot and then couldn't back it up.
13:47ahriman`can anyone invite me to #java?
13:47rlubkeGave up on the channel a while back.
13:48pdk"GRR SCREW YOU MAN WRITING ONE OFF CLASSES FOR SWING BUTTONS IS BRILLIANT"
13:51Scriptorhey, I've been basically told linked lists is overengineering in #php
13:54Hodapplol
13:57amalloyScriptor: you should try doing functional programming in php
13:57amalloyit's funny times
13:58amalloyi guess you probably have, though, come to think of it
14:04ohwow_Hello guys, I wonder if you could recommend me a book on Clojure. I am familiar with Scheme and functional programming, however I know nothing about Java and its infrastructure (JVM, Ant/Maven, Eclipse, etc).
14:05seancorfieldI'm not sure that any of the Clojure books go into much detail on the Java side of things?
14:06cemerickWe are trying to provide a gentle intro, though we assume either Ruby or Python experience.
14:06kumarshantanuohwow_: Oh Wow! (I mean, you are lucky to have been away from Java! Pun intended)
14:06seancorfieldThe two I'd recommend are in progress: Clojure in Action by Amit Rathore; Clojure Programming by Chas Emerick et al.
14:06ohwow_kumarshantanu: I had been punched in the balls by C#, tho
14:06ohwow_I see
14:06ohwow_what about that "The Joy of Clojure"?
14:06seancorfieldCiA is due in August I think. cemerick when is Clojure Programming due?
14:07seancorfieldJoC is more about the "why" of Clojure/FP so it sounds like you've got that covered?
14:07cemerickseancorfield: I'm going to say "Fall", because I have no specific info beyond that. Don't ask. :-(
14:07cemerickohwow_: FWIW: http://oreilly.com/catalog/0636920013754/
14:07ohwow_o i c
14:07seancorfieldLOL, writing a book is an... interesting... endeavor... I don't envy you :)
14:08cemerickWe need to get a new rough cuts pushed out.
14:08kumarshantanuohwow_: you can avoid Ant, Maven and Eclipse, but some Java will behelpful
14:08ohwow_What does `rough cuts' mean?
14:08ibdknoxit's a beta version of the book ;)
14:08cemerickIt's like Manning's MEAP, but for O'Reilly.
14:08seancorfieldavailable in various drafts as it is written
14:08ohwow_hm
14:08ohwow_i see, thanks
14:09seancorfieldand Packt's RAW (Read As it's Written)
14:09cemerickHasn't Clojure in Action been planned for release for something like 6 months now? I thought Amit was basically done with it at the conj…?
14:09seancorfieldi love the MEAP system - and i'm enjoying Clojure Programming rough cut too
14:09ohwow_What about this one: http://www.amazon.com/gp/product/1430272317?ie=UTF8&amp;tag=aleottshompag-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430272317
14:09seancorfieldcemerick: it's "done" now but there were quite a few revisions even recently
14:10pdkis rough cuts worth it if you've already read joy of clojure and some others
14:10pdki heard about it through brian carper's blog
14:10seancorfieldlast update to Clojure in Action MEAP was february... hmm, thought I'd had an update since then
14:10seancorfieldpdk: i bought Clojure Programming even tho' I have Clojure in Action and Joy of Clojure :)
14:11seancorfieldi think they all offer something different
14:11pdkand has it covered stuff they don't have
14:11cemerickseancorfield: The next rough cuts push will contain massive improvements, FWIW.
14:12ibdknoxcemerick: in what way?
14:12seancorfieldand there's going to be an updated Programming Clojure too?
14:12technomancyseancorfield: second edition is in the works
14:12seancorfieldi'll buy that once an early version's available
14:12kumarshantanuohwow_: there's a title called "Big Java" that probably quickly covers the Java background
14:12cemerickibdknox: In every possible way :-) Trying to maintain a changelog more detailed than "Macros chapter expanded", etc proved to be impossible.
14:13ibdknoxhahaha
14:13ibdknoxcemerick: awesome :)
14:13seancorfieldthe changelog was longer than the book? :)
14:13amalloycemerick: "macros chapter expanded". i love it
14:13cemerickglad someone caught it :-D
14:13ibdknoxseancorfield: did you get anyone willing to talk about clojurescript for the next bay area meetup?
14:14seancorfieldgeek humor... :)
14:14seancorfieldibdknox: no one from the project lives close enough so i'm not sure what we'll end up covering
14:14seancorfieldi think we'll cover noir at the next meeting (since the author is local)
14:15ibdknoxhaha, that's me ;)
14:15seancorfieldah, didn't recognize the nick
14:15ibdknoxif I can get my browser repl working soon, I might have some fun stuff to cover in CLJS too
14:15hiredmanman, posts to the dev mailist have gotten awful formal all of a sudden
14:15seancorfield(and i have the memory of goldfish when it comes to names)
14:16cemerickhiredman: if so, it wouldn't be the worst shift in the world
14:16hiredmancemerick: sure, but pretty bad regardless
14:16jcromartiehttp://my.safaribooksonline.com/book/-/9781449312657 <- step 1: add clojure.jar to your project
14:17hiredmanwriting a series of bullet points is great, but headings and subheadings with paragraphs is tldr
14:17cemerickeh, I missed that
14:17chouserour little project is growing up *sniff*
14:17hiredmanugh
14:17hiredmana wall of text in no way is an indication of maturity or quality
14:18hiredmanit is an indication of an idea that is hard to explain or too complicated
14:18cemerickI assume chouser means the escalation of "social" problems on the list.
14:19cemerickShe can'na hold togetha, capt'in.
14:19hiredmanwell, I think the blog posts as email have been limited to the clojure list, or did some of those end up clojure-dev?
14:19cemericknah, dev is very sane.
14:19cemerickVery limited membership, too.
14:21cemerickhiredman: ah, you mean the "beefing" msg in dev
14:21chouserI actually liked the 'dir' message. I wish I had thought of the "orthogonality doesn't apply" argument when they killed my "show" msg
14:21hiredmanyes
14:21chouser s/msg/fn/
14:21hiredmanI dunno
14:21cemerick*shrug* shoulda gone into a wiki page, but I won't fault him for that
14:21hiredmanI cannot bring myself to read deeper than the headers
14:24voltonIs there a reason why the Clojure Github repo is so quiet at the moment?
14:24pjstadigClojureScript
14:24voltonThe last commit is over a month old
14:24seancorfieldvolton: because the team have been working on clojurescript instead
14:24seancorfieldand the 1.3 release is drawing near so it's pretty much just bug fixes i guess
14:25hiredmanI think clojure hasn't grown a proper development cycle yet
14:25hiredmanso master just kind of halts when there is a freeze before a release
14:25voltonso it does not mean that the clojure project is loosing speed?
14:26seancorfieldvolton: the vast majority of clojure users are still on 1.2 - i wouldn't worry about 1.3 development slowing down :)
14:26kumarshantanuIs anybody aware of the CinC schedule? Will that coincide with 1.3 relese?
14:26hiredmanthere is no schedule
14:26hiredmancinc is not a priority
14:27hiredmandefinitely not for the 1.3 release
14:27hiredman1.3 is in beta already, no way a change that big will land
14:27cemerickClojureScript *is* cinc, just not targeting the JVM.
14:27seancorfieldas a language gets more traction, stability becomes much more important so we should expect slower forward motion
14:27hiredmancemerick: bleh
14:27pjstadigcemerick: i wouldn't go that far...but it is a step in that direction
14:28hiredmanclojurescript is not cinc
14:28hiredmanit is still hosted on jvm, using java code to generate javascript
14:28hiredmanseancorfield: I disagree
14:29seancorfieldhiredman: who with? you're disagreeing with cemerick already :)
14:29hiredmangiven the way clojure is used as a maven dependency most of the time it becomes very easy to specify the version you want
14:29hiredmanseancorfield: well you are both wrong
14:29cemerickThere will *always* be some hosty bits, but look at the pieces of ClojureScript that are implemented in itself. Insofar as cinc is ill-defined to begin with, cljs is an instance of it.
14:29seancorfieldi meant that larger shops adopting clojure would feel more comfortable with stability in the project rather than rapid rate of change
14:30seancorfieldfrom a business point of view, not just a project / dev p.o.v.
14:30voltonseancorfield: you are right and since clojure/core is so small a lot of progress will be made in contrib I guess
14:30cemerickvolton: we have a winner :-)
14:30seancorfieldvolton: the new contrib libraries are certainly seeing quite a bit of activity
14:30pjstadigwell...there are still plenty of changes that could/need to happen in clojure
14:30hiredmancemerick: there doesn't have to be hosty bits
14:30pjstadigand the compiler
14:30chouserI'd argue that cljs is *not* cinc, though it may be a big step in that direction.
14:31chouseroh, sorry -- catching up now and seeing that isn't a profound statement after all :-)
14:31pjstadigchouser: i was impressed :)
14:31hiredmandefinterface + deftype is almost all you need, there are still issues with how you would do clojure.lang.RT
14:31cemerickchouser: You're ruining my strawman! :-P
14:31chouserheh, sorry.
14:32kumarshantanuI guess ideally CinC would be something I can take to another VM/runtime, re-write the hosty bits and run Clojure as usual
14:32chouserclojure leans heavily on java. clojurescript leans heavily on clojure.
14:32chouserkumarshantanu: I think that's right.
14:32hiredmanclojurescript also has a lot of differences from clojure
14:33cemerickI'm not sure that's ever going to be realistic for large programs. Every nontrivial application will use interop, and that will never be portable across hosts.
14:33seancorfieldi suspect the "re-write the hosty bits" will always be a fairly large piece of work tho' due to the high-level nature of clojure
14:33chousercljs is a step in that direction in that the amount you'd have to rewrite to change cljs to target, say ruby, is much smaller than to get clojure to target ruby.
14:33hiredmancemerick: but for example requiring macros to be in a seperate file and included specially
14:33seancorfieldif you can transform to something fairly low-level easily, the bytecode gen is easier
14:34hiredmanseancorfield: I disagree
14:34seancorfieldof course :)
14:34cemerickhiredman: what, assuming identical semantics of libraries on different hosts?
14:34hiredmanseancorfield: if you had a decent compiler, you would just swap out bytecode gen for javascript source gen
14:35hiredmanrun the compiler through the compiler on the jvm
14:35hiredmanget out a compiler targeting js that runs on js
14:35seancorfieldclojure -> java bytecode is a big jump; clojurescript -> javascript less so
14:35kitiahi, does doall force a pmap to be realized?
14:35hiredmancemerick: no, but macro expansion is a core part of clojure, and clojurescript deals with macros differently
14:35cemerickkitia: yes
14:35seancorfieldfwiw, my background is compiler development, stretching back into the 80's...
14:36cemerickhiredman: didn't realize you were talking about cljs specifically
14:36cemerickseancorfield: hey, so cinc bootstrapped via direct clj -> java source translation! :-P
14:37hiredmanthe big issue with the clojure compiler is a. rewriting in clojure in a functional style b. clean seperation of analysis from code gen
14:37cemerickold school
14:38speiI have a piece of code that seems to blow up for no real reason: (doall (pmap (fn [l] (for [gcat (range 0.25 0.76 0.05) at (range 0.25 0.76 0.05) gc (range 0.25 0.76 0.05)] [[l gcat at gc] (repeatedly 1000 #(generate-seq l gcat at gc))])) length))
14:38seancorfieldit's all about the size of the bootstrao process / layer and how to narrow the gap between what the compiler produces and whatever the native "language" of the platform is (but i'm just stating the obvious at this point and it's not really a very interesting discussion)
14:39seancorfields/bootstrao/bootstrap/
14:39lazybot<seancorfield> it's all about the size of the bootstrap process / layer and how to narrow the gap between what the compiler produces and whatever the native "language" of the platform is (but i'm just stating the obvious at this point and it's not really a very interesting discussion)
14:39Scriptylvaniaspei: that's kinda unreadable in irc, please use a pastebin
14:40cemerickIndeed; can we get back to why Clojure is stagnating?
14:40speisorry, whats a pastebin?
14:40cemerickspei: gist.github.com :-)
14:40cemerickor whatever
14:40speioh ok
14:40speithanks
14:41cemerickspei: and try to describe the problem better than "blows up" ;-)
14:42jcromartiecemerick: who says Clojure is stagnating?
14:42chouserdoesn't everyone?
14:42cemerickjcromartie: No one. It's not. I was trolling, sadly.
14:43hiredmanseancorfield: but if your core.clj starts off if a bunch of definterfaces for things like IFn, then fn is a macro that emits deftypes that use those interfaces
14:43hiredmanoff with
14:43kumarshantanua message from the infamous thread "Fess up, who's unhapy with ClojureScript" caught my attention -- which says, at some point of time a proper language spec would be nice_to_have -- Clojure_core, Clojure_java (delta), Clojure_script (delta)
14:44chousercljs is much closer to what hiredman just described than clojure is.
14:44hiredmanright
14:44chouserso that's a clear step in the right direction
14:44speii believe the code is up on gist at git://gist.github.com/1110068.git
14:44chouserin the cinc direction
14:44cemerickkumarshantanu: You'd have to come up with a really good argument for why a spec would be beneficial.
14:44HodappI reckon I should learn me some Javascript sometime.
14:44hiredmanI mention definterface instead of defprotocol because definterface is even lower level and makes the compiler less complex
14:45cemerickspei: you mean https://gist.github.com/1110068
14:45speicemerick, yea, that one
14:45kumarshantanucemerick: for a proper definition, I guess -- perhaps a reference manual instead of a spec
14:45cemerickspei: a REPL interaction that demonstrates the problem would be helpful, too
14:46speiah. so many things to write
14:46cemerickkumarshantanu: right, but what would you do with that "proper definition" and would it be worth the cost?
14:48kumarshantanucemerick: I can look it up when coding on Clojure_java vs Clojure_script vs Clojure_something_new -- some sort of canonical reference, even though skeletal
14:49speicemerick: i added a comment that might describe the problem, but i lost the error that i saw in repl
14:51hiredmankumarshantanu: there is a clojurescript wikipage somewhere that is essentially the delta
14:51cemerickkumarshantanu: Sounds like a reasonable piece of documentation, but nothing like a spec.
14:51cemerickand what hiredman said. :-)
14:52hiredmanhttps://github.com/clojure/clojurescript/wiki/Differences-from-Clojure <-- the one place Clojure/core used a github wiki instead of confluence
14:52cemerick(BTW, it's Clojure & ClojureScript; I don't know what Clojure_java and Clojure_script are)</pedantry>
14:52kumarshantanuspec is probably he wrong term, yes
14:52hiredmanalthough, some of this is just wrong
14:52hiredmanClojureScript has the same evaluation rules as Clojure
14:53hiredmannot true
14:53kumarshantanuhiredman: the delta is a moving target right now
14:53hiredman*shrug*
14:54grumpytoadheh... cemerick why dont you just paste his code into your own repl? what kind of a community is this ?
14:55cemerick:-P
14:57pjstadighiredman: but if they'd used confluence then we'd have known about it before the big reveal
15:00amalloyspei: i'm unconvinced. print-set shouldn't even work, because map isn't being passed enough args
15:00speithat would be odd considering the code does work
15:01amalloyspei: it looks like you haven't pasted it all, because the parens don't match either
15:01speioh. i cut off the code at the wrong place. sorry i'm gonna repost
15:02speii think the code should work now...?
15:02amalloyanyway, (doseq [a x] (doseq [b a] ...)) should probably be replaced with (doseq [a x, b a] ...)
15:02amalloythe former *might* lead to holding the head of your lazy sequence and the latter not
15:02cemerickpjstadig: nah, that's roles are for
15:03amalloybut probably that's not the issue
15:05speii would hope not
15:06amalloywell, to fix the former, the compiler has to be smart. to fix the latter, only doseq has to be a little careful
15:06amalloymy understanding is that the compiler *is* smart enough
15:06dnolenCinC is cool, but actually useful to noone. ClojureScript and Clojure are useful *now*, thus CinC will always get the shaft as far I can tell.
15:07speiamalloy: well, it has been working in smaller test cases
15:08amalloyokay...?
15:09voltonIs it okay to use slurp do retrieve a URL? I know that it will held in memory
15:09speibut in the case that I have up on gist, it fails
15:10amalloyi don't see what point you're making. if it runs out of memory, of course it works for small inputs
15:10amalloyand my suggestion was one thing that might cause it to manage memory better
15:10amalloyas well as being nicer-looking code
15:13speii made the suggested change and I'm running it now
15:14ipostelnikwhat's the recommended json library now? clojure.contrib.json? clj-json?
15:18hiredman0 google hits on Meranget
15:19dnolenhiredman: Maranget, sorry, http://moscova.inria.fr/~maranget/papers/ml05e-maranget.pdf
15:20cemerickipostelnik: c.c.json is now data.json: https://github.com/clojure/data.json
15:21hiredmanipostelnik: but you should be using chesire
15:21hiredman~google chesire json
15:21clojurebotFirst, out of 2340 results is:
15:21clojurebotcheshire -- Marginalia
15:21clojurebothttp://dakrone.github.com/cheshire/
15:23dnolenw/ any luck, pattern matcher might see a release before the Conj (fingers crossed)
15:27hiredmanI spent most of my evening trying to write async iteratees, that paper is a bit much
15:31ohwow_so
15:31ohwow_I was trying to install clojure-mode in emacs
15:31dnolenhiredman: the Maranget paper? It's actually the most readable thing I've come across in a while. The algorithm is completely laid out.
15:31ohwow_i have emacs-starter-kit and i did `M-x package-install <ENTER> clojure-mode' (I added marmelade repo priorly)
15:32ohwow_so I got an error: turn-on-idle-highlight: Symbol's function definition is void: idle-highlight-mode
15:32ohwow_actually I am not sure if it's an error
15:32hiredmandnolen: well more power to you
15:32dnolenhiredman: more power to Clojure, we'll have a bit of Haskell in that pattern matcher.
15:33voltonIs there a way to get a repl with contrib using clojure as inferior-lisp in emacs?
15:36scottjvolton: change inferior-lisp-program to a command that includes contrib on the classpath
15:37voltonscottj: right now it is lein repl
15:41voltonguess I will have to move to swank + slime
15:42ohwow_Hm, so I mannaged to install labrepl and slime-clojure. How can I open the SLIME repl in emacs?
15:42scottjvolton: lein repl outside a project will run the system wide one, either find a way to always have lein repl load contrib or find a way to have it run lein repl for your specific project that has contrib
15:42amalloyvolton: you *could* do it with inferior-lisp in the way that scottj recommends, but swank/slime is pretty sweet so do that
15:42scottjvolton: perhaps C-x d go to project dir, then invoke inferior-lisp
15:43scottjohwow_: if swank is already running somewhere, M-x slime-connect
15:44ohwow_scottj: that doesnt open a new buffer with repl for me :(
15:44scottjwith latest clojure-mode/swank-clojure I think M-x clojure-jack-in is recommended way
15:44scottjohwow_: I'd suspect the predicate to if didn't return true
15:45ohwow_hm
15:46scottjread https://github.com/technomancy/swank-clojure README.md before attempting to use slime
15:46ohwow_`clojure-jack-in' opens a new buffer called *swank* with this in it: Process swank finished
15:46ohwow_That's not a task. Use "lein help" to list all tasks.
15:48voltonscottj: that was a great idea, thank you
15:49ohwow_hhm
15:50hiredmanohwow_: lein plugin install swank-clojure someversion
15:50hiredmanohwow_: and make sure you don't have old versions of swank-clojure on your classpath
15:52ohwow_uh
15:52ohwow_i was using labrepl version
15:52ohwow_but w/e
15:53hiredmanohwow_: I would be surprised if labrepl was kept up to date swank wise
15:54ohwow_tru
16:04ohwow_Hm, so are macros/functions 'javadoc' and 'source' obsolete or whatnot?
16:04technomancysource is irrelevant with swank since M-. is so much nicer
16:04ohwow_Oh, I think those are for labrepl only
16:05chouserjavadoc and source are both clojure.repl functions
16:05amalloytechnomancy: i use source pretty often
16:05ohwow_strange
16:05ohwow_then why are they giving exceptions when i try to evaluate them in slime?
16:06kjeldahl_ohwow_: (use 'clojure.repl)
16:06amalloyohwow_: lazybot also has source and javadoc plugins
16:06amalloy$javadoc Integer intValue
16:06lazybothttp://download.oracle.com/javase/6/docs/api/java/lang/Integer.html#intValue()
16:08ohwow_oh cool
16:08tsdhWhy is my second message dialog not shown in the KeyListener proxy? http://pastebin.com/5yFpdbqu
16:09ohwow_kjeldahl_: is there any way to automatically do that every time i run slime?
16:09amalloyyou can /msg him and then you can ask him as many "silly" questions as you want without cluttering the channel
16:09ohwow_sorry :(
16:10amalloyohwow_: no, you're not donig anything wrongf
16:10kjeldahl_ohwow_: WIth slime, not sure. But if you use the standard "clojure-jack-in" method, you can have your repl initialized with it using the leiningen ":repl-init" feature.
16:10amalloyjust sometimes people feel like they shouldn't "overuse" lazybot, so i'm pointing out he'll talk in private
16:11ohwow_amalloy: Oh, I thought you were talking about me asking kjeldahl_
16:11ohwow_kjeldahl_: I thought clojure-jack-in uses slime under the hood?
16:11kjeldahl_ohwow_: Friendly warning, I'm still "fuzzy" about all the nuances exactly what is provided by slime, swank etc... Just telling you what I've managed to get working.
16:11hiredmanslime is a communication protocol
16:12hiredmanswank-clojure exports clojure.main/repl over slime to emacs
16:12kjeldahl_hiredman: You're sure about that? Didn't work for me either, had to ":repl-init" it... :-)
16:13kjeldahl_hiredman: To get a simple "(doc first)" working.
16:13hiredmankjeldahl_: ah, yes
16:13hiredmanmy mistake, of course swank-clojure doesn't use the clojure repl, it was written before the standard repl code existed
16:14hiredmanand 1.3 moves a lot of stuff around, so it is not available unless you pull it in, kind of a drag
16:15kjeldahl_hiredman: Yeah, I'll bet it will scare off a lot of newbies.. The simplest examples do not even work..
16:16hiredmanwhat version of swank-clojure are you using? there seem to be a few 1.3 related fixes in git, dunno if they fix any issues
16:17kjeldahl_1.3.2 - the latest version suggested on leiningen's github page.
16:18hiredmantechnomancy has us all using the 1.4-SNAPSHOT at work I think
16:19kjeldahl_Oh, can't even find that on the github page.
16:20hiredmanit may a simple change to switch swank-clojure to the main clojure repl code
16:20technomancy1.4.0 just has cdt; you can use 1.3.2
16:31tsdhAh, got it. An exception is thrown and it seems proxy swallows it...
16:40ohwow_Are there are any papers/articles regarding Clojure `namespaces' vs Racket module system?
16:41technomancyclojurebot: namespaces?
16:41clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
16:41technomancyclojurebot: ns form?
16:41clojurebotthe ns form is more complicated than it should be, but it's better-documented at http://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns
16:41technomancyohwow_: you probably want that link?
16:41technomancynothing to do with racket of course, but it's a good description
16:42ohwow_thanks :)
16:57jsnikerisAnyone know why clojure.contrib.java-utils/delete-file-recursively is deprecated?
17:00hiredmanand 'lo, rhickey said "ALL THESE WORLDS ARE YOURS EXCEPT EUROPA. ATTEMPT NO LANDING THERE."
17:02jsnikerishmm, looks like it's also found in clojure.contrib.io, and it's not deprecated there
17:06imadehello
17:06jsnikerishi
17:07imadeI have a quetion about 4clojure problem 22
17:07imadeCount a Sequence is name of the problem
17:07imadewhy is #(reduce + (for [_ %] 1)) an invalid solution?
17:08hiredman,(count (range 10))
17:08clojurebot10
17:08imadeit says You tripped the alarm! count is bad!
17:08imadecannot use function count
17:09hiredman,(#(reduce + (for [_ %] 1))) (range 10))
17:09clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox$eval1433$fn>
17:09imadebut my solution doesnt use count
17:09hiredman,(#(reduce + (for [_ %] 1)) (range 10))
17:09clojurebot10
17:09hiredmanfor may internally or something
17:09imadehmm
17:09hiredman,(macroexpand '(for [_ (range 10)] 1))
17:09clojurebot(let* [iter__4217__auto__ (clojure.core/fn iter__1528 [s__1529] (clojure.core/lazy-seq (clojure.core/loop [s__1529 s__1529] (clojure.core/when-let [s__1529 (clojure.core/seq s__1529)] (if (clojure.core/chunked-seq? s__1529) (clojure.core/let [c__4215__auto__ (clojure.core/chunk-first s__1529) size__4216__auto__ (clojure.core/int #) b__1531 ...] (if (clojure.core/loop # #) (clojure.core/chunk-cons ...
17:10Chousukeew :P
17:10hiredmantry with a map instead
17:11imade,((fn [coll] (reduce + (map #(identity 1) coll))) (range 10))
17:11clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval1556$fn--1557$fn>
17:12hiredmantry maping (constantly 1) instead
17:13imade,((fn [coll] (reduce + (map #(constantly 1) coll))) (range 10))
17:13clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval1586$fn--1587$fn>
17:14hiredman
17:14hiredmanyou're doing it wrong, stop
17:15ibdknox#(reduce + (map (fn [x] 1) %))
17:17imade,(#(reduce + (map (fn [x] 1) %)) (range 10))
17:17clojurebot10
17:17imadek, lets see if 4clojure eats that
17:18imadeit did, thanks
17:18imademaybe even replace (fn [x] 1) with (fn [_] 1), more idiomatic perhaps?
17:19hiredman(constantly 1)
17:21pmbauerIf they're playing 4clojure golf ...
17:21imade,(#(reduce + (map (constantly 1) %)) (range 10))
17:21clojurebot10
17:27imadek thanks for the inputs, learned a new fn constantly, didn't know it before
17:31amalloyimade: you'll have a similar problem if you try to use destructuring on the "implement nth" problem
17:39neotykGood morning everyone!
17:39imadeamalloy: you mean the previous problem, "nth emement"
17:39imade?
17:39imadeon top of the morning to you
17:39amalloyimade: *shrug* i don't know the ordering. but yes, it sounds like i meant the previous one
17:41imadek, I'll try that later with destructuring, I used first and drop there
17:41imade#(first (drop %2 %1))
17:43imadek I really need to go sleep now, ~6h of bed time is kinda extreme for me, good night
17:48thearthurI added a patch to issue CLJS-6, and in the patch submission procedures it mentions taging it for testing, how do I do that in jira?
17:51thearthuris clojurescript covered under the same CA as Clojure proper?
17:52dnolenthearthur: yes
17:52thearthurare people adding patches to jira to work on it or are they sending pull requests from github?
17:53hiredmanthearthur: patches in jira
17:53raekpatches to jira, no pull requests
17:53seancorfieldquick Q: ns-vars is in old contrib ns-utils but doesn't yet seem to be in any new contrib?
17:54thearthurcould someone look at CLJS-6 and tell me if i'v added the patch correctly?
17:54seancorfieldwhat's the preferred way to get a list of all the public vars in a namespace?
17:55hiredman,(take 10 (ns-publics 'clojure.core))
17:55clojurebot([sorted-map #'clojure.core/sorted-map] [read-line #'clojure.core/read-line] [re-pattern #'clojure.core/re-pattern] [keyword? #'clojure.core/keyword?] [unchecked-inc-int #'clojure.core/unchecked-inc-int] ...)
17:56seancorfieldthearthur: hey! bay area clojure group, yes?
17:56seancorfieldhiredman: thanx. i was hoping there was something in core!
17:56thearthurseancorfield: yep thats me
17:56hiredmanthere is, it's called ns-publics
17:57technomancyvals + ns-publics, rather
17:57seancorfieldthearthur: did you get your signed CA on file with Rich?
17:57thearthuryes, at the conj last year. im on the list on clojure.com
18:09seancorfieldhiredman: i'd looked on ClojureDocs but it didn't pop out at me (the search isn't as smart as it could be); i should have used the Atlas because just ns turned up ns-publics - thanx again for the quick answer on that
18:12hiredmanhttp://clojure.org/namespaces
18:12dakroneseancorfield: yea, unfortunately searches with hyphens on clojuredocs are broken until the search is rewritten
18:14seancorfieldhiredman: i don't find the information on clojure.org to be organized in a way that lends itself to easy searching / exploring which is why i use clojuredocs.org and clojureatlas.com
18:14seancorfielddakrone: good to know, thanx
18:15ibdknoxseancorfield: yeah clojure.org needs some usability help
18:18hiredmanwell, pick the people you know who know the most about clojure, did they learn from clojuredocs.org or clojureatlas.com?
18:19hiredmanwhat is the measure of the usefulness of docs?
18:21scottjthere was a recent project that replaced the core defn with a version that added type asserts based on parameter names, anyone know the name?
18:21hiredmanyou mean type hints?
18:21hiredmanthere was something on the mailing list for type hints, nothing about asserts
18:22scottjI think asserts
18:35scottjfound it (porbably the one you were thinking of too) https://github.com/MHOOO/sanity
18:37hiredmanah does both, type hints and asserts
20:21apl29is anyone running cocoa emacs + clojure-mode + swank-clojure on lion, using clojure-jack-in?
20:22hiredmanyes
20:22apl29i simply can't get it to work. slime-connect sometimes (!) does the trick.
20:23apl29did you install everything manually or via marmalade?
20:23hiredmanwhat version of swank-clojure are you using?
20:23mtmwhat do you see in the *swank* buffer? I had a path issues early on...
20:23hiredmanand are you using a project dev-dep or a plugin?
20:24apl29plugin -- v1.3.2
20:25apl29mtm: yep, had path issues early on, but they went away after specifying PATH via getenv... (possibly a mac-specific bug!?)
20:25hiredmanand what doesn't work about it?
20:25apl29it stops.
20:25hiredmanstops?
20:26danlarkinstops!
20:26apl29*swank* buffer stops at "starting swank server..."
20:26apl29i apologize for the somewhat unhelpful "it stops."
20:27apl29:)
20:28hiredmanand how long do you wait for it to start?
20:28hiredmandoes ps show a java process running?
20:28apl29hiredman: i'll check.
20:29apl29hiredman: sufficiently long, i assume. it's been doing nothing for 10, 15 minutes.
20:29hiredmanthe path thing is most likely due to osx not launching processes with the env setup from .profile
20:29amalloyoh mine always works flawlessly after 20 minutes...
20:30apl29that's what everyone's talking about when they mention "agile development."
20:41apl29i'll be damned. now it's working. getting clojure-mode from github did the trick.
20:41apl29for whatever reason.
20:41apl29thanks, everyone.
21:12amalloytechnomancy: i hate the agent threadpool. i can't even create a future without that guy refusing to let my program quit
21:12amalloy(and i only want to create a future so i can call a quick clojure.java.shell/sh
22:58technomancyamalloy: there's always runtime/exec if you want to shell out without that jerk interfering
22:59amalloytechnomancy: yeah, i suppose so
23:00technomancyI just ported lein over to that
23:00amalloywas that the only thing you were using the agent threadpool for?
23:01technomancythe only ridiculous thing is you have to hook up stdio streams yourself
23:06technomancyI wrote a bit of ruby today, and I have to admit it felt really good to just unix the problem away.
23:07jcromartietechnomancy: indeed
23:08most_interestingI don't always code imperative OO with strong Unix flavor, but when I do, it's Ruby.
23:08jcromartieOK can someone look at this little API for me? https://gist.github.com/1110894
23:08eipitenthe most interesting Russian man in the world?
23:09jcromartieI'm using it for model objects in a strictly in-memory app right now
23:09amalloyjcromartie: well, you defined the first two functions out of order
23:09jcromartieyes :P
23:09jcromartiethanks
23:09jcromartieI shuffled things around
23:10amalloy(.getTime (Date.)) is (System/currentTimeMillis), isn't it?
23:10jcromartieah
23:10jcromartieyes millis
23:11amalloyand you're updating-in with conj but saying append - if the :revisions key is nil (rather than []), you'll be adding to the front
23:11Bronsa[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[A[Ainteresting Russian man in the world?
23:11Bronsa05:09:36 jcromartie: I'm using it for model objects in a strictly in-memory app right now
23:11Bronsa05:09:50 amalloy: jcromartie: well, you defined the first two functions out of order
23:11Bronsa05:09:54 jcromartie: yes :P
23:11Bronsa05:09:54 jcromartie: thanks
23:11Bronsa05:09:58 jcromartie: I shuffled things around
23:11Bronsa05:10:45 amalloy: (.getTime (Date.)) is (System/currentTimeMillis), isn't it?
23:11Bronsa05:10:56 jcromartie: ah
23:11jcromartieamalloy: order doesn't matter
23:11jcromartieamalloy: that's what the history function is for
23:11Bronsashit im sorry
23:11jcromartieheh
23:12amalloyit's cool, i like an instant replay for my best suggestions
23:12amalloyjcromartie: i think the ! is an overstatement. it's not modifying anything, and the only global state it depends on is the system clock
23:13amalloyjust call it timestamped
23:13jcromartieI think that qualifies it for being unsafe in a transaction
23:13jcromartiewhich is the criteria for ! that I just read
23:13jcromartiein the Clojure library coding guidelines
23:13amalloyuhhhh
23:14amalloyi disagree. what could go wrong? trying it twice will have exactly the same consequences as waiting till the right time and then doing it once
23:14jcromartieyeah, I suppose so
23:15amalloyi don't quite understand what (history x) is doing, but if you're going to be sorting by time a lot, seems like you could stand to use a sorted-map as the backing store
23:15jcromartieI don't know what the usage for history will be like yet
23:16jcromartiebut I know I will use it
23:16jcromartie... just not how much
23:16amalloyanyway, i'm out of opinions/suggestions now
23:17jcromartiewait sorted-map?
23:17jcromartieor sorted-set?
23:17jcromartiewhat's faster for appending? because it will do a lot more appending than reading/sorting
23:17amalloythey're the same
23:18amalloystore it however you want. a map of timestamp to revision, or a set of revisions sorted by timestamp
23:18amalloybut the latter seems complicated for no particular gain
23:24jcromartieamalloy: hmm, timestamp-as-key makes sense
23:25dnolenhot damn, http://www.amazon.com/Programming-Artificial-Intelligence-International-Computer/dp/0321417461
23:25dnolencovers CLP, looking forward to this one.
23:35jcromartiewhat is CLP?
23:46joegalloCarnegie Library of Pittsburgh
23:46zakwilsonTrying to use Jiraph, I get a NPE thrown from masai.tokyo.DB.open(tokyo.clj:57) when trying to use (with-graph).
23:47joegalloor, perhaps, constraint logic programming
23:49zakwilsonOn a different subject, who wants a Clojure wrapper for the Paypal API?
23:49amalloyjcromartie: that's only non-obvious if you're used to writing your wrappers with arrows
23:50amalloy(wrap-params (wrap-content-type myapp)) is pretty clear about wrapping order
23:51jcromartieyes
23:51jcromartieI use -> of course :)
23:52amalloyi'm just saying, if you find it hard to read, don't write it that way :P
23:52jcromartieit's easy enough with a note
23:52grant__quick question about clojurescript: it seems to me that cljs loses one of the most important features of clj - sending functions to a repl for instant testing and tweaking. Is there any way to gain that?
23:55ibdknox_grant__: I'm working on it right now :)
23:55ibdknox_might be done tonight
23:55grant__wow
23:55grant__how are you accomplishing that?
23:56ibdknox_using the cljs compiler to emit js, capturing it, sending it over a websocket to a browser and having it execute it
23:57ibdknox_I have the first half of that done
23:57ibdknox_now I'm working on the client side :)
23:58grant__ah, cool
23:58grant__i didnt think of it at first, but i suppose that state could be maintained without much work on your part by just selectively evaling stuff
23:58ibdknox_yep :)
23:59ibdknox_I won't say it's "easy"
23:59grant__hehe
23:59ibdknox_but I've gotten pretty far in only a few hours