2011-01-17
| 00:00 | Scriptor | amalloy: ah, right |
| 00:01 | amalloy | tonyl: i confess i don't see what thunk has to do with the code there. the comment seems out of place |
| 00:01 | amalloy | see http://en.wikipedia.org/wiki/Thunk#Functional_programming |
| 00:01 | tonyl | ok, that was an option that came into mind |
| 00:01 | tonyl | thanks |
| 00:55 | hiredman | https://gist.github.com/750897 |
| 01:00 | TimMc | If someone passes me a function, can I extract a name from it? |
| 01:02 | tonyl | &(name 'first) |
| 01:02 | sexpbot | ⟹ "first" |
| 01:03 | tonyl | but I haven't use that snippet in projects |
| 01:03 | amalloy | tonyl: that's getting a name from a symbol, not a function |
| 01:04 | amalloy | &(meta (fn foo [])) |
| 01:04 | sexpbot | ⟹ nil |
| 01:04 | amalloy | &(name (fn foo [])) |
| 01:04 | sexpbot | java.lang.ClassCastException: sandbox9112$eval11089$foo__11090 cannot be cast to clojure.lang.Named |
| 01:04 | amalloy | so it looks like no, tim |
| 01:04 | amalloy | &(map meta first #'first) |
| 01:04 | sexpbot | java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core$first |
| 01:05 | amalloy | &(map meta [first #'first]) |
| 01:05 | sexpbot | ⟹ ({:line 53} {:ns #<Namespace clojure.core>, :name first, :file "clojure/core.clj", :line 48, :arglists ([coll]), :doc "Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil.", :added "1.0"}) |
| 01:18 | TimMc | &(str (fn foo [])) |
| 01:18 | sexpbot | ⟹ "sandbox9112$eval11112$foo__11113@1b6f4ea" |
| 01:18 | TimMc | Clojure knows the name somehow. |
| 01:21 | amalloy | TimMc: no it doesn't, it knows the classname |
| 01:21 | amalloy | &(class (fn[])) |
| 01:21 | sexpbot | ⟹ sandbox9112$eval11121$fn__11122 |
| 01:21 | amalloy | &(class first) |
| 01:21 | sexpbot | ⟹ clojure.core$first |
| 01:22 | amalloy | &(str first) |
| 01:22 | sexpbot | ⟹ "clojure.core$first@130e714" |
| 01:23 | amalloy | hiredman: cute little error-handler |
| 01:23 | TimMc | amalloy: The classname of (fn foo []) includes "foo"? |
| 01:23 | amalloy | TimMc: yes |
| 01:23 | TimMc | &(str (fn FOOBARQUX [])) |
| 01:23 | sexpbot | ⟹ "sandbox9112$eval11144$FOOBARQUX__11145@1a41a8d" |
| 01:23 | hiredman | amalloy: thanks |
| 01:23 | amalloy | &(map (juxt class str) [(fn []) (fn test [])]) |
| 01:23 | sexpbot | ⟹ ([sandbox9112$eval11153$fn__11154 "sandbox9112$eval11153$fn__11154@c06c8b"] [sandbox9112$eval11153$test__11156 "sandbox9112$eval11153$test__11156@1163ae3"]) |
| 01:24 | TimMc | gah |
| 01:24 | TimMc | Anyway... every anonymous function generates a class? |
| 01:24 | amalloy | TimMc: every function, period |
| 01:25 | TimMc | &(class (fn FOOBARQUX [])) |
| 01:25 | sexpbot | ⟹ sandbox9112$eval11164$FOOBARQUX__11165 |
| 01:25 | TimMc | cool |
| 01:25 | amalloy | TimMc: IFn is an interface with the method .invoke(args) |
| 01:25 | amalloy | every function is a class implementing that interface |
| 01:25 | TimMc | hrm |
| 01:26 | TimMc | I'll sleep on that. |
| 01:26 | amalloy | &(use '[clojure.contrib.repl-utils :only [show]]) |
| 01:26 | sexpbot | java.io.FileNotFoundException: Could not locate clojure/contrib/repl_utils__init.class or clojure/contrib/repl_utils.clj on classpath: |
| 01:27 | hiredman | IFn is huge in 1.3, all the LOL inner interfaces |
| 01:27 | amalloy | hiredman: as a stylistic thing, might it be...prettier to return either {:result x} or {:exception e} and destructure with :keys? |
| 01:27 | amalloy | blugh really? gross |
| 01:28 | hiredman | well, each arity for invokePrim gets an interface |
| 01:28 | amalloy | yeah, i know |
| 01:28 | amalloy | hadn't thought about the repercussions |
| 01:29 | hiredman | amalloy: *shrug* that bit is internal plumbing |
| 01:30 | amalloy | hiredman: how are return values handled in the morass of interfaces? can we still only return Object, or is there like...invokeBoolean(int, double)? |
| 01:31 | dnolen | amalloy: in 1.3 you can return long and double |
| 01:32 | amalloy | ah |
| 01:32 | amalloy | not much need for highly-performant booleans anyway, i guess :) |
| 02:27 | LauJensen | Morning all ya'll |
| 02:27 | seancorfield | it's half past 11pm on Sunday night :) |
| 02:29 | seancorfield | hey LauJensen i forked clojureql with a view to maintaining a 1.3-compatible version... any input from you much appreciated |
| 02:30 | LauJensen | clojurebot: UGT? |
| 02:30 | clojurebot | ugt is Universal Greeting Time: http://www.total-knowledge.com/~ilya/mips/ugt.html |
| 02:30 | LauJensen | seancorfield: ^ |
| 02:31 | seancorfield | lol... that's new to me but i like it |
| 02:35 | LauJensen | seancorfield: re clojureql, how incompatible are 1.2 and 1.3 ? |
| 02:43 | seancorfield | haven't dug into it yet... ^dynamic seemed to leap out... will report on more as i find it |
| 02:44 | seancorfield | compiling for 1.3 and some basic testing worked cleanly tho' |
| 02:48 | amalloy | seancorfield: not sunday night for LauJensen, even ignoring ugt |
| 02:58 | LauJensen | seancorfield: The dynamic tags will not break 1.2 compat. I would greatly prefer if we could have them co-exist within the same project since that will give is 50% fewer codebases to maintain |
| 03:01 | seancorfield | yup, i'll compile against 1.2 as well - if anything looks 1.3 only, i'll discuss coz that's not good either way |
| 03:03 | LauJensen | Sure, just bring it up in #clojureql and if manage to make the projects mergable that would be preferable |
| 03:04 | seancorfield | tomorrow (well, later today now), we have our company conference that will either bless or reject clojure for production... |
| 03:05 | seancorfield | my right hand developer looked at some clojureql code and was comfortable with it so i'm going in well armed :) |
| 03:05 | LauJensen | Very intesting, let me know how it goes |
| 03:05 | amalloy | seancorfield: best of luck |
| 03:06 | amalloy | night folks |
| 03:06 | seancorfield | night amalloy |
| 03:06 | seancorfield | well, it's now morning here (in LA, not my home) so i'm going to sign off and say goodnight |
| 03:09 | LauJensen | Goodnight |
| 04:04 | AWizzArd | http://blogs.oracle.com/henrik/2011/01/jdk_7_feature_complete_milestone_reached.html |
| 04:06 | LauJensen | Its incredible to me, that this can be considered succesfull "We hit the date less than a week late" |
| 04:07 | AWizzArd | Today in one month they plan to offer a Developer Preview. |
| 04:15 | bobo_ | so in... 3 years people will start using it? |
| 04:17 | robonobo | will clojure 1.3 run on on jdk 7? |
| 04:17 | LauJensen | Also - I dont understand why they're working on new features when the old stuff is still broke. I dont think Ive ever worked with a framework as frustrating, unrealiable and inconsistently designed as Swing |
| 04:17 | LauJensen | PHP is close, but even #java says PHP is designed with more rigor :( |
| 04:17 | LauJensen | robonobo: Clojure targets 1.5, so yes |
| 04:18 | robonobo | LauJensen: I've never had real problems with swing, what is unreliable about it? |
| 04:18 | hoeck | LauJensen: come on, swing is so old and had to make many compromises that are not necessary today |
| 04:18 | LauJensen | robonobo: Im working on a desktop application now, in which Im seeing undeterministic behaviors, such as scrollbars suddenly disappearing leaving half of the content unreachable etc |
| 04:19 | hoeck | LauJensen: and there are really much much much more worse toolkits out there |
| 04:19 | LauJensen | hoeck: They should just integrate QT and substitute it for all the junk code they put in |
| 04:19 | LauJensen | hoeck: like what? name one |
| 04:19 | robonobo | Is there a GUI framework that doesn't do stuff like that? |
| 04:19 | hoeck | LauJensen: powerbuilder, win32 crap ... |
| 04:19 | LauJensen | robonobo: Qt, Winforms, Aqua... |
| 04:20 | robonobo | I've seen Aqua do strange stuff as well |
| 04:20 | LauJensen | hoeck: I dont remember PB, but designings UI is such a pleasure on Windows |
| 04:20 | bobo_ | LauJensen: but they are replacing swing? |
| 04:20 | LauJensen | They are a almost a decade ahead of unix in that regard |
| 04:20 | AWizzArd | I must say that Swing is not that bad after all. |
| 04:20 | LauJensen | I could write a short book on how bad and inconsistent Swing is |
| 04:20 | bobo_ | well "replacing" atleast |
| 04:20 | LauJensen | Its really amazing |
| 04:20 | LauJensen | bobo_: link? |
| 04:20 | bobo_ | LauJensen: javafx will get a java api instead of an own language... |
| 04:21 | bobo_ | swing will ofcource be there |
| 04:21 | robonobo | LauJensen: how is it inconsistent? |
| 04:21 | AWizzArd | They will add JavaFX on top of Swing. |
| 04:21 | bobo_ | AWizzArd: no, its a new grapichs stack |
| 04:21 | AWizzArd | Nice new effects and visuals for Swing apps. |
| 04:22 | LauJensen | robonobo: I havent written it down everytime Ive come across these inconsisties, but I remember writing a function which changed the font/style on all components, but lo and behold a single component didnt submit. So I went on Google and it turns out that they made this one component a special case, and so it had to be rewritten for that specifically. And I come across stuff like that quite often |
| 04:22 | hoeck | and I'd rather deal with swing than with all the c++ legacy that a qt gui brings to my sweet little abstract clojure stuff |
| 04:22 | LauJensen | hoeck: You can run Qt from Clojure |
| 04:22 | AWizzArd | hoeck: yup |
| 04:23 | hoeck | of course, and you can run OpenGL from common lisp too, except that from now on you have to deal with JVM segfaults :( |
| 04:23 | robonobo | JVM segfaults sound really scary |
| 04:23 | robonobo | s/sound/sounds |
| 04:23 | sexpbot | <robonobo> JVM segfaults sounds really scary |
| 04:24 | AWizzArd | No no, Swing may have some learning overhead, but it's pretty nice. |
| 04:24 | AWizzArd | Very customizable and really fast, after the initial startup, which is slooow |
| 04:24 | robonobo | AWizzArd: I agree. And the documentation is terrific |
| 04:24 | ttmrichter | Worse than Swing? FOX leaps to mind. |
| 04:24 | hoeck | well, to be honest, I don't know how mature qt on the JVM actually is |
| 04:25 | AWizzArd | robonobo: what I can criticize is: not yet HTML 5 support and some components are missing, such as a DatePicker, etc. |
| 04:25 | LauJensen | AWizzArd: I can tell from your statements that you are an inexperienced Swing user, when you get to know it a little better, you'll hate it |
| 04:25 | AWizzArd | And of course the initial startup times. |
| 04:25 | AWizzArd | For me it was quite the other way around. I went from hate to liking it more and more. |
| 04:26 | AWizzArd | First I thought that the handling of JTables is freaking complicated. |
| 04:26 | AWizzArd | Later I realized that I need to customize a million of things and that JTables offer everything I need. |
| 04:26 | LauJensen | The novice hates it, the journeyman likes it, the master hates it with a passion |
| 04:27 | hiredman | AWizzArd: seems to be the general consensus in #java on swing too |
| 04:28 | bobo_ | a clojure question: if i have a big map, and then create a new car with 99% of its content. it shouldnt realy take alot more memory right? |
| 04:28 | AWizzArd | bobo_: car in the sense of CL or as in "driving vehicle"? |
| 04:29 | bobo_ | *var |
| 04:29 | bobo_ | so as in i cant type |
| 04:29 | AWizzArd | bobo_: it depends on how you "create a new var" with 99% of its content. |
| 04:29 | bobo_ | (def newcar (second (second original))) |
| 04:29 | bobo_ | something like that |
| 04:30 | tomoj | :) |
| 04:30 | AWizzArd | hmm, are you sure you work with "second" on maps? |
| 04:30 | AWizzArd | The results could be pretty... random. |
| 04:30 | bobo_ | the result i get is what i want |
| 04:30 | AWizzArd | It can be done in microseconds if you do use things such as dissoc. |
| 04:30 | robonobo | is map a hashmap or a treemap? |
| 04:30 | bobo_ | its a incanter dataset |
| 04:30 | raek | bobo_: map the data structure or map the function? |
| 04:30 | bobo_ | not sure what thta is |
| 04:30 | AWizzArd | bobo_: maps are typically accessed by "get" |
| 04:31 | AWizzArd | Unless it is a sorted-map-by the order may appear totally random to us. |
| 04:31 | AWizzArd | ,(second (apply hash-map (range 0 5000))) |
| 04:31 | clojurebot | [1024 1025] |
| 04:32 | AWizzArd | I don't find this intuitive. A (get m 1024) however was expected to return 1025 |
| 04:32 | bobo_ | gonna checck the type if my emacs and slime just would wake up |
| 04:33 | tomoj | robonobo: neither |
| 04:33 | tomoj | they're a kind of bit hash tries |
| 04:34 | tomoj | not sure of the exact term.. I think clojure's implementation was somewhat novel? |
| 04:35 | hiredman | novel in the sense that other languages didn't have until recently, but they come from some paper |
| 04:35 | hiredman | bagwel? |
| 04:35 | raek | I've heard the term "bit-partitioned hash trie" for clojure's hash-map |
| 04:35 | tomoj | those weren't persistent, though |
| 04:35 | tomoj | I think? but maybe persistence was no big deal, I dunno |
| 04:36 | hiredman | http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/ |
| 04:37 | robonobo | hiredman: i was just about to post that |
| 04:37 | hiredman | someone recently ported clojure's to haskell |
| 04:37 | mduerksen | #clojure.de |
| 04:37 | mduerksen | ups |
| 04:40 | AWizzArd | mduerksen: yes, it's good! :) |
| 04:41 | bobo_ | ok, so its a seq of seqs not a map |
| 04:41 | bobo_ | say its 1GB, doing (second (second myseq)) should not render 1GB more data right? |
| 04:43 | tomoj | (second (second myseq)) should only consume more memory if you haven't yet produced the second elements of either seq |
| 04:43 | bobo_ | great, thats what i thought |
| 04:43 | tomoj | if you haven't, and the second element is 1GB big... |
| 04:43 | bobo_ | yes well, it is |
| 04:43 | LauJensen | bobo_: Is there a timeframe for the JFX integration? |
| 04:44 | tomoj | don't hold the head if you're processing long seqs with big elements |
| 04:44 | bobo_ | LauJensen: i think i saw something, il try to find it |
| 04:44 | bobo_ | it was announced at devoxx this year atleast |
| 04:44 | tomoj | (or very long seqs with small elements, or short seqs with very big elements...) |
| 04:44 | bobo_ | i have alot of small elements |
| 04:45 | bobo_ | dont think it should be this large though |
| 04:45 | bobo_ | the .csv is 160MB |
| 04:45 | tomoj | do you need to hold the entire dataset in memory at once? |
| 04:45 | bobo_ | yes =( |
| 04:46 | bobo_ | but is it reasonable that 160MB file eats 1GB of ram? |
| 04:46 | tomoj | depends on what representation you use in memory.. |
| 04:46 | bobo_ | ofcource |
| 04:46 | hoeck | bobo_: you checked it with jvisualvm? |
| 04:47 | LauJensen | bobo_: each char in a string takes 2 bytes of memory on the JVM |
| 04:47 | bobo_ | hoeck: no i didnt, il do that |
| 04:48 | tomoj | bobo_: is the dataset just strings split from the csv? some numbers/dates/..? |
| 04:48 | bobo_ | im not sure what incanter does with it... but there are numbers and dates. not sure if they are converted to that |
| 04:49 | LauJensen | I did a project once where as massive CSV file had to be stored in memory. I made by own slurper that put everything in appropriate types. Memory wasnt a problem |
| 04:49 | tomoj | did you measure overhead based on theoretical values for types? |
| 04:50 | tomoj | or guess.. |
| 05:55 | tomoj | holy shit |
| 05:56 | tomoj | just as I was toying around with lamina ideas, ztellman was committing better looking variants |
| 05:56 | tomoj | I love that dude |
| 07:29 | MrHus | If my namespace imports another namespace and the other namespace imports a java class does my namespace need to import that java class as well? |
| 07:45 | bartj | MrHus, no |
| 07:45 | bartj | MrHus, as far as I know |
| 07:45 | MrHus | bartj: apparently you do have too. |
| 07:45 | Raynes | MrHus: If you want to use that Java class in your namespace, then yes. |
| 07:52 | chouser | None of use/require/import are transitive |
| 07:55 | Raynes | chouser: What font did you guys use for code in TJoC? |
| 07:56 | chouser | Raynes: In the PDFs? I have absolutely no idea -- not my department. :-) |
| 07:56 | Raynes | Man, I wish it wasn't mine. :< |
| 07:56 | chouser | Can the PDF be queried for that kind of info? |
| 07:56 | Raynes | Not sure. |
| 08:01 | chouser | Raynes: I think it's just Courier |
| 08:01 | Raynes | Looks about right. |
| 08:05 | robonobo | silly question: when using slime + emacs, how do I switch from the repl back to the current file? |
| 08:06 | AWizzArd | robonobo: Strg+x and then the arrow key left or right |
| 08:06 | AWizzArd | Ah, Strg = Ctrl |
| 08:07 | AWizzArd | You can also split the screen via Ctrl+2 or Ctrl+3 (back to one screen via Ctrl+1) |
| 08:07 | AWizzArd | And then do Ctrl+o to jump between those windows. |
| 08:08 | robonobo | i'm new to emacs: Strg? |
| 08:08 | AWizzArd | Strg is german for the "Ctrl" key. |
| 08:08 | AWizzArd | Steuerung (i.e. Control) |
| 08:09 | AWizzArd | robonobo: one can't spell your name without spelling bonobo :) |
| 08:09 | robonobo | yes |
| 08:11 | robonobo | aha, i got it. Thanks |
| 08:12 | robonobo | and is there a way to have history in slime? |
| 08:12 | mrBliss | robonobo: M-p and M-n |
| 08:15 | mrBliss | robonobo: what I love about it is that if you type 'bladibla', it automatically searches for the last input starting with 'bladibla'. This has saved me lots of time and I miss it in other REPLs (luckily, my zsh prompt has a similar feature). |
| 08:15 | robonobo | zsh is so nice |
| 08:15 | robonobo | mrBliss: have you tried oh-my-zsh? |
| 08:16 | chouser | many readline prompts let you search backwards using Ctrl-R |
| 08:16 | mrBliss | robonobo: yes I have, I'm currently running a heavily modified (or mutilated :) version of it. |
| 08:16 | robonobo | do you have it on github? |
| 08:16 | mrBliss | robonobo: https://github.com/mrBliss/dotfiles/ |
| 08:17 | robonobo | i've got four or five branches of ohmyzsh and i'm constantly switching between them |
| 08:17 | mrBliss | why is that? |
| 08:18 | robonobo | Because I go back and forth on how I like my shell. I can't really decide |
| 08:18 | robonobo | plus i've developed the svn plugin for it |
| 08:19 | mrBliss | is this you then? https://github.com/RobinRamael/oh-my-zsh |
| 08:21 | robonobo | yes it is |
| 08:21 | robonobo | Are you going to come to my house and peek through my windows now? |
| 08:22 | robonobo | i'm behind 7 (proxys) |
| 08:23 | mrBliss | it's just worrying that a simple google query can reveal so much about a person. |
| 08:24 | AWizzArd | robonobo: á propos history: you can also just scroll up to form and hit enter to copy it down. |
| 08:24 | robonobo | aha. |
| 08:24 | robonobo | I'm trying to make lein and slime work together |
| 08:24 | robonobo | but i can't import anything |
| 08:25 | robonobo | lein swank is running in one window, what else should be done? |
| 08:26 | mrBliss | my usual workflow: 1) open a file in a leiningen project, 2) run M-x lein-swank https://github.com/mrBliss/dotfiles/blob/master/.emacs.d/custom-clojure.el#L86 3) Done |
| 08:29 | robonobo | mrBliss: I just put that in my .emacs and call it with M-x lein-swank? |
| 08:30 | mrBliss | robonobo: make sure your current buffer is a file in a lein project (with [lein-swank "1.2.1"] as one of the dev-dependencies), and then M-x lein-swank |
| 08:56 | fbru02 | hey guys anyone can help out on a macro question ? |
| 08:57 | fbru02 | ./s/macro/macros |
| 08:57 | mids | just ask |
| 09:06 | fbru02 | mids: I c&p'ed around 8 lines of code http://pastie.org/1469852 ... the problem is that the functions i create always end up being user-fede634-action instead of ["add" "get" "is-in"] |
| 09:07 | qbg | macros work at compile time |
| 09:07 | qbg | They are a compile time code transformation |
| 09:08 | qbg | Thus when gif is compiled, the (gidf ...) form is transformed to (defn user-fede634-action [] println "abc") |
| 09:10 | fbru02 | qbg: thanks ! how do i make my local action to be compile time too ? |
| 09:10 | gju_ | is there a function that inserts an item at the beginning of a list? |
| 09:10 | raek | fbru02: could you tell us what you want the resulting defn to look like? |
| 09:10 | raek | gju_: conj and cons |
| 09:10 | qbg | fbru02: You probably don't wan that solution |
| 09:10 | qbg | Is there any reason why you want this done at runtime? |
| 09:11 | qbg | Instead of compile time? |
| 09:11 | fbru02 | raek: yes, there should be 3 defn user-fede634-get, user-fede634-add , user-fede634-is-in |
| 09:12 | raek | fbru02: (do (defn user-fede634-get [] (pritln "abc")) (defn user-fede634-add [] (pritln "abc")) (defn user-fede634-is-in [] (pritln "abc")) ? |
| 09:12 | fbru02 | qbg: yes, the naming depends on external input during runtime |
| 09:13 | qbg | Sounds like it might be bad design |
| 09:14 | raek | fbru02: if you strictly cannot do it at compile-time, then I don't think you have any other choice than calling 'eval'. |
| 09:14 | raek | fbru02: but not that anything that is possible during run-time is also possile in compile-time |
| 09:14 | raek | *but note |
| 09:15 | raek | so you can call code that fetches the names from a database or whatever |
| 09:15 | fbru02 | qbg: raek: I |
| 09:15 | fbru02 | It seems i'm overusing macros |
| 09:16 | fbru02 | I finish this proof of concept and go back to drawing board |
| 09:16 | raek | fbru02: also, the arguments of a macro are the code itself, so you cannot bind a name to some value and pass that symbol as an arg |
| 09:16 | raek | unless the calling code is a macro too |
| 09:17 | fbru02 | raek: qbg: thanks |
| 09:18 | raek | (defmacro gif [model occurrence & body] (list* 'do (for [action ["add" "get" "is-in"]] `(gidf "user" "fede634" ~action (println "abc"))))) |
| 09:19 | raek | so you see, macros are contagious in a sense |
| 09:20 | qbg | raek: or you make gidf a function and gif be (defmacro gif [] (do ~@(map #(gidf "user" "fede634" % '(println "abc")) ["add "get" "is-in"]))) |
| 09:20 | raek | (hrm, no need to use 'list*' there. could have used 'cons' instead) |
| 09:20 | qbg | That should be `(do ...) |
| 11:39 | arkh | for simple datetime parsing / usage in clojure, is clj-time the way to go? |
| 11:41 | Raynes | arkh: Yes. clj-time is fantastic. |
| 11:42 | arkh | Raynes: thank you |
| 11:43 | robonobo | Silly question: how do I remove brackets in clojure-mode? |
| 11:45 | klang | robonobo: backspace? |
| 11:46 | robonobo | klang: yeah, uh, that's the thing, neither backspace or C-d work on parens |
| 11:47 | robonobo | the only way i can remove them is by cutting |
| 11:47 | robonobo | which can't be right |
| 11:48 | raek | robonobo: you have paredit activated? if so, it will be removed when you remove the matching one when there is nothing in between |
| 11:48 | klang | robonobo: no, that's not right .. my backspace runs the command paredit-backward-delete |
| 11:49 | robonobo | i'm new to emacs, how would i see wether paredit was activated? |
| 11:49 | raek | x (y)| x (y|) x (|) x | |
| 11:49 | jwr7 | So — if I have an agent fn that generates lazy sequences and I don't force them with doall, will they actually be generated outside of the agent fn, in a different threads (possibly multiple threads)? |
| 11:50 | raek | for me, it sais this above the minibuffer: (Clojure Hi Paredit Fill) |
| 11:50 | klang | M-x describe-mode |
| 11:50 | jwr7 | I've just realized that this kind of defeats the serialization that agents provide :-/ |
| 11:50 | robonobo | raek: yeah, i'm in paredit mode |
| 11:51 | klang | robonobo: in the repl or in a clj file? |
| 11:51 | raek | robonobo: you can use M-s to remove the innermost pair of parens at the point |
| 11:51 | raek | I think paredit is really useful, so I would recommend to learn it. http://www.emacswiki.org/emacs/PareditCheatsheet |
| 11:52 | raek | otherwise: M-x paredit-mode to disable |
| 11:53 | robonobo | raek: thanks |
| 11:54 | raek | http://p.hagelb.org/paredit-outline <-- tutorial by technomancy |
| 12:33 | jamiltron | I am having some problems with clojure.contrib, it seems. When I try (ns jamiltron (:require clojure.contrib.server-socket)) I am getting a FileNotFoundException. |
| 12:35 | tonyl | is clojure-contrib.jar in the classpath? |
| 12:35 | jamiltron | It is |
| 12:36 | tonyl | can you share the exception stack of the problem? |
| 12:37 | tonyl | or how are you calling clojure |
| 12:39 | tonyl | &(require '[clojure.contrib.server-socket :as ccss]) |
| 12:39 | sexpbot | java.io.FileNotFoundException: Could not locate clojure/contrib/server_socket__init.class or clojure/contrib/server_socket.clj on classpath: |
| 12:39 | tonyl | ,(require '[clojure.contrib.server-socket :as ccss]) |
| 12:39 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib/server_socket__init.class or clojure/contrib/server_socket.clj on classpath: |
| 12:39 | jamiltron | FileNotFoundException Could not locate clojure/contrib__init.class or clojure/contrib.clj on classpath: clojure.lang.RT.load (RT.java:412) |
| 12:40 | tonyl | &*clojure-version* |
| 12:40 | sexpbot | ⟹ {:major 1, :minor 2, :incremental 0, :qualifier ""} |
| 12:40 | jamiltron | I am calling clojure through an alias of clj which is clojure.contrib's clj-env-dir |
| 12:40 | Raynes | Sandboxes don't seem to like certain namespaces. |
| 12:41 | Raynes | Not that it will fix your problem, but consider cake or leiningen. They'll serve you far better than a wee little clj script. |
| 12:41 | jamiltron | I usually use leiningen, but am getting the same errors. |
| 12:41 | tonyl | Raynes: what do you usually use? |
| 12:42 | Raynes | cake |
| 12:42 | jamiltron | My clojure version is 1.3.0-master |
| 12:44 | raek | jamiltron: looks like the error suggests you are trying to (:require clojure.contrib) |
| 12:44 | jamiltron | Oops, that doesn't work either |
| 12:45 | jamiltron | server-socket gives: |
| 12:45 | jamiltron | FileNotFoundException Could not locate clojure/contrib/server_socket__init.class or clojure/contrib/server_socket.clj on classpath: clojure.lang.RT.load (RT.java:412) |
| 12:45 | raek | jamiltron: what contrib jars do you use? |
| 12:45 | hiredman | I suggest you not user the launcher script |
| 12:45 | hiredman | use |
| 12:46 | raek | that error means that the server-socket module of contrib is not on the class path |
| 12:47 | jamiltron | I copied clojure-contrib/modules/complete/target/complete-1.3.0-SNAPSHOT.jar into my classpath as clojure-contrib.jar |
| 12:48 | raek | that only depends on all the other jar files and does not include them |
| 12:48 | raek | it's basically empty |
| 12:49 | raek | I think "standalone" is the droid you are looking for |
| 12:49 | jamiltron | Ah, let me try that. |
| 12:50 | jamiltron | That worked. Thank you very much! |
| 12:51 | jamiltron | Thanks for the help, everyone. I'm really new to Clojure and I love it but I keep getting stuck on stuff like this. |
| 12:53 | Raynes | My best tip is to not try to manage the classpath manually with launcher scripts and the like. Your life will be much easier just using cake or leiningen, especially since they scale to more complex things than this easily. |
| 12:53 | jamiltron | Yeah, I'm trying to learn lein as much as possible. |
| 12:54 | shortlord | shouldn't (catch Exception e (do-something)) catch every Exception, including NullPointerExceptions? |
| 12:55 | raek | shortlord: yes. |
| 13:05 | jamiltron | Does anyone know about lein and swank? |
| 13:09 | markskilbeck | http://projecteuler.net/index.php?section=problems&id=11 |
| 13:10 | markskilbeck | Well that sounds interesting. |
| 13:13 | raek | jamiltron: just ask. |
| 13:14 | jamiltron | I think I found the answer - does leiningen not work with clojure 1.3.0? |
| 13:14 | raek | it should |
| 13:14 | jamiltron | I am getting a series of classpath errors when running lein swank in a project using clojure 1.3.0, but I can run swank-clojure from the .lein/bin directory. |
| 13:15 | shortlord | raek: I have surrounded a function call with try + catch Exception e, but there is still a NullPointerException occuring as soon as I execute the block |
| 13:15 | shortlord | does try + catch work somewhat differently in clojure than in Java / is there anything obvious that could be wrong? |
| 13:15 | jamiltron | Var *classpath* not marked :dynamic true, setting to :dynamic. You should fix this before next release! |
| 13:15 | jamiltron | Exception in thread "main" java.io.FileNotFoundException: Could not locate mire/server__init.class or mire/server.clj on classpath: |
| 13:15 | jamiltron | at clojure.lang.RT.load(RT.java:412) |
| 13:15 | jamiltron | at clojure.lang.RT.load(RT.java:381) |
| 13:15 | hiredman | shortlord: your catch is throwing the npe |
| 13:15 | jamiltron | at clojure.core$load$fn__4389.invoke(core.clj:5308) |
| 13:15 | raek | no, they are compiled to the same byte code |
| 13:15 | jamiltron | at clojure.core$load.doInvoke(core.clj:5307) |
| 13:15 | jamiltron | at clojure.lang.RestFn.invoke(RestFn.java:409) |
| 13:15 | jamiltron | at clojure.core$load_one.invoke(core.clj:5132) |
| 13:15 | jamiltron | at clojure.core$compile$fn__4394.invoke(core.clj:5319) |
| 13:15 | jamiltron | at clojure.core$compile.invoke(core.clj:5318) |
| 13:15 | jamiltron | at user$eval7.invoke(NO_SOURCE_FILE:1) |
| 13:16 | jamiltron | at clojure.lang.Compiler.eval(Compiler.java:6222) |
| 13:16 | raek | jamiltron: gist.github.com |
| 13:16 | jamiltron | at clojure.lang.Compiler.eval(Compiler.java:6213) |
| 13:16 | jamiltron | at clojure.lang.Compiler.eval(Compiler.java:6189) |
| 13:16 | jamiltron | at clojure.core$eval.invoke(core.clj:2680) |
| 13:16 | jamiltron | at clojure.main$eval_opt.invoke(main.clj:232) |
| 13:16 | jamiltron | at clojure.main$initialize.invoke(main.clj:251) |
| 13:16 | jamiltron | at clojure.main$null_opt.invoke(main.clj:284) |
| 13:16 | jamiltron | at clojure.main$main.doInvoke(main.clj:362) |
| 13:16 | jamiltron | at clojure.lang.RestFn.invoke(RestFn.java:422) |
| 13:16 | jamiltron | at clojure.lang.Var.invoke(Var.java:405) |
| 13:16 | jamiltron | at clojure.lang.AFn.applyToHelper(AFn.java:165) |
| 13:16 | jamiltron | at clojure.lang.Var.applyTo(Var.java:518) |
| 13:16 | jamiltron | at clojure.main.main(main.java:37) |
| 13:16 | dakrone | gah jamiltron, use gist |
| 13:16 | raek | shortlord: the NPE doesn't happen in the catch block? |
| 13:16 | jamiltron | Sorry |
| 13:17 | jamiltron | https://gist.github.com/783190 |
| 13:18 | shortlord | I'm doing "(catch Exception e (println "in the catch block")) |
| 13:19 | shortlord | that should not throw a NPE, right? |
| 13:20 | raek | with a (try ...) surrounding it? |
| 13:21 | raek | (try (inc nil) (catch Exception e (.getName (class e)))) => "java.lang.NullPointerException" |
| 13:23 | raek | jamiltron: I would check the versions of the libraries you use and make sure they are for the same clojure version |
| 13:24 | ossareh | morning yo! |
| 13:24 | amalloy | &(supers NullPointerException) |
| 13:24 | sexpbot | ⟹ #{java.lang.RuntimeException java.lang.Throwable java.lang.Object java.lang.Exception java.io.Serializable} |
| 13:25 | amalloy | shortlord: yeah, should work |
| 13:25 | ossareh | bobo_: as long as you're not newing up new objects to put in that map - then yes, that is part of the Persistent datastructure stuff that Rich has gifted us with. |
| 13:48 | LauJensen | Remind me again why whenever somebody pastes 3+ lines people start crying gist gist, isnt it more convenient to read it right here in this buffer than to tab out to Conkeror? |
| 13:49 | Scriptor | LauJensen: 1. You don't have to keep scrolling back up to find the code again if people have talked since |
| 13:49 | Scriptor | 2. Syntax highlighting, line numbers, and formatting |
| 13:50 | Scriptor | 3. If someone joins and wants to help, you can just link them, instead of pasting all over again |
| 13:51 | TimMc | keep going |
| 13:51 | LauJensen | 1. Use ERC, then this is a non-issue, 2. I can certainly live without syntax highlighting for short 5 - 10 liners and stacktraces, and 3. I agree that if somebody joins halfway through you should gist instead |
| 13:52 | TimMc | 4. I can't read both the preceding and following parts of the conversation on the same screen when there is a giant chunk of stuff in the middle. |
| 13:52 | amalloy | 4 is the one that bugs me, personally |
| 13:53 | LauJensen | If 5 - 10 lines can screw up your display, quit using those tiny netbooks, they're not made for developers! |
| 13:53 | TimMc | Same here, though Scriptor's 1-3 are important too. |
| 13:53 | LauJensen | Even with the somewhat massive paste above, I can stille read 5 - 10 lines both above and below, and if I couldnt, hitting C-M-v isnt a huge problem |
| 13:53 | TimMc | LauJensen: 1280x800 laptop here. |
| 13:54 | TimMc | I wish I had a giant flatscreen monitor in portrait mode, but I don't. |
| 13:54 | Scriptor | the point of windows is to not have to maximize everything :) |
| 13:54 | LauJensen | Scriptor: You're on Windows? that explains it ... :) |
| 13:54 | Scriptor | windows, not Windows :p |
| 13:55 | LauJensen | I have viewports, 1) Emacs, no border, fullscreen, 2) Conkeror, no border, full screen, 3) thunderbird, maximized, .. and so forth |
| 13:55 | LauJensen | Thats gives you guys a lot of freedom to paste whatever you want :) |
| 13:59 | technomancy | some people do IRC on phones even |
| 14:00 | tonyl | i don't like fullscreen windows, except for the internet browser |
| 14:00 | tonyl | and watching videos |
| 14:02 | pjstadig | technomancy: yaaic for android is what i use |
| 14:02 | LauJensen | tonyl: I really like it, and it lets me keep away from the mouse completely |
| 14:03 | Derander | LauJensen: what window manager do you use? |
| 14:03 | technomancy | pjstadig: I have andchat, but I never use it. |
| 14:03 | Raynes | I have a whole viewport dedicated to Emacs. However, I don't actually have a single maximized Emacs window in there. Rather, I have two Emacs frames side by side, because it's easier to resize than a single frame with several panes. |
| 14:03 | technomancy | pjstadig: is it halfway decent? |
| 14:03 | LauJensen | Derander: Gnome + Compiz - I wrote about my setup on offtopic.bestinclass.dk |
| 14:03 | pjstadig | yeah |
| 14:03 | Derander | LauJensen: have you looked at a tiling window manager? seems like gnome is overkill |
| 14:03 | Derander | oh |
| 14:03 | Derander | cmd+f "tiling" in that post |
| 14:04 | technomancy | nothing wrong with andchat I guess; I just never got my bouncer situation figured out |
| 14:04 | LauJensen | Derander: I had Awesome WM for many months, then switched to Gnome and replicated my setup and binding with Compiz - Like I said, its on the blog |
| 14:04 | Derander | yep. found it seconds after I asked |
| 14:05 | LauJensen | Yea, I didn't mean that in the rude way that it came out, sorry :) |
| 14:05 | Derander | no sweat |
| 14:17 | islon | how do I generate/write xml in clojure? |
| 14:18 | amalloy | islon: clojure.contrib.prxml is decent |
| 14:19 | TimMc | Asus-- for not having a decent way to browse their laptops |
| 14:20 | TimMc | bah, wrong window |
| 14:20 | amalloy | islon: https://gist.github.com/ea060658b5677649d8e7 |
| 14:20 | islon | thanks amalloy |
| 14:21 | amalloy | and it's not hard to get it to print with decent whitespace; by default it's compact |
| 14:49 | albertid | hi, can I traverse a list without evaluation? e.g. I want (first v) to return vec instead of 1 when v = (vec (1 2)) |
| 14:50 | dale | Like (first '(vec (1 2)))? |
| 14:50 | pdk | ,(for [i '(vec (1 2))] i) |
| 14:50 | clojurebot | (vec (1 2)) |
| 14:51 | pdk | apparently so |
| 14:51 | albertid | yea, except I can't use 'v |
| 14:51 | amalloy | albertid: traversing a list never causes evaluation. you're looking (i think) for a way to input a list without evaluation |
| 14:51 | Raynes | Sounds like you need a macro. |
| 14:51 | amalloy | &(let [v '(vec (1 2))] (first v)) |
| 14:51 | sexpbot | ⟹ vec |
| 14:52 | dale | What amalloy said. I think we'll need to know how whatever gets into v, got into v. |
| 14:53 | albertid | amalloy_omglunch, hey thats right |
| 14:53 | albertid | so v would (read-string "[ 1 2]") |
| 14:54 | albertid | or (read-string "(vec (1 2))") |
| 14:54 | albertid | which should be a seperate case |
| 14:55 | albertid | ok I will try myself |
| 15:09 | shortlord | I need to grant unique tokens from a pool of 4 tokens to several concurrent accessors, so that every one ends up with a different token (or none at all, if the access happens if all the tokens are already taken). How would I do that? I can use drop on an atom, but that give me only the remaining elements, not the one I picked. Is there any elegant solution for this? |
| 15:11 | chouser | shortlord: you already have the more than 4 threads that need tokens? |
| 15:12 | shortlord | chouser: yeah, the scenario is the connection phase of a simple 4 player game. I need to distribute the 4 player colors to the first players that connect |
| 15:12 | chouser | ah, I see now. |
| 15:13 | chouser | there has been talk of an alternative to 'swap!' that returns both the old and new values of the atom |
| 15:13 | chouser | which would suffice in your case. alas such a thing doesn't currently exist. |
| 15:14 | shortlord | so that means I need to retain the original 4-token vector and compare it with the one after the swap! to figure out the token, right? |
| 15:15 | chouser | so, off the top of my head: (1) a BlockingQueue, (2) store in an atom a pair of [taken available] tokens |
| 15:16 | shortlord | chouser: ah, the idea about the token pair sounds nice, thx :) |
| 15:16 | chouser | shortlord: I don't think that would be sufficient. The original could be (a b c d), and the swap! could return (c d). |
| 15:17 | shortlord | chouser: could that happen? I thought the updates happen atomically, so after a swap! I would get only the result of my latest swap? |
| 15:18 | chouser | shortlord: well, it seems a bit messier than one might hope. (ffirst (swap! x (fn [[taken avail]] [(cons (first avail) taken) (next avail)])) |
| 15:20 | chouser | shortlord: updates are atomic, but in (let [before @a, after (swap! a next)] ...), you can't assume only one swap has happened between before and after. others may have snuck in. |
| 15:22 | shortlord | chouser: well, but that would work for (let [before original-tokens, after (swap! a next)]...), right? Using before independently from the atom |
| 15:22 | shortlord | (but anyway, your solution is great, thx a lot :)) |
| 15:23 | chouser | shortlord: no, 'after' would contain less than 3 tokens for all but the first thread in, leaving them uncertain which token is theirs. |
| 15:25 | chouser | (def q (LinkedBlockingQueue. '[a b c d])) ... (.poll q) |
| 15:25 | chouser | shortlord: that looks even easier. see http://download.oracle.com/javase/6/docs/api/java/util/concurrent/LinkedBlockingDeque.html |
| 15:29 | shortlord | chouser: nice, thx :) |
| 16:18 | amalloy | shortlord: store a map of {token, owner} pairs? |
| 16:20 | amalloy | then you swap! with some function that adds an entry if possible, and an argument some sort of this-is-me identifier; after the swap you look through the map for your identifier |
| 16:21 | shortlord | amalloy: the problem is that players get initially identified through this token (well, I guess it could also be done differently, but it works good enough right now) |
| 16:23 | shortlord | but I think in general your solution should be the best way to do it for a variable number of players |
| 16:25 | shortlord | is (:entry map-foo) or (map-foo :entry) more idiomatic clojure code (or is there no real difference in style)? |
| 16:26 | amalloy | shortlord: there's not a huge difference, but i'd prefer the former |
| 16:26 | amalloy | for one thing if you ever switch from maps to records, the second form will stop working |
| 16:28 | amalloy | speaking of which, anyone know if records will start implementing IFn or ILookup in 1.3? |
| 16:31 | hiredman | uh, I am pretty sure records do implement ilookup |
| 16:31 | amalloy | hiredman: oh, you're right |
| 16:31 | amalloy | i guess i don't quite understand what ILookup means; but what about IFn? |
| 16:32 | hiredman | I doubt it |
| 16:33 | hiredman | (foo :bar) lookup (which is what the default IFn would do presumably) wouldn't be able to use the call site cache (:bar foo) uses for records |
| 16:35 | amalloy | hiredman: interesting. i don't know what that means, but a call-site cache sounds handy :) |
| 16:36 | hiredman | the first time (:foo x) happens on a record clojure stores a thunk that calls (.foo x) non-reflectlively (which hopefully hotspot just inlines away) |
| 16:37 | hiredman | and it falls back to (:foo x) if the site becomes megamorphic |
| 16:37 | hiredman | http://en.wikipedia.org/wiki/Inline_caching |
| 16:37 | amalloy | neat |
| 17:45 | tonyl | does anybody in what server is the ##java channel? I can't seem to find it by searching the Internet |
| 17:45 | tonyl | I have a question about the java code in clojure and it is a feature I've never seen in java |
| 18:08 | benreesman | can anyone answer a quick question about ring? |
| 18:08 | brehaut | benreesman: maybe? |
| 18:08 | benreesman | it seems to evaluate my handler function twice? |
| 18:09 | brehaut | that seems surprising |
| 18:09 | brehaut | are you able to paste up a snippet somewhere? |
| 18:10 | benreesman | if that's surprising then i'll mess around some more, just wanted to know if that was a common mistake. if i don't get anywhere i'll create a gist. thanks! |
| 18:11 | brehaut | benreesman: are you using ring directly or via some intermediate library like compojure or moustache? |
| 18:11 | benreesman | ring directly |
| 18:11 | brehaut | and at the moment just simple GET requests? |
| 18:12 | benreesman | yes |
| 18:14 | brehaut | benreesman: then yes, i think that is weird |
| 18:14 | benreesman | https://gist.github.com/783678 |
| 18:17 | brehaut | huh |
| 18:17 | hiredman | benreesman: most likely your webbrowser is doing two gets |
| 18:18 | hiredman | favicon + whatever |
| 18:18 | brehaut | benreesman: look at your urls, one is to the favicon |
| 18:18 | benreesman | gotcha |
| 18:18 | benreesman | newbie mistake |
| 18:18 | brehaut | benreesman: yeah, i think your mistake is not logging the requests url |
| 18:19 | benreesman | cheers |
| 18:27 | Derander | technomancy: do you know why lein keeps using Derander as my clojars group even though I'm registered under derander? |
| 18:27 | Derander | technomancy: is this a setting I can change somewhere? |
| 18:28 | technomancy | I don't know, but I encourage you to get comfy with the clojars source, because not enough people are. =) |
| 18:29 | technomancy | maybe I'm misunderstanding the question, but it doesn't sound like it has anything to do with leiningen |
| 18:29 | Derander | the reason that I am questioning leiningen is that lein pom is generating the incorrect word in my pom file |
| 18:29 | Derander | I am not familiar with the java ecosystem, though |
| 18:29 | Derander | I am confused in general because I don't recall typing "Derander" anywhere on my system |
| 18:30 | technomancy | the pom just comes straight from project.clj |
| 18:30 | Derander | oh god. I'm a moron. I forgot to save the file. |
| 18:30 | Derander | thanks. :-P |
| 18:30 | technomancy | easy fix =) |
| 19:04 | markskilbeck | Knock knock. |
| 19:05 | raek | who's there? |
| 19:05 | markskilbeck | ... |
| 19:05 | markskilbeck | Java. |
| 19:06 | markskilbeck | Doesn't work too well in IRC. |
| 19:07 | tonyl | it uses phonetics? |
| 19:07 | markskilbeck | Supposed to wait a while before answering. |
| 19:07 | tonyl | oh hehe |
| 19:08 | pkinney | I've told that joke to a group of computer illiterates... haha, they just threw me weird looks |
| 19:08 | pkinney | (It's 1 of my fav programming jokes) |
| 19:10 | Adamant | markskilbeck: try this |
| 19:10 | Adamant | .... |
| 19:10 | Adamant | ... |
| 19:10 | Adamant | ....... |
| 19:10 | Adamant | ..... |
| 19:10 | Adamant | Java! |
| 19:10 | markskilbeck | haha |
| 19:10 | markskilbeck | Yeah I guess that does the trick |
| 19:10 | Adamant | sadly/gladly the joke isn't as true anymore |
| 19:11 | Adamant | making Java fast got turned into the primary goal of compiler folks like speeding up C and C++ used to be before that |
| 19:11 | Adamant | so after a decade+, it's pretty damn fast |
| 19:12 | technomancy | boot time is still quite bad, which is what I assumed the joke was about |
| 19:12 | technomancy | "Knock Knock/who's ther--dalvik" |
| 19:14 | technomancy | "dalvik who?/......... user=> " |
| 19:14 | brehaut | technomancy: it has race conditions? |
| 19:15 | technomancy | just quick VM boot plus slow load of clojure's runtime libs. |
| 19:15 | brehaut | oh right |
| 19:17 | Adamant | technomancy: that is true |
| 19:18 | shortlord | has anyone successfully used clojure-processing? There seems to zero documentation, not even the source code is really helpful. :-/ I'm trying to get text alignment to work |
| 19:25 | technomancy | I used it like a year and a half ago; it was really hard to get working. had to fall back to Java documentation for most things. |
| 19:30 | shortlord | technomancy: what a shame, live editing processing would've been promising |
| 19:37 | technomancy | well it could certainly be fixed |
| 19:38 | technomancy | there's nothing inherently difficult about it; it's just a matter of modernizing a legacy codebase |
| 19:44 | amalloy | tonyl: did you get your java question answered? |
| 19:45 | Derander | Is there a good way to monitor a directory for changes in java? |
| 19:45 | brehaut | Derander: by 'good way' do you mean 'not polling' ? |
| 19:46 | Derander | well, if there is a library to do polling out there that would work. I'd prefer not to have to poll, though |
| 19:46 | Derander | I see NIO2 in java 7 but I haven't see anything for java6 |
| 19:47 | brehaut | Derander: i think that about sums things up. |
| 19:48 | Derander | that is unfortuante |
| 19:48 | brehaut | Derander: i think lazy-test is the canoncial example people point to in clj land |
| 19:52 | arohner | is there a way to tell the JVM to attempt a GC before increasing its heap size? |
| 19:53 | hiredman | the jvm doesn't dynamically increase it's heapsize |
| 19:53 | hiredman | use the -Xwhatever to set the heapsize you want |
| 19:53 | arohner | hiredman: yes it does, if you use -Xmx |
| 19:54 | hiredman | no |
| 19:54 | hiredman | that is the max size |
| 19:54 | arohner | yes |
| 19:54 | hiredman | if you want to cause a gc before reach that size then decrease that size |
| 19:54 | arohner | and my current heap size starts small (50MB?), and the JVM increases its heap size when it feels the need, up to the max size |
| 19:54 | hiredman | right |
| 19:54 | hiredman | if that is not the correct max size, then you should make it smaller |
| 19:56 | tonyl | amalloy: no, still trying to figure it out |
| 19:56 | clojurebot | amalloy: therfor I return [previous] if rest is empty |
| 19:56 | Derander | brehaut: thanks for the pointer to lazy test. it seems like I've basically written a slightly buggy clojure implementation of ScheduledThreadPoolExecutor. |
| 19:57 | amalloy | tonyl: i can join ##java from freenode; not sure why you'd be having trouble there. but maybe you could just ask your java question here? |
| 19:58 | amalloy | arohner: (System/gc) i think |
| 19:58 | amalloy | though usually that's...not a good idea. why do you want to? |
| 19:58 | arohner | amalloy: yes, that tells the JVM to try to GC. I want it to try automatically, before increasing the heap size |
| 19:59 | hiredman | if you don't want a lage heapsize then make the max heapsize smaller |
| 19:59 | arohner | because it's being lazy. Right now, if I tell it to GC, it will free ~300MB |
| 20:00 | amalloy | arohner: so why do you care? that's 300 mb that's paged/swapped |
| 20:00 | hiredman | if you tell java to use a 1G heap max, don't freak out if it does |
| 20:00 | hiredman | if you really don't want it to, drop the max |
| 20:01 | tonyl | amalloy I |
| 20:01 | tonyl | amalloy: it is this line https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFn.java#L145 |
| 20:01 | amalloy | arohner: if you could get java to actually behave the way you're describing, you would be sad, not happy |
| 20:01 | tonyl | AFAIK java doesn't have ... operators |
| 20:01 | amalloy | tonyl: yeah it does |
| 20:02 | arohner | amalloy: why? |
| 20:02 | amalloy | as of 1.5 |
| 20:02 | pdk | void main(String... args) |
| 20:02 | pdk | that code is fucking scary |
| 20:02 | amalloy | it's syntactic sugar for taking an array of arguments; it lets the caller pass N arguments without wrapping them in an array first |
| 20:03 | pdk | please tell me it's not production code so i can sleep |
| 20:05 | tonyl | amalloy: I can't seem to find documentation about it, do you know how is this operator called? |
| 20:06 | joegallo | http://download.oracle.com/javase/1.5.0/docs/guide/language/varargs.html |
| 20:06 | amalloy | http://download.oracle.com/javase/1.5.0/docs/guide/language/varargs.html |
| 20:06 | joegallo | varargs |
| 20:08 | tonyl | so why not use that instead of making an function signature with 21 arguments |
| 20:08 | tonyl | is it to be safe on java versions |
| 20:08 | hiredman | array allocations are not free |
| 20:09 | arohner | the clojure compiler does it for speed |
| 20:09 | amalloy | tonyl: speed |
| 20:13 | tonyl | ok didn't know the performance |
| 20:13 | tonyl | thanks for the help guys |