2010-05-05
| 00:01 | alexyk | technomancy: what does :namespaces expect? ['a 'b] ? |
| 00:07 | technomancy | alexyk: like that but with no quotes |
| 00:07 | technomancy | I think |
| 00:07 | technomancy | I don't really do AOT much |
| 00:08 | slyphon | hmm |
| 00:08 | alexyk | ah |
| 00:08 | slyphon | it'd be nice to be able to have some control over the threadpool agents used |
| 00:09 | slyphon | use differnt pools for different tasks |
| 00:14 | alexyk | technomancy: if I do want to have a structure src/main/clojure/com/blah/file.clj, as in maven, can I teach lein to go there? |
| 00:18 | jkkramer | slyphon: re your cron question, i came across this today: http://github.com/stuarthalloway/orolo/blob/master/src/orolo/periodically.clj |
| 00:18 | slyphon | oh, nuts |
| 00:18 | slyphon | 1.2 probably |
| 00:19 | slyphon | jkkramer: i'll make a note of this though |
| 00:19 | jkkramer | yeah, uses protocols |
| 00:21 | slyphon | hrm, could probably be done w/o protocols |
| 00:21 | slyphon | since i don't need the JMX goop |
| 00:22 | jkkramer | slyphon: looks like there's an older version based on 1.1 -- http://github.com/stuarthalloway/orolo/blob/2848ddb63ee3bd635e56c0fbd1e46a558bee6c52/src/orolo/periodically.clj |
| 00:22 | technomancy | alexyk: I think you can set :source-path in project.clj |
| 00:23 | alexyk | kk |
| 00:23 | technomancy | hugod: hey, I am getting exceptions without stacktraces on your hyperdoc branch; have you tried it since the changes in clojure 1.2? |
| 00:24 | eslick | Anyone having trouble with recent changes to 1.2? |
| 00:24 | hugod | technomancy: I haven't tried it recently |
| 00:24 | technomancy | eslick: it's certainly confused a number of people |
| 00:25 | technomancy | hugod: I did merge the compile-file branch though; seems to work great |
| 00:26 | alexyk | technomancy: the clojure-protobuf project wants to run proto compiler to generate Java. How can I stick that into lein?... |
| 00:26 | technomancy | I'm not sure what that is |
| 00:26 | hugod | technomancy: I saw. Thanks! |
| 00:27 | alexyk | technomancy: basically google protobuf compiler taking a spec and generating java. Then that java is used in clojure. ant does it with an exec step... |
| 00:28 | technomancy | alexyk: I see. you can write custom lein tasks that call out to the ant exec api no problem |
| 00:28 | technomancy | alexyk: see http://github.com/antoniogarrote/lein-javac for an example |
| 00:30 | alexyk | cool |
| 00:40 | replaca | technomancy: oh, maybe if I just split the autodoc in two and have a really lightweight plugin that gathers the parameters and executes a separate instance of clojure that has all the actual stuff. It would be pretty easy to make the plugin version independent. |
| 00:40 | technomancy | replaca: also an option |
| 00:40 | replaca | this is basically what I do to manage the various version of clojure itself |
| 00:40 | technomancy | replaca: the cost/benefit tradeoff is really going to depend on how many people stick with 1.1 though |
| 00:41 | replaca | (which would mean in the end we'll be going three layers deep) |
| 00:41 | replaca | well, hopefully 1.2 isn't the end of the road |
| 00:41 | technomancy | replaca: look into the eval-in-project function in leiningen/compile.clj for one way to do that |
| 00:41 | technomancy | true |
| 00:41 | replaca | technomancy: ahh, thanks for the pointer |
| 00:59 | slyphon | hrm |
| 01:00 | slyphon | it's undocument that *agent* is set to the current agent when the send-off fn is running |
| 01:00 | slyphon | undocumented* |
| 01:00 | slyphon | is that on purpose? i.e. should one not rely on that behavior? |
| 01:06 | imran_sr | clojure newbie here. I've slurp* 'ed a multiline file to a string, and am trying to re-seq a pattern against it. I'm trying to match across multiple lines, but the pattern stops at line boundaries. Is there some kind of re flag I can put into the pattern to make it match across multiple lines? |
| 01:06 | imran_sr | (thought I might just jump in ask, rather than ask to ask ... ) |
| 01:06 | hiredman | yeah, you have to read the javadocs for Pattern |
| 01:06 | hiredman | (there is a flag, but I forget) |
| 01:07 | imran_sr | I've been looking through http://java.sun.com/docs/books/tutorial/essential/regex/ , but I don't see anything (blindness on my part could be a factor here!) |
| 01:07 | sexpbot | "Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)" |
| 01:08 | imran_sr | hiredman: I'll check out the javadocs for util.regex |
| 01:09 | hiredman | I think it's on Pattern |
| 01:10 | hiredman | http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#MULTILINE |
| 01:10 | sexpbot | "Pattern (Java Platform SE 6)" |
| 01:11 | imran_sr | hiredman: thanks mate. Was looking at that page while you said that :) |
| 01:12 | imran_sr | so I embed (?m) into the pattern |
| 01:17 | imran_sr | hiredman: hmm, still not working. Do I use it like this? #"(?m)my_re_pattern" |
| 01:17 | tomoj | I want a pair of giant parentheses I can wield |
| 01:17 | hiredman | ,(re-find #"(?m)foo\nbar" "foo\nbar") |
| 01:17 | clojurebot | "foo\nbar" |
| 01:18 | imran_sr | (re-seq #"(?m)........" <a multiline string>) |
| 01:18 | hiredman | ,(re-find #"(?m)......." "foo\nbar") |
| 01:18 | clojurebot | nil |
| 01:18 | hiredman | ,(re-find #"(?m)......" "foo\nbar") |
| 01:18 | clojurebot | nil |
| 01:18 | imran_sr | hey, is that clojurebot evaluating expressions? :) |
| 01:18 | hiredman | ,(re-find #"(?m).*\n.*" "foo\nbar") |
| 01:18 | clojurebot | "foo\nbar" |
| 01:18 | hiredman | yes |
| 01:19 | imran_sr | :) |
| 01:19 | hiredman | I'm pretty sure this whole multiline regex thing has been done before, but maybe chouser was here |
| 01:20 | hiredman | ,(re-find #"(?m)....." "foo\nbar") |
| 01:20 | clojurebot | nil |
| 01:20 | hiredman | ,(re-find #"(?m)....." "foo") |
| 01:20 | clojurebot | nil |
| 01:20 | hiredman | ,(re-find #"(?m)..." "foo") |
| 01:20 | clojurebot | "foo" |
| 01:20 | hiredman | ,(re-find #"(?m)....." "foo\nb") |
| 01:20 | clojurebot | nil |
| 01:20 | imran_sr | hiredman: nope, not working |
| 01:21 | imran_sr | hmmm |
| 01:21 | hiredman | "Note that by default, the dot matches all characters except line break characters. So the .* in the above example will only match to the end" |
| 01:21 | hiredman | we all so need the DOTALL flag, whatever that is |
| 01:22 | hiredman | ,(re-find #"(?ms)....." "foo\nb") |
| 01:22 | clojurebot | "foo\nb" |
| 01:22 | imran_sr | .(re-find #"(?md)foo" "fo\no") |
| 01:23 | hiredman | ,(= "," ".") |
| 01:23 | clojurebot | false |
| 01:25 | imran_sr | .(re-find #"(?md)foo" "a \nfoo b") |
| 01:26 | hiredman | ,(= \, \.) |
| 01:26 | clojurebot | false |
| 01:28 | imran_sr | hiredman: thanks a lot for your help :) . I've gotten the flags I needed (and more importantly, I know where to go next time I need to check something similar). |
| 01:29 | uberjar | do you guys remember a week ago when I told you about my Oracle conspiracy theory.. the one where Oracle is going to put the JRE behind a $90 pay-wall ? Well they are getting closer and closer to it. |
| 01:29 | uberjar | ""In a somewhat surprising move (and without any notification to customers), Oracle shut down public access to firmware downloads. I learned this the hard way when I contacted Oracle customer service almost two weeks ago. Yes, it took 13 days for me to get access to the firmware download for systems under the standard warranty (i.e. less than a year old)." |
| 01:30 | uberjar | each week they put something else that was public behind a pay wall.. they started with solaris.. |
| 01:32 | uberjar | I hope you all can get used to OpenJDK :) |
| 01:37 | tomoj | hmm |
| 01:37 | tomoj | wouldn't there be riots? |
| 01:38 | tomoj | mass panic? |
| 01:48 | uberjar | yes |
| 01:48 | uberjar | well in theory they would only put new version of the JRE behind the pay wall |
| 01:48 | uberjar | so it wouldn't be a massive panic all at once |
| 01:49 | uberjar | just a slow growing disguist |
| 01:49 | uberjar | disgust |
| 01:50 | uberjar | it's sort of like how politics works.. you don't make changes all at once you do it slowly over time so people don't freak out.. like boiling a frog |
| 01:50 | slyphon | oh good god |
| 01:51 | slyphon | they're messing with people who bought sun hardware |
| 01:51 | slyphon | not java developers |
| 01:51 | slyphon | *huge* difference in the markets |
| 01:53 | uberjar | you never know.. is all I'm sayin.. you never know :) |
| 01:53 | slyphon | FUD |
| 01:55 | slyphon | argh |
| 02:06 | LauJensen | Good Morning all |
| 02:10 | zmila | rainy morning |
| 02:12 | LauJensen | Does Brian Carper hang out here? |
| 02:52 | uberjar | These two strings walk into a bar and sit down. The bartender says, "So what'll it be?" |
| 02:52 | uberjar | The first string says, "I think I'll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy owmc63^Dz x.xvcu" |
| 02:52 | uberjar | "Please excuse my friend," the second string says, "He isn't null-terminated." |
| 02:55 | tomoj | :D |
| 03:10 | unfo- | lol\0 |
| 03:12 | LauJensen | Im getting a failure trying to fetch |
| 03:12 | LauJensen | Downloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from central |
| 03:12 | LauJensen | |
| 03:12 | LauJensen | Anybody else having that issue? |
| 03:13 | LauJensen | (ie., didnt have it yesterday, came after flushing .m2) |
| 03:14 | LauJensen | If anybody cares to test, try "mv ~/.m2 ~/.m3 && git clone http://github.com/ztellman/penumbra.git && cd penumbra && lein deps && mv ~/.m3 ~/.m2 && cd .. && rm -rf penumbra/" |
| 03:14 | LauJensen | I may have over complicated, but that should be traceless on your system |
| 03:15 | LauJensen | $ping repo1.maven.org |
| 03:15 | sexpbot | Command not found. No entiendo lo que estás diciendo. |
| 03:15 | LauJensen | I think I definately overcomplicated, seems maven-central is down |
| 03:17 | maravillas | i was able to download it fine with an otherwise empty project |
| 03:18 | LauJensen | maravillas: can you ping repo1.maven.org ? |
| 03:18 | maravillas | looks up from here |
| 03:18 | LauJensen | ah it just came back up I see |
| 03:18 | maravillas | :) |
| 03:19 | LauJensen | Thanks for digging in though :) |
| 03:19 | maravillas | np |
| 03:29 | LauJensen | hugod: ping |
| 03:52 | zmila | how to add doc-string to a def? |
| 03:53 | zmila | ,(def the-rules #^{:doc "the rules"} [ [] ,,, [] ]) |
| 03:53 | clojurebot | DENIED |
| 04:00 | unfo- | i lol'd at that :D |
| 04:14 | zmila | i'm in the top 5th of clojurians at Project Euler :) heh |
| 04:20 | jowag | is there some idiom for (not (nil? x)) ? or this is the correct way to check for non-nil values |
| 04:20 | _ato | jowag: just x |
| 04:21 | tomoj | eh |
| 04:21 | _ato | if you need a boolean: |
| 04:21 | jowag | yep, I need a boolean |
| 04:21 | _ato | ,(boolean 1) |
| 04:21 | clojurebot | true |
| 04:21 | _ato | ,(boolean nil) |
| 04:21 | clojurebot | false |
| 04:21 | tomoj | ,(boolean false) |
| 04:21 | clojurebot | false |
| 04:21 | tomoj | false is a non-nil value |
| 04:22 | tomoj | unless you're looking for truthy values.. |
| 04:22 | tomoj | having booleans around kinda sucks I guess |
| 04:22 | _ato | well yeah if you really mean non-nil rather than truthy there's not nothing better than (not (nil? ...)) |
| 04:24 | jowag | thank you |
| 04:36 | tomoj | whoa |
| 04:37 | tomoj | ,'''foo |
| 04:37 | clojurebot | (quote (quote foo)) |
| 04:37 | tomoj | ,```foo |
| 04:37 | clojurebot | (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list (quote sandbox/foo)))) |
| 04:37 | tomoj | I feel like I might have understood that at one point |
| 04:37 | tomoj | but not tonight |
| 04:40 | tomoj | if you (count (flatten `'`'`'`'foo)) is 261 |
| 04:54 | tomoj | ,`````[] |
| 04:54 | clojurebot | (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/list)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list (quote clojure.core/s |
| 04:56 | tomoj | hmm |
| 04:56 | tomoj | ,``````[] |
| 04:56 | clojurebot | java.lang.StackOverflowError |
| 04:56 | tomoj | weird, I get: java.lang.ClassFormatError: Invalid method Code length 162261 in class file user$eval__7 |
| 04:59 | LauJensen | in enlive, the clone-for makes sense when replicating an element, but how do I add a tag to each element, ie (clone-for [x xs] (-> (set-attr :href href) (add [:img {:src src}]))) ? |
| 05:08 | jowag | I'm trying to prevent concurrent access to InputStream object, is using "locking" macro a good approach, or should I use something else? |
| 05:10 | LauJensen | jowag: wrap it in an atom |
| 05:14 | jowag | LeuJensen: but swap! may retry, so I cannot read from InputStream inside swap! |
| 05:20 | LauJensen | good point |
| 05:20 | LauJensen | jowag: would dosync+ensure not work? Thats a lock in itself |
| 05:23 | jowag | LauJensen: I don't know, dosync still may retry even if using ensure. Another possibility I was thinking about was to read from InputStream inside agent. concurrent send-offs are possible, but agent will execute tasks sequentially |
| 05:28 | LauJensen | I think locks might be the way to go, as you're looking to do concurrency with an object that has side-effects. Clojures semantics are all wrappers around immutable things |
| 05:29 | Chousuke | jowag: use an agent if you can, but I suppose there's nothing wrong with the locking macro either if nothing else works. |
| 05:31 | jowag | ok thank you, one more thing, what should I use as a monitor in a locking macro? I've found some example which uses an atom as a monitor object. |
| 05:31 | Chousuke | any object will do |
| 05:32 | Chousuke | you could use the InputStream itself as the monitor I guess. |
| 05:35 | jowag | hmm, interesting |
| 06:15 | cschreiner | Why wont this work? (lambda () (interactive) (mark-defun) (kill-region)) |
| 06:19 | defn | :) |
| 06:21 | defn | ,`[] |
| 06:21 | clojurebot | [] |
| 06:21 | defn | ,``[] |
| 06:21 | clojurebot | (clojure.core/apply clojure.core/vector (clojure.core/seq (clojure.core/concat))) |
| 06:21 | defn | ,```[] |
| 06:21 | clojurebot | (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/apply)) (clojure.core/list (quote clojure.core/vector)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)))))))))) |
| 06:45 | eliantor | hi |
| 06:51 | eliantor | question: suppose I want to extend a java type with IObj, how do I share metadata among meta and withMeta? is it possible to do that with extend or I must use a proxy? |
| 07:11 | powr-toc | Does anyone know how to get slime-connect to redirect system output from other threads to my slime repl? |
| 07:12 | powr-toc | it turns out (slime-redirect-inferior-output) only works for M-x slime, not M-x slime-connect (where you don't get an inferior lisp buffer |
| 07:18 | _ato | powr-toc: maybe try running this in the repl you want the output to go to: (alter-var-root #'*out* (fn [_] *out*)) |
| 07:24 | powr-toc | _ato: hmmm nice trick... but it doesn't seem to work for java libraries using System.out |
| 07:25 | powr-toc | hmm maybe I can call System/setErr |
| 07:27 | _ato | yeah, not sure what you can set it to though |
| 07:28 | powr-toc | yeah, not sure how to convert a PrintWriter to a PrintStream |
| 07:32 | ivenkys | gents question - i am using xml-seq to read the contents of an xml doc , however i am unable to treat it as a map in the REPL , is it because the REPL doesn't know the "datatype" of the sequence or am i way off, any suggestions to understand this better ? |
| 07:34 | powr-toc | ivenkys: does it not return a seq of maps? |
| 07:35 | ivenkys | powr-toc: seq of maps .. hmm , i might have missed a paren,,, let me check |
| 07:36 | powr-toc | ivenkys: I think each tag is effectively described as a map |
| 07:38 | ivenkys | powr-toc: yup - you are right - map of sequences . sorry abt the newb question |
| 07:38 | ivenkys | powr-toc: thanks |
| 07:43 | powr-toc | no probs |
| 07:43 | powr-toc | top tip: functions with the word seq in them usually return sequences ;-) |
| 07:44 | powr-toc | or operate on them |
| 07:46 | cemerick | Is it the case that protocol fns cannot be rebound? |
| 07:48 | cemerick | illustration: https://gist.github.com/31dcb5bd2cacb7ef29ad |
| 08:29 | jfields | is there a function to return the value from a map or a specified default if one is not found? |
| 08:29 | chouser | ,(get {:a 1} :b :not-found) |
| 08:29 | clojurebot | :not-found |
| 08:30 | chouser | ,({:a 1} :b :not-found) |
| 08:30 | clojurebot | :not-found |
| 08:30 | chouser | ,(:b {:a 1} :not-found) |
| 08:30 | clojurebot | :not-found |
| 08:30 | chouser | jfields: a few. :-) |
| 08:30 | jfields | oh, that was obvious, sorry :) |
| 08:41 | chouser | cemerick: protocol methods have call-site caching magic that is defeating the dynamic binding |
| 08:41 | chouser | the var is indeed rebound, but the call site was already compiled to point to the protocol method |
| 08:41 | cemerick | chouser: I figured. |
| 08:41 | cemerick | Oh, maybe your latest post is relevant? |
| 08:42 | chouser | hm... not sure |
| 08:42 | cemerick | hrm, probably not. call-site caching != direct var linking |
| 08:50 | dfa2 | which version of git I should use on windows? |
| 08:51 | dfa2 | (the most recent msysgit release is in 2009, it is good?) |
| 08:52 | dfa2 | forgive me, solved :) |
| 09:03 | jfields | there doesn't seem to be a way to set a default for (get-in {:a {:b 1}} [:a :b]) though |
| 09:04 | carkh | but, why are you putting nils in your maps anyways ? |
| 09:04 | jfields | I'm not, but sometimes I need to ask for keys that don't exist. e.g. (get-in {:a {:b 1}} [:c :b]) |
| 09:05 | carkh | so if it returns nil, then you know there was nothing there |
| 09:05 | carkh | since you know that you don't put nil in there |
| 09:05 | jfields | sure, so (or (get-in {:a {:b 1}} [:c :b]) :default) is the best plan then? |
| 09:05 | carkh | but why do you need that :default return value ? nil is pretty usefull in itself |
| 09:06 | carkh | but yes, when you do need a default value, or is the way to go |
| 09:22 | basilar | heyup, new here... quick question... |
| 09:22 | basilar | is there a reason why when destructuring maps, the k/v pair has to be in reverse order {v :k} as opposed to when creating them {:k v}? |
| 09:25 | stuarthalloway | basilar: otherwise {:keys [a b c]} wouldn't work |
| 09:25 | stuarthalloway | and, btw, :keys eliminates a ton of explicit k/v destructures |
| 09:27 | basilar | cheers, that makes perfect sense. |
| 09:40 | AWizzArd | stuarthalloway: does Lancet have dependencies, such as ant/maven? |
| 09:44 | stuarthalloway | AWizzArd: it is build on Ant |
| 09:44 | ivenkys | AWizzArd: it depends on Ant |
| 09:44 | stuarthalloway | and, I should mention, unsupported |
| 09:48 | AWizzArd | ok |
| 09:56 | cemerick | is it the case that enlive transformations are lazy now? |
| 10:11 | lpetit | hello, would a keen mind help an outdated clojure follower understand what is behind the laconic sentence "last var wins" ? |
| 10:13 | chouser | lpetit: previously, 'use'ing a var with the same name from two different namespaces was a compile-time exception. |
| 10:13 | chouser | Now it is a warning, and whichever one is pull in last wins. |
| 10:19 | alexyk | let the varest var win |
| 10:20 | lpetit | chouser: ok, the last var is "reinterned" in the ns, something like this ? |
| 10:20 | spariev | alexyk: or, should we say, (let [(varest? var) :win]) :) |
| 10:21 | alexyk | survival of the latest |
| 10:22 | lpetit | chouser: if this is a new var that is added, it means that code previous to the new "use" will use the "previous var" (and so a function fA), while code after the new "use" will use the "new var" (and so a function fB) ? |
| 10:22 | stuarthalloway | I am about to send a long email to the mailing list |
| 10:22 | lpetit | stuarthalloway: yes ? |
| 10:22 | stuarthalloway | I like "last var wins" but the shortest accurate statement is ... |
| 10:23 | stuarthalloway | "attempting to define or refer a var that is already referred from another namespace causes a *warning*, not an *error*" |
| 10:23 | alexyk | last var warns :) |
| 10:23 | alexyk | to err is human; to warn is divine |
| 10:24 | lpetit | chouser, stuarthalloway: and what is the rationale for this move ? |
| 10:24 | cgrand | but isn't "last var wins" the road to more :use without :only? |
| 10:26 | lpetit | "(use 'ns1) (shared-fn-name ...) (use 'ns2) (shared-fn-name ...) (use 'ns1 (shared-fn-name ...) " ;) |
| 10:27 | stuarthalloway | cgrand: no, you will want to eliminate the warnings |
| 10:34 | stuarthalloway | just posted to the mailing list. I have 15-20 minutes to hang here and discuss if anyone has suggestions/questions/comments/rotten tomatoes |
| 10:36 | chouser | I like the all-caps single quote. :-) |
| 10:37 | chouser | stuarthalloway: nice writeup, thanks. |
| 10:40 | stuarthalloway | chouser: does it scare you that you can now (more easily) disregard vars in core? |
| 10:40 | arohner | stuarthalloway: I like the solution |
| 10:40 | chouser | hm, I don't *feel* scared. |
| 10:42 | cgrand | stuarthalloway: let imagine that someone wrote (ns lib (:use lib1) (:use lib2)), no conflicts. In a subsequent release lib2 introduces a var which shadows one of lib1... this isn't the same problem as an additive change to core. Should last-var-wins be restricted to clojure.* ? |
| 10:42 | chouser | no, I'm pretty sure I like it. You can do this sort of thing in python with no warning at all. This is a good compromise. |
| 10:42 | stuarthalloway | cgrand: in that scenario they get a warning |
| 10:43 | chouser | cgrand: unrecommended use of two naked :uses, and Clojure's still gracious enough to warn. Ignorinng both the naked :use advice *and* the warning signs them up for whatever hurt is coming... |
| 10:43 | stuarthalloway | chouser: right |
| 10:44 | stuarthalloway | ...and, if they know it is safe, they can continue to get shit done and fix the warning tomorrow |
| 10:44 | stuarthalloway | or work with the lib provider to do so |
| 10:44 | chouser | the only reason it's even come up for clojure.core is because we implicit naked use that all the time |
| 10:44 | chouser | ...despite my earnest attempts to talk people out of it. |
| 10:45 | s450r1 | could the last-var-wins policy be configurable? |
| 10:45 | stuarthalloway | s450r:1: I proposed that too |
| 10:45 | arohner | s450r1: what advantage would that provide? |
| 10:45 | stuarthalloway | and, in fact, it is an interesting motivating case for a condition system |
| 10:45 | chouser | ,(require '[clojure.core :as core]) |
| 10:45 | clojurebot | nil |
| 10:45 | chouser | ,(core/prn (core/get {::a 1} ::a)) |
| 10:45 | clojurebot | 1 |
| 10:45 | chouser | :-) |
| 10:46 | replaca | stuarthalloway: do you want me to take that pprint doc on clojure.org ticket since it's really an autodoc ticket? |
| 10:46 | s450r1 | arohner: you could use last-var-wins during development and then turn it off when testing something you want to release to double-check |
| 10:47 | stuarthalloway | configuring it back to an error might ease the minds of uptight folks: warn during beta, err during release |
| 10:47 | stuarthalloway | s450r1: but on balance, not worth the complexityu |
| 10:47 | stuarthalloway | adding a mutable setting to double-protect against people that won't heed warnings doesn't feel very Clojurish |
| 10:47 | cgrand | stuarthalloway & chouser: I know I'll get a warning, I'm just afraid a general last-var-wins policy will encourage sloppy uses of :use |
| 10:47 | stuarthalloway | replaca: yes please |
| 10:48 | replaca | stuarthalloway: k |
| 10:48 | chouser | the printing of the warning could be done by a clojure.core fn such that paranoid folks could alter-var-root to make it throw |
| 10:48 | stuarthalloway | replaca: my only question was does the clojure repos need to have the doc directory for pprint's sake. It's in there, and if it needs to stay that's cool |
| 10:48 | chouser | and the cliff-jumping sort could make all the warnings disappear. |
| 10:49 | chouser | ...all without adding the complexity of a real config option. |
| 10:49 | stuarthalloway | cgrand: we should make sure that the style guide in assembla strictly forbids naked use |
| 10:49 | stuarthalloway | and we should make sure to call it "naked use", good use of negative connotations |
| 10:50 | fogus_ | Hmmmm.. I guess it depends on your view of nakedness |
| 10:50 | chouser | fogus_: that's why we don't call it "nude use" |
| 10:50 | stuarthalloway | chouser: good luck getting rhickey to go to even that trouble on behalf of the foolish :-) |
| 10:51 | stuarthalloway | "terrorist use"? |
| 10:51 | replaca | stuarthalloway: that's the way that autodoc finds "additional" docs (except that it's broken right now cause of the oter changes I mentioned) |
| 10:51 | fogus_ | "crass use" |
| 10:51 | s450r1 | "shotgun use"? |
| 10:51 | chouser | "promiscuous use" |
| 10:51 | replaca | we can add docs there for any namespaces and they will get attached to the namespace in the autodoc |
| 10:51 | stuarthalloway | heh, amusing to see people's guesses at a "universal negatively connoting word" |
| 10:52 | ordnungswidrig | quick: where is the presentation where rich is deriving that oo is doing state wrong? |
| 10:52 | fogus_ | stuarthalloway: Whenever you are lazy about :use the terrorists win |
| 10:52 | stuarthalloway | replaca: great, thought maybe that was it and hadn't checked, we should use it more |
| 10:52 | lpetit | chouser, stuarthalloway: thanks for the explanations. Makes sense to me, in a dynamic language, to prefer warnings over errors when possible |
| 10:53 | wlangstroth | "naked" already has *kind-of* that connotation in trading |
| 10:53 | stuarthalloway | cgrand: you happy? semi-happy? |
| 10:53 | s450r1 | I like last-var-wins better than getting an error too. |
| 10:53 | cgrand | what about deprecating (warning in 1.2) naked use? |
| 10:54 | s450r1 | cgrand: I was just about to suggest that :-) |
| 10:54 | stuarthalloway | would love to cemerick's view as well, hoping that with last-var-wins we can defer :as-of for now |
| 10:55 | stuarthalloway | cgrand: that feels unclojurish to me |
| 10:56 | stuarthalloway | naked use is not a great idea, but "never" is a bit strong |
| 10:56 | replaca | stuarthalloway: yeah, we should :-). But I should get it working agian first! :) |
| 10:57 | stuarthalloway | lpetit, if you get a chance can you see if the latest labrepl is ok in ccw? |
| 10:57 | lpetit | I can see the value of naked use for RAD development, especially if for one-shot scripts. And with warnings helping you move from the "shit state" to the "production" state, that's a win-win, no ? |
| 10:57 | stuarthalloway | I think the pom.xml was pointing to the wrong contrib |
| 10:57 | lpetit | stuarthalloway: ok, tomorrow evening I hope |
| 10:58 | stuarthalloway | does anybody here have the ability to nuke artifacts on the CI box? |
| 10:58 | cemerick | last-var-wins seems remarkably dangerous to me |
| 10:58 | stuarthalloway | I have admin access but not ssh access, so maybe I can do it myself... |
| 10:58 | fogus_ | lpetit: I always start with naked use |
| 10:59 | stuarthalloway | cemerick: what's your worst-case scenario? |
| 10:59 | cemerick | stuarthalloway: I'm trying to talk myself off the cliff. |
| 10:59 | lpetit | fogus_: so do I, incremental and interative development. I like it. |
| 11:02 | cemerick | OK, easy thing's first: naked :use is good and necessary. If you've got a couple of ns' that are constantly utilized (c.c.core, c.set, c.c.def, a few of our foundational internal libs), requiring them, even with an alias, is tedious. |
| 11:02 | ordnungswidrig | w |
| 11:03 | cemerick | What happens when you refer to a core fn on line 100 of a lib, and redefine that same core fn on line 200? |
| 11:03 | cemerick | (thinking here of direct linking) |
| 11:03 | cemerick | or, I should say....define a fn with the same name as the core fn on line 200. |
| 11:04 | cemerick | stuarthalloway: ^^ |
| 11:05 | stuarthalloway | you get a warning |
| 11:06 | stuarthalloway | and since the warning is in your own code, you fix it, by adding an exclude at the top of the namespace |
| 11:06 | stuarthalloway | the earlier name is now not available, and your code won't compile |
| 11:06 | cemerick | stuarthalloway: Right, I'm asking, which fn does the usage at line 100 get? |
| 11:06 | stuarthalloway | is this an interview question? |
| 11:06 | stuarthalloway | :-0 |
| 11:07 | stuarthalloway | I am guessing you would get the core one |
| 11:07 | stuarthalloway | if direct linking is in play |
| 11:07 | cemerick | That might be my worst case scenario -- if a core (or otherwise :use'd fn) gets linked in prior to a redefinition (that is used later on in the ns), and you've got two behaviours going on in the same ns for the same name. |
| 11:08 | arohner | but can't you get that behavior now? |
| 11:08 | stuarthalloway | would you (or anyone on your team) ship with the warning in your own code? |
| 11:08 | stuarthalloway | arohner: yes, although not as easily |
| 11:09 | stuarthalloway | you would have to go (in-ns 'clojure.core) |
| 11:09 | cemerick | stuarthalloway: knowingly, no. *shrug* |
| 11:09 | cemerick | We've been able to treat ns declarations *as* declarations for the most part, which is nice. Tossing that warning and going to last-var-wins sort of pulls the veil a bit. |
| 11:10 | cemerick | This is all to prevent breakage like the case of flatten in enlive? |
| 11:10 | stuarthalloway | cemerick: I already floated (and rhickey didn't love) making it configurable ... even more complexity |
| 11:10 | stuarthalloway | cemerick: yes, although that breakage is pretty thorough |
| 11:11 | stuarthalloway | and with modular dependencies takes a while to rundown |
| 11:11 | cemerick | yeah, I wasn't meaning to imply that it's not a problem, or a widespread one |
| 11:11 | cemerick | or *not* a widespread one |
| 11:11 | stuarthalloway | take my own case: labrepl broke |
| 11:11 | stuarthalloway | but when I went to fix I first had to fix circumspec |
| 11:12 | stuarthalloway | ...and then compojure (which I didn't own, and had to fork...) |
| 11:12 | stuarthalloway | the warning also lets us leave the old vars in place |
| 11:12 | cemerick | I remember various proposals floating around a long time ago to load the entire file and do some poking and prodding in order to avoid the need for declare. Maybe that could be resurfaced, and local declarations always given priority over referred namespaces? |
| 11:13 | cemerick | Likely a much bigger change than last-var-wins, but seems far cleaner. |
| 11:14 | stuarthalloway | here's a crazy idea: last-var-wins during the beta period, and turn it back off for rc |
| 11:14 | cemerick | yes, that is crazy :-) |
| 11:15 | arohner | stuarthalloway: so official builds would have last-var-wins-off, and development builds would have it on? |
| 11:15 | stuarthalloway | but why crazy? lots of us are on snapshot bits of six different dependencies |
| 11:15 | stuarthalloway | making changes during beta requires enormous coordination, which last-var-wins solves |
| 11:16 | arohner | stuarthalloway: that would prevent e.g. using libraries based on clojure 1.1 with 1.2 |
| 11:16 | stuarthalloway | and turning it off creates a sync point for various projects |
| 11:16 | cemerick | stuarthalloway: because lots more people are going to have exactly the same problem that aren't aggressively tracking 1.2-SNAPSHOT. |
| 11:17 | stuarthalloway | arohner: not necessarily, but would require yet another feature, either ad hoc version probing or something like :as-of |
| 11:17 | lpetit | cemerick: If last-var-wins changes vars, I don't think it's necessary to have "hard linked" vars (non dynamic) from e.g. clojure.core to get 2 different var values from two different points in code. code at line 100 will have its symbol resolved at compile time to some var, and code at line 200 will have its symbol resolved at compile time to a new var (the old var is not referenced anymore... |
| 11:17 | lpetit | ...by the namespace, but is still available because referenced by some compiled code at line 100). At least that's how I understand it, without the ability to test it yet (though this is an easy test to drive) |
| 11:18 | cemerick | lpetit: good point |
| 11:18 | cemerick | stuarthalloway: am I nuts with my suggestion? |
| 11:18 | cemerick | half-baked as it is |
| 11:19 | stuarthalloway | lpetit: true or no, that doesn't bother me so much. it really comes down to how people will behave with warnings |
| 11:19 | stuarthalloway | cemerick: not nuts, I just don't know how hard it is to do |
| 11:19 | cemerick | yeah |
| 11:19 | lpetit | stuarthalloway: it was for the sake of the truth. Currently (without any experiment feedback), it also doesn't bother me. |
| 11:20 | stuarthalloway | I am going to sign off and do some day job for a while it's almost noon here and hard to pretend the sun isn't up :-) |
| 11:20 | stuarthalloway | I will make sure Rich looks at this but try to give him my slanted view |
| 11:20 | stuarthalloway | :-) |
| 11:27 | hugod | the reify doc string examples are missing the "this" argument |
| 11:36 | stuarthalloway | hugod: can you throw that in a ticket? |
| 11:36 | hugod | stuarthalloway: sure |
| 11:36 | stuarthalloway | thx |
| 11:48 | rhickey | new last-one-in-wins - tracks warnings and switches to throw after you've been warned 42 times |
| 11:48 | Chousuke | heh |
| 11:48 | Chousuke | "Code too broken, fix it" |
| 11:57 | ordnungswidrig | rhickey: 42? not 32? :-) |
| 12:00 | rhickey | ordnungswidrig: changed it. Now it pools results from all libs and apps overwriting something. If yours is in the last 10% to remove the warning, it switches to an error. Kind of like a silent auction with an unknown closing time. |
| 12:00 | ordnungswidrig | hehe |
| 12:03 | rhickey | you won't be able to sleep at night wondering - 'how long can I get away with this?' |
| 12:06 | ordnungswidrig | I can't sleep at night because I wonder how long I must keep programming java for a living... |
| 12:08 | sattvik | rhickey: I am looking into the Java 5 problem with the annotation tests. Unfortunately, because gen-class has to be AOT compiled, it's not as simple to fix. So am trying to decide the best way to handle this situation. Option 1 is to simply disable the test on Java 5, perhaps with a warning. Option 2 is to write a few custom annotations, possibly in Java, so the same test can work regardless of platform version. Option 3 is to write a limited version o |
| 12:08 | chouser | sattvik: cut off at "limited verion o" |
| 12:09 | sattvik | Option 3 is to write a limited version of the tests for Java 5 (like deftype), but this will also require some modifications to the build script. There may be other options. |
| 12:09 | scottj | How come (.getInterfaces clojure.lang.Symbol) doesn't include clojure.lang.IMeta, yet (instance? clojure.lang.IMeta 'foo) returns true? |
| 12:10 | remleduff | ,(class 'foo) |
| 12:10 | clojurebot | clojure.lang.Symbol |
| 12:11 | remleduff | ,(ancestors clojure.lang.Symbol) |
| 12:11 | clojurebot | #{clojure.lang.IObj clojure.lang.Obj clojure.lang.AFn :clojure.contrib.json.write/symbol clojure.lang.Named java.lang.Object clojure.lang.IMeta java.util.concurrent.Callable java.io.Serializable clojure.lang.IFn java.lang.Runnable :clojure.contrib.generic/any :clojure.contrib.pprint.examples.json/symbol java.lang.Comparable} |
| 12:12 | rhickey | scottj: it's not a direct super |
| 12:13 | remleduff | What does it mean that ":clojure.contrib.generic/any" is an ancestor of Symbol? |
| 12:14 | remleduff | I guess that means (derive clojure.lang.Symbol ::any) got called somewhere |
| 12:14 | scottj | remleduff, rhickey: thanks |
| 12:15 | remleduff | ,(descendants :clojure.contrib.generic/any) |
| 12:15 | clojurebot | #{:clojure.contrib.generic.arithmetic/zero :clojure.contrib.complex-numbers/pure-imaginary :clojure.contrib.generic.arithmetic/one java.lang.Object :clojure.contrib.complex-numbers/complex} |
| 12:24 | remleduff_ | rhickey: I mailed in my CA this morning, sorry about the process mixup on ticket 317 |
| 12:25 | sattvik | rhickey: I think the only way to avoid making any changes to the build.xml is be restricted to the Java 5 nnotations, which do not include the full feature set, meaning the tests would be incomplete. I don't think that is a good idea. |
| 12:26 | sattvik | Given that Java 5 is no longer supported by Sun/Oracle, I am somewhat partial to disabling the test on Java 5 and printing a warning. |
| 12:42 | slyphon | so, i'm trying to run 1.2 and slime, and i keep getting "unmatched delimeter: )" |
| 12:42 | slyphon | my code works fine under 1.1 |
| 12:43 | technomancy | slyphon: that's probably an issue with clojure-test-mode, not swank |
| 12:43 | slyphon | ah |
| 12:43 | technomancy | try fetching the latest from git |
| 12:44 | slyphon | ok |
| 12:44 | slyphon | thanks :) |
| 12:52 | cemerick | surely we can run the build against 5 and 6 JDKs? |
| 12:52 | cemerick | rhickey, sattvik ^^ |
| 12:54 | sattvik | cemerick: The code works with 5, it is just the test that depends on annotations that were introduced in Java 6. Java 5 SE bundles only a few annotations. |
| 12:55 | sattvik | For example, I don't think that Java 5 SE contains any nested annotations, though they are supported by the language. |
| 12:56 | cemerick | sattvik: Sure; I'm just saying, it's pretty straightforward to run multiple builds in hudson for a single project. |
| 12:56 | cemerick | Then wrap the JDK 6-only tests in a jdk6-only macro that sniffs for the necessary dependency. |
| 12:57 | cemerick | YAFEUC |
| 12:57 | cemerick | (Yet Another Feature-based Execution Use Case) |
| 13:09 | Raynes | How does one find out of a method is static? |
| 13:10 | slyphon | Raynes: reflection, i think |
| 13:10 | slyphon | technomancy: is clojure-test-mode part of clojure-mode? |
| 13:10 | slyphon | oh, nvm |
| 13:10 | Raynes | I'm not quite sure how to use .getModifiers from Clojure. :| |
| 13:11 | rhickey | sattvik: stuarthalloway just dealt with this - ping him |
| 13:11 | nurv | Hi. |
| 13:12 | Raynes | Hi. |
| 13:22 | chouser | I'm trying to set up a namespace on-the-fly in which to load some trusted clojure code. |
| 13:22 | chouser | I'm using create-ns and then in a binding (refer 'clojure.core). This is working fine. |
| 13:23 | sattvik | rhickey: OK, I just missed him this morning. I added a comment on the bug. I guess the key obstacle to the deftype approach is that the build script will need to be modified. Perhaps that is not a big deal, but I wanted to check. I will go ahead and implement something this afternoon. |
| 13:23 | chouser | Now I need to import some class names, but since import is a macro that takes the value of *ns* at compile time, I feel stuck. |
| 13:23 | chouser | 'binding' won't cut it anymore. |
| 13:23 | stuartsierra | chouser: That's why I was annoyed when 'import' became a macro |
| 13:24 | stuartsierra | chouser: The only way around is a hack: use 'eval' or call methods in 'clojure.lang.Namespace' |
| 13:24 | stuartsierra | or maybe it was clojure.lang.RT |
| 13:24 | chouser | the import macro seems to generate code taht calls clojure.core/import* |
| 13:25 | chouser | But I'd really rather not do that. |
| 13:25 | chouser | I guess I can have the code I'm loading do its own import. :-/ |
| 13:25 | stuartsierra | clojure.core/import* is a special, not a real function anyway |
| 13:26 | chouser | oh. :-( |
| 13:26 | chouser | and since *ns* isn't getting passed in, it probably takes its value at compile time as well. |
| 13:26 | stuartsierra | It *should* be a real function |
| 13:27 | slyphon | technomancy: um, forgive my ignorance, please, but when doing the M-x package-install-from-buffer on clojure-test-mode and clojure-mode, it'll install itself under the elpa/ directory? |
| 13:32 | chouser | that seems to work. I'll just try to pretend I didn't do that. |
| 13:33 | stuartsierra | I'll pretend I didn't hear that. |
| 13:39 | LauJensen | Raynes: feature request, $ping ip.ip.ip.ip |
| 13:39 | Raynes | LauJensen: Duly noted. |
| 13:40 | LauJensen | I could have used it today when Maven Central was down - wanted to know if it was just me :) |
| 13:43 | lrenn | Excuse me if I'm way off base, but might it be useful to have another way to specify the classloader that RT uses to initialize other than using the thread's context class loader? |
| 13:53 | zakwilson_ | Why are there about 20 different jars for Compojure on clojars.org, some with non-descriptive descriptions? |
| 13:58 | Raynes | How does one catch nested exceptions? |
| 13:59 | LauJensen | zakwilson_: there seems to be a habit of pushing waaay to much stuff to clojars |
| 14:00 | LauJensen | We found one fork of ClojureQL there which was throughly broken - Why would anybody loot a jar, break it and then upload it ? |
| 14:01 | Raynes | Don't forget the Meth syringes. |
| 14:01 | zakwilson_ | Is meth normally injected? |
| 14:02 | Raynes | I'm pretty sure it's normally <insert anything that gets it into your body here>. |
| 14:06 | remleduff | How do you diagnose "why" lein deps is failing if you know the jar is there? |
| 14:07 | remleduff | I'm willing to believe I have a proxy problem somewhere, I just can't figure out what link in the chain isn't working at the moment |
| 14:08 | ataggart | raynes: what do you mean by "nested exceptions" |
| 14:12 | Raynes | ataggart: java.lang.OmgException: java.lang.WtfException: java.lang.BbqException: blah |
| 14:13 | ataggart | that is the cause chain |
| 14:13 | ataggart | you don't need to "handle" the causes |
| 14:13 | ataggart | unless you pull the cause out and throw it |
| 14:14 | remleduff | Are you saying you want to catch BbqException, but it's been wrapped by Wtf and OmgExpection? |
| 14:14 | ataggart | I'm not saying anything about "Want" |
| 14:15 | ataggart | but yes, Omg was caused by Wtf was caused by Bbq |
| 14:15 | ataggart | the exception you're holding is a Omg |
| 14:15 | Raynes | Sorry, doing 100 things at one time here. |
| 14:15 | ataggart | the causes are mostly informational |
| 14:15 | Raynes | But yeah, the BbqException is what I wanted. |
| 14:16 | ataggart | then don't create new exceptions |
| 14:16 | ataggart | or are you saying you're throwing an exception and something else is catching it and wrapping it? |
| 14:16 | chouser | there are several places in clojure where exceptions are wrapped in a way that does not add value. |
| 14:17 | Raynes | Something else is wrapping the exception. I just need to catch it. |
| 14:17 | clojurebot | http://paste.lisp.org/display/74305 |
| 14:17 | chouser | I think you have to catch the outer one, check to see if the root is the one you want and if not rethrow that outer one again. |
| 14:17 | ataggart | you can peel back the layers of the onion via (.getCause ex) |
| 14:18 | chouser | clojure.stacktrace/root-cause |
| 14:18 | Raynes | Okay. :) |
| 14:19 | remleduff | Does lein downloading jars use some port other than 80? |
| 14:19 | ataggart | bear in mind that that'll rip through any of *your* wrapped exceptions |
| 14:26 | cemerick | looks like pprint's a little borked lately? (pprint #{}) => NPE |
| 14:29 | bmason | what does "#< ... some content ... >" mean from a println? |
| 14:30 | chouser | bmason: that's how an object prints by default when it doesn't have a matching reader. |
| 14:30 | cemerick | replaca: do you want an issue for that, or is it a simple tweak? ^^ |
| 14:30 | slyphon | yeah, it's so if you try to read that with lisp, it'll barf |
| 14:30 | bmason | ah... I see |
| 14:30 | cemerick | ah, speaking of which.... |
| 14:30 | bmason | I'm trying to capture a sample request object from the Compojure framework |
| 14:31 | bmason | figured I'd just println it, clean it up and assign it using def |
| 14:32 | cemerick | bmason: use pr or prn |
| 14:32 | cemerick | even then though, there'll be plenty of unreadable objects |
| 14:32 | bmason | Clojure is dead sexy |
| 14:33 | cemerick | rhickey: can defrecords get a map-esque .toString that yields the same as what's shown w/ (str [some-record]) |
| 14:35 | slyphon | bmason: :) |
| 14:56 | _nj | hi |
| 15:07 | replaca | cemerick: can you give me an issue? with simple-dispatch or code-dispatch? |
| 15:08 | cemerick | replaca: Sure -- I'm going to triple-check my environment first. What is simple-dispatch vs. code-dispatch? |
| 15:09 | replaca | if you do nothing, you get simple dispatch |
| 15:09 | cemerick | ah, simple then |
| 15:09 | cemerick | just (pprint #{}) does it at the moment |
| 15:09 | replaca | and the output should be similar to what print would give you |
| 15:09 | replaca | yeah, that's simple |
| 15:10 | replaca | oh that's a set... sorry I was reading the curly braces as parens |
| 15:11 | replaca | cool, give me an issue and i'll knock it down this week. Does it seem to be just sets or is it worse than that? |
| 15:11 | cemerick | replaca: that's all AFAICT |
| 15:12 | cemerick | is pprint in need of a test suite? |
| 15:15 | LauJensen | ~seen etate |
| 15:15 | clojurebot | etate was last seen quiting IRC, 8403 minutes ago |
| 15:19 | slyphon | technomancy: hey, the completion in the latest clojure-mode seems a lot better |
| 15:21 | replaca | cemerick: well, there are tests (more for the underlying cl-format than pprint itself), but there certainly could be more |
| 15:22 | Raynes | dnolen is at war with his connection. |
| 15:22 | slyphon | Raynes: i think he's losing |
| 15:23 | Raynes | I agree with your observation, sir. |
| 15:23 | slyphon | that's what IPv6'll do to ya |
| 15:23 | slyphon | :) |
| 15:25 | dnolen | erg |
| 15:31 | slyphon | it'd be nice if the [{:keys [a b c]}] form could be used to capture [& args], or rather you could do (foo :a 1 :b 2) and have the [{:keys [a b]}] "handle that" |
| 15:31 | chouser | you can! |
| 15:31 | slyphon | uh |
| 15:31 | slyphon | you can do [& {:keys [a b]}] ? |
| 15:32 | chouser | should, yeah. |
| 15:32 | chouser | though I'm failing here so far... |
| 15:32 | slyphon | but then that's your variadic arity func |
| 15:32 | slyphon | hah |
| 15:32 | slyphon | i guess that's the rub, the limits on varargs |
| 15:33 | chouser | oh, this is an old clojure |
| 15:33 | chouser | ((fn [& {:keys [a b c]}] [a b c]) :b 2 :a 1) |
| 15:34 | jfields | if I have [1 2 1 3] is there any way to easily get [2 1 3]. (remove #(= 1 %) [1 2 1 3]) removes all instances of 1, which is not my desired behavior. |
| 15:34 | slyphon | jfields: (rest [1 2 1 3]) ? |
| 15:34 | hiredman | so you want the rest, not the first? |
| 15:34 | jfields | no |
| 15:34 | jfields | sorry, bad example |
| 15:34 | jfields | the element could be at any index |
| 15:35 | slyphon | jfields: so you want "remove first instance" |
| 15:35 | jfields | I want to remove only the first match, yes |
| 15:35 | hiredman | vectors don't do abitrary resizing |
| 15:35 | jfields | I don't need to resize, a new vector is fine, as long as it only has the first match removed. |
| 15:35 | hiredman | and seqs aren't index |
| 15:35 | hiredman | indexed |
| 15:36 | chouser | ,(let [[a b] (split-with #(not= 1 %) [5 6 1 2 1 3])] (concat a (next b))) |
| 15:36 | clojurebot | (5 6 2 1 3) |
| 15:36 | hiredman | you could generate an index over a seq, find the index of the item you want to remove, then generate a new seq with take/drop leaving that index out |
| 15:37 | hiredman | or what chouser said |
| 15:40 | jfields | chouser: wow. thanks. |
| 15:51 | ataggart | how neat that the map destructuring stuff only requires an even-count sequence |
| 15:51 | ataggart | ,(let [{foo :a bar :b} '(:a 2 :b 3)] [foo bar]) |
| 15:51 | clojurebot | [nil nil] |
| 15:51 | ataggart | hmm that worked on my box |
| 15:51 | ataggart | ,*clojure-version* |
| 15:51 | clojurebot | {:interim true, :major 1, :minor 1, :incremental 0, :qualifier "master"} |
| 15:52 | ataggart | guess it's a new thing with 1.2 |
| 15:53 | cemerick | it is |
| 15:57 | ordnungswidrig | is there a clojure lib to handle URIs the right way (rfc2396) especially parsing them? |
| 15:58 | chouser | there's java.net.URI |
| 15:58 | slyphon | yeah |
| 15:58 | slyphon | but that's not "the right way" |
| 15:58 | chouser | oh? |
| 15:58 | slyphon | it's handling of query arguments is totally psychotic if you're trying to build URIs |
| 15:58 | slyphon | its, even |
| 15:58 | slyphon | it only escapes '%' chars |
| 15:59 | chouser | :-( |
| 15:59 | slyphon | it's completely baffling |
| 15:59 | ordnungswidrig | hmm, does it parse? |
| 15:59 | slyphon | it parses a single-argument string correctly |
| 15:59 | ordnungswidrig | btw. why doesn't HttpServletRequest return a java.net.URI for getRequestURI then?! |
| 15:59 | ordnungswidrig | ;-) |
| 15:59 | slyphon | the escaping rules are totally insane |
| 16:00 | ordnungswidrig | slyphon: is the insanity from the rfc or invented by java.net.URI? |
| 16:00 | slyphon | i'm pretty sure it's invented by java.net.URI, it's the only implementation i've ever seen that does things that way |
| 16:00 | slyphon | in a way that's *totally* not useful |
| 16:01 | slyphon | i mean, look, it could be me being totally retarded |
| 16:01 | rsh | i connected to a swank server running remotely via slime-connect (emacs). Now, any clojure file I open locally is not associated with slime (i.e. c-c c-k compile file does not work). Any pointers on what is wrong? |
| 16:03 | ordnungswidrig | slyphon: the rfc is insane itself because it does not state any character set for % encoding. |
| 16:03 | slyphon | yeah, there's a lot wrong with the RFC |
| 16:03 | ordnungswidrig | slyphon: which means the charset depends on the application so java.net.URI should be able to specifiy the encoding. |
| 16:04 | slyphon | i'll say this |
| 16:05 | slyphon | i spent about 6 hours trying to get it to do what i wanted, then gave up and just did (str uri-up-to-query '?' my-generated-query-str) |
| 16:05 | slyphon | and handed that to (URI. ) |
| 16:06 | ordnungswidrig | slyphon: I only need some parsing at the moment |
| 16:07 | slyphon | ordnungswidrig: yeah, just tryin' to give a friendly "heads up" before you skipping through the thorn bushes :) |
| 16:08 | ordnungswidrig | slyphon: that's how I took it :-) |
| 16:08 | slyphon | :) |
| 16:26 | _nj | Can I start a swank server from a lein uberjar? |
| 16:27 | puredanger | so, I'm trying to understand defrecord and there ain't much I can find about it. defrecord creates a class and the current idea is to create one like (Foo. etc) ala Java classes? |
| 16:28 | chouser | yes |
| 16:29 | puredanger | and do I need to import a Foo record type before I use it? |
| 16:29 | chouser | no, defrecord auto-imports for you |
| 16:29 | puredanger | I guess if I want to use it sans ns I do |
| 16:29 | puredanger | I mean from another ns |
| 16:29 | ataggart | right |
| 16:29 | chouser | oh, right. yes, then you import |
| 16:30 | puredanger | and b/c it's a Java class the convention (requirement?) is to name it with a capital letter (Foo, not foo) ? |
| 16:32 | chouser | If anything, it's a convention, but I'm not sure it's even that quite yet. |
| 16:33 | chouser | it does seem common. |
| 16:33 | dnolen | puredanger: some people seem to be following that other's not. yes it's a Java class but it's also immutable cannot be subclassed and supports map operations. Not very Java class-y. |
| 16:37 | puredanger | and you can also optionally specify protocols (which map to methods on the Java obj) |
| 16:40 | bmason | I'm trying to compile a file in emacs and getting a name conflict error... I already tried running (ns-unmap) to remove the symbol |
| 16:40 | slyphon | bmason: easiest thing to do is restart the repl |
| 16:40 | bmason | seriously? |
| 16:41 | slyphon | that's the easiest |
| 16:41 | slyphon | i've found |
| 16:41 | bmason | yeah, I was hoping to avoid that |
| 16:41 | slyphon | you can also do ns-unmap, it's just not always enough |
| 16:41 | slyphon | i mean |
| 16:42 | bmason | maybe I'm not understanding what ns-unmap is supposed to do? |
| 16:42 | slyphon | sometimes it's kind of cumbersome to do that |
| 16:42 | slyphon | i usually go (ns 'blah.foo) (ns-unmap *ns* 'symbol-name) |
| 16:43 | bmason | do you need to be in the ns where the symbol was defined, or the NS that's referencing the one where it was defined? |
| 16:44 | slyphon | if blah.foo had a definition of quux |
| 16:44 | slyphon | and you moved quux into blah.bar |
| 16:44 | slyphon | you need to (ns blah.foo) (ns-unmap *ns* 'quux) |
| 16:48 | ivenkys | b |
| 16:49 | ivenkys | que ? |
| 16:49 | MrEvil | so I'm trying to understand how to specify the :indent option for lazy-xml/emit and I'm having trouble figureing it out. Where can I find the refrence for ':as' in regards to optional keyword parameters? What's the proper way to specify the argument in this case is it (lazy-xml/emit my-xml {:indent " "})? |
| 16:49 | bmason | slyphon: yeah, none of that is working... I don't understand why so I will just restart the REPL |
| 16:49 | kotarak | slyphon: (ns-unmap 'blah.foo 'quux). No need for ns. If you really want to, use (in-ns 'blah.foo). ns should be used only once. |
| 16:50 | slyphon | ah |
| 16:50 | slyphon | kotarak: ok, good to know |
| 16:50 | chouser | MrEvil: try (lazy-xml/emit my-xml :indent 2) |
| 16:50 | slyphon | kotarak: i figured one of the grown-ups would come along and tell me how to do it better |
| 16:51 | MrEvil | chouser: that was it. thanks! |
| 16:51 | chouser | MrEvil: np |
| 16:53 | MrEvil | so i'm curious about xml/emit and lazy-xml/emit being hard coded to always output to *out* instead of writing to a supplied bufferedwriter or file handle or something along those lines. It seams to me that it goes against the functional grain if you are required to use with-out-str in order to same your XML data to a file |
| 16:53 | MrEvil | also makes it hard to debug using print statements |
| 16:54 | MrEvil | am i wrong in thinking that this is wierd? |
| 16:54 | dakrone | technomancy: question for you |
| 16:55 | chouser | MrEvil: yeah, it's probably not best. clojure has several things like this. Besides emit: print printf println prn pr... |
| 16:55 | chouser | you can using (binding [*out* foo] ...) to send to a different outputstream without having it go into a String first |
| 16:56 | chouser | but I do think there should be some way to pass in the output stream directly. |
| 16:56 | slyphon | chouser: hrm, i don't think the [& {:keys [foo bar]}] works in 1.1 |
| 16:56 | dakrone | technomancy: is it a bug if I declare clojure 1.2-snapshot as a dependency in my lein project.clj, but when doing a 'lein repl' it uses clojure 1.1? |
| 16:56 | technomancy | dakrone: it's a bug in leiningen 1.1; it's fixed in 1.2 (which is a couple weeks away from release) |
| 16:56 | chouser | slyphon: no, I think destructuring seqs into maps is just in 1.2 |
| 16:57 | dakrone | technomancy: hmm...I'm working on a project with 1.2-specific features, should I just pull the latest lein from git and try using that? |
| 16:57 | technomancy | dakrone: sure; the other option is to use swank/nailgun instead of the repl task |
| 16:57 | dakrone | technomancy: not an emacs user |
| 16:57 | technomancy | dakrone: nailgun is an option too. the docs indicate it's tied to vim, but I don't think that's true |
| 16:58 | dakrone | technomancy: cool, I'll use nailgun instead then until the 1.2 release, thanks |
| 16:58 | technomancy | dakrone: lein 1.1 uses clojure 1.1, which had a bug that made the repl task impossible to implement correctly |
| 16:58 | dakrone | technomancy: interesting, what was the bug? |
| 16:59 | technomancy | ticket #299 |
| 16:59 | technomancy | ,ticket #299 |
| 16:59 | clojurebot | java.lang.Exception: Unable to resolve symbol: ticket in this context |
| 16:59 | technomancy | ~ticket #299 |
| 16:59 | technomancy | why can I never keep those straight? |
| 16:59 | technomancy | ~botsmack |
| 16:59 | clojurebot | Owww! |
| 16:59 | dakrone | heh, okay I can search using the number |
| 16:59 | technomancy | right. =) |
| 17:00 | cemerick | ~#299 |
| 17:00 | clojurebot | excusez-moi |
| 17:00 | cemerick | oh well |
| 17:00 | clojurebot | {:url http://is.gd/bVRhz, :summary "clojure.main -e disables stdin", :status :fixed, :priority :normal, :created-on "2010-04-16T23:43:43-05:00"} |
| 17:01 | cemerick | wonky |
| 17:01 | dakrone | and while we're on the subject of different versions, is there any var that's bound to a string of Clojure's version at runtime? |
| 17:01 | dakrone | something like *clojure-version*? |
| 17:01 | Chousuke | ,(clojure-version) |
| 17:01 | clojurebot | "1.1.0-master-SNAPSHOT" |
| 17:01 | dakrone | that would be it, thanks Chousuke |
| 17:02 | Chousuke | I wasn't even aware of that until recently |
| 17:02 | dakrone | now all it needs is something similar to Ruby's vars for all the different fields |
| 17:02 | dakrone | something like (clojure-major-version) -> 1 |
| 17:03 | dakrone | etc |
| 17:03 | Chousuke | well hmm |
| 17:03 | Chousuke | ,((partial *clojure-version* :major)) |
| 17:03 | clojurebot | 1 |
| 17:04 | dakrone | oh hey, already exists, silly me |
| 17:04 | dakrone | thanks again Chousuke |
| 17:17 | Raynes | LauJensen: Do you want the length of time it takes for the ping to complete, if it completes, or just whether or not the ping completes? |
| 17:18 | LauJensen | Raynes: something similar to ping -c 1 host, where if it pings once return the time, if host doesnt resolve or doesnt reply, print that |
| 17:22 | Raynes | LauJensen: It's not going to be very detailed, but I can tell you the time it takes and whether or not it completes. I'm using InetAddress.isReachable |
| 17:22 | LauJensen | cool |
| 17:28 | MrEvil | (with-open [*out* (io/output-stream output-file-name )] (lazy-xml/emit my-xml)) should work should it not? |
| 17:32 | kotarak | MrEvil: I think you need to wrap the stream in a writer. |
| 17:52 | bmason | is (:refer foo.bar :as baz) correct syntax inside a 'ns' definition? |
| 17:52 | kotarak | bmason: (:refer [foo.bar :as baz]) |
| 17:53 | Raynes | (:refer [foo.bar :as baz]) |
| 17:53 | Raynes | Eh. |
| 17:53 | Raynes | I should look at the monitor instead of watch television while I type. |
| 17:53 | bmason | clojure.lang.PersistentVector cannot be cast to clojure.lang.Symbol |
| 17:54 | Chousuke | you probably want require? |
| 17:54 | bmason | whereas it compiles without error without the vector, but doesn't properly initialize the alias |
| 17:54 | kotarak | Argh. Yes. require |
| 17:54 | Raynes | Yeah, I think you want require. |
| 17:54 | bmason | I'm on the 1.2 snapshot... |
| 17:54 | Chousuke | I haven't seen :refer used in ns ever. |
| 17:54 | bmason | k |
| 17:54 | Chousuke | except for :refer-clojure |
| 17:54 | Chousuke | or whatever it is |
| 17:55 | bmason | when I used :require I got an error saying it couldn't be found in clojure.core |
| 17:55 | bmason | oh nvm... works now |
| 17:55 | bmason | maybe I had something else wrong |
| 17:56 | bmason | ok, thanks guys |
| 18:00 | Dawgmatix | if i was to build something like heroku for compojure / other clojure web frameworks would anyone here want to buy clojure specific cloud services ? |
| 18:00 | Dawgmatix | I am trying to start a startup and the idea i was last working on (www.bitcrumb.com) seems to have bombed, so am looking for fresh ideas where i can make a honest living |
| 18:08 | Associat0r | join #proglangtheory |
| 18:12 | DuneMan | Hey all, I'm writing some code that reads a bunch of data indefinitely, I wrap the reads of this data in an "repeatedly" to turn it into a seq |
| 18:12 | DuneMan | however, I just ran into a case where this is causing a massive memory leak |
| 18:12 | DuneMan | because, apparently, using take-nth is causing the head of the list to be held |
| 18:13 | DuneMan | so I get a huge cons list that eats up all my memory |
| 18:14 | DuneMan | (doseq [e es] (println e)) <-- no memory leak, (doseq [e (take-nth 1000 es)] (println e)) <--- memory grows unbounded and the jvm dies. |
| 18:14 | DuneMan | I do *not* see how take-nth is holding the head. |
| 18:15 | DuneMan | I have created this issue before when I introduced a function, that I passed the seq to, which was (fn [& args] ...) [e.g. something that was created with partial], and doing this caused realization of the list |
| 18:15 | DuneMan | Thoughs? Should I not use seq to represent my infinite data? |
| 18:16 | hiredman | what version of clojure are you using? |
| 18:16 | hiredman | master (what will be 1.2) is more aggressive about clearing locals |
| 18:17 | DuneMan | 1.2 |
| 18:17 | DuneMan | oh wait |
| 18:17 | DuneMan | 1.1 |
| 18:18 | hiredman | try a snapshot of 1.2 |
| 18:18 | DuneMan | Are there any major problems with 1.2 snapshot that I should know about? |
| 18:19 | hiredman | nope |
| 18:19 | hiredman | well, there are changes |
| 18:19 | hiredman | some fns where moved from contrib into core |
| 18:22 | DuneMan | (1.1.0-master-SNAPSHOT... right?) |
| 18:23 | DuneMan | or is it 1.2.0-master-SNAPSHOT |
| 18:24 | DuneMan | found it. |
| 18:42 | DuneMan | grrr - BLEH:. (hash-map :a 1 :a 2) -->> duplicate key error |
| 18:42 | DuneMan | (merge (map hash-map s)) ?? |
| 18:43 | DuneMan | er, (apply merge |
| 18:45 | MadWombat | Hello |
| 18:47 | DeusExPikachu | anyone have any experience with using / writing custom class loaders for support for versioning, loading/unloading new classes from jars during runtime? I'm trying to design a clojure distribution and looking for tips |
| 18:58 | DeusExPikachu | I'd prefer to use an existing classloader that meshes well with clojure's methods of operation which may not exist which is why I am considering writing my own |
| 19:27 | XAMPP | sorry :/ |
| 19:31 | DuneMan | hiredman: Thanks! 1.2 isn't exhibiting the same issue. |
| 20:10 | defn | cool stuff on disclojure/planet.clojure.in today |
| 20:10 | defn | the lava lamp build env is just insanely awesome |
| 20:12 | DuneMan | We had that going at an old company of mine |
| 20:13 | DuneMan | Which was, conveniently, powered by our product |
| 20:13 | DuneMan | and an arduino microcontroller that could speak internets |
| 20:13 | DuneMan | and that got expanded into live traffic lights |
| 20:19 | defn | DuneMan: cool |
| 20:19 | defn | DuneMan: im trying to find the right light or gadget to do something neat |
| 20:20 | DuneMan | Traffic lights are actually reasonably priced on ebay :-D |
| 20:20 | defn | id like to wire up a bunch of stuff and have it play a nice gong sound when the light changes as well :) |
| 20:20 | DuneMan | and impressive |
| 20:21 | defn | dune http://www.globalindustrial.com/p/material-handling/dock-truck/dock-traffic-systems/dock-traffic-light-system?utm_source=shopping&utm_medium=shp&utm_campaign=Dock-Traffic-Systems-shop&infoParam.campaignId=WP |
| 20:21 | sexpbot | "Dock & Truck Equipment | Dock-Traffic Systems | Dock Traffic Light System | B184101 - GlobalIndustrial.com" |
| 20:21 | defn | that's all i could find |
| 20:22 | defn | 900$ is a little out of my price range :) however, it weight 156lbs and would no doubt be impressive |
| 20:22 | defn | in fact, probably more annoying than anything without a filter over it |
| 20:23 | defn | however, getting a tan from the gigantic red light turning on in your face would probably get you satisfying your tests pretty damn quickly :) |
| 20:23 | defn | @DuneMan |
| 21:15 | slyphon | hrmf, is something different about binding in 1.2 ? |
| 21:17 | slyphon | i was binding a fn over c.c.sql.internal/transaction* to neuter it, but now it seems that isn't effective in 1.2 |
| 21:21 | slyphon | gah |
| 21:21 | slyphon | sonofa |
| 21:25 | slyphon | does the EPL allow me to copy c.c.sql into my own codebase and make modifications to it? |
| 21:28 | tomoj | only if your code is also EPL, I think |
| 21:28 | tomoj | but I am not a lawyer |
| 21:28 | slyphon | shit |
| 21:30 | tomoj | if you don't release the code it's less of a problem I think |
| 21:30 | slyphon | ah |
| 21:32 | slyphon | hrm |
| 21:32 | slyphon | you can't bind over a macro? |
| 21:33 | slyphon | this is really weird |
| 21:33 | tomoj | you mean like (binding [doseq ...] ...) ? |
| 21:33 | slyphon | i was able to monkey-patch clojure.contrib.sql.internal/transaction* under 1.1 so that it didn't actually do anything (i'm wrapping things in a JTA transaction, and you can't call .commit on a single connection) |
| 21:33 | slyphon | yeah |
| 21:34 | tomoj | by the time it would make a difference, the macro call will be gone |
| 21:34 | slyphon | and that doesn't seem to work under 1.2, which kind of sucks as it's a pretty core behavior i was counting on |
| 21:35 | slyphon | well, transaction* is the function |
| 21:35 | tomoj | so you're doing (binding [transaction* ...] ...) ? |
| 21:36 | slyphon | yeah essentially (binding [c.c.sql.internal/transaction* (fn [f] (f))] ...) |
| 21:38 | tomoj | well, hmm |
| 21:38 | slyphon | yeah, any idea why that wouldn't work under 1.2? |
| 21:39 | tomoj | the exact same thing worked in 1.1? |
| 21:39 | slyphon | yep |
| 21:39 | slyphon | same code, didn't change a thing |
| 21:39 | slyphon | only |
| 21:39 | slyphon | well, i'm using the 1.2 version of c.c now |
| 21:39 | tomoj | well, my intuitions about why it wouldn't work are that what you are trying is just impossible |
| 21:39 | tomoj | so I must be confused |
| 21:39 | slyphon | heh, one sec |
| 21:40 | talios | was there a chance in how c.c implemented the method between 1.1 and 1.2? anything on that side that's preventing the change? |
| 21:40 | talios | s/chance/change/ |
| 21:40 | sexpbot | was there a change in how c.c implemented the method between 1.1 and 1.2? anything on that side that's preventing the change? |
| 21:40 | tomoj | whoa |
| 21:40 | slyphon | that's a really useless feature |
| 21:41 | tomoj | oh, I guess I see what you're trying |
| 21:41 | tomoj | and that it should be possible |
| 21:42 | tomoj | the transaction macro won't expand any differently but will just now call the fn you slipped in, right? |
| 21:42 | talios | the (binding) only works on the current thread tho right - is something under your new code thats changing threads? |
| 21:42 | slyphon | yes |
| 21:42 | slyphon | no |
| 21:43 | slyphon | nothing is changing threads in my code |
| 21:43 | talios | *nod* any AOT compilation? |
| 21:43 | slyphon | uhm |
| 21:43 | slyphon | nothing relevant |
| 21:43 | slyphon | the only AOT i do is to generate Exception classes |
| 21:46 | slyphon | there hasn't been a change to that lib between cc 1.1->1.2 |
| 22:03 | alexyk | I am using a project with JNI. It needs some libs in /opt/lib. Where do I stick -Djava.library.path in repl invocation? |
| 22:05 | lancepantz | alexyk: no different than without |
| 22:05 | lancepantz | i just put it as the first option after java usually |
| 22:07 | lancepantz | alexyk: are you the same alexy that was talking to my coworker about jiraph? |
| 22:07 | vIkSiT | hi all |
| 22:07 | alexyk | lancepantz: ah, are you the geni guy too? |
| 22:07 | lancepantz | yep :) |
| 22:07 | vIkSiT | is anyone here using c.c.string/str-utils/str-utils2? |
| 22:08 | alexyk | lancepantz: yeah, I'm engaging in unnatural acts with the said jiraph. |
| 22:08 | vIkSiT | I'm trying to figure out why there a) three different libraries and b) why requiring all three still doesn't give me access to chop/re-sub and other functions? |
| 22:08 | alexyk | trying to install it properly |
| 22:08 | alexyk | you guys need some leiningen goodness! :) |
| 22:09 | lancepantz | i know |
| 22:09 | lancepantz | i tried at one point, but all the jni stuff just became a huge pain |
| 22:09 | clojurebot | the point of moby dick is "be yourself" |
| 22:09 | alexyk | lancepantz: but, it's brilliant. You must give Justin a big raise. |
| 22:09 | alexyk | protobuf works from clojure |
| 22:09 | alexyk | and tokyocabinet does too |
| 22:10 | lancepantz | i designed it too ;P |
| 22:10 | alexyk | lancepantz: he committed it :) |
| 22:10 | alexyk | then add yourself to the committers on github, these repos will be famous! :) |
| 22:10 | alexyk | I've tried some other crappy TDB bindings and they didn't work at all |
| 22:11 | lancepantz | yeah, we've got alot uncommited as well |
| 22:11 | alexyk | BTW, I suggest you factor out jiraph.tc as a separate TDB binding |
| 22:11 | alexyk | so folks can use it instead of BDB |
| 22:11 | alexyk | lancepantz: so are you moving from ruby to clojure? |
| 22:11 | lancepantz | we have it to where the graph is fully versioned as well, in that you can roll back and forward through modifications |
| 22:12 | lancepantz | we also have a rest front end |
| 22:12 | alexyk | lancepantz: I was asking Justin about that. He writes that a node exists in all layers. What if nodes are added every day? |
| 22:12 | alexyk | I'd like every day to be a layer |
| 22:12 | lancepantz | but yeah, moving from ruby to clojure |
| 22:12 | alexyk | and nodes to exist from some day onward; in its own and future layers |
| 22:12 | lancepantz | yeah, we were discussing your message earlier |
| 22:12 | alexyk | that would allow me to process things like Twitter in parallel very nicely |
| 22:13 | alexyk | so I guess if you version it, you version all layers too? |
| 22:13 | lancepantz | the problem with that is that layers are stored in separate tokyo cabinet files on disk |
| 22:13 | lancepantz | and its not nearly as fast if your walk has to cross files |
| 22:14 | alexyk | lancepantz: ah, hmm. |
| 22:14 | lancepantz | its a good idea to never have a walk cross layers |
| 22:15 | lancepantz | but yeah, any data is versioned |
| 22:15 | lancepantz | we also have a replication system, it uses the revision log |
| 22:17 | alexyk | lancepantz: sounds yummy! |
| 22:18 | lancepantz | and good advice on factoring out jiraph.tc, thats on our to do list |
| 22:18 | lancepantz | we're working on psql backend |
| 22:22 | alexyk | lancepantz: psql used to be slower than embedded |
| 22:22 | alexyk | btw why did you drop BDB JE? |
| 22:23 | lancepantz | it kept getting corrupted and we couldn't figure out why |
| 22:23 | wlangstroth | postgres is awesome (I know that's not helpful or technical, but I'm a postgres fanboy - can't help it) |
| 22:23 | slyphon | wlangstroth: huzzah! |
| 22:23 | slyphon | indeed :) |
| 22:24 | wlangstroth | haha - you just "huzzah"'d me |
| 22:24 | wlangstroth | slyphon: yeah ... Slony ... *cough* |
| 22:24 | slyphon | :D |
| 22:24 | slyphon | man |
| 22:24 | slyphon | i took one look at slony and said "You know, i'll just take a dump every 15 minutes and pray" |
| 22:24 | lancepantz | the main idea behind adding psql is to have a single interface to the graph and other data, which we use psql for |
| 22:25 | wlangstroth | I'm playing with bup (http://github.com/apenwarr/bup) for replication |
| 22:26 | wlangstroth | slyphon: no kidding. The difference in quality between postgres and its replication "solution" is vast and disheartening. |
| 22:26 | wlangstroth | bup isn't production-ready, but it's an interesting angle on the problem |
| 22:27 | slyphon | wlangstroth: well, the next release should have something that's better than what mysql has built-in |
| 22:27 | slyphon | yeah, sure, using git as a backup backend is indeed something i've thought about |
| 22:27 | wlangstroth | what, version 9.0? |
| 22:27 | slyphon | i'm glad to see someone was sufficiently motivated to actually do it :) |
| 22:27 | alexyk | lancepantz: did you see cupboard? |
| 22:27 | slyphon | uhm |
| 22:27 | slyphon | wlangstroth: 8.5 ? |
| 22:27 | slyphon | oh, maybe it's 9.0 now |
| 22:28 | slyphon | i think they changed the numbering |
| 22:29 | lancepantz | alexyk: justin looked at it, i can't remember what the issue with it was |
| 22:29 | wlangstroth | yeah. I just switched up to 8.4 about two months ago - lots of excellent changes |
| 22:29 | alexyk | lancepantz: works like a charm for me |
| 22:30 | lancepantz | alexyk: are you using it for your graph work? |
| 22:30 | alexyk | yep. very cute and perfect for any clojure data |
| 22:30 | alexyk | except reading is slower even with N threads; but faster than Mongo |
| 22:32 | wlangstroth | slyphon: do you do a lot of database work? |
| 22:32 | slyphon | yeah, i mean, on and off |
| 22:33 | slyphon | depends on the project |
| 22:33 | wlangstroth | right, otherwise you'd be a dba |
| 22:33 | slyphon | hahahaha |
| 22:33 | lancepantz | alexyk: if you ever put together any benchmarks of what you've evaluated, i'd love to see them |
| 22:33 | slyphon | god forbid! |
| 22:33 | wlangstroth | I wasn't going to say it, but ... yeah |
| 22:33 | slyphon | hahaha |
| 22:33 | lancepantz | alexyk: i'm anxious to do jiraph vs neo4j |
| 22:34 | alexyk | lancepantz: would be interesting, but in fact my graphs fit my small RAM of 64 GB so I only need to slurp them whole |
| 22:34 | alexyk | hence TDB seems good choice |
| 22:34 | lancepantz | according to some published neo4j benchmarks, we should be 10x faster, but i'm not sure how dated and accurate they were |
| 22:34 | alexyk | I don't want to walk no disks |
| 22:34 | alexyk | neo4j had a lot of progress lately |
| 22:35 | wlangstroth | slyphon: I met a guy at a conference whose bread-and-butter is FoxPro. Remember FoxPro? |
| 22:35 | slyphon | jesus |
| 22:35 | slyphon | "Career FAIL" |
| 22:35 | alexyk | lancepantz: did you guys buy the Mormon database :) ? |
| 22:36 | wlangstroth | slyphon: you'd think, but the guy was doing really well! He was hiring! |
| 22:36 | lancepantz | alexyk: we took a different approach, neo4j stores incident edges seperate from the nodes, while we store the edges on the nodes themselves, so theoretically we'll have far less seeks on an equivalent walk |
| 22:36 | slyphon | wow |
| 22:36 | slyphon | just...wow |
| 22:36 | slyphon | alexyk: :) |
| 22:37 | alexyk | lancepantz: yeah, those nasty "relationships" bothered me for a simple graph |
| 22:37 | wlangstroth | alexyk: are you playing with neo4j at all? |
| 22:38 | alexyk | wlangstroth: tried to, didn't go far; BDB JE solved my simple needs and now jiraph looks promising |
| 22:38 | alexyk | but "one of these days" |
| 22:38 | slyphon | oy |
| 22:38 | slyphon | BDB? |
| 22:38 | alexyk | cupboard rules |
| 22:39 | slyphon | i had some *bad* experiences w/ BDB + python back in the day |
| 22:39 | wlangstroth | alexyk: ah, gotcha - I'm testing out some of these systems, but I don't have the billion-row data-sets to really do any of them justice, so I'm asking around. |
| 22:40 | alexyk | bbl |
| 22:42 | defn | FoxPro?! hahahahaha. |
| 22:42 | lancepantz | bdb and neo4j aren't really for the same problem |
| 22:42 | lancepantz | i think his point was that his graph was simple enought that neo4j was overkill |
| 22:43 | slyphon | wlangstroth: "berkley db" |
| 22:43 | slyphon | aka "sleepycat" |
| 22:44 | lancepantz | aka, older, slower, more corruptable version of tokyo cabinet :P |
| 22:44 | wlangstroth | Oh, okay |
| 22:44 | wlangstroth | only ... in Java. Um ... dear God, why? |
| 22:46 | wlangstroth | defn: no kidding - the reason he was doing a bunch of conferences is that Microsoft is dropping support in 2015 |
| 22:46 | defn | no wonder MS is tanking these last 10 years |
| 22:46 | defn | they still support foxpor |
| 22:46 | defn | pro |
| 22:47 | defn | MS management is so out of touch |
| 22:48 | wlangstroth | dude's making more than I do, so I'm not going to judge. But yeah. |
| 22:48 | alexyk | hey stop pooping ob BDB JE. Java Edition completely rewritten in, well, Java. Threads, transactions, very well-understood and supported. I never had any problems with JE. Operate your machinery well! :) |
| 22:48 | alexyk | Tokyo Cabinet is a C monster you try to stick your little JNI in. JE is pure Java |
| 22:49 | wlangstroth | alexyk: hey, that's cool, I wouldn't personally be motivated to re-write berkley db in java myself, but to each his own. |
| 22:49 | alexyk | tc is a pain in the neck installing, that's what anyone who tries to build jiraph will quickly realize and remember forever! especially how it priduces wrong mach-o on snow leopard out of the box |
| 22:50 | defn | wlangstroth: i know lots of people who make a lot of money doing boring antiquated garbage that no one else in their right mind would continue to support |
| 22:50 | defn | i just feel sorry for them |
| 22:50 | alexyk | I suggest folks try cupboard off github |
| 22:50 | alexyk | some guy is optimizing IDB/360 assembly language... inside a simulator on Windows. |
| 22:50 | alexyk | now that's job security |
| 22:50 | alexyk | IBM/360 I meant |
| 22:51 | wlangstroth | I guess some people just want the cheque and don't get bored. I envy them, in a way. |
| 22:52 | wlangstroth | 360 assembly ... that's nerd wizardry |
| 22:52 | DeusExPikachu | i'm grabbing clojure's classloader through (.get clojure.lang.Compiler/LOADER), but calling (.addURL ... file) doesn't seem to do anything, ie I can't (require) new packages |
| 22:52 | defn | wlangstroth: i dont. those people are slaves. drones. boring rat race paper chasing buffoons. |
| 22:53 | defn | now let me tell you how i /really/ feel! |
| 22:53 | alexyk | the guy optimizing assembly of a nonexistent machine is a genius |
| 22:53 | wlangstroth | alexyk: agreed |
| 22:54 | wlangstroth | defn: if you like programming, those people seem like strange imposters, it's true |
| 22:54 | talios | wasn't addUrl() support removed? |
| 22:54 | DeusExPikachu | how do I add new jars and source directories so the classloader sees it? (also with the above methods, checking the URLs with .getURLs seems to not do anything |
| 22:54 | DeusExPikachu | using 1.1.0 |
| 22:55 | defn | wlangstroth: it's more than that to me. i think they actually undermine the work of serious programmers and engineers. |
| 22:56 | defn | wlangstroth: i dont even want to be associated with people who dont treat this stuff as art |
| 22:56 | DeusExPikachu | s/do anything/return anything different before and after .addURL |
| 22:56 | defn | it's like a doctor who, in the process of practicing medicine, manages to slowly kill his patients |
| 22:57 | lancepantz | hahahah |
| 22:57 | wlangstroth | DeusExPikachu: not ignoring you, just can't help - using leiningen |
| 22:57 | defn | DeusExPikachu: same here |
| 22:57 | DeusExPikachu | wlangstroth, np, just getting it out there |
| 22:58 | wlangstroth | defn: it's more like a psychiatrist who gradually drives his patients insane, because that's what actually happens |
| 22:58 | alexyk | DeusExPikachu: why are you grabbing the loader? Do you like to grab loaders? |
| 22:59 | wlangstroth | I've worked with crappy programmers (or overly-clever programmers) and insanity is what ensues |
| 22:59 | defn | wlangstroth: haha |
| 22:59 | DeusExPikachu | alexyk, trying to design a "clojure distribution", so I need a way to do custom modifications of classpath during runtime |
| 23:00 | alexyk | DeusExPikachu: cool! I was that mentioned a few times, adding to classpath from the repl here, but don't remember now |
| 23:00 | defn | im a crappy programmer in that im not the fastest most productive guy on the team, but what i have that a lot of the people i encounter don't is: I take this stuff real seriously. I can usually tell a legit programmer from a fake by asking them what they hack on outside of work, where they host their public repos, etc. |
| 23:01 | wlangstroth | I think in 1.1.0, there's a classpath function - let me check |
| 23:01 | DeusExPikachu | alexyk, I already got basic repository functionality and dependency resolution working, just want to be able, at first, to start projects without using much scripting |
| 23:01 | defn | "I've got a wife and kids-- I don't have time to program outside of work." <--asshole |
| 23:01 | slyphon | i don't think you can modify the classpath at runtime |
| 23:01 | alexyk | the fact about crappy programmers is, a good one is 1000x better than a bad one. That's why programming is so skewed. A good startup with 3 people can beat an offshore farm of a 100. |
| 23:02 | slyphon | alexyk: that's been my argument against PHP for a looooong time |
| 23:02 | defn | i wrote some PHP last night. oh god was it painful. |
| 23:02 | alexyk | defn: sounds like a reasonable guy to me :) |
| 23:02 | DeusExPikachu | slyphon, you're right you can't, but clojure uses an extension of URLClassLoader, which can arbitrary URLs to load from |
| 23:02 | defn | alexyk: i just dont understand how when you get home from work, you dont hack around on a little project or something |
| 23:02 | slyphon | ah |
| 23:02 | wlangstroth | http://richhickey.github.com/clojure/branch-1.1.x/clojure.core-api.html#clojure.core/add-classpath |
| 23:03 | alexyk | defn: how about you put kids to bed and spend time with your wife? :) |
| 23:03 | slyphon | DeusExPikachu: ok, you're obviously more aware of what's goin on than me :) |
| 23:03 | defn | i have a girlfriend i live with and we seem to balance my nerdery and our life together pretty well -- i mean i can see kids complicating that pretty significantly, but i still think id be sitting on the couch with my kid while they watch Dora the Explorer, and I'd be reading a programming book |
| 23:03 | alexyk | and you become 10x more productive at work. E.g. devnull slashdot and all other websites. Don't use browsers for anything other than API docs. :) |
| 23:04 | wlangstroth | defn: you're not a crappy programmer. Crappy programmers are ... something else |
| 23:04 | slyphon | defn: kids don't end your life |
| 23:04 | slyphon | defn: i made that mistake |
| 23:04 | slyphon | thinking that |
| 23:04 | alexyk | defn: before they get to Dora, you need to kind of make sure they grow there :) |
| 23:04 | defn | ahhhh yes! |
| 23:04 | defn | they need attention, do they? |
| 23:04 | slyphon | alexyk: argh! dora! |
| 23:04 | slyphon | eh |
| 23:05 | slyphon | ;) |
| 23:05 | wlangstroth | haha! Dora! That evil ... wait, is Lau on? |
| 23:05 | alexyk | slyphon: I have no TV and my kid was lost at Disney World. Like, who *are* all these people? |
| 23:05 | slyphon | alexyk: i don't know how they get the audio on that cartoon to be SO DAMN PIERCING! |
| 23:05 | slyphon | every time i hear her voice i wanna run into the next room |
| 23:06 | defn | i hate to use this, because it is a bit of a cliche, but a programmer without passion is like... clojure without map |
| 23:06 | alexyk | wlangstroth: is there a Danish version of Dora Lau should be especially familiar with? :) |
| 23:07 | alexyk | defn: yeah! a programmer must be obssessed. I woke up at 2 am last night to torture jiraph into submission. (Thanks lancepantz...:) |
| 23:07 | wlangstroth | alexyk: naw, he's just sensitive to the language, and Dora brings out the sailor just a bit. It's an awful show. |
| 23:07 | slyphon | wlangstroth: yeah, what's up with that? |
| 23:07 | slyphon | wlangstroth: i was gobsmacked that he actually reprimanded me for saying "f**k" in the channel the other day |
| 23:07 | alexyk | or is Lau in love with Dora? |
| 23:07 | slyphon | on *IRC* ffs! |
| 23:07 | replaca | cemerick: are you in here? |
| 23:08 | defn | alexyk: exactly. it's that insane (literally) and often disgusting drive that you get when you're knee deep in some hackery. there will be no stopping at 5pm. no stopping at 10pm. no stopping until it works. |
| 23:08 | DeusExPikachu | wlangstroth, I went to the source, and it just calls clojure.lang.RT.addURL, which when I check that, gets the classloader as I tried before, call Thread.currentThread().getContextClassLoader(). Actually I noticed there are like 5 classloaders in the runtime, and the most childish is from clojure.lang.Compiler/LOADER |
| 23:08 | slyphon | defn: it's that drive that makes you go past the point where it hurts |
| 23:08 | alexyk | defn: kids tend to moderate that, but that stays. You just become 100x more effective. And you don't pick wrong fights. :) |
| 23:08 | wlangstroth | slyphon: meh. He's one of the cool kids, so I'm not saying anything. |
| 23:09 | slyphon | wlangstroth: i was just surprised, that's all |
| 23:09 | slyphon | wlangstroth: nothing against him |
| 23:09 | wlangstroth | slyphon: course not - he's hilarious |
| 23:09 | slyphon | :) |
| 23:10 | DeusExPikachu | the main problem I have right now is why does (.addURL classloader-from-above URL) doesn't change the result of (.getURLs classloader-from-above)? |
| 23:10 | defn | alexyk && slyphon: http://www.youtube.com/watch?v=iMjG2s6UOaw This is how I feel about "going past the point where it hurts." |
| 23:10 | sexpbot | "YouTube - Arnold Pumping Iron funny clip" |
| 23:11 | defn | damned sexpbot ruining the surprise |
| 23:11 | slyphon | hahah |
| 23:11 | DeusExPikachu | defn, hey you know that's my governor |
| 23:11 | slyphon | the Governor of California, ladies and gentlemen |
| 23:11 | defn | at least he's not soliciting gay sex in airport bathroom stalls |
| 23:11 | slyphon | *that guy* has the power to grant clemency |
| 23:12 | wlangstroth | DeusExPikachu: hehe. does it work? |
| 23:12 | defn | not that there's anything wrong with being gay or having sex. it's the airport bathroom that really muddies the situation. |
| 23:12 | slyphon | hahaha |
| 23:13 | wlangstroth | Ahnuld does not grant clemency. If you can survive the electric chair, you're free to go. |
| 23:13 | DeusExPikachu | wlangstroth, which add-classpath? no :( |
| 23:13 | defn | also, wlangstroth && slyphon -- #clojure-casual exists so we dont have to endure the wrath of Lau |
| 23:13 | slyphon | ah |
| 23:13 | wlangstroth | DeusExPikachu: bah! I was hoping for some magic-by-obscurity |
| 23:14 | alexyk | is there a #clojure-confidential? |
| 23:14 | slyphon | alexyk: we could tell you, but then we'd have to k...tell you |
| 23:15 | alexyk | slyphon: hmm, apparently there is! |
| 23:15 | wlangstroth | wow, a lot has changed since 1.1.0. I haven't even looked at 1.1 before |
| 23:15 | slyphon | alexyk: hah |
| 23:15 | slyphon | ! |
| 23:18 | wlangstroth | DeusExPikachu: if you search the irc logs on http://clojure-log.n01se.net/ for add-classpath, there's a ton of discussion about it |
| 23:18 | sexpbot | "#clojure log - May 05 2010" |
| 23:18 | DeusExPikachu | that's today |
| 23:18 | DeusExPikachu | but yeah i'm searching |
| 23:19 | slyphon | y'know what would be useful, something that would check a namespace for unused imports/requires |
| 23:20 | defn | slyphon: that'd be darned handy |
| 23:20 | slyphon | i mean, totally overy *my* head :) |
| 23:21 | defn | slyphon: maybe something to mention to tcrayford for clojure-refactoring |
| 23:21 | slyphon | defn: i'll keep it in mind |
| 23:21 | defn | maybe it would refactor your ns macro to do :only for the used functions |
| 23:21 | slyphon | oooh |
| 23:22 | defn | i dont think that's actually all that difficult slyphon |
| 23:22 | defn | ,(ns-interns 'clojure.contrib.pprint) |
| 23:22 | clojurebot | {english-ordinal-units #'clojure.contrib.pprint/english-ordinal-units, pprint-map #'clojure.contrib.pprint/pprint-map, compiled-format6472 #'clojure.contrib.pprint/compiled-format6472, parse-lb-options #'clojure.contrib.pprint/parse-lb-options, formatter-out #'clojure.contrib.pprint/formatter-out, process-directive-table-element #'clojure.contrib.pprint/process-directive-table-element, formatter #'clojure.contrib.pprint/fo |
| 23:23 | defn | for example |
| 23:23 | slyphon | hrm |
| 23:23 | slyphon | yeah, but then you gotta analyze the code to pull out all the fn calls |
| 23:24 | slyphon | and compare them to the stuff in :use |
| 23:24 | defn | yeah but that wouldn't be too difficult, just go line by line for the file |
| 23:24 | defn | it's like a fancy rename for namespacen |
| 23:26 | DeusExPikachu | hmm I was reading (.getURLs wrong) need to use map or something to iterate through it to get at its values, it is actually getting stored, the problem now then is how do I load the URL? |
| 23:27 | defn | ,(map #(str (first %)) (ns-interns 'clojure.contrib.pprint)) |
| 23:27 | clojurebot | ("english-ordinal-units" "pprint-map" "compiled-format6472" "parse-lb-options" "formatter-out" "process-directive-table-element" "formatter" "right-bracket" "arg-navigator" "check-arg-conditional" "set-indent" "conditional-newline" "process-bracket" "special-chars" "downcase-writer" "defdirectives" "translate-param" "pprint-simple-list" "pprint-array" "flag-defs" "execute-format" "iterate-list-of-sublists" "pprint-agent" " |
| 23:30 | replaca | defn: you can load the namespace, do an ns-map, look at each symbol to see where it came from, and generate the use from that |
| 23:38 | vIkSiT | hmm, how would you use a regex to find a word that is enclosed between two characters (say, *)? |
| 23:39 | slyphon | [*][-0-9a-zA-Z]+[*] |
| 23:39 | slyphon | is one way |
| 23:39 | vIkSiT | I've got a regex that finds the word _with_ those characters .. (re-find #"\*[a-z]+\*" "this is a *test* statement")) |
| 23:39 | slyphon | vIkSiT: you need to capture |
| 23:39 | slyphon | #"\*([a-z]+)\*" |
| 23:39 | slyphon | then pull out $1 |
| 23:40 | vIkSiT | slyphon, hmm, how do you define "pull out $1" btw? |
| 23:40 | slyphon | heh, sorry |
| 23:40 | MadWombat | well, if the character is *, #"\*\S+?\*" should do the trick |
| 23:41 | vIkSiT | hehe |
| 23:41 | vIkSiT | MadWombat, hmm that doesn't seem to work for me |
| 23:41 | MadWombat | or #"\*(\S+?)\*" if you want capture groups |
| 23:41 | MadWombat | lemme actually try |
| 23:42 | vIkSiT | interesting. so the latter gives me a list of two elements |
| 23:42 | vIkSiT | (and I can get the second of that list) |
| 23:42 | MadWombat | user> (re-find #"\*\S+?\*" "This is a *test* of regex") |
| 23:42 | MadWombat | "*test*" |
| 23:42 | MadWombat | user> (re-find #"\*(\S+?)\*" "This is a *test* of regex") |
| 23:42 | MadWombat | ["*test*" "test"] |
| 23:43 | MadWombat | works for me |
| 23:43 | slyphon | ,(clojure.contrib.str-utils/re-sub #"\*(\w+)\*" "$1" "*this*") |
| 23:43 | clojurebot | "this" |
| 23:43 | MadWombat | slyphon: ah! the bots help :) |
| 23:43 | slyphon | :) |
| 23:44 | vIkSiT | slyphon, ah interesting |
| 23:44 | vIkSiT | slyphon, how does that $1 work here? |
| 23:44 | slyphon | it just means "the first capture group" |
| 23:44 | MadWombat | vIkSiT: well, with re-find you don't have to pull in yet another piece of contrib :) |
| 23:44 | slyphon | MadWombat: totally |
| 23:45 | slyphon | mine was just to demonstrate what i meant by $1 |
| 23:45 | vIkSiT | ah |
| 23:45 | slyphon | which is kind of a perlism |
| 23:45 | vIkSiT | actually, i do need to a substitution later :) |
| 23:45 | MadWombat | yes |
| 23:48 | MadWombat | and to complete this (re-seq #"\*(\S+?)\*" "This is a *test* and *another* of regex") |
| 23:48 | MadWombat | ,(re-seq #"\*(\S+?)\*" "This is a *test* and *another* of regex") |
| 23:48 | clojurebot | (["*test*" "test"] ["*another*" "another"]) |
| 23:51 | vIkSiT | ah yes re-seq is awesome |
| 23:52 | vIkSiT | ,((second (second (["*test*" "test"] ["*another*" "another"])))) |
| 23:52 | clojurebot | java.lang.IllegalArgumentException: Key must be integer |
| 23:52 | vIkSiT | hmm |
| 23:52 | DeusExPikachu | hmm looking at the sources, specifically RT.java, I think I know why adding to addURL doesn't do anything, cause clojure never calls findClass or findResource, which is the only methods that implement the newclasspath functionality |