2008-11-25
| 00:16 | arohner | did anyone check out my expectation test post today? Since nobody responded I'm wondering if I'm off base by proposing it in a functional language |
| 00:29 | fyuryu | arohner: I think it's pretty cool. I hope it gets added to contrib |
| 00:30 | fyuryu | arohner: (unless you want it remain its own thing) |
| 00:30 | arohner | no, I was hoping it would be useful |
| 01:43 | _Jordan_ | My stupid question for today: Why aren't ((fn [] 42)) and (#(42)) equivalent? |
| 01:46 | notallama | #(42) is the same as (fn [] (42)) |
| 01:47 | _Jordan_ | notallama: Thanks! As an aside, is there a shortcut for a function that just returns 42? |
| 01:49 | albino | Isn't (fn [] 42) a shortcut? |
| 01:49 | albino | _Jordan_: you trying to get rid of the argument vector? |
| 01:49 | _Jordan_ | yeah, but I was pretty sure I saw a shorter way used in a snippet on here once |
| 02:11 | hiredman | #(identity 42) |
| 02:14 | _Jordan_ | hiredman: thanks, that does read better |
| 02:32 | Pupeno | Good morning. |
| 02:32 | Pupeno | How would you iterate over the keys and values of a map? |
| 02:34 | hiredman | map? |
| 02:34 | _Jordan_ | :) |
| 02:35 | hiredman | (seq ...) on a hash map gives you a seq of [key val] vectors |
| 02:35 | hiredman | most sequence functions call seq on what you pass in first |
| 02:36 | hiredman | so if you (map ...) on a hashmap, the function you map with sees a vector |
| 02:36 | _Jordan_ | hiredman: I thought you were making a joke about using (map ...) to iterate over a map |
| 02:37 | hiredman | I am pretty hilarious |
| 02:37 | _Jordan_ | lol |
| 02:56 | Pupeno | Thanks. |
| 03:08 | _Jordan_ | in (take-while (complement #{some-value}) coll), is a new set created for every iteration of take-while? (e.g. if some-value never changes, is it better to do (let [v #{some-value}] and call (complement v)?) |
| 03:21 | hiredman | uh |
| 03:33 | Pupeno | Is there a simple way to concatenate a list of strings? |
| 03:35 | Pupeno | ah, (reduce str ...) |
| 03:42 | fyuryu | I compile a lib, no exceptions thrown, I see #{my.lib} in the repl, but no files are saved in the classes dir |
| 03:55 | fyuryu | 1. create dirs: /test and /test/classes, 2. in /test create /test/my/lib.clj. 3 put (ns my.lib) in it 4. enter a directory with existing project and classes directory (eg. /som/proj/classes). 5. run java -cp /test;/test/classes;clojure.jar clojure.lang.Repl 6. invoke (compile 'my.lib). |
| 03:56 | fyuryu | and class files appear in /some/proj/classes/ |
| 04:01 | fyuryu | binding *compile-path* to /test/classes does the job, but why did it work in the first place? /some/proj is not even in the classpath |
| 05:05 | Lau_of_DK | Hi guys =) |
| 05:07 | danlei` | Top of the morning, Mr. Lau |
| 05:55 | Lau_of_DK | Good morning rhickey. I had a question which I almost posted for the group yesterday, but you might have the deciding insight. I made an ant simulator, in many ways similar to yours. One difference was that mine read its sleep times from globals refs (yours used static values). When I profiled the app, I saw that all agents had 2 tasks, getTask() and runTask(). getTask() usually took 80-90% of the available 100% for each thread, causing |
| 05:55 | Lau_of_DK | a great performance drop. Even before the first call to render, each thread averaged with 1000 calls to getTask(). Do you have any idea how I can get around this? |
| 05:57 | rhickey | Lau_of_DK: sounds like you have a bug |
| 05:59 | Lau_of_DK | rhickey: What should I be looking for? |
| 06:01 | Lau_of_DK | rhickey: I ask because, it must be that I somehow am not using the STM correctly. |
| 07:59 | aperotte | hello all! |
| 08:01 | aperotte | I had a quick question. I was trying to define several things in a loop and do it by generating symbols like this (def (symbol (str "test" "123")) (+ 1 1)) |
| 08:02 | aperotte | which I thought would create a new mapping in the environment for test123 to 2 |
| 08:03 | Chousuke | I think you need a macro for that. |
| 08:03 | aperotte | ok |
| 08:03 | aperotte | I created a macro |
| 08:04 | aperotte | but then I got an InstantiationError |
| 08:04 | Chousuke | though def'ing a lot of generated symbols like that sounds a bit fishy. |
| 08:04 | aperotte | ok |
| 08:04 | Chousuke | what are you trying to accomplish with it? |
| 08:05 | aperotte | I was using a 3d library to create many instances of a sphere |
| 08:05 | aperotte | and wanted to name each object in the environment |
| 08:06 | aperotte | hmm ... now that I think about it, I could probably use a hashmap |
| 08:07 | aperotte | I'd still be generating keys though |
| 08:14 | aperotte | Using keywords worked fine |
| 08:14 | aperotte | I'm still a little confused as to why using def didn't work though |
| 08:15 | rhickey_ | aperotte: def is a special operator, not a function |
| 08:18 | aperotte | I wanted to be able to do something like this (dotimes i 20 (def (symbol (str "sphere" i)) ("Sphere constructor"))) |
| 08:18 | rhickey_ | aperotte: you could make a macro that emitted defs in a do |
| 08:20 | aperotte | rhickey_: It seemed like the problem was that def required that the first thing be a symbol, and not a list that evaluates to a symbol |
| 08:21 | aperotte | I wrote this macro: |
| 08:21 | aperotte | (defmacro def-sym [sym & body] |
| 08:21 | aperotte | (if (symbol? sym) |
| 08:21 | aperotte | `(def ~sym ~@body) |
| 08:21 | aperotte | `(def ~(eval sym) ~@body))) |
| 08:21 | rhickey_ | hmm... eval |
| 08:24 | aperotte | after defining a ref named spheres containing the empty list |
| 08:24 | aperotte | code that looked like this: |
| 08:24 | aperotte | (defmacro def-sym [sym & body] |
| 08:24 | aperotte | (if (symbol? sym) |
| 08:24 | aperotte | `(def ~sym ~@body) |
| 08:24 | aperotte | `(def ~(eval sym) ~@body))) |
| 08:24 | aperotte | oops, that wasn't corrent |
| 08:24 | aperotte | correct |
| 08:25 | aperotte | like this: |
| 08:25 | aperotte | (dotimes i 20 |
| 08:25 | aperotte | (dosync |
| 08:25 | aperotte | (ref-set spheres |
| 08:25 | aperotte | (conj @spheres |
| 08:25 | aperotte | (def-sym (symbol (str "sphere" i)) |
| 08:25 | aperotte | ("Sphere Constructor here"))))) |
| 08:25 | aperotte | gave me an InstantiationError |
| 08:31 | Chousuke | aperotte: any reason you need a separate symbol for each sphere? |
| 08:31 | Chousuke | aperotte: you could just have a vector of spheres |
| 08:32 | aperotte | eventually I am going to have more unique names for each sphere (not indexed) and would like to be able to refer to them by name |
| 08:33 | aperotte | the hashmap did work without giving me an InstantiationException |
| 08:33 | Chousuke | (def spheres (ref [])) (dotimes [i 20] (dosync (ref-set spheres (conj @spheres (new-sphere i))))) |
| 08:33 | aperotte | I just didn't understand why I was getting the exception in the first place |
| 08:33 | Chousuke | or just use a map with strings as keys |
| 08:34 | rhickey_ | aperotte: using do like this is not the way to build up data structures - use map or reduce |
| 08:34 | aperotte | ahh, ok |
| 08:35 | rhickey_ | you won't need a ref |
| 08:36 | aperotte | but if I want to be able to add and remove elements later, I would need a ref, no? |
| 08:37 | Chousuke | if the set of spheres is to be shared, yes. |
| 08:38 | aperotte | if it weren't going to be shared, I would use a var? |
| 08:38 | rhickey_ | aperotte: It's a bit hard to understand what you are trying to do - why put names into a namespace with def - what code could reference them? |
| 08:39 | Chousuke | aperotte: you don't really "add" or "remove" anything though. the sets of spheres you have never change, the ref will only point to different sets over time :) |
| 08:39 | aperotte | rhickey_: I apologize, I realize now that using a hashmap is the appropriate thing to do, but I was just trying to understand the exception |
| 08:41 | aperotte | Chousuke: haha, yes, I remembered that but I should probably force myself into using the right vocabulary |
| 08:41 | rhickey_ | ok, so if you are going to have a map as a runtime environment, that will be modified over time, you would put that in a ref, but still would keep you 'modification' logic (creating a changed map), separate from storing it into the ref after change, don't use the ref inside a loop/reduce/map |
| 08:45 | aperotte | rhickey: ok, I'll do that, thanks! |
| 08:45 | aperotte | Chousuke: Thanks! |
| 08:58 | lisppaste8 | SnowBuddy pasted "Re-binding in recur" at http://paste.lisp.org/display/71016 |
| 09:00 | SnowBuddy | Quick question. I thought that bindings in recur were done sequentially, but the paste suggests otherwise. The reduce seems to work on the unfiltered sequence rather than the other way around. What am I missing? |
| 09:02 | rhickey_ | SnowBuddy: nope, parallel: http://clojure.org/special_forms#recur |
| 09:07 | SnowBuddy | So what would be a good way to have one binding depend on a previous binding? I know I can do it by restructuring so that it's not done in the recur, but that doesn't feel as clean. |
| 09:09 | rhickey_ | SnowBuddy: you'll have to use let |
| 09:10 | rhickey_ | Trampolines for tails calls added: http://groups.google.com/group/clojure/msg/3addf875319c5c10 |
| 09:19 | Chouser | ifn? sounds like some corrupt offspring of defn and if |
| 09:20 | rhickey_ | Chouser: get your alternative in before it becomes legacy :) |
| 09:21 | cemerick | callable? |
| 09:21 | Chouser | heh, yeah, I'm useless. |
| 09:21 | rhickey_ | cemerick: the problem with callable? is Callable |
| 09:21 | Chouser | cemerick: not bad, except isn't Callable a Java interface name? |
| 09:21 | Chouser | runnable? |
| 09:21 | rhickey_ | Runnable |
| 09:21 | Chouser | :-P |
| 09:21 | Chouser | funnable |
| 09:22 | rhickey_ | argh |
| 09:23 | cemerick | rhickey_: the struct mismatch issue is proving *very* thorny. You had an idea to avoid that, but I'll take a shot if it's not really on your radar. |
| 09:23 | rhickey_ | Actually, I'm quite happy to leave it out, only there for legacy conversion |
| 09:23 | Chouser | and it has to be shorter than (instance? IFn x) to justify its existance. |
| 09:25 | rhickey_ | cemerick: the hash technique can't be on the fast path, as it could still be wrong. Could do interned concat of field names |
| 09:25 | rhickey_ | patch welcome |
| 09:26 | cemerick | rhickey_: what do you think of interning Defs to begin with (using a thorough .equals), so object identity can continue to be used? |
| 09:27 | rhickey_ | just include a symbol-illegal separator, like comma, so foo bar and foob ar are different |
| 09:27 | rhickey_ | with interned strings it's still an identity compare |
| 09:27 | rhickey_ | just of the strings, not the Defs |
| 09:28 | rhickey_ | cemerick: interning Defs means another intern table and all of the MT and GC complexity of that |
| 09:29 | rhickey_ | the string goes in the Def, still space efficient |
| 09:30 | cemerick | rhickey_: sure. Q: you threw out the idea of struct-maps becoming classes with the def-ed keys becoming instance fields. Are you really planning on that? If so, I'll wait for it; otherwise, I'll put together a patch. |
| 09:31 | rhickey_ | I have not thrown that out, just haven't gotten to it - proxy is next up for AOT special handling |
| 09:32 | cemerick | by "thrown out", I meant "casually suggested" |
| 09:33 | rhickey_ | I understood, and I have to say that what's pending is really thinking about it, not simply doing it, so I can't commit that it will happen |
| 09:34 | rhickey_ | I imagine the concat-of-names will be a very small patch if you are stuck |
| 09:35 | cemerick | yeah, it should be cake. I didn't think you would go for that approach, is all. |
| 09:36 | cemerick | I'm not stuck, but struct mismatches are happen every 5 minutes when I'm plugging away at running code through a remote REPL. |
| 09:36 | rhickey_ | of course, it changes the semantics to structural 'type' equality - you might want to ask on the group if anyone is relying on identity type equality for structs |
| 09:38 | cemerick | that'd be a little hard to do unless you explicitly carry the def in a slot of your map. PSM doesn't offer a way to obtain its Def. |
| 09:38 | rhickey_ | could fix by including the struct name in the string, but that isn't passed in right now |
| 09:38 | rhickey_ | cemerick: right, it's just the error protection semantics that change |
| 09:40 | rhickey_ | accessor mismatch |
| 09:41 | rhickey_ | probably a non-problem |
| 09:41 | blackdog_away | i just had an error in my user.clj but message was simply that it could not initialise clojure.lang.RT, it would be good to get a more specific error there |
| 09:50 | cemerick | rhickey_: is the name at all relevant, anyway? A struct is defined by its keys. The fact that a unique Def is returned by create-struct each time is entirely an implementation detail right now, right? |
| 09:52 | cemerick | put another way, I'd expect that two structs with the same set of keys would be interchangeable in every circumstance |
| 10:00 | sethtrain | wilkes: should that error handling middleware also handle 404 errors? |
| 10:00 | sethtrain | i just built it for 500 but could continue with 404 if needed |
| 10:58 | Chouser | Well, I give up. 'ifn?' is fine unless it's sufficient to by default bring in the clojure.lang.I* interfaces, so you could just say (instance? IFn) |
| 10:59 | Chouser | I'd suggest allowing (inst? IFn) for brevity, but the only options would be a rename (a breaking change) which isn't worth the trouble, or an alias (both 'inst?' and 'instance?' would work) but I very much dislike aliases. |
| 11:00 | Chouser | of that sort, anyway. |
| 11:00 | Chouser | So. :-P |
| 11:09 | danlarkin | poor rich |
| 11:09 | rhickey | :) |
| 11:10 | gnuvince | trampoline? The technique to get TCO? |
| 11:10 | rhickey | gnuvince: manual tco |
| 11:18 | cemerick | rhickey: don't be sad. The fact that the biggest topics are typically bikeshed discussions about naming means that everyone's pretty thrilled with the meat of it all. :-) |
| 11:19 | cemerick | The same thing happened with isa?; meanwhile, the multimethod impl is killer. |
| 11:20 | rhickey | I'm really happy at how clean a transformation is, just prepend #s on tails and add trampoline to the top-level call |
| 11:21 | cemerick | Yeah -- and that's the point. People like to provide feedback, but when the impl is so clean and obviously useful, that energy is channeled to the first obvious point of friction. |
| 11:22 | cooldude127 | ok what the hell does this error mean: arg literal not in #() |
| 11:22 | cooldude127 | it's an illegalstateexception |
| 11:22 | cemerick | cooldude127: it means you're using '%' outside of an anonymous fn |
| 11:22 | cooldude127 | oh |
| 11:22 | Chouser | cooldude127: you've got a % where you shouldn't |
| 11:23 | Chouser | rhickey: I snipe because I care. :-) |
| 11:23 | cooldude127 | i see, i used a % in a macro name, i guess that's not cool |
| 11:23 | cooldude127 | which makes sense now that i think about it |
| 11:23 | cemerick | yeah, it's reserved by the reader |
| 11:23 | cooldude127 | i forgot about stuff like %1 and such |
| 11:38 | cooldude127 | well fuck |
| 11:38 | cooldude127 | Chouser: i finally tried to port the continuation macros |
| 11:39 | cooldude127 | i was not lucky |
| 11:39 | cooldude127 | Can't use qualified name as parameter: clojure.contrib.onlisp/*cont* |
| 11:40 | Chouser | cooldude127: in your macros, use ~'*cont* |
| 11:40 | cooldude127 | it looks like clojure is more restrictive on parameters than cl |
| 11:40 | cooldude127 | well, let's give it a try |
| 11:42 | cooldude127 | ok that fixed basic functions, i need to try some crazier examples. |
| 11:44 | Chouser | nice |
| 11:50 | cooldude127 | ahh this is not working |
| 11:51 | cooldude127 | also why do we not have a clojure macroexpand that will do subforms? |
| 11:53 | cemerick | cooldude127: macroexpand should fully expand a macro. macroexpand-1 only does the top level |
| 11:54 | cooldude127 | neither one works on any subforms |
| 11:54 | cooldude127 | macros inside macros |
| 11:54 | cooldude127 | for example: (let [f (fn= [n] (add1 n))] (bind= [y] (call= f 9) (return= (str "9 + 1 = " y)))) |
| 11:54 | cooldude127 | everything that ends in = is a macro |
| 11:54 | cooldude127 | but macroexpand only handles the let |
| 11:54 | cooldude127 | it stops after that |
| 11:55 | cooldude127 | we need a macroexpand that actually walks the tree |
| 11:55 | cemerick | huh: (doc macroexpand) => "... Note neither macroexpand-1 nor macroexpand expand macros in subforms." |
| 11:55 | cooldude127 | yeah wtf? |
| 11:55 | cooldude127 | macroexpand just keeps going until the first element of the form is no longer a macro |
| 11:56 | cemerick | There might be a deep macroexpand -- I haven't needed one as of yet. |
| 11:56 | cooldude127 | i've got so much going on there, a deep one would help me, maybe i'm the only one |
| 11:58 | mmcgrana | there is one on the group |
| 11:59 | mmcgrana | http://groups.google.com/group/clojure/browse_thread/thread/bba604cee3b232d9/28837d55525306d8?lnk=gst&q=recursive+macroexpand#28837d55525306d8 |
| 12:09 | Lau_of_DK | Good evening gents |
| 12:11 | Lau_of_DK | brb |
| 12:16 | mibu | hmm, someone tagged the wikipedia article of clojure for deletion last week because it looked like spamcruft. maybe it's time to beef up the entry... |
| 12:35 | duck1123 | rhickey: Have you thought about getting in touch with Leo Laporte and Randal Schwartz to do FLOSS Weekly? |
| 12:35 | duck1123 | Clojure is on the list of projects they would like to talk about |
| 12:36 | duck1123 | http://spreadsheets.google.com/pub?key=pYAJMbVobYCTro_z4LGo3ZQ |
| 12:44 | gnuvince | duck1123: that would be cool |
| 12:46 | danlarkin | aye it would be |
| 12:46 | danlarkin | <3 leo |
| 13:38 | flonk | anyone good with java.swing? |
| 13:39 | flonk | im foing a simple gui and i want a layout like: row1: play stop next prev; row2: text-area the length of 3 buttons, find-button |
| 13:39 | flonk | how do i set individual button-sizes? |
| 13:58 | Lau_of_DK | Gooooood evening gents :) |
| 14:00 | AWizzArd | Hello |
| 14:12 | flonk | GridBayLayout might e it |
| 14:12 | flonk | but it seems i have to do quite a lot to make it work as i want, is there no really simple way? |
| 14:12 | Lau_of_DK | Do what? |
| 14:13 | jedediah | flonk: I think you could nest gridlayouts |
| 14:13 | flonk | im foing a simple gui and i want a layout like: row1: play stop next prev; row2: text-area the length of 3 buttons, find-button |
| 14:13 | flonk | row3: results |
| 14:14 | Lau_of_DK | flonk, sounds like a simple job with mig layout? |
| 14:15 | Lau_of_DK | (doto panel (.add results "wrap") (.add text-area "span 3, wrap") (.add button1) (.add button2) (.add button3)) |
| 14:16 | Lau_of_DK | I think if you check out miglayout.com, you'll find a get-started .pdf which has examples just like that |
| 14:16 | blackdog_ | there's a miglayout lib in clojure.contrib |
| 14:18 | AWizzArd | Anyone of you know an easy to use web development framework for Java, that should be straightforward to use from Clojure, ready for commercial development? Rife? |
| 14:18 | Lau_of_DK | If such a thing exists, Blackdog will know about it :) |
| 14:19 | AWizzArd | something like AllegroServe, but for Clojure |
| 14:28 | Lau_of_DK | Has anyone here made any interesting findings, when profiling the STM ? |
| 14:29 | cooldude127 | wow i can't believe i had never seen MIG layout before |
| 14:31 | Lau_of_DK | Miglayout is descent for GUIs, but in my oppinion still a few light years behind qtDesigner |
| 14:35 | cooldude127 | i have never used qtdesigner before |
| 14:36 | cooldude127 | what's good about it? |
| 14:38 | Lau_of_DK | Which OS are you on ? |
| 14:39 | Lau_of_DK | Mr. Dude ? |
| 14:39 | flonk | Lau: thanks |
| 14:40 | Lau_of_DK | flonk: np |
| 14:42 | cooldude127 | Lau_of_DK: i'm on os x |
| 14:43 | cooldude127 | sorry i keep irc on a different desktop, i sometimes forget about it lol |
| 14:43 | Lau_of_DK | Emacs, you should integrate it into Emacs, keeps things very simple. 4 split window. 1x code, 1x repl, 1x irc, 1x mail :) |
| 14:44 | Lau_of_DK | Anyway, if you were on *nix you would already have the designer installed and you could try it out. Its actually about the same quality as Visual Studios GUI editor |
| 14:44 | cooldude127 | Lau_of_DK: i do. i keep emacs on its own desktop full screen |
| 14:44 | cooldude127 | Lau_of_DK: i was browsing the interwebs |
| 14:44 | Lau_of_DK | oh... :) |
| 14:45 | cooldude127 | Lau_of_DK: i know that in experience with java gui designers, they usually suck because they generate code, and the generated code is not always good |
| 14:45 | cooldude127 | is qtdesigner protected from this problem? |
| 14:46 | Lau_of_DK | Yes, QtDesigner outputs xml |
| 14:49 | AWizzArd | what is the easiest way in Clojure to connect to a (mysql) db? |
| 14:49 | cooldude127 | Lau_of_DK: oh nice. kind of like interface builder uses nibs |
| 14:53 | hoeck | AWizzArd: there is clojure.contrib.sql which uses (shows how to use) jdbc |
| 14:54 | Lau_of_DK | hoeck: are you working on anything exciting in clojure these days? |
| 14:55 | hoeck | Lau_of_DK: no, not really, except relational algebra |
| 14:56 | AWizzArd | danke |
| 14:56 | Lau_of_DK | hoeck: whatever that is :) |
| 14:57 | Pupeno | Hello. |
| 14:57 | hoeck | Lau_of_DK: at least a little bit of fun :) |
| 14:58 | Pupeno | > 1 |
| 14:58 | cooldude127 | Pupeno: hello to you as well |
| 14:58 | Pupeno | Is there a Clojure REPL on the channel? |
| 14:58 | cooldude127 | just for some basic math |
| 14:58 | cooldude127 | (+ 1 2) |
| 14:58 | clojurebot | 3 |
| 14:58 | Lau_of_DK | hoeck: good, I'll look it up later :) |
| 14:58 | cooldude127 | and documentation |
| 14:58 | cooldude127 | (doc doc) |
| 14:58 | clojurebot | Prints documentation for a var or special form given its name; arglists ([name]) |
| 14:58 | Pupeno | ah, ok. |
| 14:59 | Lau_of_DK | (doc map) |
| 14:59 | clojurebot | Returns a lazy seq consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments.; arglists ([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]) |
| 14:59 | Pupeno | How are the Clojurist doing? |
| 15:00 | Pupeno | cooldude127, Lau_of_DK: oh, ok... :/ |
| 15:01 | Lau_of_DK | Pupeno: ? |
| 15:03 | cemerick | hrm, does it try to evaluate any parenthetical form? |
| 15:03 | Pupeno | nevermind. |
| 15:03 | cemerick | (fooey 5) |
| 15:03 | Pupeno | (+ + +) |
| 15:03 | cemerick | guess not |
| 15:03 | Pupeno | (+) |
| 15:03 | Pupeno | (+ 1) |
| 15:03 | clojurebot | 1 |
| 15:03 | cemerick | (apply + (range 5)) |
| 15:03 | Pupeno | (- 4) |
| 15:04 | cemerick | odd. where does clojurebot come from? |
| 15:04 | cemerick | clojurebot: help |
| 15:04 | clojurebot | I don't understand. |
| 15:04 | cemerick | clojurebot: (apply + (range 5)) |
| 15:04 | clojurebot | 728=8B5? |
| 15:04 | cemerick | clojurebot: "fooey" |
| 15:04 | clojurebot | I don't understand. |
| 15:04 | cemerick | clojurebot: 34 |
| 15:04 | clojurebot | No entiendo |
| 15:04 | cooldude127 | wtf happened with the apply one |
| 15:04 | cemerick | nothing, I guess |
| 15:05 | cemerick | clojurebot: #(identity %) |
| 15:05 | clojurebot | Huh? |
| 15:05 | technomancy | cemerick: hiredman created clojurebot |
| 15:06 | duck1123 | clojurebot: how much do you know? |
| 15:06 | clojurebot | I know 28 things |
| 15:07 | Pupeno | hehe. |
| 15:07 | cooldude127 | clojurebot: what do you know? |
| 15:07 | clojurebot | Huh? |
| 15:07 | cooldude127 | dumbass |
| 15:07 | Pupeno | clojurebot: about |
| 15:07 | clojurebot | No entiendo |
| 15:07 | Pupeno | clojurebot: who are you? |
| 15:07 | clojurebot | Titim gan ?ir? ort. |
| 15:07 | cooldude127 | how many languages does it know? |
| 15:07 | Pupeno | clojurebot: who created you? |
| 15:07 | clojurebot | Titim gan ?ir? ort. |
| 15:08 | cemerick | looks like it's wired for doing math, doc lookups, and a few other things: http://gist.github.com/raw/27733/fdfe3db932a7c95809af00f5147ede4cb2817e67 |
| 15:10 | Pupeno | Ahg, a spurious parenthesis that accidentally gets balanced can be hard to find on Lisp. I need that Emacs mode that highlight forms. Does it work with Clojure? |
| 15:10 | technomancy | Pupeno: yeah, it works fine. |
| 15:10 | technomancy | clojurebot: clojure-mode? |
| 15:10 | clojurebot | Pardon? |
| 15:11 | Pupeno | technomancy: I'm using clojure-mode already3 |
| 15:11 | technomancy | clojurebot: clojure-mode is an Emacs mode for Clojure, found at git://github.com/jochu/clojure-mode.git |
| 15:11 | clojurebot | Alles klar |
| 15:12 | technomancy | Pupeno: oh, gotcha. (show-paren-mode 1) ;; <= is that what you want? |
| 15:12 | technomancy | (no idea why that's not enabled by default...) |
| 15:13 | Pupeno | technomancy: I have that enabled as well, let me find what I mean. |
| 15:13 | duck1123 | I wonder if it would be worth it to replace dashes with spaces when doing pattern matching |
| 15:13 | hiredman | clojurebot: how much do you know? |
| 15:13 | clojurebot | I know 29 things |
| 15:13 | technomancy | Pupeno: oh, like it highlights the whole form when you have the point on the paren or something? |
| 15:14 | Pupeno | technomancy: it highlights the whole form when you are in the form, and the sorounding forms with other colors, very handy. lisppaste does that. |
| 15:14 | technomancy | Pupeno: paredit is supposed to provide a number of handy paren-matching features, but I haven't used it myself. |
| 15:14 | technomancy | oooh... yeah, the stuff that lisppaste does is awesome. never seen that in Emacs, but I'm sure it's possible |
| 15:14 | flonk | im trying to use miglayout from contrib |
| 15:14 | flonk | java.lang.ClassNotFoundException: net.miginfocom.swing.MigLayout (miglayout.clj:0) |
| 15:15 | mehrheit | Pupeno: show-paren-mode has whole form highlighting as a custom option |
| 15:15 | Lau_of_DK | flonk: (import '(net.miginfocom.swing MigLayout)) |
| 15:15 | mehrheit | Pupeno: ant there's hl-paren which colors parenthesis based on their depth relative to point |
| 15:16 | Pupeno | mehrheit: interesting. |
| 15:17 | Lau_of_DK | flonk: retraction. Thats how you import when using the miglayout-swing.jar, Ive never used the one in contrib, its probably (use clojure.contrib.sql) |
| 15:20 | Pupeno | mehrheit: can't find the options, I suppose they can only be set with elisp? |
| 15:22 | mehrheit | Pupeno: M-x customize-variable show-paren-style |
| 15:27 | flonk | (ns clojure.contrib.miglayout.test |
| 15:27 | flonk | (:import (javax.swing JButton JFrame JLabel JList JPanel |
| 15:27 | flonk | JScrollPane JTabbedPane JTextField JSeparator)) |
| 15:27 | flonk | (:use clojure.contrib.miglayout)) |
| 15:28 | flonk | adding (import '(net.miginfocom.swing MigLayout)) diesnt help |
| 15:29 | mehrheit | flonk: if the class is not found, it's apparently not in the classpath |
| 15:29 | flonk | well how do i add it then? |
| 15:29 | Chousuke | how do you run clojure? |
| 15:29 | flonk | i thought clojure-box automatically fixed that for me? |
| 15:29 | Chousuke | flonk: clojure-box doesn't automatically add things to your classpath |
| 15:30 | flonk | downloaded clojurebox, start it with M-x slime |
| 15:30 | mehrheit | flonk: it only adds clojure to the classpath |
| 15:30 | flonk | ok, how do i add o classpath(on windows) then? |
| 15:30 | AWizzArd | (add-classpath "/file/here.jar") |
| 15:30 | Chousuke | hm :/ |
| 15:30 | flonk | C:/? |
| 15:30 | flonk | in the repl? |
| 15:30 | Chousuke | that works, but only use it from the repl |
| 15:31 | Chousuke | it's only supported as a quick hack kind of thing :P |
| 15:32 | hoeck | flonk: or M-x customize-group swank-clojure |
| 15:32 | flonk | do i only need the contrib.jar, does that collect them all? |
| 15:32 | Chousuke | no |
| 15:32 | mehrheit | clojurebox should probably have some simple configuration tool for the classpath |
| 15:32 | mehrheit | flonk: you need miglayout's jar. it's separate from clojure-contrib. |
| 15:32 | Chousuke | flonk: the miglayout thing is probably a completely separate jar that you'll need to get from somewhere. |
| 15:32 | Chousuke | probably :P |
| 15:33 | flonk | there is no miglayout.jar |
| 15:33 | flonk | just .clj-files |
| 15:33 | mehrheit | flonk: clojure.contrib.miglayout is just a clojurier binding for the java library |
| 15:34 | flonk | so i need to download the lib separately? couldnt it get shipped with clojurebox? |
| 15:34 | pwade | Chouser: Where is your reflection helper code? |
| 15:34 | mehrheit | flonk: clojurebox ships clojure, emacs and swank. miglayout is a java library |
| 15:35 | Chousuke | flonk: that'd just be an unnecessary dependency for most people. |
| 15:35 | mehrheit | s/swank/slime |
| 15:35 | Chousuke | http://www.migcalendar.com/miglayout/versions/3.6/ |
| 15:35 | Chousuke | you probably want miglayout-3.6-swing.jar |
| 15:37 | Pupeno | Is there any shorter version to (not (nil? x))? |
| 15:38 | Chousuke | x |
| 15:38 | Chousuke | :) |
| 15:40 | Chousuke | (nil? foo) is generally nonidiomatic. you can usually just use "foo" or (not foo) |
| 15:40 | Chouser | pwade: you mean 'show' for at the REPL? |
| 15:40 | Chouser | Pupeno: or (seq x) is x is a container |
| 15:41 | mehrheit | Chousuke: unless you want to test only for nil and not for false |
| 15:41 | Chousuke | you really need nil? only if you need to make a distinction between false and nil I guess. |
| 15:41 | pwade | Chouser: yes |
| 15:42 | mehrheit | hivemind |
| 15:45 | cooldude127 | for clojure-contrib, what's the most up-to-date repository? |
| 15:50 | hoeck | cooldude127: the one from sourceforge |
| 15:50 | cooldude127 | ok |
| 15:58 | Chouser | pwade: http://groups.google.com/group/clojure/msg/96ed91f823305f02 |
| 15:59 | Chouser | clojurebot: show is http://groups.google.com/group/clojure/msg/96ed91f823305f02 |
| 15:59 | clojurebot | Roger. |
| 16:03 | flonk | http://www.migcalendar.com/miglayout/versions/3.6/ |
| 16:03 | flonk | which of those do i need? |
| 16:04 | flonk | oh you said already |
| 16:07 | pwade | Chouser: thank you |
| 16:08 | flonk | java.net.MalformedURLException: unknown protocol: c (NO_SOURCE_FILE:0) |
| 16:08 | flonk | when |
| 16:08 | flonk | user> (add-classpath "C:/Program Files/Clojure Box/libjars/miglayout-3.6-swing.jar") |
| 16:09 | mehrheit | flonk: add-classpath expects an URL; prepend the string with file:// |
| 16:10 | flonk | can you show exactly how? |
| 16:10 | flonk | user> (add-classpath "://C:/Program Files/Clojure Box/libjars/miglayout-3.6-swing.jar") doesnt work |
| 16:10 | mehrheit | (add-classpath "file://C:/Program Files/Clojure |
| 16:10 | mehrheit | Box/libjars/miglayout-3.6-swing.jar") |
| 16:14 | flonk | hmm import works now thanks |
| 16:14 | flonk | still program crashes, oh well first prison breka then back to coding |
| 16:21 | flonk | ok the import retusn nil, but so does it if i mess up the path |
| 16:21 | flonk | couldnt that be changed, silent errors is the worst thing i know |
| 16:33 | Lau_of_DK | flonk: I dont get silent errors when I import something thats not there |
| 16:36 | hiredman | flonk: what is the exact import form you are using? |
| 16:37 | hiredman | there are import forms that, infact, do nothing, so no errors are ever thrown |
| 16:37 | hiredman | hiredman.clojurebot=> (import '(does.not.exist)) |
| 16:37 | hiredman | nil |
| 16:38 | hiredman | you need to import specific names from the class |
| 16:39 | hiredman | hiredman.clojurebot=> (import '(does.not.exist something)) |
| 16:39 | hiredman | java.lang.ClassNotFoundException: does.not.exist.something (NO_SOURCE_FILE:0) |
| 16:41 | shoover | mehrheit: good point about clojurebox and the classpath. I will fix it to at least pick up jars in ~/.clojure |
| 16:51 | shoover | flonk: when you're done watching tv, you might also try add-classpath with file:///c:/... note the third slash |
| 16:56 | Lau_of_DK | flonk: you still havent got miglayout working? |
| 17:08 | traskan | (add-classpath "file:///C:/Program Files/Clojure Box/libjars/miglayout-3.6-swing.jar") |
| 17:08 | traskan | same again |
| 17:08 | traskan | Lau: no it is not working |
| 17:08 | traskan | i downloaded the lib you said and placed it ^^ |
| 17:09 | Lau_of_DK | And youre on windows? |
| 17:12 | traskan | yes |
| 17:12 | traskan | sometime i have to do Progra~1 |
| 17:13 | traskan | but it doenst seem to work either |
| 17:13 | hiredman | traskan: how do you know the add-classpath is not working? |
| 17:13 | hoeck | traskan: on my win2k machine add-classpath works with "file:/c:/program ..." (don't know why) |
| 17:13 | Lau_of_DK | Ok, traskan, just as an experiment, can you open a cmd, and move to the directory wherein you have miglayout-swing.jar ? |
| 17:13 | Lau_of_DK | (ex. "cd c:\test" |
| 17:14 | traskan | i am there |
| 17:14 | Lau_of_DK | Can you copy clojure.jar to the same dir ? |
| 17:16 | traskan | done |
| 17:16 | Lau_of_DK | then try "java -cp . clojure.lang.Repl" |
| 17:17 | Lau_of_DK | If that gives you a repl, try "(import '(net.miginfocom.swing Miglayout))" which should return nil |
| 17:17 | traskan | exception in thread main |
| 17:17 | Lau_of_DK | Which one? |
| 17:17 | traskan | java -cp . clojure.lang.Repl |
| 17:17 | Lau_of_DK | Which exception? |
| 17:18 | traskan | Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Repl |
| 17:18 | traskan | Caused by: java.lang.ClassNotFoundException: clojure.lang.Repl |
| 17:18 | Lau_of_DK | oh thats right, Windows has got a different syntax for cp |
| 17:19 | Lau_of_DK | Maybe "java -cp "." clojure.lang.Repl" ? |
| 17:19 | traskan | huh? |
| 17:19 | Lau_of_DK | ? |
| 17:19 | traskan | two parts? |
| 17:19 | Lau_of_DK | sorry |
| 17:20 | Lau_of_DK | 'java -cp "." clojure.lang.Repl' |
| 17:20 | traskan | same |
| 17:20 | Lau_of_DK | I seem to remember that Windows wants quote, so that it doesnt mess up the command line |
| 17:20 | Lau_of_DK | oh |
| 17:20 | hiredman | Lau_of_DK: he needs to name the jar in the cp |
| 17:20 | hiredman | just having a . does not work |
| 17:20 | Lau_of_DK | hiredman: on windows? |
| 17:20 | hiredman | every where |
| 17:20 | Lau_of_DK | hiredman: It works fine on Linux |
| 17:20 | traskan | i must have in .emacs in my "real" emacs, wait |
| 17:21 | Lau_of_DK | traskan: We can solve this in a way that takes a little longer, but will give you the best result. Browse to www.ubuntu.org and follow the installation guide, report here when ready for step #2 |
| 17:21 | hiredman | Lau_of_DK: It may apear to work that way on linux, but I really doubt it does |
| 17:21 | Lau_of_DK | hiredman: it does |
| 17:21 | traskan | Lau: ok done |
| 17:21 | hiredman | Lau_of_DK: I doubt it |
| 17:21 | Lau_of_DK | hiredman: dont doubt, it works |
| 17:21 | hiredman | traskan: how do you know the add-classpath is not working? |
| 17:22 | traskan | i have ubuntu installed |
| 17:22 | traskan | hiredman: i dont but the program doesnt start |
| 17:22 | hiredman | traskan: which program? |
| 17:22 | traskan | java.lang.ClassNotFoundException: net.miginfocom.swing.MigLayout (miglayout.clj:0) |
| 17:22 | traskan | [Thrown class clojure.lang.Compiler$CompilerException] |
| 17:22 | traskan | contrib miglayout test.clj |
| 17:22 | Lau_of_DK | traskan: in ubuntu 'java -cp /path/to/clojure.jar:/path/to/miglayout-swing.jar clojure.lang.Repl |
| 17:22 | Lau_of_DK | ' |
| 17:23 | Chouser | For me, on ubuntu, this works: java -cp ~/build/clojure/clojure.jar clojure.lang.Repl |
| 17:23 | traskan | giot the rrepl |
| 17:23 | Chouser | This fails: java -cp ~/build/clojure/ clojure.lang.Repl |
| 17:23 | traskan | java -cp clojure.jar clojure.lang.Repl |
| 17:23 | hiredman | Chouser: word |
| 17:25 | traskan | i try to import and get classnotfoundexception there too |
| 17:26 | traskan | Lau: im not intereste din Ubuntu anyway, I run it on vmware and it is to slow |
| 17:28 | traskan | lol did i offedn anone? i didnt trahs ubuntu just saying im not gonna use it for this. probably will make a real install one day though |
| 17:29 | hiredman | traskan: good, tell him to take is ubango and shove it |
| 17:29 | traskan | youre what, a Suse guy? |
| 17:29 | hiredman | no |
| 17:29 | traskan | archlinux? |
| 17:29 | traskan | fedora? |
| 17:29 | traskan | debian? |
| 17:30 | hiredman | the idea of suggesting that you install a whole new OS as part of trouble shooting this issue is outragous |
| 17:30 | hiredman | traskan: what does it matter what my personal choice is? |
| 17:30 | traskan | yes but he as just joking i think |
| 17:30 | traskan | just asking |
| 17:31 | hiredman | FreeBSD actually |
| 17:31 | traskan | im fairly new to linux an im not blown away, |
| 17:31 | traskan | ok |
| 17:31 | traskan | it is better than windows ina lot of ways but some not |
| 17:31 | hiredman | uh, in my personal opinion, just about anything is better then windows in everyway |
| 17:32 | hiredman | but I am evangelical about it |
| 17:32 | traskan | lol, is freebsd easy to use? |
| 17:32 | hiredman | I find it easy to use |
| 17:33 | hiredman | but I have been using it for about eight years |
| 17:33 | traskan | i jsut want something easy to use that is superstable and fast and good for programming. and youtube and stuff works.. |
| 17:33 | danlei | it's very well documented |
| 17:33 | traskan | ok |
| 17:33 | traskan | anyway back to clojure |
| 17:33 | traskan | java.lang.ClassNotFoundException: net.miginfocom.swing.MigLayout (miglayout.clj:0) |
| 17:33 | traskan | [Thrown class clojure.lang.Compiler$CompilerException] |
| 17:33 | traskan | so i need to get Miglayout in my classpath |
| 17:33 | hiredman | so what exactly are you doing to get that error? |
| 17:34 | traskan | and i never get the friggin java classpath |
| 17:34 | traskan | uim running miglayout/test.clj in clojure-contrib |
| 17:34 | traskan | im |
| 17:34 | hiredman | how are you running it? |
| 17:34 | traskan | C-c C-l |
| 17:34 | hiredman | I see |
| 17:34 | traskan | clojure-box |
| 17:35 | mehrheit | traskan: add-classpath may not work for some java libraries |
| 17:35 | traskan | ok |
| 17:35 | hiredman | rhicky has stated that add-classpath was a mistake |
| 17:35 | hiredman | and may be removed |
| 17:35 | blackdog_ | it's only for the repl |
| 17:36 | traskan | but now i have decided to put all my jars in ~pathto/clojure box/libjars/ |
| 17:36 | blackdog_ | he said yesterday |
| 17:36 | danlei | mehrheit: why might it not work? |
| 17:36 | traskan | how do i permanently add that to my classpath? |
| 17:36 | mehrheit | danlei: I don't know exactly; it doesn't work for Qt-Jambi, I think |
| 17:36 | hiredman | traskan: I think you have to right click on my computer |
| 17:36 | hiredman | traskan: go to the advacned tab |
| 17:36 | danlei | mehrheit: hm, good to know |
| 17:37 | hiredman | traskan: click environment variables button near the bottom |
| 17:37 | hiredman | and one of the variables is CLASSPATH |
| 17:37 | hiredman | but add the directory the jars are in to the classpath is not enough |
| 17:37 | hiredman | each jar file needs to be explicitly in the cp |
| 17:38 | traskan | ok i see |
| 17:38 | traskan | retarded but ok |
| 17:38 | hiredman | *shrug* |
| 17:38 | traskan | windonks + java -> uberclusterfuck |
| 17:38 | danlei | rhickey wrote 2 days ago, i think, a way to set a directory up, so that you would just have to put your jars in that directory |
| 17:38 | AWizzArd | why? :-) |
| 17:39 | hiredman | there are trade offs |
| 17:39 | hiredman | as always |
| 17:39 | hiredman | I rather like jar files myself, so tiddy |
| 17:39 | blackdog_ | -Djava.ext.dirs=$LIBS |
| 17:39 | danlei | blackdog_: yes, that's what i meant |
| 17:39 | hiredman | clojurebot: jar directory is -Djava.ext.dirs=$LIBS |
| 17:39 | clojurebot | Alles klar |
| 17:39 | danlei | huh |
| 17:40 | blackdog_ | onto your java command to get at all the jars in $LIBS |
| 17:40 | hiredman | good to know |
| 17:40 | danlei | der schwaetzt deutsch? |
| 17:40 | AWizzArd | danlei: yes :-) |
| 17:40 | danlei | =) |
| 17:40 | AWizzArd | but you will now wonder much more how in the world I could answer so fast |
| 17:40 | hiredman | clojurebot: der schwaetzt deutsch is <reply>#who: dah! |
| 17:40 | clojurebot | Ack. Ack. |
| 17:42 | hiredman | clojurebot: der schwaetzt deutsch is <reply>#who: Jah! |
| 17:42 | clojurebot | Ok. |
| 17:42 | hiredman | *cough* |
| 17:42 | danlei | clojurebot: schwaetzt du deutsch is <reply>aber sicher, #who! |
| 17:42 | clojurebot | You don't have to tell me twice. |
| 17:43 | danlei | clojurebot: schwaetzt du deutsch? |
| 17:43 | clojurebot | aber sicher, danlei! |
| 17:43 | danlei | clojurebot: botsnack |
| 17:43 | clojurebot | thanks; that was delicious. (nom nom nom) |
| 17:47 | traskan | still the same error after adding to classpath |
| 17:47 | hiredman | clojurebot: halting problem is <reply>not a problem, the average bid for it on getacoder is $821.00 |
| 17:47 | clojurebot | c'est bon! |
| 17:48 | traskan | can i apt-get clojure-box on ubuntu? |
| 17:48 | Chouser | Isn't clojure-box only for Windows? |
| 17:48 | AWizzArd | Anyone here who has used Rife in either Java or Clojure? |
| 17:48 | hiredman | traskan: do you still have the miglayout jar and the clojure jar together in a directory somewhere? |
| 17:49 | traskan | yes |
| 17:50 | hiredman | java -cp clojure.jar;miglayout.jar clojure.lang.Repl |
| 17:50 | hiredman | miglayout.jar replaced with the name of the jar |
| 17:50 | hiredman | actually |
| 17:51 | hiredman | java -cp clojure.jar;miglayout.jar clojure.lang.Repl c:\where\ever\miglayout\test.clj |
| 17:51 | hiredman | ugh, but that will throw an exception about not finding clojure.contrib |
| 17:53 | traskan | java -cp clojure.jar;miglayout.jar clojure.lang.Repl |
| 17:53 | traskan | lol that didnt complaing |
| 17:53 | hiredman | yeah |
| 17:53 | traskan | when it should right? |
| 17:53 | hiredman | well, type in net.miginfocom.swing.MigLayout |
| 17:53 | hiredman | no quotes, no parens, see what it does |
| 17:54 | traskan | works |
| 17:54 | traskan | or returns what iw rote |
| 17:54 | hiredman | ok |
| 17:55 | hiredman | so that means that somehow miglayout.jar has just not been in your classpath this whole time |
| 17:55 | traskan | yes |
| 17:55 | traskan | but it still doesnt seem to work from clojurebox |
| 17:55 | hiredman | yeah |
| 17:56 | hiredman | what kind of settings knobs does clojurebox have? |
| 17:57 | mehrheit | traskan: C-h v swank-clojure-binary |
| 17:57 | mehrheit | what is the value of this variable? |
| 17:58 | traskan | swank-clojure-binary is a variable defined in `c:/Program Files/Clojure Box/swank-clojure/swank-clojure.el'. |
| 17:58 | traskan | Its value is nil |
| 18:02 | mehrheit | traskan: M-: (setq swank-clojure-extra-classpaths (list "C:/path/to/miglayout.jar")) |
| 18:02 | mehrheit | then you should restart slime |
| 18:03 | mehrheit | or, better, insert that form into your .emacs and restart clojurebox, but I don't know where .emacs is found on windows |
| 18:05 | traskan | i do |
| 18:05 | traskan | but i dont know where lcojurbeox is reading it from because it isnt the normal place |
| 18:05 | traskan | still the same though |
| 18:05 | traskan | java.lang.ClassNotFoundException: net.miginfocom.swing.MigLayout (miglayout.clj:0) |
| 18:06 | mehrheit | traskan: did you restart slime? |
| 18:06 | traskan | no |
| 18:06 | traskan | how? |
| 18:06 | traskan | the whole clojure-box? |
| 18:06 | hiredman | heh |
| 18:06 | mehrheit | you should only the whole box in case you put the change into .emacs |
| 18:07 | hiredman | clojurebot: emacs? |
| 18:07 | clojurebot | uggada buggada |
| 18:07 | mehrheit | ,sayoonara in slime-repl, M-x slime |
| 18:07 | hiredman | clojurebot: emacs is also <reply>emacs is hard, lets go shopping! |
| 18:07 | clojurebot | You don't have to tell me twice. |
| 18:07 | mehrheit | actually, maybe (add-to-list 'swank-clojure-extra-classpaths "C:/path/to/miglayout.jar") would be better, since that wouldn't remove the contribs |
| 18:09 | traskan | stillt he same |
| 18:09 | mehrheit | don't know then. try posting in the google group's clojurebox thread |
| 18:09 | mehrheit | clojurebot: group? |
| 18:09 | clojurebot | group is http://groups.google.com/group/clojure/ |
| 18:20 | traskan | (ns clojure.contrib.miglayout.test |
| 18:20 | traskan | (:import (javax.swing JButton JFrame JLabel JList JPanel |
| 18:20 | traskan | JScrollPane JTabbedPane JTextField JSeparator)) |
| 18:20 | traskan | (:use clojure.contrib.miglayout)) |
| 18:20 | traskan | when i eval that i get error too |
| 18:20 | traskan | (ns clojure.contrib.miglayout.test |
| 18:20 | traskan | (:import (javax.swing JButton JFrame JLabel JList JPanel |
| 18:20 | traskan | JScrollPane JTabbedPane JTextField JSeparator))) works though |
| 18:20 | traskan | so the problem is :use clojure.contrib.miglayout |
| 18:21 | hiredman | you may have clobbered the clojure.contrib entry in classpath |
| 18:21 | traskan | uh oh |
| 18:22 | traskan | i dont have it in my classpath *red face* |
| 18:22 | hiredman | (.get (System/getProperties) "java.class.path") |
| 18:22 | traskan | "c:/Program Files/Clojure Box/clojure/clojure.jar;c:/Program Files/Clojure Box/clojure-contrib/clojure-contrib.jar" |
| 18:22 | traskan | oh |
| 18:22 | hiredman | hmmmm |
| 18:23 | hiredman | still no miglayout |
| 18:23 | traskan | nope |
| 18:23 | traskan | ah |
| 18:23 | traskan | it should be there? |
| 18:23 | danlei | hm, |
| 18:23 | hiredman | from my understanding of the swank stuff mehrheit spoke of, yes |
| 18:24 | danlei | yesterday, someone mentioned, that (System/getProperty "java.class.path") doesn't get updated |
| 18:24 | traskan | but where is that |
| 18:24 | hiredman | danlei: if you use add-classpath |
| 18:24 | traskan | i didnt |
| 18:24 | danlei | hiredman: yes |
| 18:24 | hiredman | yeah |
| 18:24 | traskan | i add do CLASSPATH in windows |
| 18:24 | traskan | .;C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip;C:/Program Files/Clojure Box/libjars/miglayout-3.6-swing.jar;C:/Program Files/ImageJ/ij.jar |
| 18:24 | hiredman | hmmm |
| 18:25 | hiredman | swank must be ignoreing that |
| 18:25 | traskan | hmm why si a zip int he path? |
| 18:25 | hiredman | jars are zips |
| 18:25 | traskan | ok |
| 18:25 | danlei | as far as i know (not sure), the CLASSPATH won't be used, if java is called with the -cp option |
| 18:25 | hiredman | danlei: yeah |
| 18:25 | hiredman | which swank does |
| 18:26 | hiredman | the swank in clojurebox will add all the jars in ~/.clojure to the classpath |
| 18:26 | hiredman | but where ~/.clojure is on windows is, uh, unkown to me |
| 18:26 | traskan | so i place it there? |
| 18:26 | traskan | ok |
| 18:26 | hiredman | yeah |
| 18:26 | hiredman | if you can figure out where it is |
| 18:29 | hoeck | traskan: or try M-x customize-variable swank-clojure-extra-classpaths and append the path, sth like "c:\\bla\\bar" |
| 18:29 | traskan | who created clojure-box? |
| 18:31 | traskan | i can in nornal emacs do $home to get to .emacs |
| 18:31 | traskan | isnt there a way to find out where .clojure is ? |
| 18:31 | traskan | like that? |
| 18:31 | hoeck | traskan: dot-paths are sometimes under c:\ (eg my .xemacs) and normally in the documents'n'settings\username\ |
| 18:33 | hiredman | traskan: try and edit ~/foo in emacs, and see where it is |
| 18:35 | traskan | ~/foo ? |
| 18:35 | hiredman | uh |
| 18:35 | traskan | how do i get that? |
| 18:35 | hiredman | I dunno emacs |
| 18:35 | hiredman | but vim :e ~/foo |
| 18:35 | hiredman | or maybe on windows :e ~\foo |
| 18:35 | traskan | well how do then get where that is |
| 18:36 | traskan | i know what u mean to do |
| 18:36 | traskan | i did now |
| 18:36 | traskan | but when i do C-c C-f again i only get ~/ as apth anyway |
| 18:36 | hiredman | well |
| 18:36 | hiredman | look around for the file :P |
| 18:36 | hiredman | Docs and settings\username |
| 18:36 | traskan | the slime-history.eld is there |
| 18:36 | hiredman | all the usual places |
| 18:37 | hiredman | look in the clojurebox dir |
| 18:37 | hiredman | c:\program files\clojurebox |
| 18:48 | traskan | is last expensive? |
| 18:48 | traskan | or O(1)? |
| 18:49 | traskan | linear time it says |
| 18:49 | traskan | for both lists and vectors? |
| 18:51 | hiredman | traskan: O(n) I believe |
| 18:52 | hiredman | O(1) is constant time |
| 18:56 | traskan | out of memory error, java heap space |
| 18:57 | traskan | summing over 10K elem list abd building a list(scanl for you who know haskell), can i do something about that? |
| 18:57 | hiredman | clojurebot: out of memory error, java heap space is <reply>hmm... sounds like your out of heap space |
| 18:57 | clojurebot | Roger. |
| 18:57 | Chousuke | traskan: building a list of what? |
| 18:57 | hiredman | traskan: my guess is you did this recursively? |
| 18:58 | traskan | loop-recur |
| 18:58 | Chousuke | can you show the code you have? |
| 18:58 | traskan | yes last is very slow |
| 18:59 | lisppaste8 | trasken pasted "scanl" at http://paste.lisp.org/display/71049 |
| 19:04 | Chousuke | hmm :/ |
| 19:05 | Chousuke | I can't see anything wrong with the looping versin |
| 19:05 | Chousuke | version* |
| 19:08 | Chousuke | the default maximum heap size for java appears to be 64MB. maybe your million items just can't fit in that :/ |
| 19:09 | traskan | yeah |
| 19:09 | hiredman | H4ns said something many moons ago about scanl |
| 19:09 | traskan | anyway could loop [fun f] be faster than not having the f in the loop? |
| 19:09 | traskan | i not declaring it again? |
| 19:09 | traskan | i emans till using it obv |
| 19:09 | traskan | (loop [fun f |
| 19:09 | traskan | i init |
| 19:09 | traskan | [x & xs] coll |
| 19:09 | traskan | acc []] |
| 19:09 | traskan | (loop [i init |
| 19:09 | traskan | [x & xs] coll |
| 19:09 | traskan | acc []] |
| 19:09 | traskan | seems it shouldnt matter |
| 19:10 | traskan | but the result differs slightly, maybe just coincidence |
| 19:10 | Chousuke | shouldn't matter that much. |
| 19:10 | hiredman | hmmm |
| 19:11 | hiredman | lose the loop and maybe recur to the function frame? |
| 19:11 | traskan | how? |
| 19:11 | traskan | recur scnal? |
| 19:11 | hiredman | (recur ...) can target the function body |
| 19:12 | hiredman | so you just take all the bindings in (loop [ ...] and but them in the function args list |
| 19:12 | hiredman | it can making calling the function a little messier |
| 19:13 | hiredman | I think that might not make a difference |
| 19:13 | hiredman | I am unsure |
| 19:17 | Chousuke | it shouldn't matter |
| 19:18 | traskan | uh |
| 19:19 | traskan | i did foldl(reduce) with and without loop |
| 19:19 | traskan | and no loop was twice as fast |
| 19:19 | traskan | how come? |
| 19:19 | traskan | is it the destructuring? |
| 19:20 | traskan | yeah seems like it |
| 19:20 | traskan | doing first and rest is a lot faster than [x & xs] |
| 19:57 | traskan | this feels like premature optimization but i investigaed the above and it seems by my naive profiling(just using time ) that having 2 functions(nested ones) and binding recur to the fucntion instead of loop and not using destructuring spees it up |
| 20:01 | Chousuke | hmm :/ |
| 20:02 | Chousuke | I wonder why having two functions would be faster than loop |
| 20:02 | Chousuke | destructuring is understandable I guess. |
| 20:15 | rhickey | 1000th member on the Google Group! |
| 20:16 | mmcgrana | nice |
| 20:30 | abrooks | rhickey: Congrats! |
| 20:36 | danlarkin | traskan: indeed, I have found destructuring to be slower than not, so for inner loops it makes sense to avoid it, but elsewhere the convenience can outweigh the (small) efficiency loss |
| 20:37 | traskan | yes that sounds reasonable, felt like i was doing pointless optimizations but you have a good point, could be used for inner loops |
| 20:59 | mattrepl | argh, having a difficult time pulling up examples of new class definition. anyone have a link handy? |
| 21:15 | mattrepl | that wasn't very clear, I was referring to the new Java class creation format that replaced the gen-class-* |
| 22:04 | Chouser | clojurebot: main? |
| 22:04 | clojurebot | 728=8B5? |
| 22:04 | Chouser | clojurebot: AOT main? |
| 22:04 | clojurebot | Pardon? |
| 22:06 | Chouser | clojurebot: AOT genclass is http://paste.lisp.org/display/70665 and http://clojure-log.n01se.net/date/2008-11-18.html#14:19 |
| 22:06 | clojurebot | Roger. |
| 22:06 | Chouser | mattrepl: ^^ |
| 22:06 | mattrepl | Chouser: thank you |
| 22:33 | mmcgrana | is anyone else having problems with clojure.contrib.except/throwf on recent versions of clojure and contrib - I'm getting the dreaded "ClassCastException" error |
| 22:34 | lisppaste8 | mmcgrana pasted "throwf problem" at http://paste.lisp.org/display/71056 |
| 23:18 | flonk | it really is awesome |
| 23:18 | flonk | git |
| 23:19 | flonk | why doesnt clojure siwtch to git and github entirely? |
| 23:25 | r2q2 | What is a good way to learn clojure? The lectures by Hitchey? |
| 23:26 | Chouser | r2q2: yeah, that's probably the best until the book comes out |
| 23:27 | Chouser | Probably seqs and concurrency, and then read through the topic pages on the web site |
| 23:31 | pjb3 | r2q2: I'd say buy the beta book now |
| 23:31 | pjb3 | There's plenty of useful stuff in there, especially for getting you started |
| 23:32 | pjb3 | After that, you pretty much learn by doing, looking stuff up from the docs |
| 23:32 | Chouser | clojurebot: book? |
| 23:32 | clojurebot | Pardon? |
| 23:33 | Chouser | clojurebot: book is http://www.pragprog.com/titles/shcloj/programming-clojure |
| 23:33 | clojurebot | c'est bon! |
| 23:34 | r2q2 | clojurebot: yow |
| 23:34 | clojurebot | I don't understand. |
| 23:34 | r2q2 | clojurebot: help |
| 23:34 | clojurebot | 728=8B5? |
| 23:34 | pjb3 | wtf is clojurebot? |
| 23:34 | pjb3 | clojurebot: book? |
| 23:34 | clojurebot | book is http://www.pragprog.com/titles/shcloj/programming-clojure |
| 23:34 | pjb3 | fancy |
| 23:34 | r2q2 | I think I will buy the book after my christmas money comes in. |
| 23:35 | pjb3 | There's a 25% sale on friday: http://pragprog.com/frequently-asked-questions/black-friday |
| 23:35 | pjb3 | So the beta book will only cost you $15.25 |
| 23:36 | pjb3 | clojurebot: AOT? |
| 23:36 | clojurebot | No entiendo |
| 23:36 | pjb3 | clojurebot: AOT genclass? |
| 23:36 | clojurebot | AOT genclass is http://paste.lisp.org/display/70665 and http://clojure-log.n01se.net/date/2008-11-18.html#14:19 |
| 23:54 | notallama | clojurebot: compile? |
| 23:54 | clojurebot | Pardon? |
| 23:54 | notallama | clojurebot: AOT compilation? |
| 23:54 | clojurebot | No entiendo |
| 23:54 | notallama | clojurebot: tell me your secrets? |
| 23:54 | clojurebot | I don't understand. |
| 23:55 | notallama | curses. foiled again. |
| 23:56 | notallama | so. for (compile [lib]), what's lib? and what does compile do? |
| 23:57 | notallama | or probably a better question: how do i compile into .class files? |