2009-02-13
| 04:14 | punya | hi |
| 04:22 | AWizzArd | Hello punya |
| 04:23 | punya | i'm fairly new to clojure, and i'm wondering if it would be reasonable to make the basic arithmetic ops multimethods |
| 04:23 | punya | i'm sure people have asked this before me, so could you point me somewhere to look? |
| 04:24 | jdz | punya: what exactly do you mean by basic arithmetic ops? |
| 04:24 | jdz | punya: you want + to concatenate strings or what? |
| 04:24 | punya | jdz: add vectors, actually |
| 04:25 | jdz | a bad idie |
| 04:25 | jdz | idea even |
| 04:25 | jdz | what does it mean to add two vectors? |
| 04:25 | punya | jdz: vectors (in the mathematical sense) are tuples of numbers |
| 04:25 | jdz | whatever your answer is i can find another one that's different |
| 04:25 | punya | jdz: you add them componentwise |
| 04:26 | punya | jdz: i mean vectors the mathematical object, not vectors the data structure |
| 04:26 | jdz | well, and Clojure is not APL you know |
| 04:26 | punya | jdz: true enough |
| 04:26 | punya | jdz: i didn't mean that the standard library should include such a definition |
| 04:27 | punya | jdz: i agree with you, that would be a terrible idea because other people might not want their vectors added the way i want mine |
| 04:27 | Holcxjo | I assume many people would object to the performance hit that everyone would take on arithmetic |
| 04:27 | punya | Holcxjo: absolutely |
| 04:28 | punya | no, i was wondering if rebinding + to a generic method in my own namespace was a reasonable thing to do |
| 04:28 | jdz | the correct soluition is to create your own namespace and define whatever functions with whatever semantics you want there |
| 04:28 | punya | jdz: okay, we're in agreement then |
| 04:29 | punya | jdz: is it considered good coding style to shadow names from the clojure core? |
| 04:29 | jdz | punya: not really, if you want other people to read your code. |
| 04:29 | jdz | (read and understand, that is) |
| 04:31 | Holcxjo | Well, he won't change the semantics of the op |
| 04:31 | Holcxjo | just extend it -- thus understanding the code should be ok |
| 04:31 | punya | Holcxjo: not quite -- people who expected to get an exception when adding vectors will now get a different behavior |
| 04:31 | Holcxjo | Some calls to +, - etc might baffle the reader but I don't think that's a big problem |
| 04:32 | Holcxjo | Consider the alternative of having to use other names for the usual arithmetic ops |
| 04:32 | Holcxjo | ... *that* would make code unreadable |
| 04:32 | punya | that's what i'm doing right now |
| 04:33 | jdz | anyway naming the function add-vectors or vector-sum instead of overloading + would be better, imo |
| 04:33 | punya | okay, thanks for your inputs! |
| 04:33 | punya | i'm going with names like "add", "scale" etc for now |
| 04:34 | jdz | punya: cool, that way you won't have to write + as clojure.core/+ :) |
| 04:34 | punya | jdz: right, i realized i wasn't going to buy any brevity by shadowing |
| 04:35 | Holcxjo | jdz: He wouldn't have to write that (except for the overload definition of + for numbers) |
| 04:36 | jdz | and in some other places (like inner loops) where performance matters |
| 04:36 | Holcxjo | jdz: that's the whole point -- his formulas would be completely natural and readable to anybody used to mathematics |
| 04:36 | punya | Holcxjo: that was what i thought originally |
| 04:36 | jdz | i'm not telling that he can't do it. i'm just trying to point out tradeoffs |
| 04:37 | Holcxjo | I thought we had established that performace would suffer and that he was going for readability rather than absolute performance -- anyway -he can always create an alias for the core + (scalar-+ or something like that) |
| 04:38 | punya | one nice feature of using separate names for scalar and vector ops is that it serves to document which one i expect to see in a particular place |
| 04:39 | punya | accidentally passing in a scalar in place of a vector will fail sooner |
| 04:39 | jdz | using a name like "sum" and "product" would feel as natural to mathematician as + and * (and it is not actually * in mathematics, really, it's �) |
| 04:40 | jdz | and it's not mathematcians who will read the code, it's programmers :) |
| 04:41 | punya | jdz: i certainly hope mathematicians and programmers aren't disjoint sets |
| 04:41 | punya | jdz: but i take your point |
| 04:42 | jdz | well, what i wanted to say is that if somebody reads code, he will know what to expect from the code, and would not want to assume that rules of mathematics are at work. |
| 04:53 | p_l | jdz: I get COBOL vibes from that |
| 08:42 | gnuvince | ~seen rhickey |
| 08:42 | clojurebot | rhickey was last seen in #clojure, 861 minutes ago saying: that's the only promise made by the sequence fns |
| 08:42 | gnuvince | ,(/ 861.0 60) |
| 08:42 | clojurebot | 14.35 |
| 09:24 | AWizzArd | ,(doc future) |
| 09:24 | clojurebot | "([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block." |
| 09:24 | AWizzArd | ,(doc future-call) |
| 09:24 | clojurebot | "([f]); Takes a function of no args and yields a future object that will invoke the function in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block." |
| 09:29 | Holcxjo | ,(let [f (future (do (Thread/sleep 5000) 'done))] (dotimes [i 10] (print i (.isDone f) " - ") (Thread/sleep 1000)) @f) |
| 09:29 | clojurebot | Execution Timed Out |
| 09:29 | Holcxjo | ,(let [f (future (do (Thread/sleep 3000) 'done))] (dotimes [i 5] (print i (.isDone f) " - ") (Thread/sleep 1000)) @f) |
| 09:29 | clojurebot | done |
| 09:29 | clojurebot | 0 false - 1 false - 2 false - 3 true - 4 true - |
| 09:30 | Holcxjo | execution timeout? |
| 09:30 | Chousuke | took more than 10 seconds |
| 09:30 | cooldude127 | Holcxjo: i believe clojurebot cuts execution |
| 09:30 | cooldude127 | after a certain amount of time |
| 09:30 | Holcxjo | I was hoping it'd tell me what the cut-off is... |
| 09:33 | durka42 | sandbox.clj:9 (def *default-timeout* 10) ; in seconds |
| 09:33 | durka42 | clojurebot: execution timeout is 10 seconds |
| 09:33 | clojurebot | Roger. |
| 09:34 | Holcxjo | Let's see... |
| 09:34 | Holcxjo | execution timeout? |
| 09:34 | durka42 | ~timeout |
| 09:34 | clojurebot | execution timeout is 10 seconds |
| 09:34 | durka42 | clojurebot: how long will you give my code for execution? |
| 09:34 | clojurebot | for is not a loop |
| 09:34 | durka42 | :) |
| 09:35 | durka42 | clojurebot: how long before the timeout is triggered? |
| 09:35 | clojurebot | It's greek to me. |
| 09:35 | durka42 | clojurebot: be more fuzzy |
| 09:35 | clojurebot | Gabh mo leithsc�al? |
| 09:43 | durka42 | clojurebot: what is the sandbox timeout? |
| 09:43 | clojurebot | sandbox is http://calumleslie.blogspot.com/2008/06/simple-jvm-sandboxing.html |
| 09:43 | durka42 | clojurebot: what is the sandbox execution timeout? |
| 09:43 | clojurebot | sandbox is http://calumleslie.blogspot.com/2008/06/simple-jvm-sandboxing.html |
| 09:43 | durka42 | clojurebot: what is the execution timeout in the sandbox? |
| 09:43 | clojurebot | execution timeout is 10 seconds |
| 09:44 | durka42 | first match apparently |
| 09:44 | durka42 | clojurebot: botsnack |
| 09:44 | clojurebot | thanks; that was delicious. (nom nom nom) |
| 09:50 | alinpopa | clojurebot: botsnack |
| 09:50 | clojurebot | thanks; that was delicious. (nom nom nom) |
| 09:50 | alinpopa | :) |
| 09:53 | clojurebot | svn rev 1279; added intCast from char/byte/short |
| 09:59 | AWizzArd | ,(let [x (delay (will-define-this-later 10))] (println 10)) |
| 09:59 | clojurebot | java.lang.Exception: Unable to resolve symbol: will-define-this-later in this context |
| 10:00 | gnuvince | ~seen Chousuke |
| 10:00 | clojurebot | Chousuke was last seen in #clojure, 29 minutes ago saying: took more than 10 seconds |
| 10:00 | gnuvince | ~seen Chouser |
| 10:00 | clojurebot | Chouser was last seen in #clojure, 637 minutes ago saying: good enough. |
| 10:00 | AWizzArd | Why does the delay produce an error when I use a not yet defined function? |
| 10:01 | jbondeson | AWizzArd: probably because while it doesn't execute, it does attempt to check the validity of the enclosed function. |
| 10:01 | jbondeson | it needs to have the proper scope in the delay object |
| 10:01 | Chouser | gnuvince: looks like 1279 is for you |
| 10:02 | Chouser | (bit-and (int (.get (ByteBuffer/allocate 10))) 0xff) |
| 10:02 | rhickey | Chouser: yes, message on the way to group |
| 10:02 | gnuvince | Chouser: I thought so too, but it's not; I tried it already and the reflection warning are still there |
| 10:02 | jbondeson | hmmmm |
| 10:02 | AWizzArd | but if the delay is lazy, how can Clojure check what I do inside it? |
| 10:03 | Chouser | AWizzArd: the code still gets compiled, which is when var resolution is done |
| 10:04 | gnuvince | ,*warn-on-reflection* |
| 10:04 | clojurebot | false |
| 10:04 | gnuvince | ,(set! *warn-on-reflection*) |
| 10:04 | clojurebot | java.lang.IllegalArgumentException: Malformed assignment, expecting (set! target val) |
| 10:04 | gnuvince | ,(set! *warn-on-reflection* true) |
| 10:04 | clojurebot | java.lang.IllegalStateException: Can't change/establish root binding of: *warn-on-reflection* with set |
| 10:05 | gnuvince | ,(binding [*warn-on-reflection* true] (short (bit-and (byte 0) (byte 0xff)))) |
| 10:05 | clojurebot | 0 |
| 10:05 | gnuvince | We don't get the warnings? |
| 10:05 | durka42 | i believe clojurebot can't do bind |
| 10:05 | durka42 | because it uses try-catch |
| 10:05 | Chouser | gnuvince: the warn flag is checked at compile time |
| 10:05 | gnuvince | ah |
| 10:05 | hiredman_ | durka42: uh? |
| 10:05 | jbondeson | AWizzArd: also, delay will execute the function with your current scope, so if a var is unbound and you bind it later you'll still get the unbound |
| 10:06 | durka42 | hiredman_: i thought clojurebot didn't do try/catch blocks? |
| 10:06 | jbondeson | (unless i'm crazy, totally possible) |
| 10:06 | hiredman_ | ,(binding [a 1] (println a)) |
| 10:06 | clojurebot | java.lang.Exception: Unable to resolve var: a in this context |
| 10:06 | knobo | Can clojure run on j2me? |
| 10:06 | gnuvince | Chouser: anyway, if you try the script I posted yesterday to the mailing list, you'll see that you still get the reflection warnings for both functions. |
| 10:06 | Chouser | ,(binding [*warn-on-reflection* true] (eval '(bit-and (byte 0) (byte 0xff)))) |
| 10:06 | clojurebot | DENIED |
| 10:06 | Chouser | oh, no eval. :-P |
| 10:06 | jbondeson | clojurebot: that's a bad bot! |
| 10:06 | clojurebot | No entiendo |
| 10:07 | Chouser | gnuvince: right, you need to make changes to your code |
| 10:07 | durka42 | ,(try (throw (Exception.)) (catch Exception e "boo")) |
| 10:07 | clojurebot | Gabh mo leithsc�al? |
| 10:07 | gnuvince | Chouser: Yeah, I am reading Rich's reply now. |
| 10:08 | durka42 | all right, class time |
| 10:09 | AWizzArd | How can I enforce a full GC run? |
| 10:09 | cooldude127 | weird, most of my irc time is during class |
| 10:09 | gnuvince | Chouser: finally, yes, it was for me :) |
| 10:09 | cooldude127 | AWizzArd: (System/gc) i think |
| 10:09 | gnuvince | I'll just need to update my code to use use ints |
| 10:13 | clojurebot | svn rev 1280; [lazy] fixed take-while |
| 10:15 | kefka | Here's a question about using agents for multi-threading. If I'm trying to do an asynchronous-or of several computations (e.g. I want the first result, and the rest are useless) and want the other threads to die (because they might block indefinitely), how do I do that? |
| 10:16 | kefka | For example, if I do (def *doomed-agent* (agent 0)); (send *doomed-agent* (fn [_] (loop [] (Thread/sleep 1000) (println "ANNOYING THREAD!!!") (recur))))... and then later try to "delete" *doomed-agent* by redefining it, the "ANNOYING THREAD!!!" keeps running. |
| 10:25 | AWizzArd | hiredman_: can you extend the clojurebot so that if one asks him something like "clojurebot: definition of count", it would then spit out http://code.google.com/p/clojure/source/browse/trunk/src/clj/clojure/core.clj#856 |
| 10:25 | cooldude127 | that would be so cool |
| 10:25 | Chouser | I perfer using 'source' in my own repl, I think. |
| 10:25 | Chouser | prefer |
| 10:26 | cooldude127 | Chouser: i don't have that |
| 10:26 | AWizzArd | Chouser: but then the ,(code-here) could also be done in the repl. |
| 10:26 | AWizzArd | It just is nice if I am in irssi anyway, or want to show someone the code. |
| 10:26 | Chouser | AWizzArd: yeah, I suppose. |
| 10:27 | cooldude127 | Chouser: how do i get source in my repl? |
| 10:27 | Chouser | cooldude127: clojure.contrib.repl-utils <-- shameless plug |
| 10:27 | cooldude127 | Chouser: there we go |
| 10:28 | cooldude127 | Chouser: it seems a little confused on my code |
| 10:28 | AWizzArd | ,(require '[clojure.contrib.repl-utils :as ru]) |
| 10:28 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib/repl_utils__init.class or clojure/contrib/repl_utils.clj on classpath: |
| 10:29 | cooldude127 | clojurebot: why don't you have contrib? |
| 10:29 | clojurebot | why not? |
| 10:29 | cooldude127 | AHH |
| 10:29 | notyouravgjoel | I'm looking for a way of taking the ith through jth items from a sequence and returning these items as a sequence |
| 10:29 | notyouravgjoel | suggestions? |
| 10:29 | Chouser | cooldude127: oh, really? I usually only use it on core and sometimes conrib code, but if it's breaking I'd like to know. |
| 10:30 | cooldude127 | notyouravgjoel: take and drop |
| 10:30 | cooldude127 | or subseq |
| 10:30 | cooldude127 | Chouser: it might be the with-test wrapper |
| 10:30 | cooldude127 | idk |
| 10:30 | AWizzArd | rhickey: Is Clojure reading some config file in which one could specify all the libs that one wishes to import/require/use? |
| 10:31 | cooldude127 | Chouser: the defns after my first two with-test wrapped functions don't have the right code |
| 10:31 | Chousuke | AWizzArd: you can pass the repl an --init argument |
| 10:31 | cooldude127 | AWizzArd: i think your ns is supposed to specify that |
| 10:31 | Chouser | kefka: afaik, the only recommended way to halt a thread that's busy doing computation is for it to poll something to see if it should quit. |
| 10:32 | AWizzArd | Chousuke: thx |
| 10:32 | cooldude127 | Chouser: lol (source source) |
| 10:32 | cooldude127 | how meta |
| 10:33 | notyouravgjoel | thankss |
| 10:33 | Chouser | cooldude127: ok, that makes sense. I'm not sure there's anything I can do about that. |
| 10:33 | Chouser | the line number stored by 'def' will of course be its own, not its enclosing with-test. |
| 10:33 | cooldude127 | Chouser: the weird part is it gets the code for the with-test functions just fine |
| 10:34 | cooldude127 | Chouser: it's everything after that that messes up |
| 10:34 | Chouser | oh. hm. |
| 10:35 | cooldude127 | Chouser: yeah gets the whole thing. even the with-test wrapper |
| 10:35 | cooldude127 | and the tests |
| 10:35 | cooldude127 | maybe it's trying to tell me to test my code better |
| 10:35 | Chouser | cooldude127: is your code available somewhere, or other code that fails similarly? |
| 10:38 | cooldude127 | Chouser: this is the file i was working with http://tinyurl.com/dau3so |
| 10:39 | cooldude127 | Chouser: the first two ones have their source code right, but id and on fail |
| 10:39 | cooldude127 | Chouser: actually it just got weirder. i just recompiled that whole file in slime, and now all the stuff is working |
| 10:40 | Chouser | ah, well if the file and what you're actually running is out of sync, all bets are off. |
| 10:40 | cooldude127 | and they are not surrounded in their with-test blocks |
| 10:40 | cooldude127 | Chouser: yeah apparently source is better used on code you're not actively working on |
| 10:40 | cooldude127 | which is fine actually, since you've probably got it up in an editor already |
| 10:41 | reprap | are clojure hashmaps worstcase log32 ? |
| 10:41 | AWizzArd | ,(.getCorePoolSize clojure.lang.Agent/pooledExecutor) |
| 10:41 | clojurebot | 3 |
| 10:41 | reprap | or just amortized worst case? |
| 10:42 | cooldude127 | reprap: i think it's worst case |
| 10:42 | AWizzArd | ,(.getMaximumPoolSize clojure.lang.Agent/pooledExecutor) |
| 10:42 | clojurebot | 3 |
| 10:42 | reprap | well i said wrong |
| 10:42 | reprap | amoritzed is orst case |
| 10:43 | reprap | i mean is it worst case or average time |
| 10:43 | cooldude127 | reprap: i'm pretty sure it's worst case |
| 10:43 | cooldude127 | but i'm not the best guy to ask |
| 10:43 | Chouser | clojure hash-maps are O(log32 n) for lookup where n is the number of items stored |
| 10:44 | Chouser | hm... no, I guess if the hash algos are bad for your keys it might get bad sooner |
| 10:44 | cooldude127 | oh yeah |
| 10:45 | Chouser | anyway, the tree caps out at 7 or 8 levels I think, so if you can pretend that's a constant and call it O(1) if you want |
| 10:45 | cooldude127 | rhickey knows way more about data structures than i do :) |
| 10:49 | Chousuke | it's O(almost 1) |
| 10:51 | rhickey | Chouser: I was thinking about a debug version of 'if' for easing transition to lazy - some $if$ that you could search/replace in your codebase, and it would throw if its test arg was a LazySeq |
| 10:52 | Chousuke | However if you do a *lot* of overwrites it'll ofcourse lose to a mutable structure... even if it's almost O(1), the O(1) access time of a standard array is still a lot faster because the constant is smaller |
| 10:59 | reprap | log 32 = 1.50514998 |
| 10:59 | reprap | but where does 32 come from? |
| 10:59 | Chousuke | it's not log 32, it's log32 :P |
| 10:59 | Chouser | rhickey: that sounds interesting. |
| 11:00 | Chouser | reprap: no, log base 32 |
| 11:00 | reprap | log(32) = 1.50514998 |
| 11:00 | reprap | ? |
| 11:00 | reprap | ah |
| 11:00 | reprap | how do i compute that? |
| 11:00 | Chouser | ,(/ (Math/log 500) (Math/log 32)) |
| 11:00 | clojurebot | 1.7931568569324172 |
| 11:01 | Chouser | 500 items builds a tree of depth 2 |
| 11:01 | reprap | ,(/ (Math/log 1000000) (Math/log 32)) |
| 11:01 | clojurebot | 3.986313713864835 |
| 11:01 | reprap | ,(/ (Math/log 10000000) (Math/log 32)) |
| 11:01 | clojurebot | 4.650699332842308 |
| 11:01 | Chouser | it grows very slowly. :-) |
| 11:01 | reprap | yes |
| 11:02 | Chousuke | what's the memory overhead by average though? :/ |
| 11:03 | Chouser | rhickey: any chance of making more like a binding or pragma or something? there are lots of macros that use 'if' that would not themselves by found easily in a search/replace. |
| 11:11 | rhickey | Chouser: don't the macros contain "if" ? |
| 11:11 | Chouser | sure, but are you suggesting I search/replace in core.clj? |
| 11:12 | Chouser | when trying to port my app code? |
| 11:12 | kefka | keys and vals: On a sorted map, they return the keys / vals in sorted order, right? |
| 11:12 | rhickey | Chouser: maybe. OTOH, I could build it into the compiler in lazy branch... |
| 11:12 | Chouser | kefka: keys in sorted order, vals in the same order as the keys (not sorted themselves of course) |
| 11:14 | Chouser | rhickey: it'd be simple if you made 'if' a macro like 'let' already is. |
| 11:16 | kefka | Chouser: Great. That's what I was hoping for. :) |
| 11:17 | reprap | is clojure fast enoughf or large-scale image analysis and mahcine learning? |
| 11:18 | Chouser | reprap: for that kind of work I'd recommend assembly or ruby. |
| 11:19 | reprap | ruby? |
| 11:19 | reprap | yeah id love to dig around in assembler, illc all you back 2030 when i finished |
| 11:19 | rhickey | Chouser: want to try it and send me a patch (to lazy) for that? (using if* for primitive) |
| 11:20 | Chouser | rhickey: yes. yes I do. |
| 11:20 | rhickey | Chouser: thanks! bbl |
| 11:24 | Chouser | reprap: just a joke. a lame one, apparently. |
| 11:25 | Chouser | reprap: Clojure can pretty well match Java's speed when you need it to. |
| 11:25 | rsynnott | hiredman: or BOTH |
| 11:26 | Chousuke | you can always write java for the parts you need speed for, anyway |
| 12:05 | reprap | hiredman: webdevelopment requieres quite heavy use of ruby or asm |
| 12:06 | jbondeson | you had a problem, to solve it you used ruby... now you have two problems |
| 12:07 | reprap | as in: some people think when they have a problem, "I know, I'll use ruby", now they have 2 problems |
| 12:07 | reprap | i rewrote my webapp in asm today, it took 8 hours, i saved 5 processor cycles |
| 12:13 | Chouser | anyone here good with ant? |
| 12:14 | jbondeson | define "good" for me ;) |
| 12:14 | Chouser | I need to set a sysproperty depending on an ant command-line option (presumably -Dsomething) |
| 12:15 | jbondeson | yep, so not me |
| 12:15 | Chouser | heh |
| 12:15 | jbondeson | quick someone find a java developer... |
| 12:16 | hiredman | if only there was a #java full of helpful people! |
| 12:16 | hiredman | (there isn't) |
| 12:16 | technomancy | time to switch to lancet. =) |
| 12:17 | reprap | and makes me want to blow my brains out, mostly becuae oyu have to deal with xml |
| 12:17 | reprap | i use python to smack it together |
| 12:17 | jbondeson | you know what really sucks? editing a CC.Net build file when you build 90+ binaries. |
| 12:18 | jbondeson | and that's what i'm doing right now. |
| 12:20 | technomancy | could be worse... could be makefiles |
| 12:21 | technomancy | actually, I don't have enough experience with either system to say which is worse. |
| 12:21 | WizardofWestmarc | makefiles can certainly get ugly |
| 12:22 | danlarkin | I donno, I never understood why people hate Makefiles |
| 12:22 | danlarkin | they're very capable |
| 12:22 | danlarkin | simple syntax |
| 12:22 | hiredman | word |
| 12:22 | technomancy | the fact that spaces and tabs are interpreted differently is disastrous |
| 12:23 | hiredman | *shrug* |
| 12:23 | Chouser | unfortunately, but hardly a deal breaker |
| 12:23 | hiredman | Yes. |
| 12:23 | hiredman | as demonstrated, it could be much worse |
| 12:23 | Chouser | *unfortunate |
| 12:23 | technomancy | yeah, manual memory management is enough of a deal breaker to keep me away from hacking the kind of projects that use makefiles. =) |
| 12:24 | danlarkin | oh but that's the best part, you can use a Makefile with any project! |
| 12:24 | hiredman | exactly |
| 12:25 | hiredman | I have a makefile with targets for changing tex->pdf svg->png dot->png etc etc |
| 12:25 | hiredman | oh |
| 12:25 | hiredman | and gnuplot files to png |
| 12:26 | technomancy | (was actually replying to danlarkin) |
| 12:27 | jbondeson | hey Chouser, what's the tool you were using to generate your graphs? |
| 12:27 | jbondeson | dot? |
| 12:27 | Chouser | jbondeson: yes |
| 12:28 | jbondeson | need to do some tree-visualizations and that would be handy |
| 12:28 | rsynnott | "oh but that's the best part, you can use a Makefile with any project!" - try with common lisp and see how far you get |
| 12:29 | rsynnott | (in principle, you probably COULD, but you'd need a system file to load the result, anyway, and you could have just used it to build in the first place) |
| 12:31 | jbondeson | learning how to use graphviz will give me a nice break from looking at 1000+ line build files |
| 12:31 | technomancy | graphviz is pretty handy |
| 12:33 | jbondeson | i love how when i start a project i spend 90% of the time solving meta-problems |
| 12:33 | technomancy | guy at work is learning Groovy, and he's got like five Groovy books in a stack on his desk next to him... |
| 12:33 | technomancy | the stack has grown throughout the week |
| 12:33 | technomancy | I'm wondering how having more books helps you learn faster... |
| 12:34 | rsynnott | that seems excessive |
| 12:34 | jbondeson | technomancy: blow his mind and show him that the internet has more than porn on it... |
| 12:35 | jbondeson | "if only someone had thought to put INFORMATION on the internet" |
| 12:35 | WizardofWestmarc | Porn's not informative? Damn it! |
| 12:36 | WizardofWestmarc | but yeah, getting 5 books about a single language seems silly |
| 12:36 | technomancy | WizardofWestmarc: maybe he's a Pok�mon fan... "gotta catch 'em all"? |
| 12:36 | technomancy | I mean, how many books about Groovy can there be? |
| 12:36 | jbondeson | my guess would be 5... |
| 12:37 | WizardofWestmarc | technomancy: shrug, there are like a billion about ruby and rails |
| 12:37 | WizardofWestmarc | so the sky's the limit |
| 12:37 | technomancy | yeah, but three years ago there were only two |
| 12:37 | WizardofWestmarc | ok true |
| 12:38 | Chouser | hm, turns out ##java can be helpful after all |
| 12:38 | WizardofWestmarc | hah |
| 12:39 | jbondeson | Chouser: quick! disinfect yourself before you catch The Java. |
| 12:43 | notyouravgjoel | how does one convert a set to a list? |
| 12:43 | technomancy | notyouravgjoel: you could just call seq on it |
| 12:44 | technomancy | won't technically be a list, but you can treat it as such |
| 12:44 | notyouravgjoel | ah |
| 12:44 | notyouravgjoel | right |
| 12:44 | notyouravgjoel | I just want it to look prettier than lots of #{}'s everywehre |
| 12:44 | technomancy | huh? |
| 12:45 | notyouravgjoel | n/m =) |
| 13:05 | rhickey | Chouser: any luck with if? |
| 13:05 | Chouser | yep, was just about to post. |
| 13:05 | Chouser | you want to look at the patch before I do? |
| 13:06 | rhickey | Chouser: no, go ahead |
| 13:06 | Chouser | it found a nil pun in proxy :-) |
| 13:06 | rhickey | find any issues in core? |
| 13:06 | rhickey | hah |
| 13:07 | rhickey | I've been doing a visual audit - nothing more unsettling than questioning every if you've got |
| 13:07 | Chouser | and it complained about one in 'sort' that I'm not sure was actually a problem. |
| 13:07 | Chouser | but I had to change it to avoid the exception. |
| 13:10 | technomancy | it seems really strange for me that the test suite is in another repository |
| 13:10 | rhickey | yep, false positive |
| 13:10 | technomancy | if it were kept together with the code, it would branch together with the code, which would provide some definite benefits in this case |
| 13:10 | technomancy | just a thought... |
| 13:10 | Chouser | rhickey: My patch replaces that with (when (seq coll) ... is that acceptible? |
| 13:12 | rhickey | yes |
| 13:12 | hiredman | technomancy: well, rhickey (who keeps the central repo) does not prioritize the test suite, and other people do |
| 13:12 | gnuvince | rhickey: thanks for the (int) fix |
| 13:12 | rhickey | hiredman: more important, other people write the test suite |
| 13:14 | hiredman | rhickey: well *cough* I decided against saying "rhickey doesn't care about the test suite" |
| 13:14 | rhickey | hiredman: I do care about it - you want tests or features from me? |
| 13:15 | hiredman | uh, is that a trick question? |
| 13:15 | danlarkin | can I choose both? :) |
| 13:15 | rhickey | hiredman: no, it's the real tradeoff |
| 13:16 | hiredman | I mean, of course I want features |
| 13:16 | Chousuke | I think contrib is a good place for tests |
| 13:17 | Chousuke | otherwise, rhickey would have to individually accept every addition :/ |
| 13:18 | gnuvince | I think a comprehensive unit test suite for Clojure would be a nice addition. |
| 13:18 | Chousuke | gnuvince: there's one in contrib. I don't know about "comprehensive", however... |
| 13:19 | Chouser | I can't think of how to capture a value at compile time that will... |
| 13:19 | gnuvince | You don't know what? If it'd be benificial or if the current suite is comprehensive? |
| 13:19 | Chouser | I can't think of how to phrase my question. |
| 13:19 | Chousuke | gnuvince: whether it's comprehensive or not. |
| 13:20 | hiredman | Chousuke: are you still playing with clojurebot at all? if so, have you tried it on the lazy branch? |
| 13:20 | gnuvince | Chousuke: I imagine it's up to us to comprehensify it |
| 13:20 | Chousuke | hiredman: not for a while. |
| 13:20 | Chousuke | hiredman: I might take a look. |
| 13:21 | gnuvince | In the Java world, do people recommend Swing or SWT for GUIs these days? |
| 13:21 | Chouser | I want to get a value from a fn at compile time, and use that same value at runtime without checking the fn anymore. Any ideas? |
| 13:22 | jbondeson | dynamic inlining... |
| 13:22 | jbondeson | heh |
| 13:23 | danlarkin | Chouser: isn't that what a macro does? |
| 13:23 | jbondeson | danlarkin: that's read time |
| 13:23 | danlarkin | ohhh, compile time |
| 13:23 | danlarkin | hm |
| 13:23 | technomancy | features vs tests is a false dichotomy; without tests, features take longer. |
| 13:23 | danlarkin | technomancy: or worse, features may not be correct |
| 13:23 | jbondeson | it like you want self modifying code, you want to add an :inline flag that just has the value |
| 13:23 | technomancy | but I do agree that tests are easier for the community to work on |
| 13:24 | technomancy | danlarkin: or nearly as bad: features will not be attempted for fear of breaking things. |
| 13:24 | jbondeson | Chouser: could you just memoize it? |
| 13:24 | technomancy | but the codebase is probably still small enough for that not to be a worry except for minor cleanups |
| 13:25 | jbondeson | it's not quite the same thing, because it looks it up, but it won't recalculate |
| 13:26 | jbondeson | course that would look it up at load time, not compile. hrmmm |
| 13:26 | Chouser | right, that's the problem |
| 13:26 | Chouser | well, the problem is I can't even think about it clearly |
| 13:26 | jbondeson | honestly, i think you want to look it up, modify the :inline tag and then compile |
| 13:27 | Chouser | (if (foo) (def build-foo true) (def build-foo false)) |
| 13:27 | jbondeson | oh |
| 13:27 | jbondeson | hah |
| 13:27 | Chouser | ...but that will run at load time too, right, so no good. |
| 13:27 | danlarkin | Chouser: is there a way you can use that *compiling* var or whatever it's called? |
| 13:27 | Chouser | danlarkin: maybe, but how? |
| 13:27 | Chousuke | Chouser: *compile-files*? |
| 13:28 | Chouser | when it's true, store the value in a def, when it's false ... ? |
| 13:29 | Chousuke | hmm |
| 13:32 | Chousuke | (def *val* nil) (defmacro whatever [] (when-not *val* (def *val* (get-thing))) `*val*)? is that valid? |
| 13:32 | Chousuke | hm |
| 13:32 | Chousuke | I guess that again does it at read time. |
| 13:32 | Chouser | I think I don't sufficiently understand how constants are compiled. |
| 13:33 | Chouser | there was a thread about this recently, using print-dup vs. something else, but I didn't dig in deep enough to grok it. |
| 13:33 | Chouser | bbl |
| 13:58 | vsthesquares | are cons and conj both O(1)? |
| 13:59 | Chouser | yes |
| 13:59 | vsthesquares | nice |
| 13:59 | vsthesquares | thanks |
| 13:59 | Chouser | hm, well, depending on the data structure, conj maybe as slow as O(n log n), I think. |
| 13:59 | vsthesquares | ah yes |
| 13:59 | vsthesquares | on vectors? |
| 14:00 | vsthesquares | but not on lists? |
| 14:00 | Chouser | on sorted sets and maps |
| 14:00 | ayrnieu | ,(complexity (conj {} {:a :b})) |
| 14:00 | clojurebot | java.lang.Exception: Unable to resolve symbol: complexity in this context |
| 14:00 | gnuvince | ayrnieu: that'd be too nice :) |
| 14:00 | gnuvince | (set! *warn-on-O-n-squared* true) |
| 14:01 | Chouser | on hash maps and vectors, conj is more like O(log32 n) |
| 14:01 | Chouser | O(1) on lists |
| 14:01 | vsthesquares | excellent |
| 14:02 | rsynnott | Chouser: conj is O(1) in lists?! |
| 14:02 | rsynnott | are lists not linked lists? |
| 14:02 | technomancy | rsynnott: conj adds to the head of lists |
| 14:02 | Chouser | sure they are. |
| 14:02 | rsynnott | ah |
| 14:02 | vsthesquares | so the list doesn't need to be traversed |
| 14:02 | ayrnieu | ,(let [x '(1 2 3)] [(cons 0 x) (conj x 0)]) |
| 14:02 | clojurebot | [(0 1 2 3) (0 1 2 3)] |
| 14:02 | rsynnott | ah, nevermind, I was thinking of it as a concatenate-type thing |
| 14:04 | Chouser | concat on lists is O(1) also |
| 14:04 | Chouser | ...as long as you never actually traverse it. ;-) |
| 14:04 | technomancy | hehe |
| 14:04 | gnuvince | Does the JVM keep a cache of its optimizations between sessions? |
| 14:06 | rsynnott | concat is lazy, then? |
| 14:06 | Chouser | rsynnott: yes |
| 14:06 | gnuvince | ,(class (concat "a" "b")) |
| 14:06 | clojurebot | clojure.lang.LazyCons |
| 14:06 | rsynnott | and working in CL at the same time |
| 14:06 | rsynnott | probably not a great idea; it all gets quite confusing |
| 14:08 | alinpopa | ,(conj (list 1 2 3) 0) |
| 14:08 | clojurebot | (0 1 2 3) |
| 14:09 | alinpopa | ,(cons 0 (list 1 2 3)) |
| 14:09 | clojurebot | (0 1 2 3) |
| 14:11 | gnuvince | rsynnott: how are you liking Clojure? |
| 14:17 | gnuvince | lazy-cons is really gonna be gone once the lazy branch is merged? |
| 14:17 | Chouser | gnuvince: I think so. |
| 14:17 | Chouser | it's certainly been removed from the lazy branch. |
| 14:18 | gnuvince | ok |
| 14:18 | gnuvince | I have a couple lazy-cons in my code, I'll add a comment to remind me to change them |
| 14:19 | Chouser | it'll remind you |
| 14:19 | Chouser | java.lang.Exception: Unable to resolve symbol: lazy-cons in this context |
| 14:19 | vsthesquares | :D |
| 14:19 | gnuvince | :) |
| 14:19 | cooldude127 | Chouser: isn't cons just gonna be naturally lazy? |
| 14:19 | rsynnott | gnuvince: It's quite nice |
| 14:20 | gnuvince | rsynnott: nice to hear :) |
| 14:20 | rsynnott | I would probably not choose it over CL for random-thing |
| 14:20 | rsynnott | but the Java integration is extremely useful |
| 14:20 | Chouser | cooldude127: no, I don't think so. |
| 14:20 | cooldude127 | Chouser: wait, then what is going on in that branch? maybe i'm confused |
| 14:21 | Chouser | most places that currently use (lazy-cons a b) will have to change to something like (lazy-seq (cons a b)) |
| 14:21 | Chouser | importantly, though, is where the test for the end of the seq goes. |
| 14:22 | Chouser | currently it usually looks like (when not-done (lazy-cons a b)) |
| 14:22 | gnuvince | rsynnott: yeah. I'm no fan of Java (the language), but the Java integration is what pushed me to try Clojure: knowing that it would have access to a large body of useful code. |
| 14:22 | Chouser | in lazy, it's more likely to be (lazy-seq (when not-done (cons a b))) |
| 14:22 | Chouser | this means that even the not-done test is delayed until needed. |
| 14:22 | cooldude127 | Chouser: oh. i was hoping it would be like haskell where everything is lazy by default |
| 14:22 | shoover | any word on a .net port coming to clojure.contrib? I heard a rumor here last month. just wondering if there's any public knowledge of such a thing |
| 14:23 | Chouser | people are plowing ahead with ikvm, but the rumor is all I've heard for the other. |
| 14:24 | Chousuke | there is some clojure-inspired thing called Xronos, though |
| 14:24 | shoover | Xronos logs went silent after November |
| 14:25 | Chouser | that's an odd one |
| 14:25 | shoover | er, mid December, but still |
| 14:25 | Chousuke | it seems it's still active |
| 14:26 | Chousuke | at least, somewhat |
| 14:26 | Chouser | the license is incompatible with Clojure's, but there's some code in it that would be hard to defend as not a copy |
| 14:26 | rsynnott | well, at least they refrained from calling it clo[a-z]ure |
| 14:26 | cooldude127 | last commit was feb 1 |
| 14:27 | rsynnott | (as it is, there's clojure, clozure and closure (a web browser)) |
| 14:27 | Chouser | on the other hand, there is some code that is so different from Clojure's for the same class that it's not clear its profiding the same data-sharing, thread, immutability, etc. properties as Clojure. |
| 14:27 | Chousuke | clogure :( |
| 14:27 | shoover | cooldude127: pretty minor stuff in those February commits |
| 14:27 | shoover | cooldude127: but perhaps a sign of life |
| 14:27 | cooldude127 | it's something :) |
| 14:28 | Chouser | the author's been here before, but I've never talked with him. |
| 14:28 | shoover | there is also #xronos. I'm asking over there too |
| 14:28 | cooldude127 | clozure = os x common lisp |
| 14:28 | vsthesquares | hm, when I populate a list with structs, the repl weirds it all up with pointers. that's weird since the structs are just maps, right? |
| 14:28 | vsthesquares | the representation, I mean |
| 14:28 | rsynnott | yep, the impl formerly known as openmcl, and the company that maintains it |
| 14:28 | cooldude127 | vsthesquares: care to paste what you mean? |
| 14:29 | rsynnott | are there really enough .NET users to make a .NET version sensible? |
| 14:29 | Chousuke | vsthesquares: structs are a special kind of map |
| 14:29 | cooldude127 | rsynnott: probably not for rhickey |
| 14:29 | cooldude127 | but for someone, maybe |
| 14:29 | shoover | rsynnott: my town is mostly .NET shops |
| 14:29 | vsthesquares | Chousuke: they appeart to be equal |
| 14:29 | Chousuke | the two versions could never be really compatible though :/ |
| 14:30 | vsthesquares | I'll paste it, but right now I've got to run, got to pick up the girlfriend ;) |
| 14:30 | Chousuke | the host platforms are way too different, and clojure makes no attempt to hide the JVM |
| 14:30 | Chouser | it's not unreasonable to have a clojure.core that supports both, I think, but contrib would be another matter entirely. |
| 14:31 | shoover | Chousuke: I just want the secret sauce; doesn't have to be 100% compatible |
| 14:31 | Chousuke | Chouser: yeah |
| 14:32 | Chousuke | maybe some "clojure.host" namespace that clojure.core could use |
| 14:32 | Chouser | clojurescript has clojure.JS |
| 14:32 | Chouser | I think |
| 14:32 | Chouser | yeah |
| 14:33 | Chousuke | you wrote it, and you "think" it has that? :P |
| 14:33 | Chouser | I had to check... wondered for a moment if I had called it clojure.lang.JS or something. |
| 14:33 | Chousuke | For integrating those changes to the main source tree to be feasible they should have no effect on performance though |
| 14:34 | Chouser | I don't think that'd be a problem. |
| 14:34 | Chousuke | shouldn't be. |
| 14:34 | Chouser | core currently makes only a few direct Java assumptions that aren't already abstracted by the api to Numbers, RT, etc. |
| 14:35 | Chouser | the remaining ones are, I believe, removed by the clojurescript patch. |
| 14:36 | technomancy | what's the delay getting that patch in? Just need to prove that it doesn't affect perf? |
| 14:37 | Chouser | technomancy: dunno, though I doubt that's it. I assume it's just not a priority for rhickey at the moment. |
| 14:37 | Chouser | A more significant patch was already applied for clojurescript. |
| 14:38 | danlarkin | I don't want a .net port, a majority of user level code will be totally incompatible between the two |
| 14:38 | Chouser | svn rev 1035 -- mucked about in Compiler.java and such. |
| 14:38 | shoover | danlarkin: are you a .NET programmer? |
| 14:39 | cooldude127 | danlarkin is right, there are a lot of times when dipping down into java is necessary, any code that does it will just not work on .net |
| 14:39 | Chouser | most code would have to be clearly labeled -- clojure, clojure.NET, clojurescript, etc. |
| 14:40 | danlarkin | shoover: no |
| 14:40 | Chouser | though the same file could support multiple, with some care. |
| 14:40 | technomancy | sounds like more work than it's worth |
| 14:40 | cooldude127 | that sounds like a pain in the ass |
| 14:40 | Chouser | more of a pain than writing C# code? |
| 14:41 | Chouser | doesn't C# already have this issue with mono? |
| 14:41 | hiredman | eh? |
| 14:41 | cooldude127 | i think mono is fairly compatible with MS, no? |
| 14:41 | danlarkin | mono is just an alternate VM implementation, same libraries |
| 14:41 | Chouser | "fairly" perhaps, but aren't the GUI toolkits quite different -- gtk vs. MS-whatever? |
| 14:42 | cooldude127 | Chouser: well yeah |
| 14:42 | Chouser | I want Clojure to be *everywhere*. :-) |
| 14:42 | hiredman | I think mono tranlates the windows.forms stuff to gtk |
| 14:42 | Chousuke | Chouser: you can use some portable GUI toolkit I guess. |
| 14:42 | cooldude127 | it doesn't have something like swing |
| 14:42 | cooldude127 | i don't think |
| 14:42 | cooldude127 | Chouser: but it could be useful to have a common code base and then just maintain the separate guis |
| 14:42 | cooldude127 | if you wanted to do windows and linux apps |
| 14:42 | hiredman | http://www.mono-project.com/WinForms |
| 14:43 | rsynnott | "< shoover> rsynnott: my town is mostly .NET shops" - your TOWN? I hadn't realised it was a geographic thing :) |
| 14:43 | rsynnott | isn't mono terribly slow, though? |
| 14:43 | rsynnott | hiredman: still in trouble if you want MacOS guis, though |
| 14:44 | cooldude127 | might as well use java at that point tho |
| 14:44 | technomancy | rsynnott: I'm in Seattle, and I don't know any .NET people, so I'm not sure how that works. =) |
| 14:44 | hiredman | http://geekswithblogs.net/CISCBrain/articles/Mono_vs_dotNet_Performance_Test.aspx |
| 14:44 | hiredman | rsynnott: apparently winforms also does native stuff on OSX |
| 14:45 | rsynnott | perhaps I too am in the wrong geographic area |
| 14:45 | cooldude127 | oh yeah forgot about mono for os x |
| 14:45 | shoover | rsynnott: that's why I said my town. my company and my friends' companies use .NET. come to Indianapolis next Thursday night |
| 14:46 | rsynnott | odd. Dublin (and possibly Europe as a whole) seems to be pretty much .NET free, except for the odd VB classic thing given new life |
| 14:47 | hiredman | I thought MS had a large presence in dublin? |
| 14:47 | rsynnott | yep, EU headquarters, translation, R&D |
| 14:47 | rsynnott | they just don't seem to have convinced anyone to use their stuff |
| 14:47 | shoover | I think Chouser said it best: there's nothing in clojure.core that prevents having multiple implementations, if someone wants to take the time to build clojure.lang.RT, clojure.lang.Compiler, etc. on their platform |
| 14:47 | hiredman | Oh |
| 14:48 | rsynnott | (and Sun also has a large presence in Dublin, as does IBM and Google) |
| 14:48 | technomancy | shoover: right now there's not a high priority on implementing as much of clojure as possible in clojure. |
| 14:48 | technomancy | if it ever moves in that direction, alternate runtimes will become much easier to support. |
| 14:49 | shoover | agreed. but even the current state it's doable. clojurescript and xronos have shown that |
| 14:49 | rsynnott | technomancy: up to a point |
| 14:50 | technomancy | rsynnott: sure; I don't know if it will ever be self-hosting |
| 14:50 | hiredman | wasn't there some flash port sort of thing? |
| 14:50 | Chouser | clojurescript doesn't have sorted-anything or persistentqueue yet. ;-) |
| 14:50 | Chouser | hiredman: yep |
| 14:50 | shoover | Chouser: any hurdles, or just effort? |
| 14:50 | technomancy | this is what happened with Ruby anyway, as soon as Rubinius focused on implementing as much in itself as possible, it was able to help the JVM and .NET implementations immensely |
| 14:51 | Chouser | shoover: just effort. |
| 14:51 | WizardofWestmarc | not sure Ruby's implementation model is what I'd want to follow, last I knew it was the slowest language of anything modern |
| 14:51 | WizardofWestmarc | even with the 1.9/2.0 improvements |
| 14:51 | Chouser | PersistentQueue in particular should be a snap, just haven't done it. |
| 14:51 | technomancy | WizardofWestmarc: well consider that model came from smalltalk |
| 14:51 | rsynnott | self-hosting seems to be the turning point; many self-hosting lisps are REMARKABLY hard to port to other platforms |
| 14:52 | WizardofWestmarc | rsynnott: sbcl on windows proves that so true ;-; |
| 14:52 | technomancy | rsynnott: I'm not sure if that's comparable though since it's not dealing with a VM |
| 14:52 | Chouser | PersistentTreeMap would be roughly as much effort as PersistentHashMap was, after with PersistentTreeSet would be a snap. |
| 14:53 | rsynnott | no, there is that |
| 14:54 | rsynnott | also, doesn't have to (and nor should it) have its own GC |
| 14:54 | rsynnott | (sbcl and clozure both have at least two GC systems, due to the 386's miserliness with registers) |
| 14:57 | lisppaste8 | gnuvince pasted "Improvement suggestions? This seems ugly and complicated" at http://paste.lisp.org/display/75431 |
| 14:58 | cooldude127 | gnuvince: for one thing, the docstring is in the wrong spot. should go before the arglist |
| 14:59 | gnuvince | Yeah, I've spotted it just now. |
| 14:59 | cooldude127 | technomancy: it makes sense when you consider multiple arglists but it is still weird after using CL and elisp |
| 14:59 | technomancy | cooldude127: yeah. I need to fix clojure-mode to highlight them differently |
| 15:00 | cooldude127 | technomancy: really? is there anyway it could treat them like comments so auto-fill would work? |
| 15:00 | technomancy | you can already auto-fill them |
| 15:00 | technomancy | oh, sort of... |
| 15:01 | cooldude127 | technomancy: it pulls the arglist up to the next line |
| 15:02 | technomancy | right; should be fixable, but needs work |
| 15:02 | cooldude127 | technomancy: at the very least, making the indentation system understand that it should be indented two spaces would be AWESOME |
| 15:02 | gnuvince | ,(#("hello") 3) |
| 15:02 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--1197$fn |
| 15:03 | cooldude127 | gnuvince: trying to call ("hello") |
| 15:03 | technomancy | cooldude127: that already works if you fix the arg list by hand |
| 15:03 | cooldude127 | gnuvince: in addition to only creating a zero-arg functions |
| 15:03 | cooldude127 | technomancy: yeah, but that drives me nuts having to do that |
| 15:03 | technomancy | cooldude127: right, what I mean is you only have to fix the arg list problem, not indentation |
| 15:03 | technomancy | well, and font-lock |
| 15:03 | gnuvince | cooldude127: yeah |
| 15:04 | gnuvince | cooldude127: just checking |
| 15:04 | cooldude127 | technomancy: except if you manually hit enter or tab, it doesn't indent inside a docstring |
| 15:04 | technomancy | cooldude127: oh, ok. I was thinking of M-q |
| 15:04 | Chousuke | it kind of sucks that docstrings need to be manually indented. |
| 15:04 | Chouser | #(:foo %) is the same as just :foo |
| 15:05 | gnuvince | Anyway, I use constantly in this case. |
| 15:05 | Chouser | Chousuke: they indent fine in vim. ;-) |
| 15:05 | Chousuke | Chouser: I didn't mean that; I mean for them to align properly in (doc) |
| 15:05 | Chousuke | the whitespace is actually *meaningful* |
| 15:05 | gnuvince | When is whitespace not meaningful? |
| 15:05 | cooldude127 | technomancy: yeah well i would honestly be ok if just one of them worked |
| 15:06 | Chouser | oh. it looks good indented two spaces, doesn't it? |
| 15:06 | Chousuke | gnuvince: when indenting :P |
| 15:06 | Chousuke | Chouser: yeah, but the two spaces are actually part of the docstring |
| 15:06 | gnuvince | Chousuke: one of the rare cases |
| 15:06 | cooldude127 | docstrings should ignore leading spaces |
| 15:06 | Chousuke | so if you print it out, removing newlines, you will get weird spacing. |
| 15:07 | Chousuke | it mixes layout with actual content which is what I don't like :/ |
| 15:07 | Chouser | gnuvince: can't you say (m action-name) for the :when? |
| 15:08 | gnuvince | Chouser: oh yeah |
| 15:08 | gnuvince | thanks |
| 15:09 | gnuvince | great |
| 15:11 | gnuvince | Chouser: that even improved performance ;) |
| 15:40 | hiredman | is there some handy code around to get the line number of a def or defn in a file? |
| 15:41 | jbondeson | grep? |
| 15:41 | hiredman | :( |
| 15:41 | shoover | (:line ^#'my-fn) |
| 15:41 | Chouser | ,(:line ^#'filter) |
| 15:41 | clojurebot | 1454 |
| 15:41 | jbondeson | i try to be helpful! |
| 15:41 | Chouser | shoover: oooh |
| 15:41 | hiredman | meh |
| 15:41 | shoover | I lose with my non-botness |
| 15:41 | hiredman | I guess that'll do |
| 15:41 | hiredman | hmmm |
| 15:41 | Chouser | shoover: but you win in time |
| 15:42 | jbondeson | are you doing the source lookup for clojurebot? |
| 15:42 | hiredman | yes |
| 15:42 | jbondeson | what about the java files? |
| 15:42 | shoover | ,(:file ^#'filter) |
| 15:42 | clojurebot | "core.clj" |
| 15:42 | Chouser | hiredman: you may want to look at get-source in repl-utils. |
| 15:42 | Chouser | it does some work to find the right source file |
| 15:43 | hiredman | hmmm |
| 15:45 | hiredman | so I need to turn a string into a symbol and then resolve the symbol? and get the metadata off the var? |
| 15:45 | Chouser | or you could grep |
| 15:45 | danlarkin | ,(:file ^#'if) |
| 15:45 | clojurebot | java.lang.Exception: Unable to resolve var: if in this context |
| 15:46 | hiredman | danlarkin: that would be a problem |
| 15:46 | Chouser | danlarkin: close, but 'if' is a special form |
| 15:46 | Chouser | oh, was that the point? |
| 15:46 | danlarkin | yeah |
| 15:47 | danlarkin | I was just wondering if it'd point to the .java file, I guess it does not |
| 15:47 | Chouser | but what would you want? http://code.google.com/p/clojure/source/browse/trunk/src/jvm/clojure/lang/Compiler.java#2324 |
| 15:47 | Chouser | or http://code.google.com/p/clojure/source/browse/trunk/src/jvm/clojure/lang/Compiler.java#43 |
| 15:47 | hiredman | hmmm |
| 15:47 | Chouser | probably not very useful to most folks |
| 15:48 | danlarkin | yeah |
| 15:52 | e_0r | So I'm trying to get clojure+slime+emacs going (following bill clementson's , and I'm running into a ( NoClassDefFoundError: clojure/lang/Repl ) |
| 15:52 | e_0r | crap.. that was premature |
| 15:52 | cooldude127 | e_0r: sounds like you're not pointing it to clojure.jar correctly |
| 15:52 | e_0r | yea im about to start tinkering w/ my ~/.emacs file |
| 15:52 | cooldude127 | e_0r: technomancy's clojure-mode on github has a clojure-install function that will take care of it |
| 15:53 | cooldude127 | e_0r: it also has a clojure-update function written by me to keep you up-to-date :) |
| 15:53 | e_0r | oh hell yes |
| 15:53 | e_0r | i'm so excited about this language |
| 15:53 | e_0r | just want to get it in a decent environment |
| 15:54 | cooldude127 | e_0r: slime is the only way to ride :) |
| 15:58 | technomancy | it's the most fun, at least |
| 16:01 | mattrepl | technomancy: has jochu said anything about pulling your changes? |
| 16:02 | technomancy | mattrepl: it's been quiet since he merged imenu support |
| 16:02 | technomancy | haven't heard about the installer |
| 16:05 | danlarkin | he's an illusive guy huh |
| 16:06 | hiredman | clojurebot: def filter |
| 16:06 | hiredman | hmmm |
| 16:07 | hiredman | that is not filter |
| 16:07 | Chouser | is that the svn rev clojurebot's currently using? |
| 16:08 | hiredman | yes |
| 16:08 | hiredman | clojurebot: def filter |
| 16:10 | Lau_of_DK | Good evening gents |
| 16:10 | AWizzArd | Hi the Lau. |
| 16:12 | danlarkin | Hi Lau_of_DK |
| 16:12 | e_0r | 'ello |
| 16:12 | danlarkin | lots of progress on AYUP |
| 16:12 | Chouser | Lau walks in and suddenly this place reminds me of Cheers. :-) |
| 16:13 | cooldude127 | hiredman: that is cool :) |
| 16:13 | hiredman | :) |
| 16:14 | AWizzArd | hiredman: thanks for realizing my suggestion so fast |
| 16:14 | hiredman | my pleasure |
| 16:15 | danlarkin | hiredman: what if instead of "def" it was "source" :) |
| 16:15 | hiredman | ~def *compile-path* |
| 16:15 | AWizzArd | is the ~ short for clojurebot: ? |
| 16:16 | hiredman | AWizzArd: yes |
| 16:16 | hiredman | ~source *compile-path* |
| 16:16 | hiredman | ~def *compile-path* |
| 16:16 | hiredman | does both |
| 16:17 | danlarkin | coo |
| 16:17 | danlarkin | l |
| 16:21 | Lau_of_DK | Chouser: Hehe, which member did you picture me as ? :) |
| 16:22 | Chouser | Norm!!!! |
| 16:22 | Chouser | though only because of the greetings you recieve. |
| 16:22 | Chouser | receive |
| 16:24 | Lau_of_DK | Funny, I had the same thought... :) |
| 16:51 | cooldude127 | technomancy: you're watching me! |
| 16:52 | technomancy | cooldude127: yeah; don't try anything funny |
| 16:52 | cooldude127 | lol |
| 16:54 | cooldude127 | you checking up on my date library? :p |
| 16:54 | technomancy | yup |
| 16:54 | cooldude127 | i figured the linear algebra stuff and the pointless trees weren't it |
| 16:55 | cooldude127 | although the linear algebra is what's currently being worked on |
| 16:55 | technomancy | you ought to fork clojure-contrib and add your date stuff to that |
| 16:56 | technomancy | that way you can keep your tests in the main test suite |
| 16:56 | cooldude127 | technomancy: you forgot to prefix that with "write some tests" |
| 16:57 | lisppaste8 | reprap pasted "input" at http://paste.lisp.org/display/75443 |
| 16:57 | cooldude127 | technomancy: you are right about that. i didn't do it at first because i was using svn for clojure-contrib when i started writing it |
| 16:57 | cooldude127 | technomancy: it would be easier for sure to keep it with the rest of my clojure-contrib |
| 16:57 | technomancy | cooldude127: well before too long I'll probably be interested in jumping on board, and what better place to start than with a test suite |
| 16:57 | cooldude127 | technomancy: cool |
| 16:58 | cooldude127 | right now the priority is the math stuff cuz i'm gonna need it for a school project |
| 16:59 | technomancy | well my read patch got (rightly) rejected yesterday, so I've got to find another way to get some code in. =) |
| 16:59 | cooldude127 | technomancy: why was it rejected? |
| 17:00 | technomancy | cooldude127: it doesn't work as expected when objects aren't separated by whitespace and you want to call read repeatedly |
| 17:00 | technomancy | http://groups.google.com/group/clojure/browse_thread/thread/fedbb2a63af633f0 <= see the second-to-last post in the thread |
| 17:00 | technomancy | I can't figure out a way to handle that gracefully without changing read to peek instead of pulling a char off and pushing it back. |
| 17:05 | cooldude127 | technomancy: wait, i'm not sure i understand why it works if you wrap yourself, but not with the patch? isn't that all the patch does? |
| 17:06 | technomancy | cooldude127: the patch creates a new pushback reader for *every* read |
| 17:06 | technomancy | you're free to do that without the patch, but without the patch the correct thing to do is hang on to the same pushback reader |
| 17:07 | technomancy | if this weren't Java, I could slap the pushback reader into a newly created slot on the wrapped reader and check for it, essentially memoizing. |
| 17:07 | technomancy | which would possibly be too hacky to cut the mustard, but it would address the problem. =) |
| 17:08 | cooldude127 | technomancy: i see now |
| 17:08 | technomancy | it's a tough problem. I was totally oblivious to it due to the limited way in which I was using read. |
| 17:09 | cooldude127 | yeah |
| 17:10 | Chouser | statefulness |
| 17:11 | technomancy | I suspect other lisps get around the problem by using peek on the stream. |
| 17:11 | Chouser | the underlying reader has state, and the pushback reader adds more. suddenly you start having to pay attention to who owns which state, who mutates it when, etc, etc. |
| 17:12 | cooldude127 | this is why we're using clojure in the first place |
| 17:12 | flowerpower | wow playign aroun wtih scheme now and it really makes me apprecate clojrue even more, plt scheme isnt very mature and basiclaly it is lisp for the 80s or soemthing |
| 17:12 | Chousuke | hmm |
| 17:12 | technomancy | flowerpower: well considering your nick, I'm not sure why you consider that a bad thing. |
| 17:12 | Chousuke | I think it's wrong to say scheme is not mature |
| 17:13 | cooldude127 | scheme is thin |
| 17:13 | cooldude127 | lean |
| 17:13 | technomancy | flowerpower: you prefer maclisp? |
| 17:13 | Chousuke | it... never was expected to grow up :) |
| 17:13 | technomancy | 70's style? =) |
| 17:20 | technomancy | it's funny how hard it is for languages to shake the "academic" label |
| 17:21 | cooldude127 | technomancy: it's ok, it's not great. it's more the drscheme environment that i find unusable |
| 17:21 | technomancy | well you can hook it up to slime, right? |
| 17:22 | cooldude127 | technomancy: i don't know how to do that plt. i know mit scheme supports as well as i think kawa |
| 17:22 | WizardofWestmarc | PLT probably has the best set of libraries of any stand alone scheme, or it does of any I've looked at |
| 17:22 | cooldude127 | yeah |
| 17:22 | WizardofWestmarc | it's just the library set is still tiny compared to that available on the jvm |
| 17:23 | cooldude127 | woo somebody else is watching my clojure-code repo |
| 17:23 | technomancy | anyway, I'm relieved we don't have to deal with the academic label |
| 17:23 | gnuvince_ | cooldude127: link? |
| 17:23 | cooldude127 | i feel special |
| 17:23 | cooldude127 | http://github.com/cooldude127/clojure-code/tree/master |
| 17:25 | cooldude127 | gnuvince_: that's pretty much every piece of useful clojure code i've written |
| 17:42 | reprap | scheme sucks so hard |
| 17:42 | reprap | it doesnt have anything |
| 17:42 | reprap | you want to do anythign then spend first time coding stuff that has been done a millliont iems already |
| 17:45 | technomancy | if you're limiting yourself to the stuff in RNRS, you're doing it wrong |
| 17:45 | technomancy | kawa has all the same advantages as clojure. |
| 17:45 | technomancy | (as far as that goes) |
| 17:50 | cooldude127 | i tried all the java-based schemes. none of them worked nearly as well as clojure |
| 17:50 | technomancy | well Bus Scheme has access to a ton of libraries. |
| 17:50 | hiredman | uh |
| 17:51 | technomancy | also it comes with my personal guarantee that it will be awesome. |
| 17:51 | technomancy | and slow. |
| 17:54 | cooldude127 | technomancy: lol |
| 17:54 | karmazilla | so... "bus" is a metaphor for how it is to "drive"? |
| 17:54 | cooldude127 | karmazilla: i don't think intentionally |
| 17:55 | cooldude127 | technomancy: bus scheme's in ruby right? |
| 17:55 | technomancy | karmazilla: Bus Scheme is the only scheme implementation that claim to be implemented while riding the bus. |
| 17:55 | technomancy | cooldude127: yes, hence the guarantee of slowness. |
| 17:55 | cooldude127 | lol |
| 17:55 | cooldude127 | wait that's not funny. what the hell ruby? |
| 17:55 | Chousuke | why not. |
| 17:56 | karmazilla | is it a public transport bus? |
| 17:56 | technomancy | karmazilla: yeah |
| 17:56 | cooldude127 | ruby's such a beautiful language, but its performance is suck |
| 17:56 | Chousuke | it also has ultrafail string handling. |
| 17:56 | cooldude127 | lol |
| 17:56 | technomancy | karmazilla: http://transit.metrokc.gov/tops/bus/schedules/s301_0_.html |
| 17:56 | gnuvince_ | Ruby has some MAJOR fails |
| 17:56 | Chousuke | yeah, but the string fail is just unbeliveable. |
| 17:57 | technomancy | Chousuke: encoding stuff you mean? |
| 17:57 | technomancy | that stuff is so politicized. =\ |
| 17:57 | karmazilla | you must have quiet buses and smooth roads around where you go. |
| 17:57 | Chousuke | technomancy: the fact that indexing a string will return an integer. |
| 17:57 | Chousuke | technomancy: which makes no sense at all. |
| 17:57 | technomancy | Chousuke: not any more; that was fixed. |
| 17:57 | technomancy | but yeah, brain-dead decision |
| 17:57 | cooldude127 | in 1.9? |
| 17:57 | technomancy | karmazilla: it's pretty good; most of the ride is on the freeway |
| 17:57 | gnuvince_ | irb(main):001:0> x = 10 if false |
| 17:57 | gnuvince_ | => nil |
| 17:57 | gnuvince_ | irb(main):002:0> x |
| 17:57 | gnuvince_ | => nil |
| 17:57 | technomancy | still loud though. |
| 17:57 | hiredman | technomancy: oh man |
| 17:58 | hiredman | or go on |
| 17:58 | jbondeson | any language that thinks puts is a better name than print is bound to be bad. |
| 17:58 | cooldude127 | lol |
| 17:58 | Chousuke | heh |
| 17:58 | Chousuke | well, ruby has some nice features too |
| 17:58 | hiredman | I ride seattle metro every day |
| 17:58 | cooldude127 | jbondeson: what about haskell? putStrLn ? |
| 17:58 | Chousuke | like blocks |
| 17:59 | Chousuke | though that's nothing new, it's still nice. |
| 17:59 | technomancy | jbondeson: print works too, it just doesn't include a newline |
| 17:59 | Raynes | cooldude127: They have a print function that converts whatever it gets into something printable and prints it. |
| 17:59 | hiredman | and to think, someone out there was writing a lisp on one of the buses |
| 17:59 | cooldude127 | Raynes: no way! |
| 17:59 | Raynes | cooldude127: Yeah way! |
| 17:59 | jbondeson | cooldude127: it's functional, it's allowed to not like side effect functions ;) |
| 17:59 | Raynes | :D |
| 17:59 | cooldude127 | lol |
| 17:59 | hiredman | Raynes: doesn't that depend on the show typeclass? |
| 17:59 | Raynes | hiredman: Yes. |
| 17:59 | gnuvince_ | Yes |
| 18:00 | hiredman | Yes. |
| 18:00 | Raynes | It wont print "everything" you give it. |
| 18:00 | technomancy | hiredman: a lot of crazy things happen on the bus. you never know. |
| 18:00 | Raynes | But it will print anything that is printable. |
| 18:00 | jbondeson | technomancy: that just makes it worse. two printing functions named *completely* differently that differ only in one adding a new line. |
| 18:00 | Raynes | Including Integers. |
| 18:00 | gnuvince_ | print in Haskell is like prn in Clojure |
| 18:00 | Raynes | ,(prn 2) |
| 18:00 | Chousuke | jbondeson: there's a putStr too though, I think |
| 18:00 | clojurebot | 2 |
| 18:00 | Raynes | Oh thats fuckin' neat. |
| 18:00 | gnuvince_ | ,(prn "hello") |
| 18:01 | clojurebot | "hello" |
| 18:01 | Raynes | ,(doc prn) |
| 18:01 | clojurebot | "([& more]); Same as pr followed by (newline). Observes *flush-on-newline*" |
| 18:01 | hiredman | I started writing a ruby lisp once |
| 18:01 | Raynes | :D |
| 18:01 | technomancy | jbondeson: there's plenty more interesting things to complain about in Ruby. you're scraping the bottom of the barrel; admit it. |
| 18:01 | gnuvince_ | technomancy: is the parser bug still there? |
| 18:01 | hiredman | but I really hate writing parsers |
| 18:01 | WizardofWestmarc | The rampant monkeypatching alone is reason to avoid Ruby |
| 18:01 | Raynes | The problem with Ruby is that it exists. |
| 18:01 | cooldude127 | hiredman: what sort of paper? |
| 18:01 | jbondeson | technomancy: if you can't get the easy stuff right i have no confidence in you getting the hard stuff right |
| 18:01 | WizardofWestmarc | makes mixing libraries insanely risky |
| 18:02 | technomancy | hiredman: I hate writing parsers for things that aren't sexps |
| 18:02 | technomancy | hiredman: my bus scheme parser was around 100 LOC |
| 18:02 | cooldude127 | oh parser |
| 18:02 | cooldude127 | nvm |
| 18:02 | hiredman | well, I kept trying to take short cuts |
| 18:02 | gnuvince_ | Just a question of time; the more the "enterprise" programmers try to find new ways to use XML everywhere, the closer they will be to just using Lisp |
| 18:10 | cooldude127 | hmm, i rather like the syntax highlighting that github uses, i wonder if i could translate that to emacs |
| 18:11 | danlarkin | cooldude127: they use pygments |
| 18:11 | cooldude127 | danlarkin: well i meant the color scheme |
| 18:11 | danlarkin | ah |
| 18:12 | danlarkin | yeah it's pleasant |
| 18:13 | cooldude127 | god bless google: http://github.com/dudleyf/color-theme-github/tree/master |
| 18:14 | danlarkin | sweet!! |
| 18:15 | cooldude127 | danlarkin: yeah i'm trying it to see how good it is |
| 18:16 | cooldude127 | danlarkin: it's close but not quite the same |
| 18:16 | cooldude127 | maybe when i have a chance i can try to improve it |
| 18:17 | danlarkin | Hm, what's different |
| 18:17 | cooldude127 | danlarkin: function names are colored red, not teal, function calls are still black |
| 18:18 | cooldude127 | danlarkin: maybe that's good when you're actually editing, idk |
| 18:19 | Lau_of_DK | danlarkin: any news? |
| 18:19 | danlarkin | Lau_of_DK: oh yes, much progress |
| 18:20 | Lau_of_DK | No no not the work, the name? |
| 18:20 | danlarkin | haha |
| 18:21 | danlarkin | no name progress |
| 18:21 | Lau_of_DK | :( |
| 18:21 | danlarkin | I ran "hansard" by a few friends and they laughed :( |
| 18:21 | Raynes | danlarkin: I know you. :> |
| 18:22 | danlarkin | Raynes: from my reply to your SO question? |
| 18:22 | Raynes | You answered one of my stupid questions on Stackoverflow. |
| 18:22 | Raynes | <: |
| 18:23 | Lau_of_DK | Ok, danlarkin, Im going to bed now, when I get back tomorrow I want your decision and following that, a Github project: |
| 18:23 | Lau_of_DK | 1) Clabango |
| 18:23 | Lau_of_DK | 2) Bio Hansard |
| 18:23 | cooldude127 | what is this project? |
| 18:24 | Raynes | cooldude127: They are coding an IRC bot that closely replicates your behavior. It's called cooldude128. |
| 18:24 | cooldude127 | DAMNIT |
| 18:25 | hiredman | I could wire up a, uh, what do you call it, starts with an 'm'? anyway wire that up to clojurebot and feed it with a corpus of cooldude127 |
| 18:25 | cooldude127 | i'm scared |
| 18:26 | hiredman | god, that are those called? |
| 18:26 | cooldude127 | hiredman: if i had a clue what you were talking about, i would say |
| 18:26 | Fib | markov chain |
| 18:26 | cooldude127 | oh |
| 18:26 | hiredman | ding! |
| 18:27 | cooldude127 | i do not possess the markov property |
| 18:27 | cooldude127 | so while clojurebot may replicate my behavior at first, time will cause us to develop into different beings |
| 18:28 | hiredman | markov chains are a sufficent corpus text are pretty good for replicating style |
| 18:28 | cooldude127 | NO. i will not allow myself to be imitated by a bot |
| 18:28 | cooldude127 | and i still don't know what this project was |
| 18:28 | Raynes | http://paste.pocoo.org/show/103895/ |
| 18:35 | technomancy | cooldude127: if you start seeding it with inconsistent data now, you can still retain exclusivity on your identity |
| 18:36 | cooldude127 | rabble rabble rabblne |
| 18:36 | cooldude127 | i need to just start saying everything i hear around me |
| 18:37 | hiredman | then you'll be just like the bot |
| 18:37 | cooldude127 | lol |
| 18:37 | cooldude127 | well once the bot is seeded, i will continue acting as my normal self |
| 18:37 | hiredman | nah |
| 18:37 | cooldude127 | lol |
| 18:37 | hiredman | the corpos would keep growing |
| 18:38 | hiredman | you just lay down new chains |
| 18:38 | cooldude127 | hiredman: maybe make the bot before i start worrying about it |
| 18:38 | hiredman | :P |
| 18:38 | lisppaste8 | reprap pasted "folding and hashtables" at http://paste.lisp.org/display/75453 |
| 18:38 | hiredman | I started on it a month or so ago |
| 18:38 | cooldude127 | i was asking about danlarkin's project lol. how did this even happen? |
| 18:38 | hiredman | hmmm |
| 18:39 | hiredman | this is not clojure |
| 18:39 | cooldude127 | reprap: you know this is #clojure right? |
| 18:40 | Raynes | Who is reprap? |
| 18:40 | Raynes | :| |
| 18:40 | ayrnieu | the person who just pasted some Scheme. |
| 18:42 | Raynes | Oh shit. |
| 18:42 | Raynes | That is illegal in 7 channels. Bad juju. |
| 18:42 | Raynes | I think he should be banhammered for such nonsense. |
| 18:42 | Raynes | :| |
| 18:43 | Raynes | /end off topic jokes and lulz |
| 18:48 | reprap | scheme sucks |
| 18:48 | ayrnieu | why does it suck? |
| 19:09 | dirtmcgirt | greetings. any way to alias an imported java class? ala (alias 'ParserB 'org.parser.Parser)? i get an error currently ("Expecting Symbol + Namespace"). |
| 19:09 | hiredman | erm |
| 19:09 | Chouser | dirtmcgirt: hm, good question. 'alias' doesn't support it directly. what do you intend to do with it |
| 19:10 | gnuvince_ | (doc import) |
| 19:10 | clojurebot | import-list => (package-symbol class-name-symbols*) For each name in class-name-symbols, adds a mapping from name to the class named by package.name to the current namespace. Use :import in the ns macro in preference to calling this directly.; arglists ([& import-symbols-or-lists]) |
| 19:10 | Chouser | hm, maybe it doesn't matter. You can do (import '(org.parser Parser)) and then just say Parser |
| 19:10 | dirtmcgirt | i have two Java libraries each with a Parser class |
| 19:10 | hiredman | I thought there was something in contrib that let you do that? |
| 19:10 | cooldude127 | dirtmcgirt: you might have to do it the java way, address one by its full name |
| 19:12 | Chouser | bleh. I guess you could slap together a macro or three. |
| 19:12 | danlarkin | cooldude127: sorry, went to get some dinner. my project is yet another web framework |
| 19:13 | Chouser | dirtmcgirt: you need to mostly create instances? call statics? some of each? |
| 19:13 | dirtmcgirt | Chouser: create instances |
| 19:14 | dirtmcgirt | i can always just do a direct reference |
| 19:14 | cooldude127 | danlarkin: oh lovely |
| 19:14 | dirtmcgirt | but i was just curious |
| 19:14 | hiredman | yawfie |
| 19:16 | danlarkin | what's the ie? |
| 19:17 | hiredman | it is, you know, sort an endearment? |
| 19:17 | hiredman | like I have a friend named Jove, who I Jovie |
| 19:18 | hiredman | people sometimes, and only once, call me Kevie |
| 19:18 | hiredman | er |
| 19:18 | hiredman | I call him Jovie |
| 19:18 | danlarkin | ah |
| 19:19 | hiredman | ~google Yawf |
| 19:19 | clojurebot | First, out of 6310 results is: |
| 19:19 | clojurebot | 1970: Reviving the fighting spirit of Int'l Women's Day |
| 19:19 | clojurebot | http://www.workers.org/2005/us/womens-day-0303/ |
| 19:19 | danlarkin | clojurebot: google yawfie |
| 19:19 | clojurebot | First, out of results is: |
| 19:20 | hiredman | uh |
| 19:20 | hiredman | yeah, those corner cases |
| 19:21 | danlarkin | upside is there's only 8 results for yawfie |
| 19:21 | hiredman | and you could do the argentine Y |
| 19:22 | hiredman | so pronounced like Joffie |
| 19:23 | Chouser | dirtmcgirt: (defmacro newParserB [& args] `(new org.parser.Parser ~@args)) |
| 19:23 | Chouser | that's all I've got. |
| 19:37 | stimuli | hi |
| 19:37 | stimuli | has anyone noticed the contrib unit tests are breaking on the new mod code ? |
| 19:58 | flowerpower | scheme has so mixed up semantics. it makes me really appreciate clojures ways the mroe i try other languages after having tried clojure |
| 20:00 | stimuli | I never properly learned scheme .. other than reading sicp |
| 20:02 | gregh | flowerpower: can you give an example? I'm curious |
| 20:04 | blbrown | if I have a bunch of clojure files (clj) in a jar, within in the clj files is a namespace. How do I load the namespace from another clojure file. I thought I just had to add the clj files in the jar and then add that to the classpath |
| 20:04 | blbrown | ...but maybe I have to compile |
| 20:06 | stimuli | blb : does the ns match the folder hierarchy ? |
| 20:09 | blbrown | stimuli, I think so, this is what I have... http://paste.lisp.org/display/75457 |
| 20:10 | stimuli | it uses the ns to find the file |
| 20:10 | stimuli | ns fred.joe.mary is in fred/joe/mary.clj |
| 20:10 | stimuli | fred.joe.mary-with-lispy-dividers is in fred/joe/mary_with_lispy_dividers.clj |
| 20:10 | Chousuke | you should name your namespaces deeper than one level |
| 20:10 | blbrown | stimuli, I need to move 'octane_main...' into octane/octane_main.clj? |
| 20:11 | Chousuke | so a "octane" namespace is not good |
| 20:11 | stimuli | uh .. no .. octane-main (the ns) will be found in octane_name the file |
| 20:11 | stimuli | octane is fine |
| 20:11 | Chousuke | stimuli: it's not good practice. |
| 20:11 | stimuli | namespaces are broken on the dots |
| 20:11 | stimuli | like in java |
| 20:11 | Chousuke | blbrown.octane would be better, for example |
| 20:12 | Chousuke | to avoid collisions with others |
| 20:12 | stimuli | yeah |
| 20:12 | blbrown | Yea, but clearly I can't get a directory with one directory right |
| 20:12 | stimuli | look in the contrib files and do it like them |
| 20:12 | Chousuke | blbrown: you can have an octane.clj file AND an octane/ directory |
| 20:12 | stimuli | you should be starting every file with a ns macro that names its imports |
| 20:12 | Chousuke | blbrown: and you can load files from that directory in the octane.clj |
| 20:13 | Chousuke | blbrown: that way, you can break a single namespace into multiple files. |
| 20:13 | Chousuke | you can also have subnamespaces of course |
| 20:13 | Chousuke | for example, octane, octane.main and octane.analytics |
| 20:13 | blbrown | sorry, where does the namespace have to be defined. 'octane/file.clj' or 'file.clj' |
| 20:14 | Chousuke | blbrown: depends on which namespace it is |
| 20:14 | Chousuke | if the namespace is octane.file, then it is octane/file.clj |
| 20:14 | Chousuke | if it's file, then it's just file.clj |
| 20:14 | Chousuke | no directory |
| 20:14 | blbrown | right now, namespace ... '(ns octane...) |
| 20:15 | Chousuke | that must be in a file called "octane.clj" at the root of the classpath |
| 20:16 | Chousuke | clojure inherits from java the source code organisation conventions. |
| 20:16 | Chousuke | they might strike newbies as restrictive at first, but you'll just have to get used to it. |
| 20:17 | blbrown | Chouser, in the file './octane.clj' I define the namespace? |
| 20:17 | Chousuke | with clojure it's not as restrictive either, since it only matters when you create namespaces, not arbitrary files |
| 20:17 | Chousuke | blbrown: yeah |
| 20:17 | Chousuke | blbrown: though as said earlier, you should not call your namespace "octane" |
| 20:18 | Chouser | Beats me, just do whatever Chousuke says. |
| 20:18 | Chousuke | :) |
| 20:18 | blbrown | Chousuke, got it, I was trying to get it to work, then I will change the structure |
| 20:19 | Chousuke | okay |
| 20:20 | Chousuke | a common trick with clojure code seems to be to have a namespace corresponding to some file, and then that file uses "subnamespaces" internally |
| 20:20 | Chousuke | clojure.contrib seems to use this a lot |
| 20:21 | blbrown | I will have to look at it. besides the ability to get information about a namespace, are there are any special rules for namespaces. LIke, can you change the scope of a namespace. Available to some, unavailable to others |
| 20:22 | Chousuke | a namespace will be available to whoever has it in the classpath |
| 20:22 | Chousuke | but you can define private things in it :) |
| 20:24 | Chousuke | clojure.contrib.sql has a subnamespace called clojure.contrib.sql.internal that it uses; it is quite apparent that it's not intended for end users of the library :) |
| 20:24 | Chouser | heh |
| 20:25 | blbrown | there is no 'com' or 'org' , are we dropping that convention |
| 20:25 | stimuli | blb : seriously, look how they do it in the contrib code |
| 20:25 | Chousuke | you can use it, but clojure doesn't, nor does contrib |
| 20:25 | stimuli | I hope we drop com and org |
| 20:26 | blbrown | so, it is sort of like the java convention |
| 20:27 | Chouser | blbrown: well, the idea is to be sure you don't have accidental collisions |
| 20:27 | blbrown | got ya |
| 20:27 | Chouser | people using clojure aren't likely to accidentally make their own clojure namespace |
| 20:27 | Chousuke | pick something to identify yourself, and stick with it. |
| 20:28 | Chouser | but who knows if someone might make an octane or textjure namespace |
| 20:29 | Chouser | so using the domain names as aribtration is a practical if verbose solution |
| 20:29 | Chouser | of course domain names can change hands, so it's not exactly foolproof either. |
| 20:29 | Chouser | clearly we should all use uuids for our namespaces. |
| 20:30 | blbrown | hehe |
| 20:30 | Chousuke | I wonder how java handles namespace collisions. |
| 20:30 | Chousuke | I'm thinking it doesn't. |
| 20:30 | Chousuke | which is probably why the convention is verbose. |
| 20:30 | blbrown | are you talking about classpath hell |
| 20:31 | blbrown | it is also interesting in Java, that you can compile a package with whatever name you want, the directory that it is compiled in doesn't matter, but runtime does. |
| 20:32 | Chousuke | yeah |
| 20:32 | Chousuke | the default package is annoying too |
| 20:33 | Chousuke | I once wrote some java code that did custom classloading and it confused the hell out of me. |
| 20:33 | Chousuke | I was a newbie to Java's package system and it was not fun. |
| 20:34 | Chousuke | I think using netbeans further complicated it :P |
| 20:35 | blbrown | it never is, I work with 'websphere' (complex j2ee application server crap) and it is not always clear how classes are loaded. I get A.class is not compatible with A.class errors all the time |
| 20:58 | stimuli | has anyone noticed the contrib unit tests are breaking on the new mod code ? |
| 20:59 | durka42 | well the behavior of mod definitely changed |
| 21:01 | hiredman | ~def mod |
| 21:01 | reprap | whats the easiuest way to do 2d-grpahics in clojure? liek for shoot-emup-sidescroller |
| 21:01 | durka42 | (yes, the unit tests fail) |
| 21:02 | stimuli | luckily I don't use mod on floats or ratios :) |
| 21:02 | hiredman | I could have sworn google code syntax highlighted clojure code |
| 21:03 | stimuli | so is the new mod wrong .. or do the unit tests need to update |
| 21:03 | stimuli | it is nice to mod floats ... I wonder if java.lang.Math has mod on floats |
| 21:03 | durka42 | heh, a clojure koan |
| 21:04 | durka42 | "mod is broken in SVN HEAD" |
| 21:04 | stimuli | if so we could leave clojure's mod just ints without pain |
| 21:04 | durka42 | "perhaps you should... change your definition of mod" |
| 21:05 | stimuli | Math has no mod |
| 21:05 | Chouser | it doesn't look to me like mod has changed |
| 21:05 | stimuli | well .. I updated both branches from svn about an hour ago and the tests blew up |
| 21:05 | stimuli | you guys discussed changing it on the list |
| 21:05 | durka42 | it was fixed recently to give the same answers as ruby |
| 21:06 | durka42 | i remember hearing about it in here |
| 21:06 | stimuli | ooooo .. he added multi argument union and intersection |
| 21:06 | stimuli | YAY !!!! |
| 21:06 | stimuli | that will help me |
| 21:07 | stimuli | (sorry ... I get excited easily) |
| 21:09 | stimuli | so ... if I have a macro defined in a namespace ... but I want to *export* it from another namespace as if it were included there .. is there an easy way ? |
| 21:10 | stimuli | I have a macro defined ... in namespace clojure.datalog.rules |
| 21:10 | stimuli | but I want to create a lib named clojure.datalog.datalog |
| 21:11 | stimuli | and have users just import that |
| 21:11 | stimuli | but I want them to get the macro from rules w/out explicitly importing it |
| 21:11 | durka42 | oh i see |
| 21:11 | stimuli | (def macroname rules/macroname) doesn't work |
| 21:11 | stimuli | maybe some ns interning trick |
| 21:12 | stimuli | someone asked something like this on the list recently |
| 21:12 | durka42 | wait, if datalog uses or requires rules/macroname, and client uses datalog, it doesn't inherit like that? |
| 21:12 | stimuli | no |
| 21:12 | stimuli | when you use a ns .. you get the symbols *defined* there |
| 21:12 | stimuli | not the ones transitively included |
| 21:12 | durka42 | right |
| 21:15 | stimuli | I could just define a macro that expands to the other macro |
| 21:15 | stimuli | I think |
| 21:15 | Chouser | yes |
| 21:20 | stimuli | that worked |
| 21:21 | cooldude127 | ~latest? |
| 21:21 | clojurebot | latest is 1280 |
| 21:21 | cooldude127 | oh man 1 behind |
| 21:28 | flowerpower | whats the easiuest way to do 2d-grpahics in clojure? liek for shoot-emup-sidescroller |
| 21:30 | stimuli | flower : java 2d |
| 21:30 | cooldude127 | hsrhlehnrtrstnenenvsnstntht |
| 21:30 | cooldude127 | taertnrsta |
| 21:30 | cooldude127 | attrstinehartr |
| 21:30 | stimuli | it isn't necessarily easy |
| 21:30 | cooldude127 | eiseir |
| 21:30 | stimuli | cool : agree |
| 21:30 | durka42 | eh? |
| 21:30 | stimuli | I agree |
| 21:30 | cooldude127 | yeag it is so easy |
| 21:31 | stimuli | I think cool has a cat |
| 21:31 | stimuli | :) |
| 21:31 | cooldude127 | i have 4 cats |
| 21:31 | stimuli | evidently |
| 21:31 | cooldude127 | but this stuffis soeasy |
| 21:31 | Raynes | I have 1 doggy and a snake :> |
| 21:31 | stimuli | I have four ferrets and a skunk |
| 21:31 | cooldude127 | ehh i am not fond of snakes |
| 21:31 | cooldude127 | skunk?> |
| 21:31 | stimuli | yes |
| 21:32 | stimuli | black and white stripey thing |
| 21:32 | Raynes | cooldude127: Corn snake. Most docile snakes in the world. He is shedding at the moment, so I can't play with him :| |
| 21:32 | cooldude127 | how did you obtain a skunk |
| 21:32 | stimuli | I purchased her at a pet store |
| 21:32 | cooldude127 | oh how un forntunate |
| 21:32 | stimuli | she's lovely |
| 21:32 | cooldude127 | where do you live that you can buy a skunk at a pet store |
| 21:32 | stimuli | florida |
| 21:33 | Raynes | Skunks are pretty. But they smell :( |
| 21:33 | stimuli | well .. when you buy a skunk they come disarmed |
| 21:33 | cooldude127 | oh that is a plus |
| 21:33 | stimuli | well .. yeah |
| 21:33 | Raynes | I should buy a ferret |
| 21:33 | cooldude127 | well i will let you talk with the real cool now. i took over his computer :) |
| 21:33 | stimuli | people ask me if she can spray and I just look at them funny |
| 21:33 | Raynes | I bet they shit constantly. |
| 21:33 | Raynes | :| |
| 21:33 | stimuli | ray : always get at least 2 |
| 21:33 | stimuli | yes .. they shit a lot |
| 21:34 | stimuli | ferrets need playmates or they go a bit off |
| 21:34 | cooldude127 | off how? |
| 21:34 | stimuli | they get mean and bite a lot |
| 21:34 | stimuli | I mean .. not always |
| 21:34 | cooldude127 | lol not good |
| 21:34 | stimuli | but if they have a friend to play w/ they get along better .. are happier ... and learn not to bite hard |
| 21:34 | cooldude127 | i would like a hamster |
| 21:35 | cooldude127 | haha |
| 21:37 | cooldude127 | hey guys im going to have sex so i will talk to yall later |
| 21:38 | flowerpower | java.awt.Graphics2D ? |
| 21:39 | cooldude127 | lol gf has a sense of humor |
| 21:41 | flowerpower | you mean your bf |
| 21:41 | cooldude127 | what's that supposed to mean? |
| 21:41 | Chouser | that's enough guys |
| 21:42 | dreish | Let's not have any drunk fights tonight. |
| 21:42 | cooldude127 | lol |
| 21:42 | stimuli | http://java.sun.com/docs/books/tutorial/2d/index.html |
| 21:42 | flowerpower | he has a bf, he cant fight anyway |
| 21:42 | stimuli | flower .. ^^^^ |
| 21:43 | cooldude127 | lol |
| 21:46 | stimuli | I don't know if I'd actually like to *see* that |
| 21:46 | stimuli | I mean ... read about it perhaps |
| 21:48 | flowerpower | if a constructor is proteted what do i import and construct? |
| 21:50 | Chouser | you probably have to subclass it, perhaps with 'proxy'? |
| 21:50 | Chouser | or maybe there's a static method you're supposed to use to create them? |
| 21:50 | Chouser | flowerpower: what's the class? |
| 21:50 | flowerpower | http://java.sun.com/javase/6/docs/api/java/awt/Graphics2D.html |
| 21:50 | flowerpower | java.awt Graphics2D |
| 21:52 | Chouser | I don't think you make those, you're given them. |
| 21:56 | gnuvince_ | Is there a document that describes guidelines to improve memory usage in the JVM? |
| 21:56 | gnuvince_ | Rich mentioned that ephemeral objects are super cheap in a couple of his talks for example |
| 21:57 | Chouser | flowerpower: (.getGraphics (doto (javax.swing.JFrame.) .show)) |
| 21:57 | Chouser | that returns a Graphics2D |
| 21:57 | Chouser | object |
| 21:58 | Chouser | actually, a sun.java2d.SunGraphics2D |
| 21:59 | flowerpower | chouser: given? |
| 21:59 | flowerpower | what does getGraphics do? |
| 21:59 | flowerpower | ah |
| 21:59 | Chouser | it's a method of JFrame |
| 21:59 | flowerpower | (let [myg2d (.getGraphics (doto (javax.swing.JFrame.)] (.dostuff myg2d)) ? |
| 22:01 | gnuvince_ | QCon, that's by the site infoq.com, right? |
| 22:01 | Chouser | flowerpower: yes |
| 22:02 | Chouser | flowerpower: well, it seems you have to .show it before it has a graphics object |
| 22:02 | Chouser | before that, getGraphics returns nil |
| 22:04 | lisppaste8 | fp pasted "graphics 2d" at http://paste.lisp.org/display/75462 |
| 22:04 | flowerpower | ^^ the string doesnt get shown |
| 22:06 | Chouser | try 100 100 for the coords |
| 22:07 | Chouser | flowerpower: and I'd recommend finding a Java turorial and following that |
| 22:10 | flowerpower | This is an abstract class that cannot be instantiated directly. |
| 22:11 | flowerpower | what does that mean? i need to subclass? |
| 22:11 | Chouser | didn't I answer that? |
| 22:11 | Chouser | There are concrete classes that may be platform-specific |
| 22:12 | Chouser | that are subclasses of Graphics2D |
| 22:12 | Chouser | things like swing and awt will create the right concrete object for you, and you can get if via .getGraphics |
| 22:18 | lisppaste8 | fp pasted "doesnt show" at http://paste.lisp.org/display/75463 |
| 22:18 | flowerpower | do i need to set color or something? |
| 22:20 | gnuvince_ | Anyone here uses paredit? |
| 22:20 | durka42 | i used to... |
| 22:21 | Raynes | Because it has that neat little button that automagically builds jar's for me. |
| 22:21 | gnuvince_ | paredit.el, the Emacs minor mode. |
| 22:22 | Raynes | I know what it is. |
| 22:22 | durka42 | invaluable for lisp |
| 22:22 | gnuvince_ | ok |
| 22:23 | gnuvince_ | Just wanted to make sure there was not another program with the same name. |
| 22:23 | gnuvince_ | durka42: You say you used to. You stopped? |
| 22:23 | durka42 | well, i switched to vim :) |
| 22:23 | gnuvince_ | ok |
| 22:23 | durka42 | if i were to use emacs for a lisp, i would use apredit |
| 22:23 | durka42 | paredit |
| 22:24 | gnuvince_ | I need to learn to use it properly |
| 22:24 | gnuvince_ | Some things felt weird when I tried it |
| 22:25 | gnuvince_ | for instance, because it always inserts a pair of parens at once, I'm not sure how you "wrap" a form into another |
| 22:25 | durka42 | you've seen http://www.emacswiki.org/emacs/PareditCheatsheet and http://mumble.net/~campbell/emacs/paredit-beta.html ? |
| 22:25 | gnuvince_ | For instance you have (map foo coll) and you want to call count on that. That gives me (count) (map foo coll) |
| 22:25 | durka42 | i believe it's M-shift-( |
| 22:26 | durka42 | there's also a binding to gobble (i think it calls it slurping) the s-exp to the right |
| 22:26 | gnuvince_ | Ah, thanks |
| 22:26 | gnuvince_ | I'll bookmark those |
| 22:27 | gnuvince_ | I imagine you need to think of it less as inserting individual characters and more as moving forms around |
| 22:28 | flowerpower | do i need to set color or something? |
| 22:29 | durka42 | gnuvince_: it definitely makes for a more structural editor |
| 22:30 | gnuvince_ | I'll enable it and work with it this weekend |
| 22:37 | durka42 | FWIW, flowerpower was just drawing the rectangle somewhere offscreen |
| 22:44 | durka42 | flowerpower: try changing the rectangle's coordinates |
| 22:44 | durka42 | i did setColor but i'm not sure it made a difference |
| 22:44 | durka42 | also, you might get more help in #java, although you'd have to be able to translate their advice |
| 23:00 | Raynes | Does anyone know how to turn off that bothersome feature where emacs creates a back up file when you exit emacs so that if you did it accidentally you wont lose anything? |
| 23:00 | Raynes | Because it's annoying. |
| 23:00 | ayrnieu | ask in #emacs ; that's not why it does it, or when it does it; C-h i m emacs RET C-s back-up , probably. |
| 23:01 | durka42 | http://www.lns.cornell.edu/~bxin/computer/emacs/emacs24/emacs047.htm |
| 23:01 | durka42 | Raynes: (setq make-backup-files nil) |
| 23:02 | Raynes | Thanks. |
| 23:02 | durka42 | also known as (setq shoot-self-in-foot t) :p |
| 23:03 | Raynes | I don't use emacs enough for it to be a problem. But everytime I save a file I have to delete the backup and that gets annoying. |
| 23:08 | reprap | is the backup-files the ojnes with ~ after? ie, hmm.clj~ |
| 23:14 | reprap | http://rafb.net/p/pKtPYn75.html |
| 23:15 | p_l | Raynes: change the backup settings then |
| 23:15 | Raynes | [22:14] <Raynes> I'm going to read Clojure until I become so gay for LISP that I piss parentheses and jackoff to macros. |
| 23:16 | durka42 | (identical? reprap flowerpower) |
| 23:17 | reprap | clojurebot: Raynes is [22:14] <Raynes>I'm going to read Clojure until I become so gay for LISP that I piss parentheses and jackoff to macros. |
| 23:17 | clojurebot | 'Sea, mhuise. |