2010-09-16
| 00:16 | bhenry | practical use for binding outside of testing? |
| 00:20 | wwmorgan | bhennry: (binding [*out* *err*] (println "something")) ;print to standard error |
| 00:40 | sproust | Hi; I have a quick question about an install problem. |
| 00:40 | sproust | I'm trying to get penumbra (OpenGL bindings) working. |
| 00:41 | sproust | lein native-deps provides this error message: Caused by: java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V |
| 00:41 | sproust | at clojure.contrib.java_utils$file__565.<init>(java_utils.clj:83 |
| 00:41 | sproust | I looked in the source, couldn't find references to init. |
| 00:42 | sproust | Any hints where to dig next? |
| 00:42 | sproust | It seems to be leiningen issue. I upgraded to latest stable leiningen (1.3.1) and re-ran self-install. |
| 00:43 | hiredman | means you have some clojure code aot'ed (to class files) and they were aot'ed with a different version of clojure then the one you where using |
| 00:44 | sproust | hiredman: thx! |
| 00:45 | sproust | It must be one of the project's dependencies. |
| 00:46 | sproust | hiredman: Is there a way to get some sort of signature to find out which Clojure generated the class file? (I'm unfamiliar with Java, maybe this is a Java obvious one.) |
| 00:46 | hiredman | no |
| 00:47 | hiredman | you can look through your dependencies for class files |
| 00:47 | sproust | There's a *bunch*. |
| 00:48 | sproust | I get two stack traces; from those, is there any way I could find out which dependency fails? (by inspection it isn't obvious, unless it's java-utils) |
| 00:49 | hiredman | can you pastebin the stacktrace? |
| 00:49 | sproust | http://pastebin.com/y41gze5z |
| 00:51 | hiredman | do you have maven installed? |
| 00:52 | hiredman | you can have lein generate a pom.xml and then maven can generate a dependency graph |
| 00:52 | sproust | yep, maven2 (I don't know anything about it, I'm coming into Clojure from the LISP / dyn.lang angle) |
| 00:52 | sproust | Ha, nice. |
| 00:52 | sproust | Thx hiredman. |
| 00:54 | sproust | Well that'll just list the libraries. |
| 00:54 | sproust | Would be a nice feature to add to Clojure, to insert some marker in the jar files about which version compiled it, since it matters... wouldn't it? |
| 01:12 | sproust | re. penumbra: something's hokey with leiningen; I went the lazy route and rm'ed its repository (~/.m2), reinstalled it, and now it works! |
| 01:33 | sproust | Must be my lucky night, I managed to crash Java: # A fatal error has been detected by the Java Runtime Environment. Allright, to be continued. Thx again hiredman (G'night). |
| 02:32 | jjido | ,(pos? 0) |
| 02:32 | clojurebot | false |
| 02:33 | jjido | ,(nat? 0) |
| 02:33 | clojurebot | java.lang.Exception: Unable to resolve symbol: nat? in this context |
| 02:35 | phobbs | ,(let [nat? (partial >= 0)] (nat? 0)) |
| 02:35 | clojurebot | true |
| 02:36 | jjido | phobbs: hey, you can put the operator between the operands? |
| 02:36 | jjido | ah I get it |
| 02:36 | jjido | "partial" |
| 02:36 | phobbs | yes |
| 02:36 | phobbs | I wish clojure would automatically partial functions like haskell |
| 02:36 | tomoj | ,(let [nat? (partial >= 0)] (nat? 0.5)) |
| 02:36 | clojurebot | false |
| 02:36 | tomoj | maybe I don't know what 'nat' stands for |
| 02:36 | phobbs | erm |
| 02:37 | phobbs | ,(>= 0 0.5) |
| 02:37 | clojurebot | false |
| 02:37 | phobbs | oh |
| 02:37 | phobbs | I'm flipping it again |
| 02:37 | phobbs | haskell habits |
| 02:37 | jjido | tomoj: natural numbers |
| 02:38 | phobbs | yeah |
| 02:38 | phobbs | and you have to test that it is an integer |
| 02:38 | tomoj | that's what I was worried about, didn't even realize that (>= 0 0.5) |
| 02:38 | jjido | phobbs: mmh I don't need to test that :) I just want pos? with zero included |
| 02:38 | phobbs | oh |
| 02:39 | phobbs | well then you just do (partial <= 0) |
| 02:39 | phobbs | or #(<= 0 %) |
| 02:39 | phobbs | which is a little too perl-ish for my tastes |
| 02:39 | phobbs | syntax soup |
| 02:44 | lancepantz_ | anyone else get an insatiable desire to code when the get home from work? |
| 02:44 | lancepantz_ | i got at work |
| 02:44 | lancepantz_ | but usually those are huge projects |
| 02:44 | lancepantz_ | but then i come home, nothing to do |
| 02:44 | lancepantz_ | and want to do something simple |
| 02:45 | jjido | how do you read command-line arguments? Then convert to int with a default value |
| 02:47 | jjido | ,(doc *command-line-args*) |
| 02:47 | clojurebot | "; A sequence of the supplied command line arguments, or nil if none were supplied" |
| 02:48 | jjido | ,(first nil) |
| 02:48 | clojurebot | nil |
| 02:50 | jjido | ,(or nil 4) |
| 02:50 | clojurebot | 4 |
| 02:53 | phobbs | ,(doc read-line) |
| 02:53 | clojurebot | "([]); Reads the next line from stream that is the current value of *in* ." |
| 02:54 | jjido | ,(.parseInt "4") |
| 02:54 | clojurebot | java.lang.IllegalArgumentException: No matching field found: parseInt for class java.lang.String |
| 02:56 | zmila | lancepantz_, i do sometimes at-home programming. these are little hobby projects (like personal dvd and books library) or solving project-euler problems |
| 02:56 | lancepantz_ | its a nice break |
| 02:56 | lancepantz_ | all day i was fighting dragons in solr and jetty |
| 02:56 | lancepantz_ | just just to come home to an empy repl feels nice |
| 02:56 | lancepantz_ | better than tv :) |
| 03:10 | jjido | if you do (+ @(future (f1)) @(future (f2))), does Clojure wait for (f1) to start (f2)? |
| 03:11 | Chousuke | I don't know if the order is defined but AFAIK yes. |
| 03:12 | jjido | beginner's programming error :-/ |
| 03:19 | LauJensen | Good morning all |
| 03:20 | jjido | ,(time (doseq @(future (Thread/sleep 1000)) @(future (Thread/sleep 1000)))) |
| 03:20 | clojurebot | java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: doseq requires a vector for its binding |
| 03:21 | jjido | ,(time (and @(future (Thread/sleep 1000)) @(future (Thread/sleep 1000)))) |
| 03:21 | clojurebot | java.lang.Exception: No such namespace: Thread |
| 03:22 | _na_ka_na_ | hey guys, how do a distinguish a list, vector from a map, coll? returns false for a [] |
| 03:23 | _na_ka_na_ | ,(coll? []) |
| 03:23 | clojurebot | true |
| 03:23 | LauJensen | ,(vector? '(1 2 3)) |
| 03:23 | clojurebot | false |
| 03:23 | LauJensen | ,(map? [1 2 3]) |
| 03:23 | _na_ka_na_ | ,(coll? {}) |
| 03:23 | clojurebot | false |
| 03:23 | clojurebot | true |
| 03:25 | _na_ka_na_ | LauJensen: I want to distinguish between a collection and an object (not necessarily a map) |
| 03:25 | _na_ka_na_ | so map? doesn't quite do it |
| 03:26 | _na_ka_na_ | seq? and coll? are also don't |
| 03:26 | LauJensen | Example? |
| 03:26 | clojurebot | examples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples |
| 03:27 | jjido | Chousuke: it does the Right Thing, ie. it runs both at the same time |
| 03:28 | _na_ka_na_ | LauJensen: something like .. (many? []) => true ... (many? '()) => true ... (many? (seq ..)) => true ... (many? anything-else) => false |
| 03:30 | _na_ka_na_ | I guess many? = (comp (comp not map?) coll?) |
| 03:30 | _na_ka_na_ | not tested |
| 03:32 | LauJensen | ,(not-any? true? ((juxt vector? map? list?) 5)) |
| 03:32 | clojurebot | true |
| 03:32 | jjido | Chousuke: sorry my mistake, it doesn't. |
| 03:33 | LauJensen | That'll test for all non-clojure types |
| 03:33 | _na_ka_na_ | ah my bad .. (and (comp not map?) coll?) |
| 03:33 | _na_ka_na_ | oh we have vector? and list? .. didnt know that |
| 03:34 | _na_ka_na_ | , (source coll?) |
| 03:34 | clojurebot | java.lang.Exception: Unable to resolve symbol: source in this context |
| 03:34 | _na_ka_na_ | , (clojure.repl/source coll?) |
| 03:34 | clojurebot | Source not found |
| 03:36 | LauJensen | ~source coll? |
| 03:37 | _na_ka_na_ | ,(#(and ((comp not map?) %) (coll? %)) []) |
| 03:37 | clojurebot | true |
| 03:37 | _na_ka_na_ | ,(#(and ((comp not map?) %) (coll? %)) '()) |
| 03:37 | clojurebot | true |
| 03:37 | _na_ka_na_ | ,(#(and ((comp not map?) %) (coll? %)) {}) |
| 03:37 | clojurebot | false |
| 03:37 | _na_ka_na_ | ,(#(and ((comp not map?) %) (coll? %)) 543) |
| 03:37 | clojurebot | false |
| 03:38 | _na_ka_na_ | ,(#(and ((comp not map?) %) (coll? %)) "") |
| 03:38 | clojurebot | false |
| 03:39 | _na_ka_na_ | LauJensen: I'm having to deal with a multimethod which returns a vector of objects sometimes and sometimes just one object .. how do I deal with it? |
| 03:40 | _na_ka_na_ | changing the multimethod itself is not a pretty solution .. as all but one defmethod return only one object .. |
| 03:41 | LauJensen | How the receiver should deal with it? How about just wrapping the single object in [object], that way all interfaces would still work. Thats probably the best alternative to adjusting the mm |
| 03:42 | _na_ka_na_ | LauJensen: but as a receiver I first need to find out if its single or not .. that's what I want to avoid .. I think its not good to have a function return different things at different times .. . I think I'll just change all defmethods |
| 03:43 | LauJensen | Good idea |
| 03:43 | LauJensen | If you just let everything return a vector, you have a uniform interface |
| 03:43 | _na_ka_na_ | thanks |
| 03:43 | _na_ka_na_ | ya |
| 03:48 | _Vi | Why when I do "(def q (ref 0)), (comment Now start incrementor of q) (def f (future (loop [] (dosync (ref-set q (+ 1 @q))) (recur)))), (comment Acquire 1000 values from q repeatably) (dosync (for [x (range 1000)] @q))" I get list with from increasing values? Isn't this in the transaction created by "dosync"? |
| 03:49 | _Vi | *list of increasing values |
| 03:50 | LauJensen | _Vi: for is list-comprehension, so its taking a 1000 values and returning them as a seq |
| 03:50 | _Vi | LauJensen, Why that values are not the same? |
| 03:51 | LauJensen | hmm |
| 03:51 | _Vi | LauJensen, I clearly see that q is updated by future while transaction should prevent this. |
| 03:51 | LauJensen | I think its because you're not comitting anything, so your transaction doesn't retry. try (dosync (for [x (range 1000)] (ensure q))) |
| 03:52 | LauJensen | That will prevent q from being written to while you're working |
| 03:54 | _Vi | (dosync (def l (for [x (range 1000)] @q)) (ensure q) l) ; The same |
| 03:56 | _Vi | BTW How to explicitly start a transaction? "(dosync (for [x (range 1000)] (ensure q)))" -> "No transaction running" |
| 03:59 | _Vi | Probably understood. "for" is returning "lazy" sequence and "(ensure q)" is called not in "dosync", but while printing. |
| 03:59 | raek | _Vi: for is lazy, so it isn't realized until you try to print it, which happens outside the transaction. use 'doseq' |
| 04:00 | raek | which is exactly like for, except that it is not lazy and returns nil (presumably, it is used for its side-effects) |
| 04:02 | raek | you can also use doall to force a lazy sequence |
| 04:03 | raek | (dosync (doall (for [x (range 1000)] @q))) ; will force the lazy sequence returned by for to be fully realized within the transaction |
| 04:03 | raek | hrm, use might not be the best fit for the acquire part... |
| 04:03 | raek | s/use/doseq/ |
| 04:03 | sexpbot | <raek> hrm, doseq might not be the best fit for the acquire part... |
| 04:03 | _Vi | Yes, "doall" fixes things. |
| 04:05 | raek | also, don't do ref-set + @, use 'alter' instead |
| 04:06 | raek | (doc alter) |
| 04:06 | clojurebot | "([ref fun & args]); Must be called in a transaction. Sets the in-transaction-value of ref to: (apply fun in-transaction-value-of-ref args) and returns the in-transaction-value of ref." |
| 04:06 | raek | (alter q inc) |
| 04:09 | raek | (dotimes [_ 1000] (Thread/sleep 10) (alter q inc)) |
| 04:09 | raek | (dotimes [_ 1000] (Thread/sleep 10) (dosync (alter q inc))) ; *ahem* |
| 04:15 | raek | _Vi: (what I said after the last thing you said and when your connection died: http://pastebin.com/8XMzieFE ) |
| 04:16 | _Vi | raek, (Yes, I'm looking at http://clojure-log.n01se.net/ now but it is not yet updated to this point) |
| 04:20 | _Vi | (def f (future (recur))) (comment endless loop in background), (future-cancel f) ; Still looping |
| 04:20 | _Vi | How to really terminate it (without of restarting JVM)? |
| 04:21 | raek | I'm not sure that futures can be canceled at all times |
| 04:21 | raek | the best way is probably to make the looping code check for a condition |
| 04:22 | _Vi | raek, I mean if there is some broken code looping, and we need to get rid of it. |
| 04:23 | _Vi | raek, For example, it can get stuck not in Clojure code, but in some external library. |
| 04:24 | raek | good question, but unfortunately I don't know the answer |
| 04:24 | jjido | anyone wants to test? I get no benefit from parallelism with a 1000 elements set http://pastebin.ca/1941926 |
| 04:24 | Chousuke | _Vi: You can't really |
| 04:25 | _Vi | Something like Thread.interrupt() or Thread.stop(). |
| 04:25 | Chousuke | _Vi: unless you get hold of the Thread instance that the future is running in and call .stop on it |
| 04:25 | Chousuke | but even that's deprecated |
| 04:25 | Chousuke | .interrupt doesn't help with broken code. |
| 04:25 | _Vi | How to get the Thread instance of a future? |
| 04:25 | Chousuke | No idea :/ I think they run in an executor so hm. |
| 04:26 | _Vi | E.g. how to more-or-less safely call to some binary blob that can arbitrarily do "for(;;);" just for fun? |
| 04:28 | Chousuke | _Vi: use Threads explicitly and .stop them. or use clj-sandbox |
| 06:04 | kjeldahl | Any gurus want a question? I have a list with integers indicating capacity. I have a known need (for capacity). I want to iterate through the list, taking the available capacity from each entry until capacity has been reached. |
| 06:04 | kjeldahl | And here I am wrapping my head around for/recur/while etc. not quite figuring it out. |
| 06:05 | kjeldahl | ,'(range 10) |
| 06:05 | clojurebot | (range 10) |
| 06:05 | kjeldahl | ,'[(range 10)] |
| 06:05 | clojurebot | [(range 10)] |
| 06:05 | kjeldahl | ,(range 10) |
| 06:05 | clojurebot | (0 1 2 3 4 5 6 7 8 9) |
| 06:06 | kjeldahl | Let that be the list. Say I want to read from the top, until total capacity reaches 8. 0+1+2+3+ (half of four) |
| 06:12 | LauJensen | kjeldahl: like this? |
| 06:12 | LauJensen | ,(reduce #(if (< (reduce + %1) 10) (conj %1 %2) %1) [] (range 20)) |
| 06:12 | clojurebot | [0 1 2 3 4] |
| 06:12 | LauJensen | Walks through (range 20), stops when the sum is > 10 |
| 06:13 | LauJensen | or.. stops is the wrong word. But it doesn't accumulate above that point |
| 06:13 | kjeldahl | Let me chew on that. |
| 06:14 | kjeldahl | Where's my 8? |
| 06:14 | kjeldahl | (the capacity I want filled) |
| 06:14 | LauJensen | ,(reduce #(if (< (reduce + %1) 8) (conj %1 %2) %1) [] (range 20)) |
| 06:14 | clojurebot | [0 1 2 3 4] |
| 06:15 | LauJensen | ,(let [capacity 8] (reduce #(if (< (reduce + %1) capacity) (conj %1 %2) %1) [] (range 20))) |
| 06:15 | clojurebot | [0 1 2 3 4] |
| 06:16 | kjeldahl | Excellent. I'll see if I can munge it into something usable in my baby-steps code. Thanks. |
| 06:16 | LauJensen | kjeldahl: np. Most of the time, loop/recurs can be replaced by reduce. But this is one of those cases where if this was performance critical, I would do a loop instead |
| 06:17 | kjeldahl | Yes, this is what hit me as well. Nothing critical right now, but good to know. Thanks again. |
| 06:19 | raek | maximum flow problem? |
| 06:19 | bsteuber | I think gen-class should do automatic conversion to camel case |
| 06:20 | bsteuber | so you can use the same code for java and clojure callers |
| 06:21 | LauJensen | kjeldahl: In case you're wondering, this is a simple loop version |
| 06:21 | LauJensen | (loop [x (range 20) acc []] (if (< (reduce + acc) 8) (recur (next x) (conj acc (first x))) acc)) |
| 06:21 | LauJensen | and this is probably a little faster for larger data sets |
| 06:21 | LauJensen | (loop [x (range 20) acc [] sum 0] (if (< sum 8) (recur (next x) (conj acc (first x)) (+ sum (first x))) acc)) |
| 06:21 | LauJensen | (because its not calling reduce on each loop) |
| 06:21 | LauJensen | im done :) |
| 06:25 | pomyk | hello |
| 06:25 | bsteuber | does anyone else have problems with lein not returning after it's done? |
| 06:25 | raek | kjeldahl: you don't happen to be practicing for Nordic Collegiate Programming Contest? |
| 06:25 | pomyk | does clojureql work with clojure 1.2? |
| 06:26 | LauJensen | kjeldahl: actually, sorry last one. I showed you something in poor style, calling first twice. Usually when you reference something twice with a modifier, you should bind it to a name, this is the way to go: |
| 06:26 | LauJensen | (loop [[x & xs] (range 20) acc [] sum 0] (if (< sum 8) (recur xs (conj acc x) (+ sum x)) acc)) |
| 06:26 | LauJensen | pomyk: If you build the jar without AOT compilation, then yes, if you just use the source then it works as well. AOT compilation currently only works for 1.0 |
| 06:26 | kjeldahl | raek: No, I'm using the planetwars google ai challenge to try to teach myself some clojure. |
| 06:27 | kjeldahl | raek: Obviously, clojure being my first function language... :-) |
| 06:28 | kjeldahl | *functionAL |
| 06:32 | kjeldahl | ,(doc negate) |
| 06:32 | clojurebot | Excuse me? |
| 06:33 | LauJensen | ,(doc complement) |
| 06:33 | clojurebot | "([f]); Takes a fn f and returns a fn that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value." |
| 06:33 | kjeldahl | ,(* -5 -1) |
| 06:33 | clojurebot | 5 |
| 06:33 | kjeldahl | That's what I want. Cheat sheet says negate, but doesn't seem to exist. |
| 06:34 | LauJensen | ,(doc unchecked-negate) |
| 06:34 | clojurebot | "([x]); Returns the negation of x, an int or long. Note - uses a primitive operator subject to overflow." |
| 06:34 | kjeldahl | Thanks again. |
| 06:34 | LauJensen | np |
| 06:35 | kjeldahl | Ah, didn't read the cheat sheet close enough... |
| 06:36 | fbru02 | is it true what i read here that 1.3 will be getting a sort of maybe monad?? |
| 06:38 | raek | link? |
| 06:38 | clojurebot | your link is dead |
| 06:41 | raek | this might be of intereset: I think that contrib's -?> and -?>> have maybe-monad-like behaviour (if I have understood the maybe monad correctly; I'm a total noob in that area) |
| 06:41 | raek | ,-?> |
| 06:41 | clojurebot | java.lang.Exception: Unable to resolve symbol: -?> in this context |
| 06:42 | raek | ,(use '[clojure.contrib.core :only [-?> -?>>]]) |
| 06:42 | fbru02 | raek cool i will check them out |
| 06:42 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib/core__init.class or clojure/contrib/core.clj on classpath: |
| 06:43 | raek | they work like ordinary -> and ->>, but stops and returns nil if any form in the chain returns nil |
| 06:45 | raek | -> -?> |
| 06:45 | sexpbot | java.lang.Exception: Unable to resolve symbol: -?> in this context |
| 06:45 | LauJensen | Im glad I started so early with Clojure, coming in now and seeing functions like "$" "->" "->>" "-?>>" "#(fn %&)" etc will likely freak some people out |
| 06:49 | LauJensen | which one? |
| 06:50 | raek | when the condition of a cond clause is large enought to occupy a whole line, how do you indent? |
| 06:50 | LauJensen | I've suggested wrapping each line in a () |
| 06:50 | raek | didn't know that you could do that in clojure |
| 06:51 | LauJensen | You cant, it was a suggested change to cond/condp/deftemplates/defsnippet et al |
| 06:52 | pomyk | with clojure 1.2 I get this warning in repl: WARNING: group-by already refers to: #'clojure.core/group-by in namespace: clojureql, being replaced by: #'clojureql/group-by |
| 06:52 | raek | maybe I could resort to use two nested ifs this time... |
| 06:54 | raek | pomyk: there's a function called group-by in clojure.core nowadays. it can be replaced by another function when using use, so that older code will not break |
| 06:58 | LauJensen | Ive written a quite simple factorial for beginners to model their code after: |
| 06:58 | LauJensen | ,(letfn [(!-?> [&$ &!] (if (> &! 1)(!-?> (->> &$ (* &!))(-> &! dec))&$))](!-?> 1 5)) |
| 06:58 | clojurebot | 120 |
| 07:00 | raek | you could replace 'dec' with #(- % (*)) |
| 07:01 | LauJensen | even better |
| 07:03 | raek | ,(letfn [(!-?> [&$ &!] (if (> &! (*))(!-?> (->> &$ (* &!))(-> &! #(- % (*))))&$))](!-?> (*) (- (* (+ (*) (*)) (+ (*) (*) (*))) (*)))) |
| 07:03 | clojurebot | java.lang.ClassCastException: sandbox$eval6608$_BANG___QMARK__GT___6609$_AMPERSAND__BANG___6610 cannot be cast to java.lang.Number |
| 07:09 | raek | I guess you have hanged out in #clojure too long when you feel the urge to have show-paren-mode in irssi... |
| 07:10 | LauJensen | raek: or not long enough. I have parens matching in all channels, thanks to ERC |
| 07:10 | LauJensen | I think this is the most elegant version |
| 07:10 | LauJensen | ,(letfn [(!-?>[&$ &!](if(>,&!,1)(!-?>@(->>,&$,(*,&!)ref)(->,&!,dec))&$))](!-?>,1,5)) |
| 07:10 | clojurebot | 120 |
| 07:10 | raek | ERC is very high on my to-learn list |
| 07:25 | tomoj | LauJensen: how? not paredit right? |
| 07:25 | LauJensen | tomoj: What? I never use paredit, what are you talking about? :) |
| 07:26 | tomoj | you use emacs but not paredit? O_o |
| 07:27 | LauJensen | http://twitter.com/LauJensen/status/18062045007 |
| 07:28 | tomoj | you really think so? |
| 07:28 | tomoj | or is that just agitprop? |
| 07:29 | LauJensen | Whats 'agitprop' ? |
| 07:29 | tomoj | s/agitprop/flamebait |
| 07:29 | LauJensen | ah, well its both |
| 07:29 | tomoj | you really think so and it's flamebait? |
| 07:29 | LauJensen | Yes sir |
| 07:30 | tomoj | I'd love to hear a more detailed explanation someday |
| 07:30 | LauJensen | I think Paredit has its virtues when you're writing code, but I think its a ball 'n' chain as soon as you have to edit loads of code. I've had several tries with it and its always made me slower |
| 07:31 | tomoj | I see |
| 07:32 | tomoj | what is it that you do while editing loads of code which is easier without paredit? |
| 07:32 | LauJensen | just standard refactoring |
| 07:32 | LauJensen | I think. Didn't really stop and think about it :) |
| 07:32 | tomoj | and, I don't mean to imply anything by asking this, but did you know all the bindings well? |
| 07:32 | LauJensen | hehe |
| 07:33 | LauJensen | No I think I knew like 10% |
| 07:33 | tomoj | ok |
| 07:33 | tomoj | counterflame: paredit is like training wheels that turn into jet engines once you figure out how to use them |
| 07:34 | LauJensen | I'll tell you what I've told every individual who has made statements to that effect: Screencast or it didn't happen |
| 07:34 | tomoj | I really want to |
| 07:34 | tomoj | I always get frustrated with the tools |
| 07:34 | AWizzArd | tomoj: how do you cut the expression your cursor is on? |
| 07:35 | AWizzArd | (a b |(c d e) x y) ==> Keys ==> (a b x y) and (c d e) can be pasted somewhere else |
| 07:35 | tomoj | kill-sexp, C-M-k by default |
| 07:35 | AWizzArd | C-k at alone this position would result in (a b) |
| 07:36 | tomoj | right |
| 07:36 | LauJensen | tomoj: C-M-k isn't specific to paredit |
| 07:36 | tomoj | indeed |
| 07:36 | tomoj | wasn't my example :) |
| 07:36 | LauJensen | I know, Im just keeping it real :) |
| 07:36 | tomoj | LauJensen: have you made screencasts before? |
| 07:37 | AWizzArd | C-M-k doesn't work for me like this. It is doing the same as C-k |
| 07:37 | tomoj | would be interested in recommendations for free tools |
| 07:37 | LauJensen | tomoj: many |
| 07:37 | LauJensen | tomoj: Which OS are you on ? |
| 07:37 | zmila | after using paredit from CCW i feel its lack in my java programming |
| 07:37 | tomoj | AWizzArd: check what it's bound to |
| 07:37 | tomoj | LauJensen: ubuntu, have os x available too |
| 07:38 | LauJensen | tomoj: On OSX I dont know of any free tools, but I would purchase Screenflow. Its cheap and powerful. Cemerick uses it. On linux I use gnome-soundrecord and gtk-recordMyDesktop. Once Im done shooting I mix the video/audio in Audacity, and merge them with mkvmerge and upload to Vimeo |
| 07:38 | tomoj | what resolution do you record? |
| 07:38 | LauJensen | Post processing takes about 5 minutes |
| 07:38 | tomoj | I couldn't seem to find any good answers for resolutions for vimeo |
| 07:38 | LauJensen | I usually aim for 800x600 - No good reason |
| 07:39 | LauJensen | tomoj: You can see my latest screencast, which was shot with Camtasia and was the correct resolution for HD - Forgot the numbers though |
| 07:39 | raek | can audacity do edit video too? |
| 07:39 | tomoj | thanks for the tips |
| 07:39 | LauJensen | raek: No. But there are actually good video editors of linux as well |
| 07:39 | tomoj | I had a camtasia demo |
| 07:40 | tomoj | also snapz pro |
| 07:40 | tomoj | I'll try gtk-recordMyDesktop |
| 07:41 | LauJensen | tomoj: it supposedly can both record audio and video at the same time. But Ive never had a good result with it |
| 07:42 | LauJensen | So what I do is, I start the sound recorder first, then the video record. Then open the sound afterwards and select the starting point as when I say "Hi" and then the end point as the duration of the video + starting point. Cut that out, save as mp3, merge |
| 07:42 | LauJensen | At first I used an insanly long mencoder formula to merge, but then I found out that mkvmerge could do the process in 1 sec with no args :) |
| 07:47 | LauJensen | tomoj: Do you have a blog where you will publish? |
| 07:48 | tomoj | no, only a snowman http://tomojack.com/ |
| 07:48 | tomoj | I had a blog there but took it down because there'd only been one post for months |
| 07:49 | LauJensen | Was your name Tomas or Jack ? |
| 07:49 | LauJensen | s/Was/Is/ |
| 07:49 | sexpbot | <LauJensen> Is your name Tomas or Jack ? |
| 07:49 | tomoj | thomas |
| 07:49 | tomoj | 'tomo' a nickname from esperanto |
| 07:50 | LauJensen | Yea I remember you told me |
| 07:50 | LauJensen | Ok well, you'll have to announce it here then, once you're done :) |
| 07:50 | tomoj | will do |
| 07:50 | tomoj | don't hold your breath |
| 07:50 | LauJensen | O_O |
| 08:04 | tomoj | LauJensen: got any ideas for what would be a good way to demo? |
| 08:04 | tomoj | I was thinking a very simple project might be nice |
| 08:05 | LauJensen | tomoj: You're looking to code a project live ? |
| 08:05 | tomoj | well, maybe |
| 08:05 | tomoj | I don't want to just mess with contrived examples |
| 08:05 | tomoj | I want to show using paredit to write/refactor real code |
| 08:05 | LauJensen | tomoj: Would be great if you had some code lying around, that needing converting to protocols/records |
| 08:36 | bobo_ | i got supprised by the choice of rails for diaspora, but cant decide what i would have used. Could clojure handle a site potentialy that heavy used? with that much dynamic content? i doubt rails will |
| 08:37 | LauJensen | bobo_: Jetty is very touted for its scalability, but personally I have my doubts |
| 08:40 | bobo_ | im not sure how i would do at all. i almost wanna say php, but i refuse |
| 08:42 | nlogax | isn't it rails that can only handle 1 request at a time? |
| 08:42 | nlogax | maybe that's fixed now :) |
| 08:45 | solussd | I' trying to use swank-clojure with leiningen, I type "lein swank" in my project directory and I get an error: "That's not a task. Use "lein help" to list all tasks." I've added [swank-clojure "1.2.1"] to my project's :dependencies list and then ran "lein deps". anyideas? |
| 08:46 | r0man | solussd: i think you must add it to the :dev-dependencies list |
| 08:46 | bobo_ | solussd: dev-dependencies |
| 08:46 | bobo_ | or add it to ~/.lein/plugins |
| 08:46 | bobo_ | wher "it" is the jar |
| 08:46 | bobo_ | ~/.lein/plugins$ ls |
| 08:46 | bobo_ | swank-clojure-1.2.1.jar |
| 08:46 | clojurebot | http://www.assembla.com/wiki/show/clojure/Protocols http://clojure-log.n01se.net/date/2009-10-13.html#12:02 |
| 08:47 | solussd | thanks, that did it. |
| 09:02 | LauJensen | bobo_: Ive just seen a report wherein Jetty handled 10.000 concurrent users with 250 threads and a latency of about 2.5s per request |
| 09:02 | bobo_ | 2.5s is ages on internet, but i assume that goes down pretty fast |
| 09:04 | LauJensen | bobo_: Yes, but it tells you something about when to shard your application, which will happen eventually anyway, so that point may come 10% sooner for Jetty than for Rails, but if it has speed up your development process by 400% not using rails, it still could make sense |
| 09:04 | bobo_ | indeed |
| 09:05 | bobo_ | would be intresting to benchmark some clojure web code |
| 09:05 | bobo_ | maybe i should try something with some rest and curl |
| 09:07 | LauJensen | Yea, you should need to a host and a server both on massive connections for it to have any real value |
| 09:07 | fbru02 | how would be a good way of doing juxt over a vector ?? |
| 09:07 | LauJensen | I mean, server and client |
| 09:08 | LauJensen | fbru02: What are you looking to do ? |
| 09:08 | bobo_ | yes, massive connections i have some. i live in sweden afterall :-) |
| 09:08 | LauJensen | bobo_: oh right, I always forget that Denmark is Scandinavias little Africa when it comes to IT |
| 09:08 | fbru02 | LauJensen: I have a vector of [fn(x), fn1(x)] and i want to juxt fn fn1(x) |
| 09:08 | bobo_ | LauJensen: lol |
| 09:09 | LauJensen | bobo_: Its so terrible here, that its not even funny |
| 09:09 | mrBliss | fbru02: apply? |
| 09:09 | LauJensen | ,(apply juxt [(print "one ") (print "two")]) |
| 09:09 | clojurebot | #<core$juxt$fn__3657 clojure.core$juxt$fn__3657@95f865> |
| 09:09 | clojurebot | one two |
| 09:09 | fbru02 | mrBliss: LauJensen thanks a lot i sometimes forget about that magic thing :) |
| 09:11 | grignaak | is there something that is the reverse of apply? |
| 09:11 | grignaak | something like (defn select [f] (fn [& xs] (f xs))) |
| 09:12 | LauJensen | grignaak: What are you looking to do with it? |
| 09:13 | grignaak | ((#(fn [& xs] (% xs)) second) 1 2 3) |
| 09:13 | grignaak | ,((#(fn [& xs] (% xs)) second) 1 2 3) |
| 09:13 | clojurebot | 2 |
| 09:13 | grignaak | where the lambda is replaced by the defn above |
| 09:42 | fliebel | Is it defined behavior(ie, something that can be relied on) that load-file returns the result of the last expression? |
| 09:43 | LauJensen | fliebel: judging from the doc string I would say yes |
| 09:44 | jjido | ,(defn troll [opinion object dissing] (println (pick opinion) " " (pick object) ". " (pick dissing))) (troll ["I love" "I hate"] ["Java" "Clojure" "functional"] ["I don't get you.""You don't read what I wrote." "There are idiots everywhere."]) |
| 09:44 | clojurebot | DENIED |
| 09:44 | LauJensen | Also, Rich is usually pretty strict about sticking with signatures |
| 09:45 | _fogus_ | ,(#(second %&) 1 2 3) |
| 09:45 | clojurebot | 2 |
| 09:45 | fliebel | LauJensen: Okay :) None of the other load/require/use functions seems to do this. It's nice to avoid things like in Twisted, where you have to define an application variable. |
| 09:46 | grignaak | _fogus_: what? you can put an & after the % ? |
| 09:47 | fliebel | _fogus_: Awesome! *slaps forehead as well* |
| 09:47 | _fogus_ | grignaak: Yes. That is the #() way to say "var args" |
| 09:47 | jjido | /msg nickserv |
| 09:47 | LauJensen | _fogus_: Did you get my contribution to @learnclojure ? |
| 09:47 | _fogus_ | Ooooo. That gives me an idea for a @learnclojure tweet |
| 09:48 | bobo_ | i didnt know about @learnclojure! |
| 09:48 | _fogus_ | LauJensen: I have not checked yet. I still haven't gotten the hang of managing multiple twitter accounts |
| 09:48 | fliebel | *follows learnclojure* |
| 09:49 | jjido | test: idiot |
| 09:49 | LauJensen | _fogus_: It was just an attempt to make people coming from Perl a little more comfortable: http://twitter.com/LauJensen/status/24654495072 |
| 09:50 | _fogus_ | LauJensen: Love the use of commas |
| 09:50 | LauJensen | _fogus_: yea, its artistic :) |
| 09:50 | jjido | can you make it more obfuscated |
| 09:51 | LauJensen | not without sacrificing elegance |
| 09:52 | jsanda | hey everyone, can someone tell me how can i check to see if a var has a root binding? when i call bound? an exception is thrown |
| 09:52 | jjido | I don't even know what !- is |
| 09:52 | chouser | !-?> is defined right there |
| 09:52 | fliebel | jjido: I think that is just a normal variable |
| 09:52 | chouser | LauJensen: that's really horrible. Shame on you. And ... congrats, I think. |
| 09:52 | LauJensen | chouser: hehe :() |
| 09:53 | chouser | letfn, so !-?> is a normal local function |
| 09:53 | LauJensen | !-?> is factorial |
| 09:54 | jsanda | and if done, (declare myvar), how can i set the root binding? i just noticed the docs mention that set! cannot be used to set the root binding |
| 09:57 | vu3rdd | LauJensen: Obfuscated Clojure contest? |
| 09:58 | LauJensen | vu3rdd: Dont know if its a contenst. Just wanted to attract a few more Perl developers to Clojure, I dont think we dont enough advertising for that group |
| 09:58 | LauJensen | s/contenst/contest |
| 09:58 | vu3rdd | :-) |
| 09:58 | LauJensen | s/dont/do |
| 09:58 | LauJensen | I should get a new keyboard |
| 10:02 | bobo_ | would a twitter clone be a good webapp to use for benchmarking? |
| 10:03 | fliebel | bobo_: What do you want to benchmark? |
| 10:03 | bobo_ | performance of clojure web stack, or something like that. Havent set a real goal |
| 10:03 | LauJensen | _fogus_: haha, #eyeshurt :) |
| 10:04 | LauJensen | bobo_: Why not just serve a single static page which pulls some data from a fast db and then hammer it with ab or some other stresstest util |
| 10:05 | fliebel | bobo_: Yea, I think any real-life app would do. Nice thing for the Twitter clone is that you can compare to StatusNet and Twitter. |
| 10:05 | bobo_ | i think i already have a twitter clone aswell, thats why i thought about that |
| 10:05 | LauJensen | s/static/dynamic/ |
| 10:05 | sexpbot | <LauJensen> bobo_: Why not just serve a single dynamic page which pulls some data from a fast db and then hammer it with ab or some other stresstest util |
| 10:05 | bobo_ | with redis as backend |
| 10:06 | bobo_ | but static page can be intresting aswell |
| 10:06 | bobo_ | then it is easier to try other languages aswell |
| 10:14 | jjido | ,(let [n 4] (-> n dec)) |
| 10:14 | clojurebot | 3 |
| 10:15 | jjido | ,(-> 3 dec) |
| 10:15 | clojurebot | 2 |
| 10:15 | chouser | ,(-> 3 inc inc inc) |
| 10:15 | clojurebot | 6 |
| 10:16 | jjido | how about ->>? |
| 10:16 | LauJensen | isnt it -?>> ? |
| 10:17 | LauJensen | its something lpetit cooked up IIRC |
| 10:17 | jjido | you used ->> in the twitter post |
| 10:18 | LauJensen | ooh :) I thought you were asking about -?>> |
| 10:19 | LauJensen | ->> threads as last argument, -> as first |
| 10:19 | sexpbot | => #<core$_GT_ clojure.core$_GT_@36f7a0> |
| 10:19 | LauJensen | (-> 5 (/ 2)) |
| 10:19 | LauJensen | ,(-> 5 (/ 2)) |
| 10:19 | clojurebot | 5/2 |
| 10:19 | LauJensen | ,(->> 5 (/ 2)) |
| 10:19 | clojurebot | 2/5 |
| 10:22 | jjido | ,(->> 5 (/ 2) (+ 1)) |
| 10:22 | clojurebot | 7/5 |
| 10:24 | LauJensen | ,(->> 5 (/ 2) inc str reverse (apply str)) |
| 10:24 | clojurebot | "5/7" |
| 10:26 | jjido | lol. I was able to undo your post now. |
| 10:40 | LauJensen | ? :) |
| 10:41 | LauJensen | oh, you de-scrambled it you mean ? |
| 10:43 | bobo_ | how do i enlive (select a link with class "class"? tried everything i could think off |
| 10:43 | LauJensen | bobo_: [:a.class] |
| 10:45 | bobo_ | ah, its ajax that fools me |
| 10:58 | chouser | breaking changes to the contrib build have cost me at least as much time as breaking changes to the clojure language itself. |
| 10:59 | Raynes | Same with me and Dominos' new pizza recipe. |
| 11:00 | chouser | hehe, er, what? |
| 11:01 | Raynes | It was a bad joke. Forgive me, I just woke up. |
| 11:01 | Raynes | :> |
| 11:02 | chouser | :-) |
| 11:03 | kjeldahl | ,(doc doseq) |
| 11:04 | Raynes | sdeobald: I shot you a message on github about running tryc. |
| 11:04 | AWizzArd | chouser: Contribs breaks were much worse for me, probably because they occur very regularily. |
| 11:04 | kjeldahl | From the doseq docs: Repeatedly executes body (presumably for side-effects) with |
| 11:04 | kjeldahl | bindings and filtering as provided by "for". Does not retain |
| 11:04 | kjeldahl | the head of the sequence. Returns nil. |
| 11:05 | kjeldahl | Can anybody tell me what the "Does not retain the head of the sequence" means here? |
| 11:05 | bhenry | any of the rubylearning clojure for beginners class instructors on here ? |
| 11:05 | AWizzArd | duck-streams is suddenly renamed, then renamed again with some functions removed, http-agent disappeared completely, now Contrib is split up into a million pieces, etc. |
| 11:05 | Raynes | Doesn't keep the sequence in memory. |
| 11:05 | Raynes | bhenry: Whatcha need? |
| 11:06 | kjeldahl | Eh? |
| 11:06 | chouser | AWizzArd: hm, good point. I wasn't even thinking of half of those. I was referring mostly to the ant->maven switch and then the recent splitting |
| 11:06 | sdeobald | Raynes: Just woke up and saw that -- thanks. |
| 11:07 | bhenry | kjeldahl i think it means for every time body is executed the previous results of body are ignored/unavailable/garbage collected. |
| 11:07 | Raynes | kjeldahl: If you hold onto the head of a sequence, it keeps it from being garbage collected. |
| 11:07 | chouser | kjeldahl: if any part of the code keeps a reference to the head of a seq while something else walks it, all of the values of the seq from the head to the current walk position will be kept in memory |
| 11:08 | bhenry | rubylearning.org isn't working for me. i had just made a double post, and i'm wondering if my "Hour to edit" timeframe will expire before the site comes back up |
| 11:08 | Raynes | bhenry: It appears to be working for me. |
| 11:08 | Raynes | $ping rubylearning.org |
| 11:08 | chouser | kjeldahl: the docs for doseq are simply saying it will not kee a reference to the head, in contrast with for example doall. |
| 11:08 | sexpbot | Raynes: Ping completed in 0 seconds. |
| 11:10 | Raynes | bhenry: I'm not sure if I can delete your second post or not, but I'll check if you want. |
| 11:11 | apgwoz | does anyone know when an agenda for clojure conj is likely to be released? |
| 11:12 | bhenry | i can ping it, but it just hangs. it might be my computer now that i see hwo wacky my chat client is. |
| 11:12 | bhenry | Raynes: the first one needs to be deleted |
| 11:12 | bhenry | i'm going to restart, it may be my computer |
| 11:12 | Raynes | bhenry: Is that the shorter or the longer one? |
| 11:12 | bhenry | i didn't think the first one went through and added things. so the shorter one should be deleted |
| 11:13 | Raynes | Ah, yes. |
| 11:13 | Raynes | Deleted. |
| 11:13 | chouser | apgwoz: I've heard rumors the topics are picked. I don't know if timing or order has been. All that suggests "pretty soon" to me, but ... *shrug* |
| 11:13 | bhenry | thanks! |
| 11:13 | jfields | I need to send a snapshot request for data. If anyone requests that data before the snapshot returns I want to wait for 30 seconds and then throw an exception. I know how to do this with latches, but what's the clojure way you'd go about this? |
| 11:14 | jfields | (I only throw the exception if the response isn't returned within the 30 seconds) |
| 11:16 | chouser | jfields: clojure's reference types aren't really for workflow tasks. what you want to do may be best handled (currently, anyway) with java.utils.concurrent stuff |
| 11:17 | kjeldahl | bhenry/chouser: Thanks. I'm struggling with a NPE in after a doseq finishes... |
| 11:17 | kjeldahl | bhenry chouser: Thanks. I'm struggling with a NPE in after a doseq finishes... |
| 11:17 | sdeobald | jfields: oh, hi. |
| 11:18 | jfields | chouser, cool. thanks |
| 11:18 | jfields | sdeobald, hello. |
| 11:18 | chouser | kjeldahl: doseq does return nil, so be careful how you use that return value. |
| 11:18 | sdeobald | jfields: I hope you're having a beautiful day at work! Say hello to the good people there for me. And give Nate a kiss. |
| 11:19 | kjeldahl | chouser: Thanks. I don't use it though. It's inside a normal sequence of forms. |
| 11:20 | jfields | sdeobald, will do. |
| 11:20 | kjeldahl | chouser: Runs one time through (there's one item in the sequence I'm processing) - all the way through, and crashes with NPE when done. |
| 11:20 | apgwoz | chouser: awesome! i look forward to it regardless, but in a discussion now with someone who doesn't wanna go without having some idea what's happening |
| 11:20 | chouser | kjeldahl: stack traces are usually quite helpful in tracking down NPEs |
| 11:21 | chouser | apgwoz: sure, I understand. |
| 11:21 | kjeldahl | chouser: Points to the innermost form (a logging statement). Replacing the logging statement with nil gives the same error though. |
| 11:21 | Raynes | I'm going just to meet chouser. <3 |
| 11:21 | chouser | apgwoz: of course, I would be at least as happy to go to a two-day event with all these people if there were no talks at all. |
| 11:22 | apgwoz | well, Raynes, I'm going to meet you |
| 11:22 | Raynes | Aw. <3 |
| 11:22 | chouser | heck, I'd go if we were all going to be working in a box factory for two days. |
| 11:22 | chouser | I'm going to meet _fogus_ |
| 11:23 | apgwoz | chouser: my thoughts exactly. i know for sure i'll obtain enough useful information just from talking to people to make it worth my companies dime :) |
| 11:23 | Raynes | I have never seen his face before. My motivation is slightly fueled by my curiosity. |
| 11:23 | chouser | Raynes: whose face? |
| 11:23 | Raynes | _fogus_: |
| 11:24 | apgwoz | chouser: fogus i'd guess |
| 11:24 | Raynes | Minus the colon. |
| 11:24 | apgwoz | the picture on his website is of him in a mask |
| 11:24 | chouser | ah. he's got pictures up if you look around. |
| 11:24 | apgwoz | who *is* michael fogus |
| 11:24 | chouser | of course that would ruin the surprise. |
| 11:24 | apgwoz | exactly |
| 11:24 | Raynes | Indeed. |
| 11:24 | chouser | well, you've seen the cover of the book, right? |
| 11:24 | apgwoz | is that fogus? |
| 11:25 | apgwoz | i didn't think he wore a top hat--just a mask |
| 11:26 | dpritchett | Did we ever find out who wrote the mystery foreword to JoC? |
| 11:27 | _fogus_ | I am wearing a top hat right now |
| 11:27 | Raynes | I'm wearing a fedora. And a _fogus_ mask. |
| 11:27 | chouser | dpritchett: I heard today he's got writer's block, so we may never know... |
| 11:28 | kjeldahl | Is there an implicit "do" in the true part of an if statement? |
| 11:28 | chouser | kjeldahl: no |
| 11:28 | apgwoz | no |
| 11:28 | qbg | I have a CMath protocol, and I want the methods be hinted with the Complex deftype, but I want to inline implement CMath in the definition of Complex. Is there any way to do this? |
| 11:28 | apgwoz | kjeldahl: if you don't require an else, use `when` |
| 11:28 | apgwoz | that *does* have an implicit `do` |
| 11:28 | qbg | I can only get it to work by defining the protocol after the type, and then use extend-type |
| 11:30 | chouser | Complex implements CMath? |
| 11:30 | qbg | Yes |
| 11:30 | chouser | then dpm you should probably hint CMath instead? |
| 11:31 | chouser | then don't you want to hint CMath instead? |
| 11:31 | qbg | I'm hinting the methods in the CMath protocol definition |
| 11:34 | qbg | Hmm... Now that I think about it, I don't think I need a protocol here, as I don't see any other type/record implementing CMath |
| 11:34 | chouser | but you can't defined new methods in a deftype, can you? |
| 11:34 | chouser | only implement existing ones from some interface |
| 11:35 | qbg | I could use ordinary fns instead |
| 11:35 | kjeldahl | apgwoz: Thanks for the when hint. Code worked fine with it. Now I need to retrace my steps to figure out why an if with a do only worked once before NPE. |
| 11:35 | chouser | oh. well, prefer that any time it makes sense. |
| 11:35 | qbg | I wonder how much slower that would be though |
| 11:36 | apgwoz | kjeldahl: no problem. |
| 11:36 | chouser | qbg: probably not at all. |
| 11:36 | qbg | I could also use ^:static in 1.3 |
| 11:36 | kjeldahl | As suspected; got confused with the parens again. A if - do works fine as long as I save on the parenthesis... :-) |
| 11:37 | chouser | qbg: if you use interop syntax to get at your deftype fields with no reflection and, right, :static fns |
| 11:37 | qbg | Naturally |
| 11:38 | Raynes | apgwoz: You have a severely intimidating last name. |
| 11:38 | apgwoz | Raynes: hahahaha. yes. |
| 11:38 | apgwoz | Guh-shev-itz, is how we pronounce it (gwozdziewycz for those that haven't bothered to look) |
| 11:39 | Raynes | Even Google said 'wut'. |
| 11:39 | apgwoz | (not that i expected *anyone* to look mind you) |
| 11:39 | apgwoz | Raynes: the great thing is that i'm the only Andrew Gwozdziewycz in the world. but *not* the only Andrew GwozdziewIcz |
| 11:39 | Raynes | Interesting. :o |
| 11:40 | apgwoz | but, that pronunciation is completely americanized, and Polish speakers always get upset with me |
| 11:49 | Raynes | apgwoz: At least you don't have a boring name. |
| 11:49 | apgwoz | Raynes: it does spark interesting (although also boring) conversation |
| 11:49 | chouser | so ... str-utils/partition is just completely gone now? |
| 11:50 | chouser | no string lib in contrib anymore and clojure.string doesn't have it. |
| 12:01 | hiredman | clojurebot: ping? |
| 12:01 | clojurebot | PONG! |
| 12:06 | ivey | Is there anything in contrib to turn an XML doc into a nested hash, without all the XML attr bits? |
| 12:07 | ivey | IE: taking an XML response from REST API and getting a hash that represents same data structure |
| 12:08 | chouser | tag names become map keys? |
| 12:09 | ivey | Yes |
| 12:10 | ivey | I have a first pass in my private utils repo but realized I may have duplicated effort |
| 12:10 | ivey | And have no idea |
| 12:10 | ivey | What to do with attrs vs text contents |
| 12:11 | Raynes | {:tag :attrs ... :contents ...}? |
| 12:14 | chouser | ivey: I'm not aware of such a thing |
| 12:14 | ivey | Cool. I'll clean mine up and add better tests. |
| 12:14 | chouser | ivey: you recursively convert the return value of xml/parse? |
| 12:15 | grignaak | ivey: attrs as meta-data ? |
| 12:15 | ivey | chouser: Correct, just pulling out the elements. |
| 12:15 | ivey | grignaak: Excellent. That's perfect. |
| 12:15 | chouser | grignaak: you're bound to lose data regardless if the input repeats tag names or such. |
| 12:16 | grignaak | true dat |
| 12:16 | grignaak | :( |
| 12:16 | ivey | repeated tag names turn into an array |
| 12:16 | chouser | vector I hope. :-) |
| 12:17 | ivey | Heh. My Ruby bias is showing. Indeed a vector. |
| 12:17 | amalloy | chouser: are repeated tag names allowed? i thought they weren't |
| 12:17 | amalloy | er, repeated attr names |
| 12:17 | chouser | amalloy: ah, no. But I was talking about tag names. |
| 12:31 | ivey | What's the best way to distribute a little util like that? Put it in my utils lib on GitHub/clojars |
| 12:32 | chouser | good question. interested in giving it to contrib? |
| 12:33 | ohpauleez | ... and the crowd chanted to give it to contrib |
| 12:33 | ohpauleez | :) |
| 12:34 | chouser | friction 1: in your own separate lib, who will find it? Will they want to depend on your whole lib? Which verision -- will you do releases? Can they copy and paste into their own code -- but what about license? |
| 12:35 | chouser | friction 2: in contrib as a non committer, you still need a CA. And now you need to get time from a contrib committer to do anything -- submit the original, fix a bug, add a feature, etc. |
| 12:35 | Raynes | Oops. |
| 12:36 | Raynes | I meant to kill the local -dev instance. >.> |
| 12:36 | ohpauleez | Mr Houser is raising all the best points... The crowd goes wild and cheers for more |
| 12:36 | ivey | contrib sounds perfect |
| 12:36 | ohpauleez | I'm turning #clojure into an adventure game |
| 12:36 | chouser | friction 3: being a contrib committer is the least friction ...except I don't know what the process is to become one, so that itself is friction. |
| 12:37 | Raynes | java.lang.IllegalArgumentException: No matching method found: clojure.core/nanoTime |
| 12:37 | Raynes | wut |
| 12:37 | ohpauleez | Contrib has won, the day is saved |
| 12:38 | chouser | of course regardless of how your code gets into contrib, it's at the mercy of all other contrib committers and may disappear or grow a new bug at any moment. :-) |
| 12:38 | ivey | That's what makes it fun |
| 12:38 | Raynes | What is clojure.core/nanoTime? |
| 12:38 | Raynes | It doesn't appear to exist. |
| 12:39 | chouser | Raynes: what's trying to use it? |
| 12:39 | Raynes | time |
| 12:39 | chouser | It's System/nanoTime |
| 12:40 | chouser | clojure.core/time is still using the old interop syntax. |
| 12:40 | scottj | Added arg list highlighting (ala slime w/ common lisp or eldoc) to swank-clojure last night: http://github.com/scottjad/swank-clojure/commit/2b8f6052552c062b7b42b655c46713d963374340 |
| 12:40 | Raynes | I just looked at the macro expansion. |
| 12:40 | chouser | System/nanoTime === (. System (nanoTime)) |
| 12:40 | Raynes | (. java.lang.System (clojure.core/nanoTime)) |
| 12:40 | chouser | heh, yeah -- the compiler ignores the namespace (if any) of the method name |
| 12:41 | Raynes | How odd... |
| 12:41 | Raynes | Must be a clj-sandbox bug. |
| 12:41 | Raynes | :\ |
| 12:42 | Raynes | I'm starting to consider just stealing clojurebot's sandbox. |
| 12:42 | Raynes | At least for now. |
| 12:53 | amalloy | scottj: what are the chances of getting slime to recognize (apply inc |) and supply the parameters for inc instead of apply? |
| 12:55 | scottj | amalloy: hmm, I think it would be pretty easy |
| 12:55 | amalloy | cause it seems like that would be super-useful and nobody ever forgets the arguments to apply :) |
| 12:56 | scottj | well I'd have it still show args to apply when cursor is on apply |
| 12:59 | amalloy | sure of course |
| 13:07 | scottj | hmm, eldoc doesn't do that. does CL? |
| 13:13 | amalloy | yes |
| 13:14 | amalloy | M-x slime |
| 13:14 | amalloy | (apply 1+ | |
| 13:14 | amalloy | (1+ arg0) |
| 13:16 | Raynes | -> (time (range 1 10000)) |
| 13:16 | sexpbot | => "Elapsed time: 0.934 msecs" (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 ... http://gist.github.com/ |
| 13:17 | Raynes | Yes, yes. LauJensen will be pleased. |
| 13:17 | Raynes | Also, failgist... |
| 13:17 | Raynes | It shouldn't even try to gist something that large. |
| 13:18 | scottj | interesting, arglists and C-c C-d C-d appears broken for functions with =. not= actually shows for not, >= for > |
| 13:18 | amalloy | Raynes: very cool |
| 13:19 | Raynes | Actually, it doesn't seem to do that every time. |
| 13:19 | Raynes | -> (time (range 1 10000)) |
| 13:19 | sexpbot | => "Elapsed time: 0.858 msecs" (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 ... |
| 13:19 | Raynes | Weird! |
| 13:19 | Raynes | Only did it that one time. |
| 13:19 | Raynes | Moving on. |
| 13:29 | amalloy | anyone know how to get emacs to interact with the x copy/paste buffer? |
| 13:30 | amalloy | it's kinda a pain to mark with the keyboard and have to use the menubar to copy |
| 13:30 | scottj | maybe (setq x-select-enable-clipboard t) |
| 13:32 | chouser | "*p in vim :-) |
| 13:34 | amalloy | aha |
| 13:35 | amalloy | lovely. thanks scottj |
| 13:35 | amalloy | i wonder how it interacts with multiple entries in the kill buffer/ring/whatever it is |
| 13:40 | LauJensen | Raynes: Well done old friend :) |
| 13:41 | Raynes | LauJensen: Had to fix a bug in clj-sandbox to get there. :p |
| 13:42 | bhenry | any solid emacs configs for clojure code folding? |
| 13:43 | LauJensen | Hmmm, I had that a one point, forgot how though |
| 13:43 | LauJensen | And, didn't use it enough to keep it |
| 13:46 | bhenry | ideally the clickable area would be on the first line in the top level form. theoretically every line within the form after that should be indented. i'd like my emacs to have a bunch of lines like this: [+] (defn some-func …). then i can click on the plus to expand or collapse the forms i want to see or hide respectively. |
| 13:52 | jjido | ,(doc deliver) |
| 13:52 | clojurebot | "([promise val]); Alpha - subject to change. Delivers the supplied value to the promise, releasing any pending derefs. A subsequent call to deliver on a promise will throw an exception." |
| 13:54 | amalloy | is clojure-bot clever enough to give up on @(promise)? |
| 13:54 | Raynes | Yes. |
| 13:55 | amalloy | woo go clojurebot. i always want to try breaking him, without the risk of actually breaking him. how can i get a local copy going? |
| 13:56 | Raynes | Uh, very, very carefully. It's a little tricky. |
| 13:56 | jjido | amalloy: you like to torture little animals? |
| 13:56 | jjido | ;) |
| 13:57 | Raynes | -> @(promise) |
| 13:57 | sexpbot | Execution Timed Out! |
| 13:57 | Raynes | amalloy: You'd never break either of the bots with any sort of time thing. They both timeout. |
| 13:58 | Raynes | I doubt you'll break anyone's heart if you actually do manage to break it. |
| 13:59 | Raynes | At least, nobody has given sexpbot the courtesy of not breaking the running copy. ;) |
| 14:00 | Raynes | Especially _ato. He's *destroyed* sexpbot's security measures on a few occasions. <3 |
| 14:00 | jjido | is it bad to use (future) even if I don't care about the return value? (doing deliver) |
| 14:01 | Raynes | The only time using future instead of starting a thread has ever bit me is when an exception was thrown and I never got to see it because I never tried to get it's return value. |
| 14:02 | LauJensen | jjido: future is fine if you dont care about the return |
| 14:02 | Raynes | Except if an exception is thrown. |
| 14:02 | jjido | I will resolve the promise anyway, and deliver is the last peration |
| 14:03 | jjido | operation in the task |
| 14:05 | dpritchett | I just noticed that node.js surpassed clojure on Google Trends for the first time at the end of August thanks to Node Knockout. I wonder if Clojure could have its own similar competition? |
| 14:05 | dpritchett | http://www.google.com/trends?q=node.js,+clojure&ctab=0&geo=all&date=mtd&sort=0 |
| 14:05 | ohpauleez | How do you type hint a ref? I'm going to guess ^IRef |
| 14:06 | LauJensen | dpritchett: Good idea |
| 14:06 | ohpauleez | I also like that idea |
| 14:06 | dpritchett | Node Knockout seems to have been partially sponsored by Joyent, the employer of Node's creator Ryan Dahl. |
| 14:07 | ivey | Ry is such a cool dude |
| 14:07 | ivey | Worked with him on merb. He used to have a blog that was all little comics he drew about his day |
| 14:08 | LauJensen | Feb10 was good, http://www.statsaholic.com/scala-lang.org+bestinclass.dk+clojure.org :) |
| 14:09 | jjido | how do I get the promise value |
| 14:10 | jjido | I forgot |
| 14:10 | dpritchett | What was your biggest article in February, the Reddit clone or the language roundup? |
| 14:10 | LauJensen | Hmm, dont recall |
| 14:11 | amalloy | jjido: @promise-ref |
| 14:11 | dpritchett | What would we need infrastructure wise to put on a No.de -style competition? Heroku-style Clojure hosting seems like it would be a huge step forward for rapid prototyping and for adoption. |
| 14:12 | jjido | amalloy: clojure.core$promise cannot be cast to clojure.lang.IDeref |
| 14:12 | amalloy | works for me |
| 14:13 | amalloy | ,(let [x (promise)] (deliver x 10) x) |
| 14:13 | clojurebot | #<core$promise$reify__5534@15e909c: 10> |
| 14:13 | chouser | dpritchett: I was pondering yesterday if it would be possible to build something like that on top of google app engine. |
| 14:13 | amalloy | ,(let [x (promise)] (deliver x 10) @x) |
| 14:13 | clojurebot | 10 |
| 14:14 | chouser | ohpauleez: what Java method of a ref are you calling directly? |
| 14:14 | amalloy | jjido: you seem to have typed @promise |
| 14:14 | amalloy | that derefs the *function* promise, not the specific promise instance you created |
| 14:14 | ohpauleez | I'm passing in a ref that is alter'd |
| 14:15 | ohpauleez | intended to be done in a dosync, obv |
| 14:15 | ohpauleez | chouser: ^ |
| 14:15 | chouser | but if you don't call a java method of it directly, you shouldn't need to hint |
| 14:15 | dpritchett | VMForce claims to be a Java cloud. I don't know that it actually exists or if it would be as flexible as Heroku though. |
| 14:16 | chouser | @x is no faster if x is hinted than if it is not |
| 14:16 | ohpauleez | ah, ok |
| 14:16 | ohpauleez | if x is a ref to a PersistentQueue... ? |
| 14:17 | chouser | (pop @x) still has no reflection |
| 14:17 | ohpauleez | ahh, ok, thanks |
| 14:17 | ohpauleez | I've just been getting in the habit of typing for clarity sake |
| 14:18 | amalloy | ohpauleez: tried turning on warn-on-reflection and running your function? seems silly to type-hint before you find out what the reflection issues are |
| 14:18 | chouser | hints only help avoid reflection, and reflection is only used on a direct interop call (Foo. bar) or (.foo bar) or (Foo/foo bar) where the types of the args involved are in sufficient doubt at compile time. |
| 14:18 | ohpauleez | right |
| 14:19 | amalloy | chouser: really? the compiler can always figure out what's going on in the absence of interop? |
| 14:19 | chouser | well, yes. |
| 14:20 | chouser | until :static fns it never had to. |
| 14:20 | chouser | because fns are not overloaded on arg type |
| 14:21 | amalloy | i see. that makes sense |
| 14:22 | chouser | and now with :static fns it does have to know the types of the formal args when compiling a fn call, but there's still no type-based overloading so it can figure out what it needs to easily with no type hints. |
| 14:24 | chouser | and prototype fns are special and achieve nearly raw method call speeds with runtime call-site caching rather than type knowledge at compile time. |
| 14:24 | LauJensen | Does anyone here have a snippet of a simple override of TableCellRenderer for JTable ? |
| 14:24 | chouser | LauJensen: I think so, hang on |
| 14:24 | LauJensen | chouser: prototype fns? |
| 14:25 | chouser | LauJensen: sorry, protocol fns. the fns generated by defprotocol |
| 14:25 | LauJensen | Thought so, just wondering if you had sneaked some new feature in |
| 14:25 | LauJensen | chouser: btw, did you blog about call-site caching yet? |
| 14:27 | chouser | LauJensen: http://gist.github.com/582903 TableCellRenderer] |
| 14:27 | chouser | nope, haven't blogged about anything in a while. |
| 14:27 | chouser | should I blog about call-site caching? |
| 14:27 | LauJensen | chouser: thanks alot, exactly what I was looking for |
| 14:28 | LauJensen | chouser: Yea, we talked about it a month or so ago, perhaps 2. We both thought it was a good idea |
| 14:28 | chouser | heh. oh! |
| 14:30 | jjido | my Internet time finished. I will catch up later. |
| 14:31 | edbond | why (read-line) immediately return nil? |
| 14:35 | scottj | cause it doesn't work in slime |
| 14:57 | edbond | scottj: is it possible to make it works? |
| 15:00 | LauJensen | edbond: just eval your code in the *inferior-lisp* buffer |
| 15:13 | scottj | FYI *inferior-lisp* will only be there with slime project M-x thing not lein |
| 15:14 | LauJensen | yea, I typically start my coding with M-x swank-clojure-project |
| 15:15 | scottj | is swank-clojure-project deprecated? |
| 15:15 | Raynes | swank-clojure.el is deprecated. I'm not sure where swank-clojure-project went. |
| 15:16 | LauJensen | Raynes: It just moved to a new maintainer. Its not deprecated |
| 15:16 | Raynes | deprecated or just optional. Not sure. |
| 15:16 | Raynes | Shouldn't put the cart before the horse. |
| 15:16 | LauJensen | Its always been optional |
| 15:17 | Raynes | I remember talk on the swank-clojure mailing list where it was said that swank-clojure.el was no longer needed and such, so my first reaction was "deprecated". |
| 15:18 | LauJensen | well, if you want you can run lein swank && slime-connect instead, but you miss out on the inferior lisp buffer, which truely sucks |
| 15:18 | LauJensen | Besides, its a small patch to make swank-clojure.el work with the new lib/dev/* structure |
| 15:20 | Raynes | I've always did the former. |
| 15:20 | Raynes | Not sure why I would want the inferior lisp buffer. |
| 15:20 | LauJensen | So you go check a console everytime you need to see output/traces from a thread? |
| 15:21 | Raynes | Uh... huh? |
| 15:22 | LauJensen | In case you haven't noticed, output to *out* and stacktraces etc from threads will only appear in inferior-lisp, not slime-repl. So when you need that info, I would think that it sucks to go out to a shell to see it |
| 15:23 | LauJensen | I usually have left buffer: code, right top: inferior lisp, right bottom: slime-repl |
| 15:23 | Raynes | Could you show me an example? |
| 15:23 | LauJensen | At least when Im doing threaded stuff |
| 15:23 | LauJensen | ,(future (println "hi")) |
| 15:23 | clojurebot | #<core$future_call$reify__5492@1f16561: :pending> |
| 15:23 | LauJensen | That will print in inferior-lisp |
| 15:24 | LauJensen | And besides. Its great whenever you start hacking, just to open project.clj, hit M-x swank-clojure-project and off you go |
| 15:24 | Raynes | Fair enough. I've never noticed that before. |
| 15:24 | Raynes | I don't guess I've ever wanted output from threads before. |
| 15:25 | shoover | LauJensen: you know about slime-redirect-inferior-output? |
| 15:25 | scottj | the problem isn't seeing output, it's easy enough to have a term where you would otherwise have a buffer, the problem is with lein afaik if started with swank you can't give it input at the terminal, whereas you can type in *inferior-lisp*. this is needed in the case of read-line, swing stuff occassionally I think, and maybe other cases |
| 15:25 | LauJensen | shoover: nope |
| 15:25 | shoover | run it, and you won't need to look in inferior-lisp |
| 15:25 | Raynes | Oh cool. |
| 15:25 | LauJensen | scottj: good point about input |
| 15:26 | shoover | but I can't figure out how to get the same behavior with lein swank, it only works with inferior-lisp |
| 15:26 | LauJensen | shoover: cool |
| 15:26 | shoover | so it still supports swank-clojure-project :) |
| 15:27 | apgwoz | anyone using ant for builds and using emacs? |
| 15:27 | Raynes | The latter. |
| 15:27 | LauJensen | apgwoz: of course not, we're all rational people here :) |
| 15:27 | Raynes | (: |
| 15:28 | apgwoz | LauJensen: my company uses ant and java (no clojure -- yet). |
| 15:28 | LauJensen | ant and maven are invented by dentists |
| 15:28 | apgwoz | anyway, point being, i wrote some wrappers for ant around compilation mode that might be helpful to folks |
| 15:28 | shoover | LauJensen: however, I recently saw some interesting elisp to launch lein swank within emacs, which would retain the ability to just switch buffers and see the output |
| 15:28 | clojurebot | emacs is best configured for Clojure with instructions at http://technomancy.us/126 |
| 15:29 | LauJensen | shoover: whats the point when we have swank-clojure-project? |
| 15:29 | LauJensen | except having less stuff to maintain |
| 15:29 | apgwoz | shoover: i saw that as well, but haven't yet integrated it |
| 15:29 | LauJensen | but elisp just sits there |
| 15:29 | shoover | LauJensen: right |
| 15:37 | shoover | LauJensen: I can think of one advantage, and that's if you hook up the lein run plugin to launch the swank server and run some initialization code (start a jetty server, etc). This lein elisp code I saw could easily run that, whereas I'm not sure how you would inject all that behavior with swank-clojure-project |
| 15:46 | shoover | Whenever I lose my connection I end up getting a different nick, and then I can't change my nick without leaving the channel. What am I doing wrong?! |
| 15:52 | hiredman | #clojure has some dumb mode set on the channel so you cannnot change nicks while in it |
| 15:53 | Raynes | I know. |
| 15:53 | Raynes | It's horrible. |
| 15:53 | technomancy | shoover: you can register your fallback nick. I agree it's very annoying. |
| 15:53 | Raynes | :( |
| 15:53 | Raynes | #concatenative has the same thing set, so if I accidentally join without identifying, I have to leave both channels. |
| 15:58 | Chousuke | you don't need to actually register two nicknames, you can link an alt to the existing registration |
| 15:59 | sthuebner | Chousuke: how would you do that? |
| 15:59 | Chousuke | /msg nickserv help :) |
| 15:59 | chouser | hiredman: can we turn off that mode? |
| 15:59 | chouser | I don't remember having any real problems with spam or anything before it was changed for us |
| 16:00 | sthuebner | Chousuke: ah, nickserver! never mind |
| 16:01 | hiredman | chouser: no idea |
| 16:03 | technomancy | what's the status on ticket #315? |
| 16:03 | technomancy | would really love to see that applied so everyone could reduce AOT usage |
| 16:03 | technomancy | considering it's a patch to clojure.main submitted by the author of clojure.main it seems like a no-brainer. |
| 16:05 | lpetit | ticket 322 is important too, regarding AOT compilation |
| 16:06 | cemerick | lpetit: I saw you're now a speaker at the conj, congrats! :-) |
| 16:08 | lpetit | cemerick: yeah, thanks, it's so impressive that I kind of haven't totally realized yet the chance I have ! |
| 16:08 | cemerick | technomancy: I'm mostly hoping all of them will be :-) |
| 16:09 | technomancy | well... I only have time to prepare one talk. =) |
| 16:09 | technomancy | but I'd love to hear three apiece from everyone else |
| 16:09 | lpetit | indedd ticket 315 seems both interesting and low hanging fruit |
| 16:09 | lpetit | so do I ! |
| 16:10 | chouser | technomancy: heh |
| 16:11 | chouser | I'm already doing a different one for Strange Loop. |
| 16:12 | lpetit | Soo many different "command line/project management" tools for clojure : maven, ant, cake, cljr, lein, gradle, polyglot maven ! What a hell for a poor IDE dev ! |
| 16:13 | cemerick | lpetit: some very wise bets will have to be made |
| 16:13 | lpetit | cemerick: :-/ |
| 16:13 | lpetit | cemerick: talking about IDE features ... :-) |
| 16:14 | lpetit | cemerick: PING ! |
| 16:14 | cemerick | hah |
| 16:14 | cemerick | Patience, patience :-) |
| 16:14 | cemerick | It's been a busy couple of weeks |
| 16:14 | _fogus_ | technomancy: 3!?! |
| 16:16 | technomancy | _fogus_: oh right; only 2 abstracts were required. I had a third, so I threw it in there. |
| 16:17 | cemerick | _fogus_: I'd happily do 3. Hoping to, actually. |
| 16:17 | cemerick | The fourth I'm not so excited about, but it's a common pain/interest point. |
| 16:17 | Raynes | technomancy: Is 315 the one about adding a way for clojure.main to execute a -main function in a provided namespace to avoid AOT compilation just for executable jars? |
| 16:17 | Raynes | I was highly disappointed that that one didn't make it into 1.2 |
| 16:17 | technomancy | Raynes: yeah |
| 16:18 | _fogus_ | I could talk about the 2 that I submitted, but for the 3rd I'd have to pull out contracts or something more exciting, like my cats |
| 16:19 | Chouser1 | Hello? |
| 16:19 | clojurebot | BUENOS DING DONG DIDDLY DIOS, fRaUline Chouser1 |
| 16:19 | Raynes | o.o |
| 16:19 | Chouser1 | I'm not a girl! |
| 16:20 | nakkaya22223333 | testing |
| 16:20 | jjido | Hello? |
| 16:20 | clojurebot | BUENOS DING DONG DIDDLY DIOS, fRaUline jjido |
| 16:20 | jjido | lol |
| 16:20 | @chouser | ok, we'll try that for a while. |
| 16:21 | shoover | chouser: on behalf of users of finicky ISPs and freenode servers everywhere, thank you |
| 16:21 | @chouser | shoover: :-) |
| 16:22 | @chouser | shoover: sorry about the twitter search brokenness, too. Afraid I don't know how to proceed on that one. |
| 16:22 | shoover | chouser: not your problem. I've filed multiple bug reports to no avail |
| 16:22 | chouser | why should they care, after all. You're only a user, not a customer. |
| 16:22 | jjido | ,(let [x promise] (future (apply (partial deliver x) 3)) @x) |
| 16:22 | clojurebot | java.lang.ClassCastException: clojure.core$promise cannot be cast to clojure.lang.IDeref |
| 16:22 | jjido | why? |
| 16:22 | clojurebot | why not? |
| 16:23 | chouser | (promise) not promise |
| 16:23 | jjido | aaah |
| 16:24 | shoover | chouser: according to al3x, they have ample resources now, so I'll expect a fix any day now |
| 16:24 | jjido | ,(let [x (promise)] (future (apply (partial deliver x) 3)) @x) |
| 16:24 | chouser | heh |
| 16:24 | clojurebot | Execution Timed Out |
| 16:24 | chouser | [3] not 3 |
| 16:24 | jjido | ,(let [x (promise)] (future (apply (partial deliver x) [3])) @x) |
| 16:24 | clojurebot | 3 |
| 16:25 | Raynes | -> (let [x (promise)] (future (apply (partial deliver x) [3])) @x) |
| 16:25 | sexpbot | java.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/future-call) |
| 16:25 | Raynes | Doh |
| 16:26 | Raynes | -> (let [x (promise)] (future (apply (partial deliver x) [3])) @x) |
| 16:26 | sexpbot | => 3 |
| 16:26 | Raynes | That's more like it. |
| 16:27 | jjido | what did you do? |
| 16:27 | LauJensen | shoover: Pretty simple to make swank-clojure-project eval your core.clj or something like that, if you want to boot a jetty |
| 16:27 | dnolen | ,(let [x (promise) y (promise)] (future (doall (map deliver [x y] [3 4]))) (+ @x @y)) |
| 16:27 | clojurebot | 7 |
| 16:27 | Raynes | I committed a fix and then used various bot commands to pull the git repo on my VPS and reload the plugins so that the commit would take effect. |
| 16:28 | Raynes | Well, two bot commands. |
| 16:28 | jjido | Raynes: funny you can do that in so less time |
| 16:28 | nakkaya22223333 | testing |
| 16:28 | jjido | memo: when you do CPS, don't forget trampoline in the parallel threads. |
| 16:28 | Raynes | It's a pretty fast process. I already had the relevant file open in Emacs, and with magit, committing and pushing was a breeze. |
| 16:29 | jjdkdk | hello |
| 16:29 | jjido | jjdkdk: are we related? |
| 16:29 | nakkaya22223333 | still |
| 16:30 | jjdkdk | jjido: nah, just random |
| 16:30 | Raynes | ~max |
| 16:30 | clojurebot | max people is 313 |
| 16:30 | Raynes | Whoa. |
| 16:31 | jjido | not far |
| 16:31 | jjido | Raynes: is that the upper limit? |
| 16:31 | Raynes | Yes. |
| 16:31 | nakkaya22223333 | still testing |
| 16:32 | Raynes | nakkaya22223333: What exactly are you testing? |
| 16:32 | Raynes | My patience? :p |
| 16:32 | nakkaya22223333 | http://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/ |
| 16:32 | Raynes | I should really do something like that with Irclj as an example. |
| 16:33 | nakkaya22223333 | from slime repl, sorry Raynes |
| 16:33 | jjido | ,(Integer/parseInt nil) |
| 16:33 | clojurebot | java.lang.NumberFormatException: null |
| 16:33 | Raynes | nakkaya22223333: It's cool. <3 |
| 16:33 | jjido | is there apply-if-not-nil? |
| 16:35 | nakkaya22223333 | works good once I figured out that sending a message is actually a privmsg to #clojure with a : in front of the text |
| 16:35 | nakkaya22223333 | and that my message doesn't show in swank |
| 16:35 | jjido | ,(Integer/parseInt (or nil "5")) |
| 16:35 | clojurebot | 5 |
| 16:37 | nakkaya22223333 | later, thanks |
| 16:39 | Raynes | jjido: Also, see clojure.contrib.core/-?>> |
| 16:39 | jjido | ,(-?>> Integer/parseInt (nil)) |
| 16:39 | clojurebot | java.lang.Exception: Unable to resolve symbol: -?>> in this context |
| 16:41 | Raynes | -> (clojure.contrib.core/-?>> nil Integer/parseInt) |
| 16:41 | sexpbot | => nil |
| 16:44 | lancepantz | we've got our first los angeles clojure meetup tonight if anyone is in the area http://bit.ly/9F9DJp |
| 16:45 | Raynes | lancepantz: Sure, I'm only like on the other side of the country. ;) |
| 16:53 | jjido | Could someone try that code on a big vector of unsorted numbers? http://pastebin.ca/1942389 |
| 16:53 | jjido | if you have several cores |
| 16:54 | jjido | it takes a number, 0, 1, 2... default 5 |
| 16:59 | dnolen | for $0.68 an hour you can also try it yrself on an 8-core box on Amazon EC2 ;) |
| 16:59 | dnolen | jjido: ^ |
| 17:00 | jjido | dnolen: ok ;) |
| 17:01 | LauJensen | Good night Clojure, whereever you are |
| 17:02 | grignaak | dnolen: you can get boxes that are $0.02/per hour new |
| 17:02 | lancepantz | an 8 core one? |
| 17:03 | lancepantz | or are you talking about the micro instances |
| 17:05 | jjido | the built-in sort function is almost 10x faster on my computer, and using 2 threads does not help :( |
| 17:07 | tomoj | jjido: the built-in uses java.util.Arrays/sort |
| 17:07 | tomoj | so don't feel bad |
| 17:15 | jjido | tomoj: I threw in more iteration and I look better (2.5 times slower) |
| 17:18 | jjido | is there a built-in (fn [_] nil)? |
| 17:19 | tomoj | well.. (constantly nil) |
| 17:19 | lpetit | ,(clojure-version) |
| 17:19 | clojurebot | "1.2.0-master-SNAPSHOT" |
| 17:19 | lpetit | clojurebot still SNAPSHOT 1.2 ? |
| 17:19 | Raynes | -> (clojure-version) |
| 17:19 | sexpbot | => "1.2.0" |
| 17:20 | jjido | thanks tomoj |
| 17:20 | lpetit | Raynes: thx |
| 17:21 | jjido | it is not faster than identity, I wondered |
| 17:26 | alpheus | I just registered for the clojure-conj |
| 17:32 | jjido | I am on a Core2 Duo Mac. When I run the linear version I see both cores taken up |
| 17:32 | jjido | is that magic? |
| 17:48 | ohpauleez | is it poor style to use ^{} to tag your return value with metadata? |
| 17:49 | ohpauleez | should (with-meta) be preferred? |
| 17:49 | ohpauleez | jjido: The JVM will consume both cores (I believe) |
| 17:50 | jjido | ohpauleez: I see, the JIT does that? |
| 17:50 | ohpauleez | I believe so, but don't quote me on that |
| 17:52 | hiredman | ^{} tags the form read in with metadata |
| 17:53 | hiredman | if the return value is not the result of the reader reading, but the result of a function call you must use with-meta |
| 17:56 | jjido | ohpauleez: yep, with -Xint the parallel version is 2x faster than the linear one |
| 17:57 | ohpauleez | hiredman: thanks man |
| 18:10 | arkh | When I run (println ((clojure.java.shell/sh "ls") :out)) from a clj file calling clojure.main, the program hangs. Any idea what's blocking? The same works fine from a repl. |
| 18:14 | peepz | hello everyone |
| 18:14 | peepz | I am new to clojure and I have a few problems when I try to use PI: java.lang.Exception: Unable to resolve symbol: pi in this context (NO_SOURCE_FILE:1) |
| 18:14 | peepz | anyone know what I am doing wrong? |
| 18:14 | dnolen | ,Math/PI |
| 18:14 | clojurebot | 3.141592653589793 |
| 18:15 | dnolen | ,(+ 1 Math/PI) |
| 18:15 | clojurebot | 4.141592653589793 |
| 18:15 | peepz | dnolen: looks good my friend, now how do I do it on my machine ? |
| 18:15 | dnolen | peepz: copy and paste? :) |
| 18:15 | peepz | well, what I am trying to run is: (time (doall (map pi '(200000 200000)))) |
| 18:16 | ohpauleez | peepz: that 'pi' needs to be 'Math/PI' |
| 18:16 | tomoj | uhh.. no |
| 18:16 | ohpauleez | but also, you can't do that |
| 18:16 | dnolen | peepz: PI isn't a function, it's a constant, what are you trying todo there. |
| 18:16 | dnolen | ? |
| 18:17 | peepz | I found that code online and it works on other machines. |
| 18:17 | Raynes | No it doesn't. Not unless pi is defined as a function. |
| 18:17 | peepz | ok ..sorry |
| 18:17 | peepz | how do I make sure I have contrib loaded correcly? |
| 18:17 | dnolen | peepz: perhaps because the code you found defines pi as a function of some sort. |
| 18:17 | jjido | arkh: maybe you need (shutdown-agents)? |
| 18:18 | peepz | dnolen: : ok |
| 18:18 | dnolen | peepz: try (require '[clojure.contrib.repl-utils :as repl-utils]) or something similar. |
| 18:18 | arkh | jjido: thanks - checking |
| 18:18 | ohpauleez | jjido: arkh does the shell stuff use agents? |
| 18:18 | peepz | dnolen: output: nil |
| 18:18 | dnolen | peepz: that's what you want to see. |
| 18:18 | arkh | (shutdown-agents) is what I needed. Weird. |
| 18:18 | peepz | so im good? |
| 18:19 | dnolen | peepz: yes, you'll get an exception if something went wrong. |
| 18:19 | ohpauleez | peepz: you should look at and play with http://github.com/relevance/labrepl |
| 18:19 | peepz | dnolen: ok thanks for all the help and thanks for a great channel.. I might hang out here for a while while I learn this:) |
| 18:19 | ohpauleez | arkh: weird, that means the shell stuff is using an agent |
| 18:19 | sthuebner | it seems, I cannot redefine a dispatch-fn on a multimethod. whatever I try, the original one sticks to the method. my fault? |
| 18:19 | dnolen | peepz: try this, (repl-utils/source map) |
| 18:20 | peepz | dnolen: I am planning to to this tutorial: http://java.ociweb.com/mark/clojure/article.html .... do you have anything you would recommend to a beginner that wants to learn clojure? |
| 18:20 | peepz | dnolen: it returned a lazy sequence of some sort. |
| 18:21 | arkh | the source here just shows it using futures, no other threading: http://bit.ly/aXsmzV |
| 18:21 | jjido | ohpauleez: if I was to write the shell stuff I would use an agent too (though Clojure should not require shutdown-agents by default IMHO) |
| 18:21 | ohpauleez | jjido: totally, I agree with that. I also think it shouldn't require the shutdown |
| 18:22 | raek | sthuebner: you need to unmap the old var manually. since 1.2, defmulti has defonce semantics |
| 18:22 | raek | since when you used to redefine a multi method, all the previous implementations are gone |
| 18:22 | arkh | ahhh ... (future) uses clojure.lang.Agent |
| 18:23 | jjido | arkh: yes |
| 18:23 | raek | ...which used to be a bigger pain that having to manually unmap the old multimethod |
| 18:23 | raek | sthuebner: (ns-unmap 'foo.bar.my.namespace 'my-multimethod) |
| 18:24 | ohpauleez | jjido: I might also use futures, and deref them |
| 18:24 | sthuebner | raek: OK I see. this unmaps the whole multimethod |
| 18:24 | sthuebner | ? |
| 18:24 | raek | yes |
| 18:24 | raek | you need to re-evaluate all the defmethod forms |
| 18:24 | sthuebner | sure |
| 18:24 | ohpauleez | arkh: Are you using agents somewhere else in your code? |
| 18:25 | arkh | I'm not - only thing in the .clj file is (println ((clojure.java.shell/sh "ls") :out)) |
| 18:26 | ohpauleez | so weird, you shouldn't have to do that call |
| 18:27 | arkh | it makes me wonder if threads are going to hang out there, e.g. if I call (sh) 5000 times, is it going to leak memory etc.? |
| 18:27 | ohpauleez | instead of printing right away, putting it in a let and printing that |
| 18:27 | arkh | well ... I guess it would leak after the first time if that were the case ... |
| 18:27 | ohpauleez | and see if it hangs |
| 18:27 | arkh | k |
| 18:28 | peepz | for the people that code in bash, what editor do you use for clojure? |
| 18:28 | jjido | peepz: I like that tutorial |
| 18:29 | peepz | jjido: ya? i will go with it then..thanks! |
| 18:29 | arkh | this still hangs (let [s (clojure.java.shell/sh "ls")] (prn s)) |
| 18:29 | peepz | is clojure used in android applications? |
| 18:30 | arkh | peepz: there's some runtime problems when running clojure against dalvik (what android uses as a virtual machine) |
| 18:30 | dnolen | peepz: there's also some good books out now - Programming Clojure, Joy of Clojure, Clojure in Action. If you're a bash user, people seem to like VimClojure |
| 18:30 | ohpauleez | arkh: hmm, let me play around |
| 18:30 | peepz | ok thanks ill get that. |
| 18:32 | arkh | I have to go - have a good night/morning/afternoon all |
| 18:33 | peepz | u too thanks |
| 18:35 | ohpauleez | peepz: most editors have good support, so use whatever you're most comfortable with. A few of us use VimClojure. I think more of the community uses Emacs |
| 18:35 | ohpauleez | but someone in here or in the Google Group will be able to help out with editor configuration issues |
| 18:37 | peepz | ohpauleez: : thanks!!! |
| 18:37 | peepz | ohpauleez: I will hold of with setting up vimclojure until I have my first script coded and working |
| 18:39 | jjido | if I have two promises p and q, can I tell Clojure to hold on realising either until both are informed? |
| 18:40 | raek | don't think so... maybe some other construct is a better fit |
| 18:40 | raek | like BlockingQueue |
| 18:40 | peepz | I currently run clojure using this command: I want to load both jar files at launch: java -cp /usr/share/java/clojure.jar:clojure-contrib.jar clojure.main $1 |
| 18:41 | peepz | how do I run that command and also execute a script with parameters? assume the function takes 1 parameter and is called namer |
| 18:41 | jjido | peepz: Windows? |
| 18:41 | peepz | ubuntu bash |
| 18:42 | raek | peepz: I guess you have alread heard this, but it tends to be easier to use a build tool (leiningen, cljr, cake) to start clojure with the correct classpath |
| 18:42 | peepz | raek: is that for ubuntu? |
| 18:42 | raek | all those work for ubuntu |
| 18:42 | peepz | hmm... ok..which one should I install/start of with? |
| 18:43 | raek | leiningen and cake are project based (essential if your program is larger than one file), and cljr is a simple way to just start a repl |
| 18:43 | peepz | cljr it is! |
| 18:43 | raek | cljr makes clojure work much like python and ruby |
| 18:44 | dnolen | jjido: ? Clojure doesn't try to realize the value of promises, it just blocks until the values are delivered. You might want to try delay, dereferencing a delay will force the computation. |
| 18:44 | raek | you can install libraries in the system and start a repl that can use all those |
| 18:44 | peepz | but I think I got the classpaths right already? how canI check in repl? |
| 18:44 | raek | in the poject based approach, all projects can have their own set of dependencies (and versions of them!) independently |
| 18:45 | raek | peepz: are the clojure and contrib jars in the same directory? |
| 18:45 | peepz | yes |
| 18:45 | raek | peepz: (println (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader)))) |
| 18:45 | peepz | nil |
| 18:46 | raek | then it should be "java -cp '/usr/share/java/clojure.jar:/usr/share/java/clojure-contrib.jar' clojure.main" |
| 18:46 | peepz | so the output nil means its not working? |
| 18:47 | raek | ah, are you using slime and emacs, or some other editor-repl thingy= |
| 18:47 | raek | try just (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))) |
| 18:47 | jjido | dnolen: but if p is delivered, it is dereferenced in the waiting thread right? Then q blocks until it is delivered |
| 18:47 | raek | your *out* might be connected to the wrong terminal |
| 18:48 | raek | println always return nil |
| 18:49 | raek | peepz: {:cljr "http://github.com/liebke/cljr", :leiningen "http://github.com/technomancy/leiningen", :cake "http://github.com/ninjudd/cake"} |
| 18:49 | kjeldahl | Ready for a clojure quiz? ;-) How to make ([1 9] [1 8] [2 7] [1 6] [2 6) => ([1 9] [2 7]) . Basically, extract only the first vector in a sorted list based on the first number in the vector. |
| 18:50 | jjido | dnolen: mmh I suppose a promise is ever delivered only once. |
| 18:52 | peepz | raek: i got this output: (#<URL file:/usr/share/java/clojure-1.0.0.jar> #<URL file:/usr/share/java/clojure-contrib.jar>) |
| 18:53 | raek | jjido: you could try to invert the situation and use *one* BlockingQueue that the two threads put objects into. a thread that tries to take an object from it will block until someone puts an object into it |
| 18:54 | raek | peepz: looks like clojure and clojure.contrib are good to go (assuming the filenames are correct) |
| 18:54 | peepz | ok great thanks! |
| 18:54 | clojurebot | () invokes the form inside, but there is an implied str call. The semantics are different inside the interpolated string, necessarily so. |
| 18:54 | grignaak | ,(seq (reduce (fn [m [a b]] (if (contains? m a) m (assoc m a b))) (sorted-map) [[1 2] [1 3] [2 4] [2 6]])) |
| 18:54 | clojurebot | ([1 2] [2 4]) |
| 18:54 | peepz | raek: now how do I run a clojure script? |
| 18:55 | kjeldahl | Thanks. |
| 18:55 | raek | peepz: it is described here: http://clojure.org/repl_and_main |
| 18:55 | peepz | got it thanks! |
| 18:56 | raek | looks like you only need to pass the script file after the "clojure.main" argument to java |
| 18:56 | kjeldahl | grignaak: Hm. You're changing the order aren't you. I need the items in the same order as in the original sequence. |
| 18:56 | raek | I dunno if that requires the script file in question to be on the class path too... |
| 18:57 | kjeldahl | ,(seq (reduce (fn [m [a b]] (if (contains? m a) m (assoc m a b))) (sorted-map) [[2 4] [1 3] [1 2] [2 6]])) |
| 18:57 | clojurebot | ([1 3] [2 4]) |
| 18:57 | raek | (the build tools simplify the classpath management very much) |
| 18:57 | grignaak | kjeldahl: hmm. I saw the "sorted list" and I *assumed* |
| 18:58 | kjeldahl | grignaak: Hey, I'm in no position to demand anything. I meant the original list was sorted. |
| 18:58 | grignaak | how is that sorted? |
| 18:59 | kjeldahl | Well, there is a score in the vector which is not shown or used in my example. Including it would actually make your solution work, assuming it would be sorted by the score. |
| 18:59 | kjeldahl | Thanks, I think I can piece it together from here. |
| 19:05 | kjeldahl | ,(doc nth) |
| 19:05 | clojurebot | "([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences." |
| 19:14 | grignaak | kjeldahl: this one is not as elegant, but it meets the requirements : http://gist.github.com/583347 |
| 19:17 | kjeldahl | grignaak: Excellent, thanks. Still struggling at my end. Figure sorted-map-by would work, but it does not of course as I want to sort on something be pointed to and not the key (if I get it right). |
| 19:18 | grignaak | yep, didn't see an arg for a custom comparator |
| 19:18 | kjeldahl | Although not as elegant, your latest solution seems more adaptable to what I'm looking for right now. I'll give it a go. Thanks again. |
| 19:22 | peepz | http://pastebin.com/m1EnaPT3 |
| 19:22 | peepz | shouldnt that give me an output?? |
| 19:22 | kjeldahl | grignaak: Worked perfectly. Thanks! |
| 19:23 | raek | peepz: no, since hello is never called |
| 19:23 | peepz | wow ok |
| 19:23 | peepz | so the arguments is the actual procedure call and its paramters |
| 19:23 | raek | you'd have to add a (hello (first *command-line-args*)) |
| 19:24 | raek | no, the arguments just end up in the var *command-line-args* |
| 19:24 | peepz | ... (hello(first jesus)) |
| 19:24 | peepz | didnt work |
| 19:25 | jjido | type error? ["jesus"] |
| 19:25 | peepz | hhehe |
| 19:25 | raek | there is no main function as in C |
| 19:26 | raek | it simply runs all the code in the script |
| 19:26 | raek | the defn form is just a function definition |
| 19:26 | raek | you need to add an actual call to the function |
| 19:26 | peepz | so then how do I execute that peiece of code |
| 19:26 | clojurebot | peepcode is a commercial screencast series; see the Clojure one at http://peepcode.com/products/functional-programming-with-clojure by technomancy |
| 19:26 | peepz | ok |
| 19:26 | raek | you add it after the defn |
| 19:27 | raek | http://pastebin.com/ZQYYFS8m |
| 19:27 | raek | (doc *command-line-args*) |
| 19:27 | clojurebot | "; A sequence of the supplied command line arguments, or nil if none were supplied" |
| 19:28 | peepz | ohh thanks! |
| 19:28 | raek | hrm, make that (apply str (interpose \space *command-line-args*)) |
| 19:29 | raek | note: clojure programming is most often done interactively at the repl, rather than making a script file and then executing it |
| 19:29 | raek | now I need to sleep. good night. |
| 19:36 | peepz | then how would I sent a parameter to my short script in repl? |
| 19:37 | raek | java -cp <*snip*> clojure.main script.clj arg1 arg2 arg3 |
| 19:38 | raek | in the script, *command-line-args* is bound to ("arg1" "arg2" "arg3") |
| 19:39 | peepz | yes but u are saying most coding is done right in the REPL without executing scripts from command line |
| 19:39 | raek | aha |
| 19:39 | peepz | so how do I run that piece of code in repl and pass an argument? |
| 19:40 | raek | you first evaluate your definitions by writing the into the repl |
| 19:40 | raek | and then just call the function: (hello "world") |
| 19:40 | raek | you can also load definitions from files |
| 19:40 | peepz | worked like a charm |
| 19:41 | peepz | last question promise :) why isnt my keyup work in repl? |
| 19:41 | peepz | it gives me : [[A |
| 19:41 | raek | yes, that's the control codes for "up" |
| 19:42 | raek | you need to use one of the build tools to get line-editing and command history |
| 19:42 | raek | it's not a part of clojure the language |
| 19:42 | peepz | give me an example of a build tool |
| 19:42 | raek | cljr is a good way to start |
| 19:42 | raek | and leiningen |
| 19:43 | raek | if you run "cljr repl" or "cljr swingrepl" you get a repl with line-editing |
| 19:43 | raek | (after instaling cljr, of course) |
| 19:43 | peepz | it seems there is no cljr for ubuntu, i did apt-get install cljr |
| 19:43 | raek | I also recommend looking into editor integration |
| 19:43 | peepz | also googling it didnt give any info |
| 19:43 | peepz | what about vimclojure? |
| 19:43 | raek | I gave you some links before |
| 19:44 | peepz | ok ill look there. |
| 19:44 | anonymouse89 | I'm trying to modify an element of an a 2d vector and and return the 2d vector. I was thinking something like (let [m [[0 0][0 0]]] (assoc m 0 (assoc (nth m 0) 0 1))) |
| 19:44 | raek | cljr http://github.com/liebke/cljr |
| 19:44 | raek | leiningen http://github.com/technomancy/leiningen |
| 19:44 | raek | cake http://github.com/ninjudd/cake |
| 19:44 | anonymouse89 | works. But I would like something less clunky. |
| 19:45 | raek | peepz: http://www.assembla.com/wiki/show/clojure/Getting_Started |
| 19:45 | raek | anonymouse89: assoc-in? :-) |
| 19:46 | raek | ,(let [m [[0 0][0 0]]] (assoc-in [0 0] 1)) |
| 19:46 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args (2) passed to: core$assoc-in |
| 19:46 | raek | ,(let [m [[0 0][0 0]]] (assoc-in m [0 0] 1)) |
| 19:46 | clojurebot | [[1 0] [0 0]] |
| 19:46 | anonymouse89 | ah, thought there might be something like that. i know of update-in |
| 19:46 | raek | a neat family of functions... |
| 19:47 | anonymouse89 | but to update only 1 element I'll still have to nest them |
| 19:47 | peepz | thanks!! |
| 19:48 | raek | assoc-in only updates one value |
| 19:48 | anonymouse89 | oh, duh [0 0] is the address |
| 19:48 | raek | ,(assoc-in {:a {:b 1}} [:a :b] 2) |
| 19:48 | clojurebot | {:a {:b 2}} |
| 19:49 | anonymouse89 | raek: thanks, that's perfect |
| 19:49 | raek | yes, in my vectors and numbers example, the indices and values was easy to mix up |
| 19:54 | peepz | im trying to install vimclojure and I am stuck..I downloaded and unziped the package.. what do I do now? I am following: http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Vim |
| 19:59 | raek | I'm not a vim user, so I cannot help you with that, I'm afraid.... In the beginning when you learn Clojure, just playing around with the repl (using, for example, cljr or the clojure jar manually) could be sufficient. I recommend getting that to work first. |
| 19:59 | raek | you can alway copy-and-paste code from an editor into the repl... |
| 19:59 | raek | not a very elegant way, but a simple one |
| 20:00 | raek | good luck and happy hacking! |
| 20:00 | raek | good night. |
| 20:01 | anonymouse89 | is there a more idiomatic wasy to do this? |
| 20:01 | anonymouse89 | , (vec (take 3 (repeat (vec (take 3 (repeat 0)))))) |
| 20:01 | clojurebot | [[0 0 0] [0 0 0] [0 0 0]] |
| 20:03 | hiredman | ,(repeat 3 (repeat 3 (repeat 3 0))) |
| 20:03 | clojurebot | (((0 0 0) (0 0 0) (0 0 0)) ((0 0 0) (0 0 0) (0 0 0)) ((0 0 0) (0 0 0) (0 0 0))) |
| 20:04 | anonymouse89 | ,(vec (repeat 3 (vec (repeat 3 0)))) |
| 20:04 | clojurebot | [[0 0 0] [0 0 0] [0 0 0]] |
| 20:05 | anonymouse89 | seems good |
| 20:06 | jamesnvc | Hello; does anyone here use Vim/vimclojure? |
| 20:06 | jamesnvc | I'm having a bit of trouble getting it set up under OS X, was wondering if anyone here could help or point to a better place to ask... |
| 20:07 | jamesnvc | Currently, when I try to build the vimclojure jar, it errors out with "java.lang.Exception: Unmatched delimiter: ) (backend.clj:171)" |
| 20:07 | jamesnvc | I've seen other people with that error, but no solutions... |
| 20:08 | Raynes | jamesnvc: If you don't get an answer here, there is a mailing list you can try here: http://groups.google.com/group/vimclojure |
| 20:08 | anonymouse89 | I know this may not be the most helpful but, I had a bunch of problems compiling too. I ended up just downloading a prebuilt jar from a link on the mailing list. |
| 20:08 | Raynes | kotarak is the vimclojure guy |
| 20:09 | jamesnvc | Raynes: Cool, thanks |
| 20:09 | jamesnvc | anonymouse89: Alright, I guess I'll try that if I can't get this working |
| 20:53 | hiredman | ,(doc ns-alias) |
| 20:53 | clojurebot | Pardon? |
| 20:53 | hiredman | clojurebot: jerk |
| 20:53 | clojurebot | No entiendo |
| 20:54 | hiredman | ,(doc alias) |
| 20:54 | clojurebot | "([alias namespace-sym]); Add an alias in the current namespace to another namespace. Arguments are two symbols: the alias to be used, and the symbolic name of the target namespace. Use :as in the ns macro in preference to calling this directly." |
| 20:55 | hiredman | ,(doc ns-resolve) |
| 20:55 | clojurebot | "([ns sym]); Returns the var or Class to which a symbol will be resolved in the namespace, else nil. Note that if the symbol is fully qualified, the var/Class to which it resolves need not be present in the namespace." |
| 23:36 | hiredman | clojurebot: ping |
| 23:36 | clojurebot | PONG! |
| 23:40 | Raynes | clojurebot: pong |
| 23:40 | clojurebot | Qinfengxiang! |
| 23:50 | old_sound | clojurebot: 青峰乡 |
| 23:50 | clojurebot | I don't understand. |
| 23:51 | hiredman | clojurebot: tranlsate from zh 青峰乡 |
| 23:51 | clojurebot | I don't understand. |
| 23:54 | old_sound | clojurebot: just a village in china |
| 23:54 | clojurebot | Pardon? |
| 23:54 | old_sound | AKA QingFengXiang |