2010-08-06
| 00:04 | Bahman | Hi all! |
| 00:04 | pdk | OH YES YES |
| 00:10 | cais2002 | (doc throw-arg) |
| 00:10 | clojurebot | "clojure.contrib.except/throw-arg;[[& args]]; Throws an IllegalArgumentException. All arguments are optional: cause? format? format-args* - cause defaults to nil, if present it must be a Throwable - format is a format string for clojure.core/format - format-args are objects that correspond to format specifiers in format." |
| 01:26 | vIkSiT | hi all |
| 01:26 | vIkSiT | is anyone here using clojure-http-client? |
| 01:27 | vIkSiT | for some reason, a lein uberjar fails on any code that uses it |
| 01:27 | vIkSiT | (ns foo (:use [clojure-http.client :only [url-encode]])) |
| 01:27 | vIkSiT | lein deps works. |
| 01:28 | vIkSiT | Exception in thread "main" java.io.FileNotFoundException: Could not locate clojure_http/client__init.class or clojure_http/client.clj on classpath |
| 01:28 | vIkSiT | on a lein uberjar. |
| 01:31 | wwmorgan | vIkSiT: I'm having trouble replicating it. What versions of clojure, leiningen, and clojure-http-client are you using? |
| 01:32 | vIkSiT | wwmorgan, let me pastebin that |
| 01:34 | vIkSiT | http://paste.lisp.org/display/113241 |
| 01:34 | vIkSiT | wwmorgan, ^ |
| 01:35 | vIkSiT | lein deps goes through fine |
| 01:35 | vIkSiT | pasting lein uberjar error. |
| 01:36 | vIkSiT | wwmorgan, http://paste.lisp.org/display/113241#1 |
| 01:50 | wwmorgan | vIkSiT: in your ns declaration in cljtwitter.clj, you need to (:use [clojure.http.resourcefully]). Not clojure-http.resourcefully |
| 02:18 | quotemstr | Are there any plans to get symbol-macros into the core? |
| 02:20 | tomoj | quotemstr: I still don't know what you mean |
| 02:20 | tomoj | but there is &env, maybe that's what you're looking for? |
| 02:21 | tomoj | probably not actually |
| 02:21 | tomoj | ah |
| 02:21 | tomoj | probably so |
| 02:21 | quotemstr | I'm talking about CL-style symbol-macros. |
| 02:22 | quotemstr | As I mentioned in the other channel, without core support, symbol-macros can't become part of the lexical environment object. |
| 02:22 | tomoj | I was talking about the environment thing |
| 02:22 | tomoj | all macros receive an implicit parameter &env |
| 02:23 | quotemstr | Oh, the parameter itself is called "&env" anaphorically? |
| 02:28 | tomoj | yeah |
| 02:31 | tomoj | I actually have no idea how to use it though |
| 02:31 | quotemstr | tomoj: You want to use it when you write a tree-walker so you can be sure you've completely expanded all your arguments. |
| 02:31 | tomoj | &env is a map of symbols to clojure.lang.Compiler$LocalBinding's |
| 02:32 | tomoj | but clojure.lang.Compiler$LocalBinding seems to give no way to access the value |
| 02:32 | quotemstr | Hrm, that's interesting. macroexpand doesn't take an environment argument. |
| 02:36 | tomoj | I'm now wondering what the hell &env is there for |
| 02:39 | tomoj | oh |
| 02:39 | quotemstr | Oh? |
| 02:40 | tomoj | https://gist.github.com/21ca8d61004767771bc7 |
| 02:40 | tomoj | that can't be the way we're supposed to use it... |
| 02:40 | quotemstr | That looks evil. |
| 02:40 | tomoj | yeah |
| 02:41 | quotemstr | What are .eval and .init doing here? |
| 02:41 | tomoj | that's the only way I could find to get a value from a LocalBinding |
| 02:41 | sid3k | morning guys |
| 02:41 | tomoj | .init on the LocalBinding returns an Expr, then .eval to get the value |
| 02:42 | tomoj | unless there's something I'm missing &env must only be useful for compiler hackers |
| 02:43 | quotemstr | Ah, I see. |
| 02:43 | quotemstr | sid3k: It's bedtime for me, you insensitive clod. |
| 02:47 | tomoj | oh, found something in the log |
| 02:47 | tomoj | well.. |
| 02:48 | tomoj | the suggestion was to just look at the keys in &env and use resolve |
| 02:48 | tomoj | that doesn't seem to work |
| 02:51 | vIkSiT | hey wwmorgan |
| 02:51 | vIkSiT | looks like I got disconnected before.. |
| 02:51 | wwmorgan | vIkSiT: did you get my fix? |
| 02:51 | LauJensen | Good morning all |
| 02:51 | vIkSiT | wwmorgan, you mentioned . instead of - in clojure.httpd |
| 02:51 | vIkSiT | er http* |
| 02:51 | vIkSiT | but now I get a : Exception in thread "main" java.lang.IllegalAccessError: spit does not exist (client.clj:1) |
| 02:52 | wwmorgan | on lein uberjar? |
| 02:53 | vIkSiT | wwmorgan, thats right |
| 02:56 | vIkSiT | wwmorgan, I changed clojure-http.resourcefully to clojure.http.client |
| 02:56 | vIkSiT | since thats what i wanted to test in the first place |
| 03:01 | vIkSiT | wwmorgan, ideas? |
| 03:01 | wwmorgan | vIkSiT: I can't seem to reproduce it. What version of leiningen are you using? |
| 03:02 | vIkSiT | Leiningen 1.2.0 on Java 1.6.0_20 Java HotSpot(TM) 64-Bit Server VM |
| 03:05 | bartj | how do I get a double quote ? |
| 03:05 | bartj | , (def x "\"") |
| 03:05 | clojurebot | DENIED |
| 03:05 | bartj | (def x '"') |
| 03:05 | bartj | both don't work as expected ? |
| 03:05 | Chousuke | just \" |
| 03:06 | bartj | oh, I don't need to quote the double quote ? |
| 03:06 | Chousuke | if you want it as a char, no. |
| 03:06 | bartj | Chousuke, gee thanks! |
| 03:07 | wwmorgan | vIkSiT: works on my machine :-/ http://paste.lisp.org/display/113241#2 |
| 03:07 | vIkSiT | hrm |
| 03:08 | vIkSiT | interesting |
| 03:08 | vIkSiT | WARNING: spit already refers to: #'clojure.core/spit in namespace: clojure.http.client, being replaced by: #'clojure.contrib.duck-streams/spit |
| 03:09 | vIkSiT | i wonder if thats causing this |
| 03:13 | vIkSiT | there we go |
| 03:14 | vIkSiT | replacing 1.2.0-master-SNAPSHOT with 1.2.0-beta1 gives me the warning as above |
| 03:15 | vIkSiT | wwmorgan, ^ |
| 03:16 | tomoj | bartj: what did you expect "\ |
| 03:16 | tomoj | er |
| 03:16 | tomoj | what did you expect "\"" to do? |
| 03:16 | bartj | is there a library function which prefix and suffixes a string with a character ? |
| 03:17 | bartj | tomoj, was expecting a double-quote string |
| 03:17 | wwmorgan | vIkSiT: is that good enough for your purposes? |
| 03:17 | tomoj | isn't that what it is? |
| 03:17 | bartj | tomoj, yes, that was stupid on my part |
| 03:17 | vIkSiT | wwmorgan, :) well it works. but I guess the important point is - when I do make this a production script - I wouldn't want it totally breaking heh |
| 03:18 | quotemstr | /join #cygwin |
| 03:18 | quotemstr | Damn spaces before commands. |
| 03:19 | Derander | don't worry |
| 03:19 | Derander | I just saw #hunter2 |
| 03:21 | quotemstr | At least it wasn't #midgetfetish or something equally compromising to any future political campaigns. |
| 03:32 | bartj | quotemstr, have only heard of widgets :) |
| 03:46 | bartj | er, why is (not (empty? coll)) not advised (as per the documentation) |
| 03:48 | quotemstr | Where does it say that? |
| 03:50 | Chousuke | bartj: because (seq coll) does the same thing. |
| 03:50 | Chousuke | bartj: in fact, empty? is defined as (not (seq coll)) |
| 03:51 | Chousuke | bartj: It's not wrong to use not + empty?, but using seq is idiomatic |
| 04:15 | bartj | Chousuke, thanks again! |
| 04:15 | slyrus | name for my nascent computational chemistry package -- chemiclj or covalence? or go with the idea of naming it after a famous, relevant person and call it lewis? |
| 04:16 | bartj | , (doc empty?) |
| 04:16 | clojurebot | "([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))" |
| 04:16 | bartj | aargh, quotemstr has quit |
| 04:18 | LauJensen | I think ERC has a hook, where if you are chatting with someone and that person quits within some timeout, you actually see that quit message - but I might be mistaking ERC for something else |
| 04:19 | slyrus | any votes before I turn in for the night? |
| 04:19 | LauJensen | slyrus: clovalence? :) |
| 04:20 | slyrus | hrm... I'll sleep on that. thanks. |
| 04:20 | tomoj | "lewis" seems bad for google |
| 04:20 | slyrus | yeah, there is that... |
| 04:20 | tomoj | I guess it doesn't matter much though |
| 04:21 | tomoj | unlikely people will try to find your app by googling for "lewis" |
| 04:28 | LauJensen | tomoj: but then again, you could say the same about 'jetty' but most people end up there anyway |
| 04:38 | neotyk | Hi * |
| 04:39 | neotyk | is there a test coverage tool for clojure already? |
| 04:40 | lpetit | LauJensen: hi |
| 04:40 | LauJensen | hey Laurant |
| 04:47 | esj | morning guys |
| 04:54 | LauJensen | morning home dawg |
| 05:22 | AWizzArd | ~seen ordnungswidrig |
| 05:22 | clojurebot | no, I have not seen ordnungswidrig |
| 05:23 | AWizzArd | ~max people |
| 05:23 | clojurebot | max people is 283 |
| 05:58 | xkb | is there something like a "times" function in clojure? |
| 05:58 | xkb | to chain a function? |
| 05:59 | Chousuke | repeatedly? |
| 05:59 | Chousuke | or iterate |
| 05:59 | xkb | (times 10 (mutate-code code)) |
| 05:59 | xkb | something like that |
| 05:59 | Chousuke | looks like you might want iterate |
| 06:00 | Chousuke | it'd work something like (nth 10 (iterate mutate-code code)) |
| 06:00 | xkb | ah yes |
| 06:00 | xkb | thanks |
| 06:01 | xkb | hmm I get an error on that |
| 06:01 | xkb | Cons cannot be cast to Number |
| 06:02 | Chousuke | hm, I suppose I got the order the wrong way around |
| 06:02 | xkb | lol, reminds me to read (doc |
| 06:02 | xkb | :) |
| 06:05 | LauJensen | or you slime, it prints the argument list in the minibuffer |
| 06:05 | LauJensen | s/you/use/ |
| 06:05 | sexpbot | or use slime, it prints the argument list in the minibuffer |
| 06:07 | ben_m | s/.*// |
| 06:07 | ben_m | Aww :3 |
| 06:20 | bartj | trying to detect russian characters |
| 06:20 | bartj | why doesn't this work please - http://pastebin.org/450630 |
| 06:20 | bartj | basic idea is: |
| 06:20 | bartj | (intersection #{russian character} (re-seq #"." "string")) |
| 06:21 | bartj | currently get a: java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentSet |
| 06:21 | Chousuke | you need to make a set out of the sequence first |
| 06:23 | bartj | Chousuke, yes, I unforunately tried with a sorted-set |
| 06:24 | bartj | (set [coll]) != (sorted-set [coll]) ? |
| 06:24 | Chousuke | heh, hmm |
| 06:24 | Chousuke | (doc sorted-set) |
| 06:24 | clojurebot | "([& keys]); Returns a new sorted set with supplied keys." |
| 06:24 | Chousuke | so if you want a sorted-set of a collection, you need to use apply |
| 06:27 | bartj | I am afraid, I don't really understand why I need an "apply" here |
| 06:27 | bartj | naively, wouldn't you just expected sorted-set to work ? |
| 06:31 | Chousuke | bartj: sorted-set doesn't take a collection as an argument, so you need apply |
| 06:32 | bartj | Chousuke, gee thanks! I just over-looked that. |
| 06:57 | raek | java regexes has unicode class support |
| 06:58 | raek | so \p{L} matches a unicode code point that is a letter |
| 06:58 | raek | no matter what script |
| 06:58 | raek | bartj: maybe there is a unicode class for cyrillic letters |
| 07:00 | raek | http://www.regular-expressions.info/unicode.html |
| 07:01 | raek | #"\p{Cyrillic}" should work... :) |
| 07:02 | bartj | raek, hmm, thanks - will look into that! |
| 07:02 | raek | hrm, potentially disregard that... script matching might not be supported by java |
| 07:18 | AWizzArd | Challenge: is there a very simple way to mirror/proxy a file in Compojure? I would like to offer a .swf file on my server which is not local, but to which I have remote access. This .swf file changes constantly, so I don't want to cache it locally on my disk. |
| 07:19 | AWizzArd | Currently I have a byte-array BA and .read from a clojure.java.io/input-stream into BA, then save it as a temp file on disk and return (File. "mytemp.swf") |
| 07:21 | tomoj | on every request? |
| 07:21 | tomoj | your clients don't have remote access, I guess? |
| 07:23 | AWizzArd | The setup is a little complicated. The Flash thing wants to use a webservice, but is restricted to do cross-site-requests. |
| 07:23 | AWizzArd | So I want to proxy the .swf transparently on my server. |
| 07:26 | tomoj | ah |
| 07:26 | tomoj | I don't actually have any advice, I was just curious :P |
| 07:27 | AWizzArd | Oki, I think I can use an input stream directly. Will try that. |
| 07:38 | raek | serving from disk should be fairly straight forward |
| 07:38 | raek | ...but that wasn't what you needed, right? |
| 07:39 | raek | ,(-> (java.net.URL. "http://google.com/") bean :contents class) |
| 07:39 | clojurebot | java.lang.NullPointerException |
| 07:39 | raek | ,(-> (java.net.URL. "http://google.com/") bean :content class) |
| 07:39 | clojurebot | java.lang.reflect.InvocationTargetException |
| 07:39 | raek | ,(-> (java.net.URL. "http://google.com/") bean) |
| 07:39 | clojurebot | java.lang.reflect.InvocationTargetException |
| 07:40 | raek | ,(.openStream (java.net.URL. "http://google.com/")) |
| 07:40 | clojurebot | java.security.AccessControlException: access denied (java.net.SocketPermission google.com:80 connect,resolve) |
| 07:40 | raek | I think that should make an input stream |
| 07:41 | raek | maybe that can be passed as thre body |
| 07:41 | raek | iirc, the body of a compojure response can be a input stream |
| 07:41 | AWizzArd | Serving from disk is done simply like: (GET "/my/file.swf" (File. "/some/path/to/app.swf")) |
| 07:41 | AWizzArd | raek: yes, and this is what I am trying now |
| 07:42 | AWizzArd | The only question I have is: who will close this IS? |
| 07:43 | bartj | neotyk, this is the only link I could find related to doing coverage using clojure - http://www.talios.com/code_coverage_of_clojure_code.htm |
| 07:43 | bartj | neotyk, hope this helps! |
| 07:45 | raek | AWizzArd: I think I read somewhere that compojure closes the IS after it is done with it |
| 07:45 | raek | or was that ring? |
| 07:45 | AWizzArd | Probably ring then. |
| 07:45 | AWizzArd | Anyway, would be good. Otherwise I have a resource leak. |
| 07:46 | raek | it makes sense for it to close the stream |
| 07:57 | AWizzArd | raek: yes, and I just checked that it indeed does close it. |
| 08:04 | old_sound_ | hi guys |
| 08:04 | old_sound_ | and gals… |
| 08:04 | old_sound_ | I have a question regarding import and java packages |
| 08:05 | old_sound_ | how to do something like this: import com.blah.me.something.* |
| 08:05 | old_sound_ | I |
| 08:05 | old_sound_ | I've only seen examples of importing classes, but not using the '*'… |
| 08:05 | AWizzArd | This is (intentionally) not directly possible in Clojure. |
| 08:06 | AWizzArd | And in clean code you don't want to do this (: |
| 08:06 | old_sound_ | hoho, thanks :) |
| 08:07 | LauJensen | AWizzArd: The benefits still arent tangible enough, imo |
| 08:09 | AWizzArd | It's not a huge win, right. |
| 08:10 | lpetit | hello |
| 08:10 | LauJensen | AWizzArd: I think there are some promises in the pipe for certain optimizations, but I dont think any of its implemented |
| 08:10 | LauJensen | lpetit: hey |
| 08:11 | LauJensen | And it especially bugs me, if Im just testing something where all the examples use .*. Sure I agree that shouldnt go into production code, but for rapid prototyping it would be nice |
| 08:12 | AWizzArd | I agree. For fast hacks in the repl it could be beneficial, saving a few minutes. |
| 08:12 | lpetit | talking 'bout what, buddies ? |
| 08:12 | LauJensen | (import '(java.util.*)) |
| 08:13 | lpetit | oh this |
| 08:13 | AWizzArd | In general I think Rich decided for the "right" solution in the long run, but agree that it also has disadvantages. |
| 08:14 | LauJensen | Sure - But while we wait for tangible benefits, it would have been nice to have |
| 08:15 | LauJensen | Dont know if its trivial to implment or not |
| 08:15 | lpetit | maybe some distinct function, just for the repl (and which could be installed by default when on a repl), e.g. (clojure.repl/import-* 'java.util) |
| 08:16 | LauJensen | Yea, I wonder if this could be plugged in |
| 08:18 | lpetit | LauJensen: I guess it's not a problem of being trivial , but rather of being accurate under all circumstances, since I guess it's impossible to get the classes from the Java API, the tricks used in e.g. clojure contrib are to get a location, detect whether it's local on the filesystem, if it's a directory or a jar, etc. and then if it's handled, it has to recursively search for .class resources, sort out those that are internal cla |
| 08:18 | LauJensen | For repl experiments, we could probably suffer a slight inaccuracy |
| 08:18 | lpetit | LauJensen: will not be accurate for dynamically created classes in the package, will not work if the specific type of classloader is not known in advance |
| 08:18 | AWizzArd | lpetit: that message got cut off: "[...] out those that are internal cla" |
| 08:18 | lpetit | LauJensen: I also think so |
| 08:19 | lpetit | AWizzArd: "...ses (XXX$YYY.class), etc." |
| 08:31 | cemerick | lpetit: I had no idea that you had a quasi-remote REPL in ccw already |
| 08:31 | lpetit | cemerick: yeah, maybe I didn't manage to get the point clear. |
| 08:31 | AWizzArd | How can I check in ring if a specific route exists, and/or which methods it allows (GET, PUT, ...)? |
| 08:32 | lpetit | cemerick: I've tried to keep it very simple, though robust. |
| 08:32 | lpetit | cemerick: did it a long time ago ! |
| 08:33 | cemerick | lpetit: It doesn't change my plans, but they'll be side-by-side for a while, until the dependencies on the existing REPL can be switched over. The enclojure one is more complete. |
| 08:33 | lpetit | cemerick: in fact it's more a "general purpose remote sexpr evaluator" than a REPL. The idea is that it could even be used by the client IDE to "install/update" dynamically the server helper functions, e.g. "repair/upgrade" the server backend :) |
| 08:34 | lpetit | cemerick: sure, np |
| 08:34 | cemerick | Right, that's what any remote REPL needs to do. :-) |
| 08:34 | lpetit | cemerick: :) |
| 08:37 | lpetit | cemerick: what i've done with mine, is that it's not the remote repl which determines when it's time to evaluate what it received. With my version, the string's length is computed and sent as part of the message, and in the other end, it's used to know when to stop listening and try evaluating (so even if some bug made the client send an incomplete sexpr) |
| 08:37 | lpetit | cemerick: I don't know if other remote repls do that or not |
| 08:45 | cemerick | lpetit: yeah, the same notion is in the enclojure repl (it sends chunked strings instead of bytes, but the result's the same). |
| 08:46 | lpetit | cemerick: FYI, I'll try to meet Lee's expectations, and will do a new RC release on monday. I'll be invaluable to have a full class of users. Lots of bugs to correct. Lots of ergonomics to modify. Paradise on earth :-) |
| 08:47 | cemerick | lpetit: I think he's overly optimistic. And, he's only 15 minutes from me, so I'm not sure about being the closest target of his irritation come mid-terms! ;-) |
| 08:47 | lpetit | cemerick: so in enclojure REPL, it's not the PushBackReader which decides when he got a complete form ? |
| 08:47 | lpetit | cemerick: (rofl) |
| 08:48 | cemerick | lpetit: no, it's the chunks-len in the read-socket fn that determines how much to read. |
| 08:49 | lpetit | cemerick: ok, 'cause I would not like if there's a bug in the IDE's client code, and say e.g. it sends "(find-completion foo" (note the missing paren), and then the client will have no answer (with ccw's backend, he'll get a malformed expression error) |
| 08:50 | cemerick | yeah, the same thing will happen |
| 08:52 | lpetit | cemerick: cool |
| 09:14 | cemerick | lpetit: where are ClojureConsole and ClojureConsoleFactory hooked in? I don't see any references to them anywhere in the project. |
| 09:14 | lpetit | cemerick: they are artifacts of the past. Currently the REPL you see is just the standard ProcessConsole with a few additional hooks (implementation dependent) |
| 09:16 | cemerick | oohkay, that makes more sense now |
| 09:16 | lpetit | cemerick: I did not remove them until the time when someone would create proper REPL views, and see whether they could serve as a base or not. I don't know them well, they are a real artifact of the past, when Casey Marshall started the plugin |
| 09:17 | cemerick | lpetit: so that's for an IDE-internal REPL/console, right? |
| 09:17 | lpetit | cemerick: I guess so |
| 09:18 | cemerick | I think that's the only way they'd be usable. There's in-process references to RT, etc., so it can't be working with even an external clojure process. |
| 09:18 | cemerick | (nevermind remote, etc) |
| 09:21 | lpetit | cemerick: yes, I'm pretty sure you're right. So there's little to keep from this 2 classes codebase, but (maybe) the skeleton |
| 09:24 | lpetit | cemerick: and I'm not even sure that's a good idea or not to plug the REPL's GUI into the Console framework. What if you want to see the (locally) launched JVM console side by side with your REPL ? What if you want to put 2 REPLs side by side ? What if you want to keep side by side a REPL and a totally unrelated type of console? I haven't (yet) been able to find how to do this with the Eclipse console (seeing several different cons |
| 09:25 | cemerick | lpetit: I've been down this road before, when I worked on cusp for a little while years ago. Unless things have *significantly* changed, you can't customize IOConsoles much at all. |
| 09:26 | cemerick | My current plan is to continue to reuse the JDT launch stuff, but have a separate REPL interaction window/frame (with a hotkey/button to switch to the corresponding console when you want to see *out*/*err* |
| 09:27 | cemerick | That's the only way we'll be able to roll in the editor capabilities (highlighting, completion, etc), command history, etc etc. |
| 09:27 | lpetit | cemerick: yeah, I've started a WIP local ccw branch where I try to plug my own SourceConfiguration, but it's rather hackish, need to recurse down the Widget tree to find the right one, etc. . Never got this one finished, and with your WIP, think it'll never get. |
| 09:28 | cemerick | Yeah, that seems like a hard road. The JDT does a good job, and interops with all of the various things that can impact process invocation (different build tools, PDT stuff, etc). Trying to replace it isn't something I want to contemplate. |
| 09:29 | lpetit | cemerick: indeed, I would probably have started as you said. Separating the launch of a process (or of a connection to a remote process) from the instanciation and connection of REPL windows to sockets. |
| 09:30 | lpetit | cemerick: wait. In the case of "pure" remote connection, we don't need to launch a remote java debugger connection at all, do we ? enclojure's server process uses its own port. |
| 09:32 | lpetit | cemerick: so the "link" between launch configuration , launched configurations and the REPL window will be loose. E.G. provide facilities to open a new REPL window from a process console, etc. |
| 09:32 | cemerick | lpetit: Yes, the REPL runs on its own port. Ideally, we'll be able to dynamically attach the debugger to the REPL's process. |
| 09:32 | cemerick | Exactly. |
| 09:33 | cemerick | The environments will be the same, but you'll have a separate REPL interaction windows. |
| 09:33 | lpetit | cemerick: ok, I see we follow the same goals :-D |
| 09:33 | cemerick | I wouldn't lead you astray. :-) |
| 09:34 | cemerick | I think that's all for today. Good progress, I think the plan has been validated. Now I just need to relearn the eclipse APIs :-0 |
| 09:38 | cemerick | lpetit: should the plugin be using clojure 1.1 or 1.2? I see the latter in the project dependencies, but the former in the plugin.xml manifest. |
| 09:38 | lpetit | cemerick: plugin.xml manifest is not up to date. |
| 09:38 | cemerick | OK, thanks. I'll stop bugging you now. :-) |
| 09:41 | lpetit | cemerick: np. If I can't answer, I won't. So bug as you need, and I'll say "stop" when I can't any more :) |
| 09:42 | cemerick | Heh, sure. I have to get back to work now anyway. |
| 09:42 | rhickey | has anyone tried the latest from git? |
| 09:44 | lpetit | rhickey: sorry no |
| 09:45 | rhickey | lpetit: I figured I might have to get in in an RC in order to get people to try it |
| 09:46 | lpetit | rhickey: maybe yeah |
| 09:49 | cemerick | rhickey: if there's no maven artifact, it's almost like it doesn't exist *shrug* |
| 09:49 | rhickey | cemerick: what a world we live in |
| 09:51 | cemerick | rhickey: it's hard to argue with, from a user perspective |
| 09:51 | cemerick | twiddle a single line in a file....oh, look, new version of clojure to bang on, etc. |
| 09:54 | AWizzArd | rhickey: I often update my clojure to whatever is available under build.clojure.org |
| 09:54 | AWizzArd | If the .jar from 20 hours ago includes your updates then I have them. But I did not do particular tests. |
| 09:55 | cemerick | actually, it's even better for leads and similar; distribution isn't exactly a low hurdle for most projects. |
| 10:39 | fogus_ | Martin Odersky on Clojure -> http://blog.fogus.me/2010/08/06/martinodersky-take5-tolist/ |
| 10:41 | dnolen | fogus: nice! |
| 10:43 | fogus_ | thanks. he's a cool dude |
| 10:48 | esj | i liked his joke... perfect humour. |
| 12:49 | Bahman | Hi all! |
| 13:13 | esj | foguse: wow, that's #2 on HN right now... |
| 13:49 | slyrus | hmm... I don't suppose clojure's format has a ~{ ... ~} equivalent? |
| 13:52 | maravillas | ,(doc cl-format) |
| 13:52 | clojurebot | "clojure.contrib.pprint/cl-format;[[writer format-in & args]]; An implementation of a Common Lisp compatible format function. cl-format formats its arguments to an output stream or string based on the format control string given. It supports sophisticated formatting of structured data. Writer is an instance of java.io.Writer, true to output to *out* or nil to output to a string, format-in is the format control string and t |
| 13:54 | slyrus | maravillas: thanks! |
| 13:54 | maravillas | no prob |
| 13:59 | dulanov | what is the preferred method to binary search in sorted lists? (contains? el (sort <some_coll>)) work for that? |
| 14:08 | raek | contains? only checks for keys in maps and sets |
| 14:08 | raek | it also works for vectors, where it checks if the index is in range |
| 14:08 | raek | has-key? would probably be a more accurate name |
| 14:16 | Lajla | raek, your shadow is most magnificent, let me worship her |
| 14:28 | mebaran151 | lancepantz, did you have a chance to test out my hack? |
| 14:36 | bonega | is there some sort of take-while that needs a pred that works on taken list? |
| 14:36 | bonega | for example: (take-while + #(< % 100) (iterate inc 0)) |
| 14:39 | wwmorgan | bonega: what does the + do in your pseudocode? |
| 14:39 | bonega | that's the function passed for reduction |
| 14:40 | bonega | so: reduce list with +, until sum > 100 |
| 14:41 | wwmorgan | ,(->> (iterate inc 0) (reductions +) (take-while #(< % 100)) last) |
| 14:41 | clojurebot | 91 |
| 14:42 | wwmorgan | I don't think there's a function like that in core or contrib. |
| 14:42 | bonega | thanks but |
| 14:42 | bonega | What I want is to return the list that equals the sum |
| 14:43 | bonega | return all values which sum < 100 |
| 14:47 | cemerick | fogus_: You're probably the only one that could have brought East and West together like that. :-) |
| 14:47 | cemerick | fogus_: where's the loperOS guy's reaction? I could use a good laugh. |
| 15:01 | wwmorgan | bonega: here's what I came up with. It's quadratic in time, so if your collection is especially large you'd want to rewrite it as something that performs one pass only. http://paste.lisp.org/display/113260 |
| 15:03 | ecyrb | I defrecord'd a record with a field name that conflicted with a (:use) import name. I agree that I'm a dolt, but should clojure complain instead of silently screwing me over? |
| 15:03 | ecyrb | (should I file a bug report?) |
| 15:05 | tomoj | the problem is that inside the defrecord methods, you can't use the :use'd var? |
| 15:06 | ecyrb | tomoj: sorry, I'm bad at explaining stuff. |
| 15:07 | ecyrb | I did a (ns my-namespace (:use (clojure.contrib server-socket))) (defrecord R [server-socket]) |
| 15:08 | ecyrb | And clojure sort of created a type R for me, but I could never construct it |
| 15:08 | tomoj | works fine for me |
| 15:09 | tomoj | https://gist.github.com/c6388f583a7e2cfbc4e4 |
| 15:10 | ecyrb | yeah, it works for me too |
| 15:10 | ecyrb | sorry |
| 15:10 | ecyrb | I obviously haven't isolated the behaviour I was seeing.. Sorry about that. |
| 15:11 | tomoj | no problem |
| 15:14 | fogus_ | cemerick: Thanks. :-) http://www.loper-os.org/?p=198 |
| 15:16 | ecyrb | http://paste.lisp.org/+2FE6 |
| 15:17 | ecyrb | whoops. see the annotation: http://paste.lisp.org/display/113262#1 |
| 15:18 | ecyrb | (s/srv-socket/server-socket/) |
| 15:22 | ecyrb | tomoj: Does that still work? Can you instantiate a CondorServer? |
| 15:23 | tomoj | yep https://gist.github.com/b64b0da1681e35bfcda8 |
| 15:25 | ecyrb | Hmmm. I'm getting a NoSuchMethodError |
| 15:25 | tomoj | clojure version? |
| 15:25 | ecyrb | 1.2.0-RC1 |
| 15:25 | tomoj | me too |
| 15:26 | ecyrb | if I rename server-socket to srv-socket it works though |
| 15:27 | tomoj | what's the NoSuchMethodError say? |
| 15:27 | ecyrb | did you use the original or annotated lisppaste? |
| 15:28 | ecyrb | java.lang.NoSuchMethodError: com.maple.util.condor.Server.CondorServer.<init>(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V (NO_SOURCE_FILE:0) |
| 15:28 | tomoj | the one with "server-socket" |
| 15:28 | tomoj | are you using leiningen? |
| 15:28 | ecyrb | No |
| 15:29 | tomoj | maven? or what? |
| 15:29 | ecyrb | just a regular inferior-lisp |
| 15:29 | tomoj | so you constructed the classpath yourself? |
| 15:29 | ecyrb | yes |
| 15:29 | tomoj | no clue, then |
| 15:30 | arohner | technomancy: dammit man, I wrote reducate like 3 days ago. But I called it "fold" |
| 15:30 | arohner | technomancy: exact same signature |
| 15:31 | bonega | wwmorgan: thank you |
| 15:33 | ecyrb | classpath checks out |
| 15:35 | ecyrb | tomoj: Well, thanks for trying it out for me. I'll just rename and keep going for now |
| 15:50 | jlf` | is it expected behavior for functions like intersection/union to be unavailable prior to doing (use 'clojure.set) ? |
| 15:51 | Chousuke | yes |
| 15:51 | Chousuke | they're in that namespace |
| 15:54 | jlf` | hmm, i wonder why set operations get that treatment while operations on other standard data structures do not |
| 15:55 | Chousuke | jlf`: they're not "basic" operations |
| 15:55 | jlf` | fair enough |
| 16:26 | technomancy | arohner: hah; awesome. |
| 16:27 | technomancy | arohner: it was a really fun group exercise |
| 16:28 | technomancy | jlf`: there's certainly room for improvement; see http://code.google.com/p/clj-nstools/ |
| 16:29 | jlf` | interesting |
| 16:31 | technomancy | I don't know if nstools is useful in its current state, but if something like it were integrated into Clojure itself it would probably help a lot. |
| 16:59 | herdrick | having ns trouble |
| 17:00 | herdrick | just doing (ns my-namespace) gets me an error |
| 17:00 | herdrick | Unknown location: |
| 17:00 | herdrick | error: java.lang.IllegalStateException: repeat already refers to: #'clojure.contrib.string/repeat in namespace: my-namespace |
| 17:01 | herdrick | that contrib package is one which previously i had done a require clause on |
| 17:01 | herdrick | but if I get rid of that clause, i would think that I would start with a fresh slate |
| 17:09 | lozh | I wonder if (ns-unmap 'my-namespace 'repeat) would fix it? |
| 17:09 | herdrick | it's just odd, because I haven't seen anything like this happen before |
| 17:09 | herdrick | if i do this: |
| 17:09 | herdrick | (ns my-namespace |
| 17:09 | herdrick | (:use clojure.contrib.jmx) |
| 17:09 | herdrick | (:use clojure.contrib.combinatorics)) |
| 17:09 | herdrick | and 'compile' it |
| 17:10 | herdrick | it works fine once |
| 17:10 | herdrick | the second time it blows |
| 17:10 | lozh | I'm not sure :use makes sense without specifying classes |
| 17:12 | lozh | Ah no, refers to all public vars of ns subject to filters, that should be fine |
| 17:14 | herdrick | do you get the same result? |
| 17:16 | lozh | I'm just starting up a repl now, sec |
| 17:16 | herdrick | thanks, lozh: |
| 17:17 | edbond | I'm trying to use deftemplate from enlive, got NullPointerException. How to debug/fix? |
| 17:17 | lozh | yep same thing, though I get the error with #'clojure.core/read and #'cloure.contrib.jmx/read |
| 17:18 | herdrick | right, same thing here |
| 17:18 | lozh | Get a warning first time, then an error second |
| 17:18 | herdrick | try just saying (ns my-namespace) |
| 17:19 | lozh | same error |
| 17:19 | herdrick | yeah |
| 17:19 | herdrick | also the ns-unmap doesn't work |
| 17:19 | dnolen | edbond: that's almost always because deftemplate can't find the html resource you're pointing to, in my experience anyway |
| 17:20 | herdrick | so I've been restarting my 'lein swank' everytime i get into this problem |
| 17:20 | herdrick | which is ridiculous |
| 17:21 | edbond | dnolen: thanks, does it looks for it on compile? |
| 17:22 | herdrick | lozh: what do you do for 'importing' packages |
| 17:22 | herdrick | ? |
| 17:23 | lozh | I've not had to import a complete package yet, just a few named classes |
| 17:23 | herdrick | ok |
| 17:24 | herdrick | so, what... I'm supposed to only do a "require" and never "use"? |
| 17:24 | rhudson | herdrick, you'd likely be better off doing (:require [clojure.contrib.jmx :as jmx]) |
| 17:25 | herdrick | rhudson: actually I can't even do that |
| 17:25 | herdrick | apparently i need to restart my REPL |
| 17:25 | herdrick | because what I was doing has it in a state where even this: |
| 17:26 | herdrick | (ns your-namespace |
| 17:26 | herdrick | (:require clojure.contrib.string) |
| 17:26 | herdrick | (:require clojure.contrib.combinatorics)) |
| 17:26 | edbond | dnolen: created a file and still have NPE. |
| 17:26 | herdrick | breaks it |
| 17:26 | herdrick | error: java.lang.IllegalStateException: repeat already refers to: #'clojure.contrib.string/repeat in namespace: your-namespace" |
| 17:26 | Raynes | (ns your-namespace (:require clojure.contrib.string clojure.contrib.combinatorics)) also works. |
| 17:27 | rhudson | The rule of thumb I use is require instead of use unless I'm absolutely sure there are no confligcts |
| 17:27 | herdrick | which is extremely annoying |
| 17:27 | pdk | what, did 1.2 come out today |
| 17:27 | herdrick | rhudson: ok |
| 17:28 | Raynes | If you're using 1.2, clojure.contrib.string is deprecated in favor of clojure.string. |
| 17:29 | lozh | if there's only a small number of conflicts then you might be able to stuff a :except in your :use |
| 17:29 | lozh | assuming it supports everything use does |
| 17:32 | lozh | erm :exclude, not :except |
| 17:33 | edbond | where does enlive looks for templates? |
| 17:33 | lozh | herdrick: If you change your :use clause to (:use [clojure.contrib.jmx :exclude (read)]) then I can run it repeatedly |
| 17:34 | lozh | I guess you could refer to read specifically if you needed the jmx method too |
| 17:34 | herdrick | lozh: hmm, i had tried that - maybe i got the syntax wrong will check |
| 17:38 | lozh | The unmap thing worked for me too, (ns-unmap 'my-namespace 'read) meant I could rerun the (ns...) |
| 17:38 | lozh | I think the exclude thing only works provided you haven't already errored |
| 17:39 | herdrick | lozh: that new clause isn't working for me, though it might if I restart my REPL |
| 17:39 | dnolen | edbond: have you tried running a file exists on that file or reading it by other means? |
| 17:39 | dnolen | edbond: deftemplate uses html-resource, you might want to call that directly |
| 17:39 | lozh | yep, I did it multiple times from a fresh repl |
| 17:40 | lozh | the ns-unmap thing fixes it for me without restarting the repl, though |
| 17:40 | herdrick | lozh: BTW how did you decide upon surrounding clojure.contrib.jmx plus the :exclude thing in a vector? |
| 17:41 | lozh | |
| 17:41 | lozh | http://clojure.org/libs |
| 17:42 | lozh | I copied the way :only is used near the top of example lib |
| 17:42 | herdrick | lozh: right, copying and pasting works |
| 17:42 | herdrick | it's just that I want to know why |
| 17:42 | herdrick | why surround with a vector |
| 17:43 | herdrick | why are :exclude and :use and whatnot keywords |
| 17:43 | herdrick | I just find the ns and require and use stuff to be a baffling mini-language, not much documented |
| 17:43 | rhudson | I know that frustration. |
| 17:44 | herdrick | rhudson: thanks |
| 17:44 | rhudson | I finally figured out the right way to do (require [xxx :as yyy]) by reading the source code |
| 17:44 | lozh | I got the :use reference from the docs for :ns and then went to http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/use to guess what options were available with :use |
| 17:45 | rhudson | The reason might be that generally in Clojure, places where symbols are bound use vectors |
| 17:45 | herdrick | so that's "require" not within a "ns"? |
| 17:45 | rhudson | without ns: (require '[xxx :as yyy]) |
| 17:46 | rhudson | inside ns: (:require [xxx :as yyy]) |
| 17:46 | herdrick | i don't think quoting out that vector is necessary, right? |
| 17:47 | rhudson | I think the docstring for ns says that the options for :require :use etc are the same as the standalong require use etc |
| 17:47 | slyrus | for the clojure-loving chemists/bioinformaticians: http://github.com/slyrus/chemiclj |
| 17:47 | edbond | dnolen: (enlive/html-resource "www/index.html") raises exception. |
| 17:47 | dnolen | edbond: there you go |
| 17:48 | dnolen | edbond: is www in your src directory? are you using lein to manage the classpath? |
| 17:48 | edbond | www is in project root (where project.clj is), yes I use lein |
| 17:49 | dnolen | edbond: project root is not on the classpath, src is |
| 17:49 | dnolen | edbond: just move www into src |
| 17:50 | dnolen | edbond: lein also support setting resource-path I believe or something like that |
| 17:50 | rhudson | The quote's necessary in (require '[xxx :as yyy]) because the construct is expecting a couple of symbols. |
| 17:51 | edbond | dnolen: works, many thanks. |
| 17:51 | dnolen | edbond: np |
| 17:51 | rhudson | Without the quote, it's trying to resolve xxx and yyy, and complaining when it can't |
| 17:51 | neotyk | how do one start swank-clojure-project for project managed by new lein? |
| 17:52 | rhudson | But in (ns ... (:require [xxx :as yyy])...) you're inside a macro, so it's actually dealing with the symbols & not trying to resolve them |
| 17:53 | lozh | neotyk: you need to make sure something like :dev-dependencies [[swank-clojure "1.2.0"]] to your project.clj, then then run lein deps then lein swank |
| 17:53 | herdrick | rhudson: someone please make the pain stop |
| 17:54 | rhudson | It just takes a while to get used to. You'll get it |
| 17:55 | herdrick | I don't want to. Clojure is beautifully designed. That's a big part of the appeal. But this stuff is awful. |
| 17:55 | rhudson | You don't actually need to use namespaces until you start writing multi-file programs |
| 17:55 | herdrick | but thanks, rhudson: |
| 17:56 | herdrick | but you still need require or use |
| 17:56 | herdrick | (which of course are calling differently than if they were within an "ns". yuk.) |
| 17:57 | rhudson | Right. Like if I'm exploring in the repl, it's convenient to (use 'clojure.repl), so I can look at source by (source ns) |
| 17:57 | rhudson | or if I want to parse xml, then (require '[clojure.xml :as xml]) then (xml/parse whatever) |
| 17:58 | herdrick | AHA! Thank you! Someone was telling me about 'source' last night at the Clojure meetup in San Francisco but I hadn't heard of it and he wasn't sure why it wasn't bound in my repl |
| 17:58 | herdrick | ok, clojure.repl, cool |
| 17:58 | rhudson | Namespaces are kind of like maps -- you wouldn't want to be restricted to having all your maps have distinct keys |
| 17:59 | rhudson | So the ns/require/use stuff gives you control over how names are bound. |
| 18:00 | herdrick | ...through use of its mini-language |
| 18:00 | rhudson | Right. And I'm not saying it's not a little tricky to get the hang of |
| 18:01 | rhudson | But that mini language is all Clojure keywords and functions and macros. |
| 18:02 | herdrick | Raynes: the capabilities seem fine (except that it seems to have borked my REPL, but never mind that) it's the notation that's the problem |
| 18:02 | rhudson | Somewhere (Joy of Clojure maybe) I saw the remark that in a language like Clojure, there's not a sharp distinction between a domain-specific language and an API |
| 18:02 | herdrick | Raynes: that's why we're all using Clojure instead of C++ after all |
| 18:02 | Raynes | I don't see anything wrong with it. :\ |
| 18:02 | dnolen | herdrick: I think that's overstating a bit. When used inside the ns macro everything is clear. but require is function. while the cognitive dissonance is annoying at first, require and use being functions is crazy powerful. |
| 18:03 | Raynes | dnolen: Indeed! I've made magics happen with require that were only possible thanks to it being a function. :D |
| 18:03 | herdrick | rhudson: yes, there are lots of mini languages in Clojure and other lisps. it's just that some of them, like Common Lisp's "do" are... kind of a mess |
| 18:05 | herdrick | dolen: it is not clear. the usage I had above wasn't even idempotent. the first time you try it, it works as expected. it breaks each subsequent time. |
| 18:05 | herdrick | and the REPL is then borked and needs a restart |
| 18:06 | rhudson | I've never seen much need to use namespaces in the REPL unless I'm specifically trying to explore what namespaces do. |
| 18:06 | jlf | herdrick: there's nothing messy about CL's do |
| 18:07 | jlf | maybe you mean loop? |
| 18:07 | herdrick | dnolen: Raynes: sounds interesting. what have you done with require and use as functions where they being functions has mattered? |
| 18:07 | herdrick | jlf: oops, thanks. yes, loop |
| 18:08 | herdrick | but i don't want to get into a flamewar. sometimes mistakes are made. it's better to be open to recognizing them as such. |
| 18:09 | dnolen | herdrick: no flamewar. you're use of use is un-idiomatic. only use require with an alias, if you use use, only with :only. you'll save yourself a lot of trouble. |
| 18:10 | dnolen | (require '[some.long.ns :as ns]) or (use '[some.ns.with.lots.of.defs :only [the-one-you-need])) |
| 18:10 | dnolen | everything else is asking for trouble |
| 18:10 | rhudson | what dnolen said |
| 18:11 | herdrick | dnolen: all of the docs for clojure.contrib stuff says no |
| 18:11 | herdrick | example: http://richhickey.github.com/clojure-contrib/string-api.html |
| 18:11 | gfrlog | has anybody made use of remove-ns? |
| 18:11 | dnolen | herdrick: says no ? |
| 18:12 | rhudson | gfrlog: yes, I had reason to define some temporary namespaces & remove them afterward |
| 18:12 | hiredman | dnolen: he's pointing at the usage example at the top |
| 18:12 | herdrick | dnolen: right, at the top of that page is: |
| 18:12 | herdrick | Usage: |
| 18:12 | herdrick | (ns your-namespace |
| 18:12 | herdrick | (:require clojure.contrib.string)) |
| 18:12 | herdrick | and all the other such pages |
| 18:12 | hiredman | herdrick: that is the "simplest" possible usage, not the correct one |
| 18:13 | herdrick | dnolen: rhudson: ok, thanks for the tip. I very much appreciate it. but I must say that I am frustrated that I have to get such a tip on IRC from you guys instead of from the docs |
| 18:13 | hiredman | import java.util.*; vs import java.util.HashMap; |
| 18:13 | dnolen | herdrick: note the use of require, it's doesn't say different from what I just said |
| 18:13 | rhudson | It's a young language yet, and we're living on the frontier |
| 18:13 | herdrick | well... maybe the correct one should be simpler or put the correct on there instead |
| 18:13 | herdrick | rhudson: right! which is good. |
| 18:14 | herdrick | how about making the docs wiki? |
| 18:14 | gfrlog | rhudson: are there any gotchas related to messing with namespaces? I get errors resolving the symbol I pass |
| 18:14 | hiredman | the correct one depends on which functions you are using |
| 18:14 | rhudson | It's not incorrect, just kind of inconvenient: with that you need (clojure.contrib.string/capitalize whatever) |
| 18:14 | herdrick | dnolen: it doesn't use :as |
| 18:14 | rhudson | with an alias (say ccstr) you just need (ccstr/capitalize whatever) |
| 18:14 | hiredman | :use and :only |
| 18:15 | rhudson | clojuredocs.org |
| 18:15 | dnolen | herdrick: :as is just a convenience. it is recommending the right thing. |
| 18:16 | herdrick | dnolen: i thought that was asking for trouble |
| 18:16 | dnolen | herdrick: no, sorry. require or require + :as is always fine. a use without :only is the problem. |
| 18:17 | rhudson | With those usages, you know exactly what symbols you're introducing |
| 18:18 | dnolen | herdrick: use is basically a blind import, you can and will get clashes. require keeps that from happening. |
| 18:18 | herdrick | dnolen: rhudson: ok, thanks |
| 18:18 | rhudson | gfrlog: what kinds of errors? |
| 18:20 | gfrlog | rhudson: http://gist.github.com/512112 |
| 18:21 | lozh | (remove-ns 'x) ? |
| 18:21 | rhudson | I think you need to do (remove-ns 'x) |
| 18:22 | gfrlog | I bet so :) |
| 18:22 | gfrlog | but only because I didn't think of it this time |
| 18:22 | gfrlog | great, thanks |
| 18:24 | technomancy | use and require have a rehaul in the works planned |
| 18:24 | technomancy | clojurebot: google ns use require overhaul |
| 18:24 | clojurebot | First, out of 35900 results is: |
| 18:24 | clojurebot | House sends health bill to Obama's desk - Politics - Health care ... |
| 18:24 | clojurebot | http://www.msnbc.msn.com/id/35961584/ |
| 18:25 | technomancy | yeah... anyway. check the mailing list archives. |
| 18:37 | neotyk | lozh: thanks, it works! |
| 18:38 | herdrick | technomancy: very very good to hear that. and i'm not surprised that it stuck out as being unclojurian to the leadership |
| 18:40 | lozh | cool! |
| 18:40 | lozh | I think http://www.mail-archive.com/clojure@googlegroups.com/msg20403.html is some of the discussion. |
| 18:41 | lozh | and http://onclojure.com/2010/02/17/managing-namespaces/ would have been quite handy to read as a primer to namespaces, ignoring the extra stuff he's put in to ns-tools |
| 18:51 | kencausey | This must be an FAQ but I can't find the answer. How do you exit the repl? One started via lein repl for example. |
| 18:52 | kencausey | I expected ctrl-d to work, but nothing happens. ctrl-c works for some value of work but doesn't seem like the likely polite manner. |
| 18:52 | mebaran151 | is there a general utility to turn a map into a record, given they share the same keys? |
| 18:53 | mebaran151 | kencausey, ctrl-d works on linux, I think it's ctrl-z on Windows, and you can always do a (System/exit) |
| 18:54 | mebaran151 | sorry (System/exit 0) |
| 18:54 | kencausey | mebaran151: ah, I'm in cygwin which blurred my thinking here, ctrl-z it is, thanks. |
| 18:54 | kencausey | thanks again |
| 18:54 | mebaran151 | glad I could help |
| 18:54 | mebaran151 | kencausey, what are you using Cygwin for though? |
| 18:54 | mebaran151 | you can run clojure pretty easily in plain ol' windows |
| 18:55 | kencausey | because I like a unix environment? |
| 18:55 | mebaran151 | ah, I was just checking, because I know ruby hatd Windows |
| 18:56 | mebaran151 | without cygwin to support it |
| 18:56 | kencausey | I hadn't assumed clojure needed cygwin |
| 18:57 | mebaran151 | sorry, just being too presumptuous |
| 19:19 | slyrus_ | anyone using cow-blog? |
| 19:22 | pdk | brian carper would be an obvious guess :p |
| 19:28 | slyrus_ | well, yeah, anyone else? and what's his nick? |
| 20:13 | raek | has anyone made a "forcat" |
| 20:14 | raek | ...that works like for, but concatenates all the results into one sequence |
| 20:14 | raek | ("result" = result sequence) |
| 20:14 | slyrus_ | forcan, a la mapcan |
| 20:15 | slyrus_ | if course this lisp doesn't have nconc :) |
| 20:18 | slyrus_ | raek: I see you have fontlock on for defrecord. but you left the indentation the way it was? |
| 20:20 | raek | it requires you to activate the backtracking indentation mode |
| 20:20 | raek | but I think I added a rule for the usual mode too... |
| 20:21 | raek | (defrecord 2) |
| 20:22 | raek | yep, when using the default indentation mode, the two first forms will be indented 4 spaces and the rest 2 spaces |
| 20:22 | raek | this will not indent the methods correctly, though |
| 20:23 | raek | slyrus_: M-x customize-variable, clojure-mode-use-backtracking-indent |
| 20:23 | raek | that should make defrecord indent well |
| 20:25 | Derander | I need to create some sort of random facts repository |
| 20:26 | Derander | stuff like that is so incredibly useful when you need it, but it's so incredibly forgettable when you don't |
| 20:29 | slyrus_ | raek: hmm... no all the lines are indented two spaces, as before. perhaps I'm doing something wrong though. |
| 20:31 | raek | slyrus_: can you do a paste? |
| 20:31 | raek | maybe I overlook something |
| 20:31 | slyrus_ | sure, of what? |
| 20:31 | raek | ah, misread |
| 20:33 | raek | in the backtracking mode, the name and fields of the record are indented two additional spaces |
| 20:33 | raek | this doesn't happen for you? |
| 20:34 | raek | this seems to happen in both modes for me |
| 20:34 | slyrus_ | Oh, I see... that's not what I want :) I want the names of the protocols to be 2 spaces and the names of the methods to be 4. |
| 20:34 | slyrus_ | no, I just throw all that stuff on one line |
| 20:34 | slyrus_ | or w.w. the fields, if need be. |
| 20:35 | raek | currently, I don't think that would be possible to do |
| 20:36 | raek | also, indenting the method forms at the same column as the protocol names is what I've seen in most code |
| 20:36 | slyrus_ | well, yeah, because that's what emacs does! :) |
| 20:37 | slyrus_ | trying to override your editor's indentation preferences is madness. fixing those preferences, not so much |
| 20:38 | raek | yeah, I never manually corrected the indentation for method contents before |
| 20:38 | slyrus_ | heh. maybe somebody will write a clojure mode for climacs. |
| 20:39 | raek | thought I'd either change clojure-mode or accept it |
| 21:00 | technomancy | raek: if you want commit on clojure-mode that'd be fine by me; just ask. I don't have time to give it attention right now. |
| 21:22 | raek | I would consider the commits I've made so far on my fork to be ready for integration with your fork |
| 21:22 | raek | technomancy: feel free to pull them whenever you like it |
| 21:24 | raek | btw, how would you like to be notified when I have something ready? |
| 21:31 | slyrus_ | hrm... it's annoying having to change all of these project.clj's to use, say, RC2. there has to be a better way to say "hey, maven, give me some version of clojure 1.2, preferably the latest" |
| 21:47 | rplevy | for some reason scripture can't find clojure.contrib.string when I load it in leiningen (while other libraries that use other clojure.contrib libraries seem to work fine) |
| 21:47 | rplevy | *scriptjure |
| 22:08 | rplevy | does anyone know of an example of using scriptjure in leiningen? |