2010-11-05
| 00:18 | rata_ | good night :) |
| 00:26 | quile | hey any recommendations for clojure lib to send tweets? |
| 00:30 | amalloy | quile: http://www.lmgtfy.com/?q=clojure+twitter+library |
| 00:30 | quile | uh, i asked for recommendations, you know, like personal opinions. |
| 00:30 | cemerick | amalloy: wiseass :-P |
| 00:31 | quile | good way to put off n00bs |
| 00:31 | rdeshpande | hey guys |
| 00:31 | rdeshpande | newbie question: (reduce (fn [mymap [k v]] (assoc mymap k v)) {} (map vector [1,2,3] [4,5,6])) |
| 00:32 | rdeshpande | hwo does mymap get assigned? |
| 00:32 | rdeshpande | oh nevermind |
| 00:32 | cemerick | rdeshpande: assigned? It's an argument going into the fn being used in the reduce… |
| 00:32 | rdeshpande | just reread the reduce docs |
| 00:33 | rdeshpande | didnt' stick the first time :/ |
| 00:33 | Raynes | cemerick: I think he just wanted to use sexpbot's lmgtfy you plugin. |
| 00:33 | Raynes | quile: There is clojure-twitter. |
| 00:33 | Raynes | $google sexpbot-twitter |
| 00:33 | sexpbot | First out of 32 results is: ivey's sexpbot-twitter at master - GitHub |
| 00:33 | sexpbot | http://github.com/ivey/sexpbot-twitter/tree/ |
| 00:34 | Raynes | That's a sexpbot plugin that ivey wrote for sending tweets from sexpbot. Might be a nice example of doing what you want to do. |
| 00:34 | Raynes | And some shameless self-promotion. <3 |
| 00:34 | cemerick | Raynes: Sure, I was just poking at amalloy. He's good people. :-) |
| 00:34 | Raynes | He sure is. <3 |
| 00:34 | quile | Raynes: yes, i found it on clojars; just seems overkill for what i need... just need to send a tweet from a bot |
| 00:34 | cemerick | quile: It's hard to beat #clojure's noob-friendliness IMO, if you want to put it that way. |
| 00:34 | amalloy | rdeshpande: by the way, i assume you're practicing either reduce or assoc, but you could do the same thing with conj: &|(reduce conj {} (map vector [1,2,3] [4,5,6]))|& |
| 00:34 | sexpbot | ⟹ {3 6, 2 5, 1 4} |
| 00:35 | ivey | clojure-twitter is pretty easy to use |
| 00:35 | quile | cemerick: yeah for the most part it seems to be, i just have little patience for snide remarks |
| 00:35 | ivey | quile: and now that you need oauth to send tweets ... you don't want to do oauth by hand |
| 00:35 | rdeshpande | amalloy: ah cool. working through labrepl right now |
| 00:35 | Raynes | quiesce: You could probably get by using the API directly, but either way, you're going to need a JSON parser and a http client. |
| 00:35 | quile | ivey: thanks for the tip |
| 00:35 | cemerick | quile: *shrug* I wouldn't read too much into a lmgtfy link. :-) |
| 00:35 | Raynes | But yeah, oauth is oh mah gawd. |
| 00:36 | quiesce | I'll assume that was a tab-error and move on. |
| 00:36 | quile | Raynes: hell yes |
| 00:36 | Raynes | quile: I assure you, he loves you very much. |
| 00:36 | quile | hahaha nice |
| 00:36 | Raynes | quiesce: Yes, it was. Sorry. |
| 00:37 | amalloy | lmgtfy is a bad habit :P |
| 00:38 | Raynes | amalloy: Also, if you want a bug to fix, I don't think the lmgtfy command encodes URLs properly. |
| 00:38 | Raynes | $lmgtfy *##@$!@~$!`@ |
| 00:38 | sexpbot | http://www.lmgtfy.com/?q=*##@$!@~$!`@ |
| 00:39 | amalloy | Raynes: the doc could use a tweak too - i assumed it meant @nick, not @ nick |
| 00:39 | Raynes | Probably. |
| 00:39 | Raynes | I haven't touched that plugin in at least 30 years. |
| 00:39 | cemerick | amalloy: a critical weapon in more…uncivilized arenas. ;-) |
| 01:34 | LauJensen | Morning all |
| 01:44 | cemerick | LauJensen: good night :-) |
| 01:44 | LauJensen | Night :) |
| 03:10 | ppppaul | heeeeeeeeeeeeeeeey |
| 03:10 | ppppaul | anyone awake? |
| 03:11 | seancorfield | i am |
| 03:11 | seancorfield | barely |
| 03:12 | seancorfield | hey kumarshantanu |
| 03:12 | kumarshantanu | seancorfield: hi |
| 03:13 | ppppaul | i'm trying to set up emacs to use clojure |
| 03:14 | seancorfield | kumarshantanu: where are you based? google suggests bangalore but i wanted to ask :) |
| 03:14 | kumarshantanu | seancorfield: I am at Bangalore |
| 03:14 | seancorfield | pppaul: i've tried emacs a couple of times but i just can't get on with it :( |
| 03:14 | ppppaul | i installed clojure from the ubuntu repo, and i would like to know how do i find what a var in bash points to? |
| 03:14 | seancorfield | kumarshantanu: ok, same place as macromedia's teams (i worked for macromedia) |
| 03:14 | seancorfield | adobe has their teams in noida |
| 03:15 | ppppaul | 'clojure' is a symbol on my system, but i would like to find out what it's pointing to |
| 03:15 | kumarshantanu | seancorfield: Adobe has offices at Noida and Bangalore, yes |
| 03:15 | seancorfield | i almost got to bangalore when i was their senior IT architect... |
| 03:16 | ppppaul | i have clojure running on emacs, the learning curve is a bit high, but i feel that the more i learn, the more useful i'm finding emacs to be |
| 03:16 | seancorfield | i'm using eclipse + ccw |
| 03:16 | seancorfield | and leiningen from the command line |
| 03:16 | kumarshantanu | seancorfield: so I guess that where your ColdFusion linkage came from? you seem to be working a lot in CF |
| 03:17 | seancorfield | yeah, i was a C++ / Java guy when i joined macr... then they bought allr... and i created a team to rewrite macromedia.com... and was told to use cfml |
| 03:18 | kumarshantanu | seancorfield: cool |
| 03:18 | seancorfield | it's one of the original scripting languages for the jvm... but most folks just know about the proprietary c++ version allaire had |
| 03:19 | seancorfield | and now i work with railo which is a jboss project that provides a free open source cfml engine on the jvm |
| 03:19 | seancorfield | so i'm using clojure + cfml on railo / tomcat |
| 03:19 | amalloy | ppppaul: what do you mean, a var in bash? |
| 03:19 | kumarshantanu | seancorfield: I saw Railo |
| 03:20 | ppppaul | when i'm in bash, i type in 'clojure' and it runs a script or something.... i don't know what it's doing |
| 03:20 | ppppaul | i'm just calling 'clojure' a var |
| 03:20 | seancorfield | nearly half past midnight here so i must head to bed... laters |
| 03:20 | ppppaul | i don't know the terminology |
| 03:20 | amalloy | ah |
| 03:20 | amalloy | clojure is a command on your PATH |
| 03:20 | amalloy | you can find out where it is on the filesystem with "which clojure" |
| 03:20 | kumarshantanu | seancorfield: sure, good night |
| 03:20 | ppppaul | thanks |
| 03:21 | ppppaul | thank you soooo much! |
| 03:22 | ppppaul | now i can figure out how to get my 'clj' script to work... i hope |
| 03:33 | amalloy | ppppaul: good luck. i'm off to bed |
| 03:49 | ppppaul | woot! clojure is completely working in emacs now |
| 03:50 | coldhead | aww |
| 03:51 | ppppaul | the repo for ubuntu doesn't work properly (classpath isn't set up for contrib) |
| 03:53 | samx | how would you add two arrays together element wise ? That is, (array+ [1 2] [3 4]) => [4 6] ? I can come up with a small function to do that, but just wondering if there's some higher order function in the standard libraries that would make it trivial. |
| 03:55 | Raynes | &(map + [1 2] [3 4]) |
| 03:55 | sexpbot | ⟹ (4 6) |
| 03:55 | ppppaul | that doesn't make sense to me |
| 03:56 | samx | that sounds good :-) thx |
| 03:56 | ppppaul | &(map + [1 2]) |
| 03:56 | sexpbot | ⟹ (1 2) |
| 03:56 | ppppaul | oh, now it makes sense |
| 03:56 | ppppaul | maybe i should go to sleep |
| 03:57 | coldhead | never sleep |
| 03:57 | coldhead | sleep is the enemy |
| 03:57 | ppppaul | &(apply [1 2] +) |
| 03:57 | sexpbot | java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core$_PLUS_ |
| 03:58 | ppppaul | i still sorta don't understand what map is doing in the above code |
| 03:59 | ppppaul | (doc map) |
| 03:59 | clojurebot | "([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]); Returns a lazy sequence 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." |
| 03:59 | ppppaul | ok, now i get it |
| 04:00 | ppppaul | &(map % [1 2 3 4 5] [60 70 80 90 100]) |
| 04:00 | sexpbot | java.lang.Exception: Unable to resolve symbol: % in this context |
| 04:00 | LauJensen | &(time (dotimes [_ 1e6] (map + (range 1e5) (range 1e5)))) |
| 04:00 | sexpbot | ⟹ "Elapsed time: 146.31 msecs" nil |
| 04:00 | LauJensen | &(time (dotimes [_ 1e6] (apply + (range 1000)))) |
| 04:00 | ppppaul | &(map * [1 2 3 4 5] [60 70 80 90 100]) |
| 04:00 | sexpbot | ⟹ (60 140 240 360 500) |
| 04:00 | sexpbot | Execution Timed Out! |
| 04:01 | LauJensen | Thats how much faster inlining is |
| 04:01 | ppppaul | huh? |
| 04:01 | ppppaul | what the hell is [_ 1e6]? |
| 04:01 | LauJensen | &1e6 |
| 04:01 | sexpbot | ⟹ 1000000.0 |
| 04:01 | ppppaul | oh |
| 04:01 | ppppaul | and _? |
| 04:01 | LauJensen | and _ is my way of saying that an argument goes there, but Im disregarding it |
| 04:01 | ppppaul | &[_ 1e6[ |
| 04:01 | sexpbot | java.lang.Exception: EOF while reading |
| 04:01 | LauJensen | &(dotimes [i 5] (print i " ")) |
| 04:01 | sexpbot | ⟹ 0 1 2 3 4 nil |
| 04:02 | ppppaul | &[_ 1e6]] |
| 04:02 | sexpbot | java.lang.Exception: Unable to resolve symbol: _ in this context |
| 04:02 | ppppaul | &[_ 1e6] |
| 04:02 | sexpbot | java.lang.Exception: Unable to resolve symbol: _ in this context |
| 04:02 | ppppaul | oh |
| 04:03 | ppppaul | &(dotimes [i 1000] (print i " ")) |
| 04:03 | sexpbot | ⟹ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77... http://gist.github.com/663802 |
| 04:03 | LauJensen | Raynes: Can you make the gist include the expression and the caller ? |
| 04:04 | Raynes | LauJensen: I don't see why not. |
| 04:04 | ppppaul | not sure |
| 04:04 | LauJensen | Raynes: Great |
| 04:04 | ppppaul | (doc dotimes) |
| 04:04 | clojurebot | "([bindings & body]); bindings => name n Repeatedly executes body (presumably for side-effects) with name bound to integers from 0 through n-1." |
| 04:05 | ppppaul | &(dotimes [10] (+ 1 3)) |
| 04:05 | sexpbot | java.lang.IllegalArgumentException: dotimes requires exactly 2 forms in binding vector |
| 04:05 | ppppaul | &(dotimes [n 10] (+ 1 3)) |
| 04:05 | sexpbot | ⟹ nil |
| 04:05 | ppppaul | &(dotimes [n 1e9] (+ 1 3)) |
| 04:05 | sexpbot | ⟹ nil |
| 04:05 | ppppaul | &1e9 |
| 04:05 | sexpbot | ⟹ 1.0E9 |
| 04:06 | ppppaul | &(dotimes [n 1e99] (+ 1 3)) |
| 04:06 | sexpbot | java.lang.IllegalArgumentException: Value out of range for int: 9223372036854775807 |
| 04:06 | ppppaul | out of range? |
| 04:06 | ppppaul | thought that we were allowed to have big numbers in clojure |
| 04:06 | ppppaul | &1e99 |
| 04:06 | sexpbot | ⟹ 1.0E99 |
| 04:06 | LauJensen | &(clojure-version) |
| 04:06 | sexpbot | ⟹ "1.2.0" |
| 04:07 | ppppaul | &(* 1e99 1e200) |
| 04:07 | sexpbot | ⟹ 9.999999999999999E298 |
| 04:07 | LauJensen | Ah, ppppaul dotimes is using a primitive int for the loop, it cant overflow |
| 04:07 | LauJensen | ~source dotimes |
| 04:07 | ppppaul | (doc dotimes) |
| 04:07 | clojurebot | "([bindings & body]); bindings => name n Repeatedly executes body (presumably for side-effects) with name bound to integers from 0 through n-1." |
| 04:07 | ppppaul | oh |
| 04:08 | ppppaul | &(/ 1e99324234234 1e20234234240) |
| 04:08 | sexpbot | ⟹ NaN |
| 04:08 | ppppaul | &(* NaN NaN) |
| 04:08 | sexpbot | java.lang.Exception: Unable to resolve symbol: NaN in this context |
| 04:08 | ppppaul | all this nan is making me hungry |
| 04:09 | Raynes | Oh. Line numbers are included in metadata. |
| 04:09 | ppppaul | yeah |
| 04:09 | Raynes | That's useful. |
| 04:09 | ppppaul | &(meta (val meta)) |
| 04:09 | sexpbot | java.lang.ClassCastException: clojure.core$meta cannot be cast to java.util.Map$Entry |
| 04:09 | ppppaul | &(meta meta) |
| 04:09 | sexpbot | ⟹ {:line 182} |
| 04:10 | ppppaul | &(meta #'meta) |
| 04:10 | sexpbot | ⟹ {:ns #<Namespace clojure.core>, :name meta, :file "clojure/core.clj", :line 178, :arglists ([obj]), :doc "Returns the metadata of obj, returns nil if there is no metadata.", :added "1.0"} |
| 04:10 | ppppaul | yo, what's the diff between #' and (val)??? |
| 04:10 | Raynes | There isn't one. |
| 04:10 | Raynes | I mean, the first one is a reader macro. |
| 04:10 | Raynes | But it does essentially the same thing. |
| 04:11 | ppppaul | my code says otherwise |
| 04:11 | ppppaul | &(meta (val meta)) |
| 04:11 | sexpbot | java.lang.ClassCastException: clojure.core$meta cannot be cast to java.util.Map$Entry |
| 04:11 | ppppaul | &(meta #'meta) |
| 04:11 | sexpbot | ⟹ {:ns #<Namespace clojure.core>, :name meta, :file "clojure/core.clj", :line 178, :arglists ([obj]), :doc "Returns the metadata of obj, returns nil if there is no metadata.", :added "1.0"} |
| 04:12 | ppppaul | &^meta |
| 04:12 | sexpbot | java.lang.Exception: EOF while reading |
| 04:12 | Raynes | val != var |
| 04:12 | ppppaul | oh shit |
| 04:12 | Raynes | &(meta (var meta)) |
| 04:12 | sexpbot | ⟹ {:ns #<Namespace clojure.core>, :name meta, :file "clojure/core.clj", :line 178, :arglists ([obj]), :doc "Returns the metadata of obj, returns nil if there is no metadata.", :added "1.0"} |
| 04:12 | ppppaul | &(meta (var meta)) |
| 04:12 | sexpbot | ⟹ {:ns #<Namespace clojure.core>, :name meta, :file "clojure/core.clj", :line 178, :arglists ([obj]), :doc "Returns the metadata of obj, returns nil if there is no metadata.", :added "1.0"} |
| 04:12 | ppppaul | (doc val) |
| 04:12 | clojurebot | "([e]); Returns the value in the map entry." |
| 04:12 | ppppaul | hmmmm |
| 04:13 | ppppaul | &(val (meta (var meta))) |
| 04:13 | sexpbot | java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry |
| 04:14 | ppppaul | &(val :doc (meta (var meta))) |
| 04:14 | sexpbot | java.lang.IllegalArgumentException: Wrong number of args (2) passed to: core$val |
| 04:14 | ppppaul | how would i use 'val'? |
| 04:15 | ppppaul | it would be really great if the documentation had examples |
| 04:16 | Raynes | &(val (first {:one :two})) |
| 04:16 | sexpbot | ⟹ :two |
| 04:16 | Raynes | clojuredocs.org has examples |
| 04:18 | ppppaul | thanks a lot! |
| 04:19 | ppppaul | :D |
| 04:21 | ppppaul | clojuredocs is awesome! |
| 04:22 | ppppaul | &:doc (meta #'meta) |
| 04:22 | sexpbot | ⟹ :doc |
| 04:27 | Raynes | pppaul: Wrap it in parens. |
| 04:27 | ppppaul | &(:doc (meta #'meta)) |
| 04:27 | sexpbot | ⟹ "Returns the metadata of obj, returns nil if there is no metadata." |
| 04:27 | clojurebot | You don't have to tell me twice. |
| 04:34 | Raynes | LauJensen: Man, you've got me staying up all late now. |
| 04:34 | LauJensen | Sure, blame it on the european guy |
| 04:34 | Raynes | You tell me to add one thing and I end up adding two things, and the next thing you know, it's nearly 4AM. |
| 04:35 | LauJensen | What did you add? |
| 04:35 | Raynes | I'm adding a source command. |
| 04:35 | LauJensen | great, when you're done, upgrade to 1.3-alpha-2 |
| 04:35 | Raynes | No way man. |
| 04:36 | Raynes | It's too late for such antics. |
| 04:36 | Raynes | I'll upgrade when 1.3 is official, because I have about 6 million dependent libraries to update along with it. |
| 04:36 | Raynes | LauJensen: https://gist.github.com/663825 This what you had in mind? |
| 04:37 | LauJensen | Yea exactly |
| 04:37 | clojurebot | It's greek to me. |
| 04:37 | Raynes | Awesome. |
| 04:38 | LauJensen | If you want to get really fancy, make it insert an \n for every 80 characters :) |
| 04:38 | LauJensen | But other than that, good work :) |
| 04:38 | Raynes | That's a good idea. Too bad gist can't word-wrap. |
| 04:41 | Raynes | ...... |
| 04:41 | Raynes | (-> "println" symbol resolve meta :line) |
| 04:41 | Raynes | I was testing with println, and I hardcoded it. |
| 04:42 | Raynes | Sat here for the past 5 minutes wondering why I was getting the same link every time. |
| 04:43 | l_a_m | hi |
| 04:44 | LauJensen | Raynes: When you reach that point, sleep is required |
| 04:44 | l_a_m | which library can i use in a CL project to use the GAE framework ? |
| 04:44 | LauJensen | ,google clojure GAE framework |
| 04:44 | clojurebot | java.lang.Exception: Unable to resolve symbol: google in this context |
| 04:44 | LauJensen | ~google clojure GAE framework |
| 04:44 | clojurebot | First, out of 11900 results is: |
| 04:44 | clojurebot | Clojure Games |
| 04:44 | clojurebot | http://clojure-games.org/ |
| 04:44 | l_a_m | i see appengine-magic, appengine.clj, ... |
| 04:45 | Raynes | LauJensen: I agree. |
| 05:10 | Raynes | LauJensen: Your requested functionality is in the live sexpbot now. We also have a $source command now. |
| 05:11 | LauJensen | $source apply |
| 05:11 | sexpbot | http://is.gd/gJZeN |
| 05:11 | Raynes | Also, sexpbot has a $google command, for future reference. |
| 05:11 | LauJensen | Excellent, great job Raynes, and in record time |
| 05:11 | LauJensen | While you were busy I've almost implement ClojureQL as relational algebra, its astoundingly awesome |
| 05:11 | Raynes | Thank you. Now it's Raynes's sleepy time. |
| 05:12 | LauJensen | Good night |
| 05:12 | Raynes | Cute. |
| 05:12 | Raynes | By the way, I didn't implement the inserting newlines functionality yet. I or amalloy will get that tomorrow. |
| 05:13 | LauJensen | (apply str (-> col (partition 80) (interpose "\n"))) right? |
| 05:13 | Raynes | $mail Make the clojure plugin's 'trim' function insert newlines every 80 characters when gisting truncated results. I want it on my desk by 8:00pm. |
| 05:13 | sexpbot | Message saved. |
| 05:13 | Raynes | Indeed. |
| 05:13 | Raynes | Too tired. |
| 05:13 | Raynes | Good night, kind sir. <3 |
| 05:13 | LauJensen | Sleep tight :) |
| 05:21 | Raynes | I just realized that I mailed a user named 'Make' rather than amalloy. Excuse me while I correct my tired mistake. |
| 05:21 | Raynes | $mail amalloy Make the clojure plugin's 'trim' function insert newlines every 80 characters when gisting truncated results. I want it on my desk by 8:00pm. |
| 05:21 | sexpbot | Message saved. |
| 05:24 | octe | i'm trying to find some kind of memory leak in my clojure application.. it'll run fine for a while but after leaving it for a day or so it'll use up all of it's heap |
| 05:24 | octe | i did a dump now when it's full and there's an insane amount of instances of class clojure.lang.PersistentHashMap |
| 05:30 | octe | seems to be related to Vars.. |
| 05:38 | octe | the leakage should be caused by this, or the callback it call: http://paste.lisp.org/display/116260 |
| 05:38 | octe | is there anything obviously wrong with that method? |
| 05:38 | octe | function |
| 05:47 | octe | except that the file isn't being closed.. hm |
| 05:47 | octe | is the combination of make-local-variables and recursing a bad idea? |
| 06:28 | bsteuber | hi |
| 06:29 | bsteuber | using clojure.java.sh seems to have clojure hang after finishing |
| 06:29 | bsteuber | could anyone try https://gist.github.com/663939 on his computer? |
| 06:30 | bsteuber | and tell me whether the program stops after printing the contents |
| 06:32 | yonatan_ | bsteuber: it works ok for me |
| 06:32 | bsteuber | I'm using snow leapard with clojure 1.2.0 |
| 06:33 | bsteuber | and get like 10 seconds hang after it's done |
| 06:33 | yonatan_ | using Clojure 1.2.0-master-SNAPSHOT on linux. no delay here. |
| 06:34 | bsteuber | ok, so seems to be a mac-only problem |
| 06:35 | bsteuber | it's annoying my for a while now - first thought it'd be leiningen's fault |
| 06:36 | bsteuber | any mac users out there to confirm/deny? |
| 06:45 | mrBliss` | bsteuber: I'll try it in a sec |
| 06:45 | rdsr | bsteuber, the same happens for me too |
| 06:45 | rdsr | mines a mac 10.5.8 |
| 06:45 | rdsr | I guess its a leopard |
| 06:46 | bsteuber | actually, it doesn't happen with 1.2.0-master-SNAPSHOT |
| 06:46 | bsteuber | dunno which one, though |
| 06:46 | bsteuber | so seems to have sneaked in during a newer change |
| 06:47 | rdsr | hmmm |
| 06:48 | mrBliss` | It returns immediately on my machine, 1.2 on Snow Leopard via Emacs |
| 06:50 | bsteuber | mrBliss`: via emacs? you mean a shell-buffer? |
| 06:51 | mrBliss | bsteuber: I do it in a repl. I'll try it with java -cp ... |
| 06:51 | rdsr | wierd it returns immedialtely when u run it from a repl |
| 06:51 | bsteuber | yes |
| 06:52 | bsteuber | I was suspecting some sort of stream-not-flushed issue |
| 06:52 | bsteuber | but not sure |
| 06:53 | mrBliss | it prints immediately, but doesn't stop |
| 06:53 | bsteuber | ok, so same behavior |
| 06:54 | bsteuber | so it's mac-only clojure-1.2.0-only |
| 06:54 | bsteuber | and shell-only |
| 06:54 | bsteuber | I'll file a bug report then |
| 06:54 | leafw | what is the official clojure contrib git repository? There are so many online. |
| 06:55 | rdsr | bsteuber: by shell-only do u mean the shell contrib library? |
| 06:55 | mrBliss | leafw: https://github.com/clojure/clojure-contrib |
| 06:55 | mrBliss | bsteuber: it ends after +20 seconds |
| 06:56 | bsteuber | oh, even more than for me |
| 06:56 | mrBliss | the fix is: |
| 06:56 | leafw | mrBliss: thanks |
| 06:56 | mrBliss | (shutdown-agents) at the end of your file |
| 06:56 | mrBliss | sh uses futures and future uses agents under the hood |
| 06:57 | mrBliss | and (shutdown-agents) shuts down the agent thread pool |
| 06:57 | bsteuber | mrBliss: yeah, that works |
| 06:57 | rdsr | oh ok, |
| 06:57 | bsteuber | but it shoudln't be this way, should it? :) |
| 06:57 | rdsr | thks, a little bit of learning everyday :) |
| 06:58 | mrBliss | bsteuber: it's not transparent |
| 06:59 | mrBliss | it should be mentioned in the docs |
| 07:00 | bsteuber | but I think a command like sh shouldn't require a user to do cleanup - on specific operating systems only :) |
| 07:00 | mrBliss | bsteuber: I'm gonna try it on Windows now |
| 07:04 | mrBliss | Same thing happens on Windows. It's just the thread pool, platform doesn't matter. |
| 07:05 | bsteuber | ok, same with linux - so with 1.2.0 (instead of SNAPSHOT) you need to do it always |
| 07:06 | l_a_m | i've got this error : Caused by: java.lang.Exception: Unable to resolve symbol: save-entity in this context |
| 07:06 | l_a_m | but from : http://r0man.github.com/appengine-clj/appengine.datastore-api.html#appengine.datastore/save-entity |
| 07:06 | l_a_m | save-entity seems public ? |
| 07:07 | l_a_m | i put this line in my ns : (:use [appengine.datastore]) |
| 07:08 | mrBliss | aha |
| 07:08 | mrBliss | (:use [appengine datastore]) |
| 07:08 | esj | bsteuber: a little digging. clojure-1.2.0-master-20100607.150309-85.jar returns immediately, but by clojure-1.2.0-master-20100730.140143-92.jar its lagging out. Don't have any more around to check against. |
| 07:08 | mrBliss | l_a_m: lose the dot or the brackets |
| 07:11 | bsteuber | esj: ic, so I guess they might have switched to the future implementation in that time |
| 07:11 | esj | yeah |
| 07:14 | bsteuber | ah, it's that one: http://dev.clojure.org/jira/browse/CLJ-124 |
| 07:16 | bsteuber | so let's hope it'll be dealt with soon :) |
| 07:16 | bsteuber | and in the meantime I call (shutdown-agents) anywhere :) |
| 08:05 | fogus_ | LauJensen: How does your rel algebra differ from the one in clojure.set? |
| 08:05 | LauJensen | fogus_: I have no idea |
| 08:05 | fogus_ | oh |
| 08:05 | fogus_ | well then |
| 08:06 | LauJensen | fogus_: Perhaps you can take a look at my readme and tell me, if you know clojure.set |
| 08:09 | fogus_ | Well for one, yours appears to be backed by a real DB |
| 08:09 | fogus_ | ;-) |
| 08:09 | LauJensen | Yea, did you literally mean clojure.set? |
| 08:09 | LauJensen | I thought you might be aluding to some library |
| 08:10 | LauJensen | fogus_: ClojureQL is an abstraction on top of your SQL database. CQL lets you interact with that database using the primitives (not all yet) defined in the relational algrebra papers |
| 08:10 | fogus_ | I meant the relational algebra ops in the clojure.set ns (project, join, etc...) |
| 08:12 | LauJensen | I have project, join, rename (which might work differently) and select. I dont see select in theirs and rename is bound to be a little different |
| 08:17 | fogus_ | Oh, select is there |
| 08:17 | fogus_ | takes a predicate though |
| 08:18 | LauJensen | If they're both based on relational algebra, they'll pretty much being doing the same thing using the same primitive operations. The difference will be mostly in the usage and implementation. My is protocol based and useful for SQL interop. |
| 08:30 | sthuebner | LauJensen: I like you test suite! :-) |
| 09:00 | l_a_m | does someone use appengine.clj ? |
| 09:00 | l_a_m | https://github.com/r0man/appengine-clj ? |
| 10:39 | apgwoz | Raynes: awww, you're too kind. I actually did some stuff to it even! |
| 11:05 | sdeobald | Is it at all common for production deployments of clojure apps to be raw .clj files? Or is it almost always the case that folks jar up their stuff? |
| 11:14 | cemerick | pretty quiet in here today so far… |
| 11:14 | cemerick | rhickey: ping |
| 11:16 | jochen | so I say hi, I am new - here and to clojure :-) |
| 11:17 | cemerick | jochen: welcome! :-) |
| 11:18 | jochen | thank you! Could you answer me a few questions about irc? |
| 11:19 | cemerick | as best I can, sure |
| 11:20 | jochen | great! So here the first one: there is a list on the left showing about 250 users, are they all active at the moment? |
| 11:20 | cemerick | They're all connected and in the room. Obviously, they're all either lurking or busy elsewhere. |
| 11:21 | jochen | ok, nd is there a possibility to address someone directly other than typing e.g. cemerick: as the first word? |
| 11:21 | cemerick | jochen: You can see logs for this channel for the past ~3 years here: http://clojure-log.n01se.net/ |
| 11:22 | cemerick | most irc clients will highlight any message containing the user's handle anywhere (i.e. my client highlighted your last msg as directed towards me) |
| 11:22 | cemerick | but it's good practice to prefix direct addresses with handle: |
| 11:22 | jochen | yep, worked with your info about the backlog! |
| 11:23 | jochen | Can you also start a private chat? |
| 11:23 | cemerick | jochen: yes, by prefixing a message with "/msg handle <initial private msg here>" |
| 11:27 | jochen | cemerick: worked, too! Thank you for all the info! |
| 11:28 | cemerick | no problem :-) |
| 11:52 | fliebel | morning (UGT) |
| 11:55 | fliebel | I'm having a seriously wicked issue here. I figured out a function that is twice as fast as the other one, but the result is just… Slightly off, but only for a few positions. So I'm thinking I'm doing something very ureliably that overflows stuff end such, but I don't know what yet: https://gist.github.com/663096 |
| 11:58 | cemerick | fliebel: FYI, it's been *very* quiet this morning |
| 11:58 | cemerick | and now I'm taking off :-P |
| 11:58 | fliebel | okay :) |
| 11:59 | cemerick | definitely post to the list, if you haven't done so already |
| 11:59 | cemerick | Good luck, for what that's worth :-) |
| 11:59 | fliebel | yea, I did. Thanks :) |
| 12:06 | @rhickey | cemerick: pong |
| 12:07 | replaca | rhickey: think you just missed him... |
| 12:07 | @rhickey | ah |
| 12:07 | cemerick | Just on my way out… |
| 12:09 | cemerick | rhickey: This might require more discussion, but: a fair quorum of clojure dev tooling leads seems to be in basic agreement about pooling efforts to build a single (perhaps set of) libraries for backend support of such tooling. |
| 12:09 | cemerick | e.g. introspection, completion, refactoring, etc, etc |
| 12:09 | @rhickey | ok |
| 12:09 | cemerick | This seems like a perfect fit for the clojure.tools umbrella, yes? |
| 12:10 | @rhickey | yes, let's not neglect enclojure's stuff here as they were/are way ahead on e.g. context-sensitive completion |
| 12:10 | cemerick | absolutely; Eric was the first to pipe up in agreement of Meikel's initial proposal :-) |
| 12:11 | @rhickey | where is the thread? |
| 12:11 | cemerick | no public thread; it's in a reply-all round-robin at the moment |
| 12:11 | @rhickey | ugh |
| 12:11 | cemerick | seems to be the flavour of the month or something ;-) |
| 12:11 | @rhickey | not a good flavor |
| 12:12 | @rhickey | we need to stop doing that |
| 12:12 | technomancy | srsly |
| 12:12 | cemerick | yeah |
| 12:12 | cemerick | I think people are getting drawn towards that to avoid the bikeshedding :-/ |
| 12:13 | @rhickey | cemerick: that's why there's clojure-dev |
| 12:13 | cemerick | technomancy: hey Phil; are you on board with this tooling effort, and separately, the notion of it being in contrib? |
| 12:14 | technomancy | cemerick: I think it's a good idea, but it will probably be a while before Emacs can take advantage of it |
| 12:14 | cemerick | hrm, hugod should be recruited as well |
| 12:14 | technomancy | yes, definitely |
| 12:15 | cemerick | technomancy: because of the tie to the SLIME commands, etc? |
| 12:15 | @rhickey | technomancy: is not nrepl an easy path for exposing Clojure stuff to emacs/slime? |
| 12:15 | technomancy | yeah, it's harder to justify investment when much of that functionality already exists, albeit in a hacked-together way |
| 12:16 | technomancy | rhickey: long term? definitely. |
| 12:16 | cemerick | I think the common tooling effort is going to put everyone else at least on par, if not ahead of SLIME in short order. |
| 12:16 | cemerick | (or so I hope :-)) |
| 12:17 | technomancy | "broken gets fixed, but half-assed lasts forever" <= especially true of swank |
| 12:17 | @rhickey | heh |
| 12:18 | cemerick | rhickey: OK, my second question is, where might we reasonably carve out a spot for this project (/group of projects) on dev.clojure.org, so people can work on design notes, etc.? There was talk of having per-project wikis and JIRA projects (certainly my preference), but I suspect that's a ways off yet? |
| 12:19 | @rhickey | per-project Jira will definitely be the way, wiki's I think just need hierarchical nesting of some sort |
| 12:19 | @rhickey | you can put an overview page under http://dev.clojure.org/display/design/Tools |
| 12:19 | cemerick | Any reason for the latter? |
| 12:20 | @rhickey | cemerick: less admin, more interconnections between things |
| 12:20 | cemerick | i.e. it costs nothing to have as many spaces as we need |
| 12:21 | @rhickey | cemerick: I think a space for something once it's a lib makes sense, but these early discussions are prior to that level of detail |
| 12:21 | cemerick | ah, ok |
| 12:21 | cemerick | That delineation makes perfect sense. |
| 12:21 | cemerick | I thought you meant everything in one space, no matter project status. |
| 12:22 | @rhickey | there's already a data.xml space |
| 12:22 | @rhickey | and test.benchmark |
| 12:22 | cemerick | ah, hadn't been to the dashboard in a while |
| 12:23 | cemerick | yikes |
| 12:24 | @rhickey | Stu's pushing them through, new alpha soon |
| 12:24 | cemerick | nifty |
| 12:24 | cemerick | rhickey: OK, that's all I have, thanks. I'm remarkably late, gotta run; I assume you saw my last mail on the build/release stuff. If not, have a look @ http://dev.clojure.org/display/design/Common+Contrib+Build#CommonContribBuild-November3,2010%28Chas%29 |
| 12:24 | cemerick | Comments/discussion most wanted at some point. :-) |
| 12:25 | @rhickey | cemerick: will look through that, thanks! |
| 12:26 | hiredman | rhickey: does "No one should try to do any design work for async in Clojure without thoroughly understanding what Erik Meijer has done with .Net Reactive Extensions." mean the async/await/Task<T> stuff? or the push based collection stuff? |
| 12:27 | @rhickey | hiredman: the Observable abstraction first, then the map/reduce/filter duals |
| 12:27 | @rhickey | I'm concerned about a full push-based duplication of the seq lib, also the fact that the endpoint of observable is inherently non-functional |
| 12:28 | @rhickey | but understanding this gives us a shared vocabulary for discussing pros/cons |
| 12:28 | @rhickey | the composability is certainly cool |
| 12:29 | hiredman | they certainly have let the FP guys go to town |
| 12:43 | raek | anyone have a favourite link for this Erik Meijer and .Net Reactive Extensions things? |
| 13:05 | esj | raek: I came across this somehow: http://rxwiki.wikidot.com/start which seems comprehensive |
| 13:06 | raek | I'm listening to this now: http://www.hanselman.com/blog/HanselminutesPodcast198ReactiveExtensionsForNETRxWithErikMeijer.aspx |
| 13:06 | raek | an interview with the man himself |
| 13:07 | lpetit | helo |
| 13:08 | pdlogan | raek: similar or related kinds of things in java or clojure... http://www-sop.inria.fr/meije/rp/Junior/ ("JR" - Java reactive kernel) and... |
| 13:09 | pdlogan | http://intensivesystems.net/tutorials/stream_proc.html ("conduit" - streams for clojure where streams are another angle on "reactivity") |
| 13:11 | hiredman | http://dev.clojure.org/display/design/Channels |
| 13:28 | fliebel | raek: Where are those guys from? They sound Dutch... |
| 13:29 | mrBliss | fliebel: you're right http://en.wikipedia.org/wiki/Erik_Meijer_%28computer_scientist%29 |
| 13:36 | wooby | anybody know where read-lines now lives (if anywhere?) |
| 13:40 | amalloy | wooby: line-seq? |
| 13:40 | amalloy | i'm not sure what read-lines did/does, but line-seq sounds related |
| 13:44 | wooby | amalloy: cool, thanks, definitely related... read-lines just handled making a reader for you if necessary |
| 13:44 | djpowell | I wonder about retention issues when converting an observable to a sequence - I assume you'd use a blocking queue - but normally I use a bounded queue for that sort of thing to avoid runaway memory usage; but it sounds nasty to block the event firer. |
| 13:45 | amalloy | &(doc clojure.java.io/reader) |
| 13:45 | sexpbot | ⟹ "([x & opts]); Attempts to coerce its argument into an open java.io.Reader. Default implementations always return a java.io.BufferedReader. Default implementations are provided for Reader, BufferedReader, InputStream, File, URI, URL, Socket, byte arrays, character arrays, and String. If argument is ... http://gist.github.com/664517 |
| 13:45 | replaca | when I want to know what functions something has and I see that the library has autodoc which answers my question in 1 second, I feel like my life has not been entirely wasted |
| 13:45 | amalloy | wooby: ^^ |
| 13:46 | amalloy | ~source line-seq |
| 13:46 | amalloy | so line-seq requires a reader, but (reader) turns just about anything into a reader |
| 13:47 | wooby | rock on, thanks again |
| 13:47 | djpowell | you can use with-open around your reader too, as long as you don't intend to use the line-seq from it outside of that block |
| 13:48 | djpowell | &(doc with-open) |
| 13:48 | sexpbot | ⟹ "Macro ([bindings & body]); bindings => [name init ...] Evaluates body in a try expression with names bound to the values of the inits, and a finally clause that calls (.close name) on each name in reverse order." |
| 13:48 | technomancy | I think read-lines wasn't promoted because its laziness would lead to a resource leak |
| 13:51 | djpowell | clojure.diff looks cool, but diffing vectors and sequences by comparing elements at identical positions seems a bit meh - that isn't what diff does |
| 13:52 | djpowell | would anyone be interested in a version that is more diff-ish? |
| 13:53 | replaca | djpowell: what do you mean by "more diffish" here? |
| 13:54 | djpowell | [1 2 3] and [2 3 4] -> [1] [2 3] [4] |
| 13:54 | djpowell | http://www.ics.uci.edu/~eppstein/161/960229.html |
| 13:54 | djpowell | use a longest common subsequence algorithm |
| 13:55 | wooby | that would be fun to implement |
| 13:55 | djpowell | i've got one |
| 13:55 | djpowell | ie match the sequences so that they have the maximal number of matches, whilst staying in order |
| 13:55 | replaca | djpowell: you might want to propose that on the list and show how it differs/is uperior to what we have |
| 13:57 | replaca | esp. for test output |
| 13:58 | replaca | then maybe we could have an "improved" clojure.diff before 1.3 |
| 13:58 | djpowell | hmm, there are pros and cons |
| 13:59 | djpowell | it might be closer to what people might want, but in some cases (vectors as tuples) it might not; and it uses a bit of memory |
| 13:59 | replaca | mmm, I see |
| 14:02 | fliebel | where's the docs for clojrue.diff? |
| 14:03 | apgwoz | ls |
| 14:03 | apgwoz | err... |
| 14:03 | djpowell | ah |
| 14:03 | djpowell | clojure.data/diff |
| 14:04 | djpowell | &(doc clojure.data/diff) |
| 14:04 | sexpbot | java.lang.Exception: Unable to resolve var: clojure.data/diff in this context |
| 14:06 | fliebel | &(require 'clojure.data) |
| 14:06 | sexpbot | java.io.FileNotFoundException: Could not locate clojure/data__init.class or clojure/data.clj on classpath: |
| 14:08 | Lajla | ,(range 20) |
| 14:08 | clojurebot | Lajla: Gabh mo leithscéal? |
| 14:08 | Lajla | ->(range 20) |
| 14:08 | sexpbot | ⟹ (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) |
| 14:09 | Lajla | (map (fn [x] '(I worship your shadow)) (range 20)) |
| 14:09 | amalloy | clojurebot: lolwhat. that was not a hard question |
| 14:09 | Lajla | ->(map (fn [x] '(I worship your shadow)) (range 20)) |
| 14:09 | clojurebot | Excuse me? |
| 14:09 | sexpbot | ⟹ ((I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship your shadow) (I worship ... http://gist.github.com/664543 |
| 14:09 | Lajla | amalloy, they made him ignore me. =( |
| 14:09 | Lajla | Because they hate me. |
| 14:09 | Lajla | Because I'm the second best programmer int he world, right behind the Microsoft Chief Software Architect. |
| 14:09 | amalloy | Lajla: given what you just made sexpbot do i can see why |
| 14:10 | Kad_k_LaP | ,(range 20) |
| 14:10 | clojurebot | (0 1 2 3 4 5 6 7 8 9 ...) |
| 14:10 | Lajla | amalloy, I wanted to know if map was caleld map in clojure, that's all. |
| 14:10 | Lajla | They dislike me because I use 'I worship your shadow' all the time in my testing. |
| 14:11 | hiredman | Lajla tends to spam, so I have him on ignore, and since he liked to make clojurebot say weird things I have clojurebot ignore him |
| 14:11 | amalloy | Lajla: because it's annoying channel spam. if you want to test things verbosely, just /msg sexpbot |
| 14:11 | kzar | How do you view documentation for something at the REPL? |
| 14:11 | amalloy | hiredman: yeah i'm inclined to agree |
| 14:11 | amalloy | kzar: (doc something) |
| 14:12 | Lajla | amalloy, I will not bend the glory of His Shadow to accomodate your wretched human imperfections. |
| 14:12 | kzar | amalloy: Is there anything else? Dumb example but I didn't know what sets where earlier and I tried (doc #{}) and didn't get much |
| 14:12 | Lajla | Train more by searching for waldo. |
| 14:13 | raek | kzar: reader syntax is documented at http://clojure.org/reader |
| 14:13 | djpowell | kzar: no there isn't any online help for things like that - clojure.org is probably the best bet |
| 14:14 | kzar | OK, good to know thanks |
| 14:14 | fliebel | kzar: also check the page on special forms. |
| 14:14 | raek | but for everything that is something that is contained in a var, you should be able to use doc |
| 14:15 | fliebel | or find-doc if you don't know the name. But this poses somewhat of a recursive problem, since I keep forgetting whether it's doc-find or find-doc. I could of course use doc-find or find-doc to find out, but then I need to... |
| 14:16 | amalloy | fliebel: (try (doc-find foo) (catch Exception _ (find-doc foo))) - problem solved |
| 14:16 | replaca | fliebel: I recommend putting a post it on your monitor |
| 14:17 | fliebel | amalloy: Or define an alias, so both work :) |
| 14:17 | kzar | heh I'm glad I'm not the only one who can never remember stuff like that |
| 14:17 | amalloy | kzar: nth is my weak spot |
| 14:18 | Kad_k_LaP | ->,(range 20) |
| 14:18 | sexpbot | ⟹ (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) |
| 14:18 | Kad_k_LaP | &(range 20) |
| 14:18 | sexpbot | ⟹ (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) |
| 14:18 | amalloy | i always try &|(nth 10 (range 20))|& instead of &|(nth (range 20) 10)|& |
| 14:18 | sexpbot | (nth 10 (range 20)) java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Number |
| 14:18 | sexpbot | (nth (range 20) 10) ⟹ 10 |
| 14:18 | fliebel | amalloy: I only keep forgetting whether it's seq or number first. |
| 14:19 | kzar | Emacs tells you when you're typing it though |
| 14:20 | amalloy | kzar: yeah, but i'm so sure it's (nth n coll) that i don't even look at the eldoc |
| 14:20 | amalloy | it's a tough nut to crack |
| 14:22 | fliebel | amalloy: I think it's bad UI design. Only when you think about the implications for looping, apply and partials you realize it makes sense. |
| 14:22 | kzar | amalloy: Yea I guess it's deeply ingrained the wrong way around. Two ways to get past that: associate the wrong way with pain, like do something painful when you get it wrong. Another less insaine idea is to just keep typing it the right way over and over until that way is ingrained more |
| 14:23 | amalloy | hahaha |
| 14:23 | fliebel | It should be called nth-of, then it instantly makes sense to put the coll first. |
| 14:23 | amalloy | i definitely need more self-mutilation in my life, kzar |
| 14:23 | kzar | heh |
| 14:25 | amalloy | fliebel: wow you're right, it does |
| 14:25 | Raynes | apgwoz: Ping. |
| 14:25 | apgwoz | Raynes: Pong. |
| 14:26 | apgwoz | what's up? |
| 14:26 | Raynes | apgwoz: I'm looking over your changes. Fun stuff. |
| 14:26 | Raynes | I mostly want to think you for fixing my abomination of a css file. |
| 14:26 | apgwoz | indeed. |
| 14:26 | apgwoz | haha |
| 14:26 | Raynes | thank* |
| 14:26 | Raynes | :> |
| 14:26 | apgwoz | there's still some stuff to do of course |
| 14:26 | fliebel | amalloy: And we should have something like .bashrc to set your own aliases like this. Maybe I'm going to add this to cake. |
| 14:27 | apgwoz | but, *i* think it looks better than before. ymmv |
| 14:27 | Kad_k_LaP | (defalias nth-of nth) |
| 14:27 | fliebel | s/I'm going/should sometime/ |
| 14:27 | sexpbot | <fliebel> amalloy: And we should have something like .bashrc to set your own aliases like this. Maybe should sometime to add this to cake. |
| 14:27 | Raynes | I'm going to throw it into a branch and look at it in a second. |
| 14:27 | Raynes | Anyways, thanks for taking an interest in this! |
| 14:27 | amalloy | fliebel: does user.clj still work? |
| 14:27 | apgwoz | no problem! |
| 14:27 | Kad_k_LaP | ,(defalias nth-of nth) |
| 14:27 | clojurebot | java.lang.Exception: Unable to resolve symbol: defalias in this context |
| 14:27 | Kad_k_LaP | :P |
| 14:28 | fliebel | amalloy: user.clj? |
| 14:28 | replaca | defalias is in contrib |
| 14:28 | fliebel | Kad_k_LaP: I think that floats around in contirb |
| 14:28 | replaca | user.clj lets you run your own funcs before it starts the repl |
| 14:28 | fliebel | And again, I'm to slow :( |
| 14:28 | pppaul | can someone tell me the difference in using slime-repl from the normal one in lisp? |
| 14:28 | pppaul | emacs* |
| 14:29 | Kad_k_LaP | fliebel: practically everything I think of for clojure already exists :P |
| 14:29 | alpheus | pppaul: what's the normal repl? |
| 14:29 | clojurebot | whose job is<reply>that is ssideris_s job |
| 14:29 | Kad_k_LaP | fliebel: the number of libraries is quite nice :) |
| 14:30 | Raynes | apgwoz: Oh man! This is very pretty. |
| 14:30 | pppaul | the non-slime one |
| 14:30 | Raynes | I *love* the Clojuresque colors. |
| 14:30 | fliebel | Is there anything like PEP's for Clojure? |
| 14:30 | apgwoz | Raynes: I think it makes sense to tie it together as much as possible. |
| 14:31 | Raynes | apgwoz: It's exactly what I'm aiming for. |
| 14:31 | Kad_k_LaP | fliebel: I think we will need something like that :) |
| 14:31 | apgwoz | Raynes: cool! |
| 14:31 | fliebel | Kad_k_LaP: I agree |
| 14:32 | apgwoz | i'm planning to continue tweaking, make it a bit more pretty and clean up the text in the tutorial area. |
| 14:32 | Kad_k_LaP | ə |
| 14:32 | Raynes | apgwoz: Keep me posted, and let me know when you want me to pull with a pull req or whatever. |
| 14:32 | apgwoz | Raynes: sure thing |
| 14:32 | apgwoz | might get a chance to do more this weekend, but most likely sometime next week, unfortunately. |
| 14:32 | replaca | fliebel: remind me what PEPs are again. Design docs for Python? |
| 14:33 | Raynes | apgwoz: No hurry. It's more than has been done in quite a while. ;) |
| 14:33 | Kad_k_LaP | something like RFC's for Python if I'm correct |
| 14:33 | amalloy | replaca: more like style standards, i thought? i guess google would know |
| 14:33 | amalloy | $google pep python |
| 14:33 | sexpbot | First out of 24500 results is: PEP Index - Python |
| 14:33 | sexpbot | http://www.python.org/dev/peps/ |
| 14:33 | Kad_k_LaP | $google define:pep |
| 14:33 | sexpbot | First out of results is: |
| 14:34 | apgwoz | Raynes: I did have a problem this morning when working on it though. Had all sorts of security errors. It wasn't until I commented out the sandbox stuff that it actually worked. |
| 14:34 | kzar | The PEP's seem to be quasi-religious documents they always refer to |
| 14:34 | apgwoz | do you have a policy file that will force it to work? |
| 14:34 | replaca | I thought fliebel might tell us, casue that would also help us know in what sense he meant it |
| 14:34 | Raynes | apgwoz: Yeah. I should have mentioned that. |
| 14:34 | kzar | there's a PEP for style that people talk about a lot, there's a bunch of other ones too |
| 14:34 | amalloy | apgwoz: there's a policy file in sexpbot which you could use |
| 14:34 | amalloy | if tryclojure doesn't have one |
| 14:34 | Kad_k_LaP | so PEP's are really like RFC's |
| 14:35 | Raynes | apgwoz: Right, use example.policy in sexpbot. I'll add it to the tryclojure repository and to the readme. |
| 14:35 | Kad_k_LaP | they are proposed, discussed and remain as a reference |
| 14:35 | apgwoz | Raynes, amalloy: appreciated. |
| 14:36 | replaca | well Clojure is less formal still, being younger, but design discussion is happening here: http://dev.clojure.org/display/design/Home |
| 14:36 | Kad_k_LaP | it's really just going from toy to big tool |
| 14:36 | clojurebot | Titim gan éirí ort. |
| 14:36 | Kad_k_LaP | at least it's not seen as a toy language any more by practically any article |
| 14:38 | fliebel | Sorry, was afk, PEP is Pythen Enhancement Proposal. |
| 14:40 | fliebel | There are thousands of them, ranging from "I wan this to be in Python" to features that made it into Python, to PEP 8: style guid to PEP 20, zen of Python. which are sortof the 10 commandments for Python. |
| 14:41 | Raynes | apgwoz: https://github.com/Raynes/tryclojure/wiki/Running-Tryclojure |
| 14:41 | fliebel | Can anyone submit stuff to the design space, or only Clojure devs? |
| 14:41 | Kad_k_LaP | like bug 1 in Ubuntu's bugtracker :P |
| 14:41 | fliebel | Kad_k_LaP: Is that the "Windows majority" thing? |
| 14:42 | Kad_k_LaP | fliebel: exactly |
| 14:47 | amalloy | reassign the bug to windows vista? he seems to be taking care of it |
| 14:48 | rickmode | Trying to wrap my head around binding vs. with-bindings. What is the intended usage of with-bindings? |
| 14:59 | replaca | with-bindings works when you don't have a priori static knowledge of what things yuo're going to bind |
| 14:59 | replaca | rickmode: almost always you should use binding |
| 15:00 | rickmode | replaca: i'm getting that... i know it's an unusual subtly. I'm really trying to nail down def, set!, binding and with-bindings in my head. |
| 15:04 | replaca | rickmode: except for the syntax difference, the two perform the exact same function |
| 15:05 | replaca | within that hierarchy |
| 15:05 | replaca | and you can think of them essentially as stack pushes (thread-local) on def'ed vars |
| 15:11 | rickmode | replaca: given (declare *v*), (binding [*v* 1] *v*) works, but (with-bindings [*v* 1] *v*) fails with *v* unbound |
| 15:14 | pppaul | can someone give me an example of how to use cond-let? |
| 15:14 | pppaul | (clojure.contrib.cond/cond-let [a 3, b 4, c 5] ((< a b c)("true") :else ("false"))) |
| 15:15 | replaca | yeah, really you should do a def before doing either kind of bind |
| 15:15 | pppaul | &(clojure.contrib.cond/cond-let [a 3, b 4, c 5] ((< a b c) "true" :else "false")) |
| 15:15 | sexpbot | java.lang.ClassNotFoundException: clojure.contrib.cond |
| 15:15 | pppaul | &(symbol cond-let) |
| 15:15 | sexpbot | java.lang.Exception: Unable to resolve symbol: cond-let in this context |
| 15:15 | rickmode | replaca: i realize i'm using a vector with-binding instead of a map |
| 15:16 | pppaul | &(doc cond-let) |
| 15:16 | sexpbot | java.lang.Exception: Unable to resolve var: cond-let in this context |
| 15:16 | kzar | I saw some Java that used 8000f , what does that mean? |
| 15:16 | replaca | rickmode: I don't think that declare guarantees a root binding - it's meant for forward refs |
| 15:16 | amalloy | pppaul: it does all the tests first |
| 15:17 | pppaul | hmmm |
| 15:17 | pppaul | why wouldn't it bind the local vars first? |
| 15:18 | amalloy | user=> (cond-let [[a b]] [1 2 3] b) |
| 15:18 | amalloy | 2 |
| 15:18 | rickmode | replaca: My example was bad. You were correct, however the usage of with-bindings is like this: (declare *v*) (with-bindings {#'*v* 1} *v*) |
| 15:19 | pppaul | ok thanks |
| 15:19 | amalloy | ie, it iterates through the tests, binding the first one that is non-nil, and then evaluates the associated expr with the binding |
| 15:19 | pppaul | that is sorta confusing |
| 15:20 | amalloy | well, don't use cond-let then. i don't have a need for it myself, but presumably someone finds this behavior useful |
| 15:21 | amalloy | what's the form you were hoping cond-let would simplify for you? |
| 15:21 | pppaul | (let ... (cond |
| 15:22 | amalloy | eh. that really only saves like five characters; the cond-let behavior lets you quickly express a more complex concept |
| 15:23 | pppaul | ;) |
| 15:28 | pppaul | &(reduce + (range 1e4)) |
| 15:28 | sexpbot | ⟹ 49995000 |
| 15:28 | pppaul | &(reduce + (range 1e8)) |
| 15:28 | sexpbot | ⟹ 4999999950000000 |
| 15:29 | pppaul | &(time (reduce + (range 1e8))) |
| 15:30 | sexpbot | ⟹ "Elapsed time: 7872.037 msecs" 4999999950000000 |
| 15:32 | pppaul | (doc doall) |
| 15:32 | clojurebot | "([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time." |
| 15:38 | replaca | rickmode: right. still, I'm not sure you can rely on declare providing a root binding for you. As it turns out, it currently does, but that's more of an implementation detail. |
| 15:40 | kzar | Is it normal to quite often get "Evaluation aborted." without any clues when trying things? |
| 15:40 | AWizzArd | kzar: type: *e |
| 15:40 | rickmode | replaca: you're right. (declare foo) leaves foo unbound. That can be good if one intends foo to *always* be used within a binding, I guess. |
| 15:40 | rickmode | would cause an exception |
| 15:41 | kzar | AWizzArd: Cool thanks |
| 16:00 | seancorfield | ,(declare foo) |
| 16:00 | clojurebot | DENIED |
| 16:00 | seancorfield | ->(declare foo) |
| 16:00 | sexpbot | java.lang.SecurityException: Code did not pass sandbox guidelines: (def) |
| 16:00 | seancorfield | heh, ok, i'll stick to the repl... |
| 16:01 | seancorfield | i was curious whether the bots were running a recent enough version to show the new/recent Unbound var behavior |
| 16:01 | seancorfield | ,(clojure-version) |
| 16:01 | clojurebot | "1.2.0" |
| 16:01 | seancorfield | ->(clojure-version) |
| 16:01 | sexpbot | ⟹ "1.2.0" |
| 16:01 | seancorfield | and that answers that :) |
| 16:02 | seancorfield | not sure when it changed but (declare foo) (type foo) -> clojure.lang.Var$Unbound on 1.3.0-master-SNAPSHOT |
| 16:05 | rata_ | hi all |
| 16:09 | seancorfield | question about doall... |
| 16:10 | seancorfield | according to the source, it looks like (doall 1 some-lazy-seq) should only realize the first element and leave the rest unrealized |
| 16:10 | seancorfield | but if i do (def foo (doall 1 (map println [1 2 3 4 5 6]))) it prints all 6 elements |
| 16:10 | seancorfield | this definition prints none of them as expected (def foo (map println [1 2 3 4 5])) |
| 16:11 | seancorfield | ah, it's chunking... |
| 16:11 | seancorfield | (def foo (doall 1 (map println (range 100)))) prints 0..31 |
| 16:12 | hiredman | https://github.com/hiredman/die-geister ;; async task library |
| 16:14 | cemerick | seancorfield: you *almost* don't have to worry about chunking ;-) |
| 16:20 | seancorfield | cemerick: thanx, i'll try to *almost* remember that :) |
| 16:22 | seancorfield | btw, who is responsible for this page: http://clojure.org/contributing - i wonder if my surname can be corrected (to remove the 'n')? |
| 16:23 | cemerick | seancorfield: I think only Rich can change that. |
| 16:23 | seancorfield | also, how long does it normally take for applications to join clojure-dev to be approved? |
| 16:23 | seancorfield | thanx cemerick - makes sense |
| 16:24 | seancorfield | i'm just curious... not pushing... i'm a bit busy with 50 web site launches right now so, unfortunately, clojure is taking a back seat until i get those out.. |
| 16:24 | cemerick | seancorfield: you mean the ML? |
| 16:24 | seancorfield | yup |
| 16:24 | cemerick | Shouldn't take long at all. chouser might be able to help there. |
| 16:24 | seancorfield | once i saw i was listed on the contributing page, i applied to join the mailing list |
| 16:24 | clojurebot | http://clojure.org/contributing |
| 16:25 | cemerick | clojurebot's tourette's seems to have gotten worse of late :-P |
| 16:25 | amalloy | yeah |
| 16:25 | amalloy | clojurebot: shut up |
| 16:25 | clojurebot | No entiendo |
| 16:26 | amalloy | damn. i think he has a shut up command, but i guess it's for privileged users? |
| 16:26 | hiredman | when I reimplemented it, I may not have used the same percentage chance |
| 16:27 | cemerick | hiredman: did his brain get wiped at some point? There are a bunch of things that he seems to have forgotten about from early on. |
| 16:27 | hiredman | uh, I don't think so |
| 16:27 | cemerick | huh, ok |
| 16:27 | hiredman | there may be some commands that haven't been re-implemented yet |
| 16:28 | hiredman | (like shut up) |
| 16:28 | hiredman | (which I think amalloy was the first to try and use) |
| 16:29 | amalloy | yeah, i only knew about it since i found it when i was looking through the source to fix his "source" factoid |
| 16:30 | hiredman | bumped the random response from 1/200 to 1/1000 |
| 16:31 | rata_ | some days ago one person (I don't remember who) pointed out that lazyness could be the culprit of another person's performance problem because of the overhead lazyness involves... is this so? is the overhead of lazyness noticeable? is it right to abuse of lazy seqs? |
| 16:31 | cemerick | hiredman: thanks; FWIW, I was just idly whining more than anything else :-) |
| 16:32 | hiredman | I had noticed it too, and was planning to change it, but just hadn't yet |
| 16:47 | rata_ | nobody wants to make me feel better saying "don't worry, lazyness isn't involves a noticeable overhead, use it as much as you want"? :) |
| 16:49 | amalloy | rata_: i don't know about laziness's overhead, but your head will hurt less if you use laziness. it's hard not to in clojure |
| 16:50 | defn | im a mvn noob -- can anyone help me out with getting https://github.com/bgruber/lazytest-listen to build? It's comaplining that com.stuartsierra.lazytest is not on my classpath -- i grabbed a recent version of the lazytest jar that ninjudd put out on clojars inside the lazytest-listen directory, but im not sure how to point at it, and im also not sure if I need to edit something other than the pom.xml dependency which points at com.stuartsierra... Any help is |
| 16:54 | arohner | is there a way to get set behavior in a datastructure that preserves insertion order? |
| 16:55 | arohner | basically, a vector that doesn't contain duplicates |
| 16:55 | amalloy | defn: it should be downloading the dependency automatically |
| 16:56 | arohner | oh, (distinct my-vector) |
| 16:56 | amalloy | arohner: beat me to it |
| 16:57 | amalloy | defn: have you run mvn compile? |
| 16:57 | defn | only mvn install amalloy |
| 16:58 | arohner | find-doc is my friend |
| 16:58 | defn | Compiling com.iheardata.lazytest-listen.harmony to /Users/defn/src/lazytest-listen/target/classes |
| 16:58 | defn | Exception in thread "main" java.io.FileNotFoundException: Could not locate com/stuartsierra/lazytest/watch__init.class or com/stuartsierra/lazytest/watch.clj on classpath: (harmony.clj:1) |
| 16:59 | cemerick | defn: if it can't find some class, the dependencies in the pom are borked |
| 16:59 | cemerick | would help more, but gotta run, sorry :-( |
| 17:02 | amalloy | defn: it looks like listen wants version 1.0 of lazytest, and stuart is up to 1.2 |
| 17:04 | amalloy | 1.2 dpesm |
| 17:04 | amalloy | er |
| 17:05 | amalloy | 1.2 doesn't seem to have the file that listen is looking for - |
| 17:06 | amalloy | i'm not so hot at maven myself, so that's the best i can do for you |
| 17:08 | ymasory | what's the index-of function for vectors? |
| 17:11 | defn | amalloy: so do i need to find 1.0 and specify it manually? or what? |
| 17:12 | amalloy | defn: i don't know actually |
| 17:13 | amalloy | it looks like it found 1.0 okay on my machine, and that doesn't have the function he wants either |
| 17:13 | amalloy | so... |
| 17:13 | amalloy | ymasory: why would you want that? |
| 17:14 | ymasory | amalloy: i know it's not beautiful |
| 17:15 | amalloy | well, maybe show the context you want it in, so that if anything makes more sense we can spot it? |
| 17:16 | ymasory | funny, there's a whole blog post on this: http://copperthoughts.com/p/initial-thoughts-on-clojure-mostly-awesome/ |
| 17:17 | amalloy | i mean, you could write one yourself but my first pass is pretty awful: |
| 17:17 | amalloy | (let [vec [:a :b :c]] (some (comp #{:c} vec) (range (count vec)))) |
| 17:18 | amalloy | &(let [vec [:a :b :c]] (some (comp #{:c} vec) (range (count vec)))) |
| 17:18 | sexpbot | ⟹ :c |
| 17:18 | amalloy | &(let [vec [:a :b :c]] (first (filter (comp #{:c} vec) (range (count vec))))) |
| 17:18 | sexpbot | ⟹ 2 |
| 17:19 | amalloy | ymasory: ^^? |
| 17:19 | ymasory | yeah i think this is an indication that i shouldn't be doing things this way |
| 17:20 | ymasory | although it's nice to have the option of linear-time operations in the stdlib |
| 17:20 | ymasory | i'll put on my refactoring hat |
| 17:20 | amalloy | *chuckle* |
| 17:58 | kzar | I'm getting "Wrong number of args(5) passed to core$for", any ideas? (for [tone tones] (.write tone 0 (count tone))) |
| 18:00 | amalloy | kzar: that looks fine to me, and if i enter it in the repl (with a faked-up definition of tones) it works. are you sure that's your whole statement? |
| 18:01 | kzar | amalloy: Yea it's definately closed in a way that means I'm not passing all that stuff to for. I think maybe it's got something to do with what .write returns? |
| 18:02 | amalloy | no, cause .write isn't getting a chance to be called |
| 18:02 | kzar | amalloy: It's inside a doto, could that matter? |
| 18:02 | amalloy | yessssss |
| 18:03 | kzar | amalloy: So can you not put for loops inside a doto? |
| 18:03 | amalloy | try gisting the (doto ... (for...)) thing, or even just macroexpanding it locally |
| 18:04 | kzar | I've just thought of a better way to do this, I was going to loop through and write each byte array, I could just join all the arrays and write them at once |
| 18:04 | amalloy | (doto x (for [a b] (c a))) will expand into (let [x# x] (for x# [a b] (c a)) x#) |
| 18:05 | amalloy | &(macroexpand '(doto x (for [a b] (c a)))) |
| 18:05 | sexpbot | java.lang.IllegalArgumentException: Wrong number of args (5) passed to: core$for |
| 18:05 | kzar | oh I see |
| 18:05 | kzar | amalloy: Thanks man, that was confusing me |
| 18:06 | amalloy | &(macroexpand '(doto x ("for" [a b] (c a)))) |
| 18:06 | sexpbot | ⟹ (let* [G__11374 x] ("for" G__11374 [a b] (c a)) G__11374) |
| 18:07 | amalloy | but remember (for) is lazy. i fear you're about to run into another problem |
| 18:08 | kzar | I was forKED on a few levels there 'eh |
| 18:08 | amalloy | *groan* |
| 18:08 | kzar | heh |
| 18:10 | amalloy | well, now i know a new question to ask when someone's code generates impossible errors: "Is it inside a macro that rewrites your code to something different?" |
| 18:10 | kzar | heh yea, I did wonder but I assumed I was just being dumb |
| 18:11 | amalloy | yeah, sadly doto can not read your mind and realize you don't want form x to be changed |
| 18:11 | amalloy | there is a gross hack you can use though |
| 18:11 | kzar | I guess you could only apply the doto magic to functions starting with a '.' |
| 18:12 | amalloy | &(macroexpand '(doto x (whatever) (#(.write %)))) |
| 18:12 | sexpbot | ⟹ (let* [G__11378 x] (whatever G__11378) ((fn* [p1__11377#] (dot p1__11377# "write")) G__11378) G__11378) |
| 18:12 | technomancy | nooooo... /me wants to keep his (doto 'clojure.set require in-ns) trick. =) |
| 18:12 | amalloy | hahaha that's horrible |
| 18:12 | technomancy | I know. |
| 18:13 | technomancy | I'm allowed to like horrible things. |
| 18:13 | amalloy | no arguments here |
| 18:13 | amalloy | you should consider rewriting your code with enough macros that you never type the same symbol twice |
| 18:13 | kzar | I'm well on my way to a sub-bass clojure powered rendition of Smoke on the Water |
| 18:14 | amalloy | sounds fun, kzar |
| 18:25 | amalloy | anyway kzar you can't do that doto .-magic stuff, because lots of functions have side effects. eg println, my-special-log-fn... |
| 18:28 | kzar | amalloy: Yea gotya |
| 18:32 | Raynes | amalloy: You. |
| 18:33 | amalloy | *cower* |
| 18:33 | Raynes | amalloy: Have you done any sexpbotty things while I've been gone? Such as fixed the source command to work with contrib functions. |
| 18:33 | amalloy | Raynes: no, been busy today |
| 18:33 | amalloy | plus, a coworker brought her puppy to the office |
| 18:33 | Raynes | Damn. That means I have to do it. |
| 18:34 | amalloy | yeah, i still plan to do the wordwrap stuff but not right away |
| 18:36 | amalloy | instead i get to work with such lovely gems as foreach( array(1,2,3,4,5,6) as $i ) |
| 18:41 | octe | (18 |
| 18:43 | Raynes | amalloy: Actually, it looks like contrib functions don't store line numbers in their metadata. So, nothing needs to change. |
| 18:43 | Raynes | It wouldn't work regardless. |
| 18:46 | amalloy | Raynes: untrue? |
| 18:46 | Raynes | &(meta clojure.contrib.json/pprint-json) |
| 18:46 | sexpbot | ⟹ {:ns #<Namespace clojure.contrib.json>, :name pprint-json} |
| 18:46 | amalloy | user=> (:line (meta #'clojure.contrib.math/expt)) |
| 18:46 | amalloy | 101 |
| 18:46 | Raynes | &(meta clojure.contrib.math/expt) |
| 18:46 | sexpbot | java.lang.ClassNotFoundException: clojure.contrib.math |
| 18:47 | Raynes | &(require clojure.contrib.math) |
| 18:47 | sexpbot | java.lang.ClassNotFoundException: clojure.contrib.math |
| 18:47 | Raynes | He lies. |
| 18:47 | Raynes | &(require 'clojure.contrib.math) |
| 18:47 | sexpbot | java.io.FileNotFoundException: Could not locate clojure/contrib/math__init.class or clojure/contrib/math.clj on classpath: |
| 18:47 | amalloy | i don't see meta for json either, at my repl |
| 18:47 | amalloy | so it looks like a by-package issue |
| 18:48 | Raynes | Right. If it works for *some* of them, it still needs to be fixed then. |
| 18:48 | Raynes | I'll do it in a little while. I've got a shower to clean. |
| 19:10 | kzar | If I've got a vector of vectors how can I use map with them? Something like (map + [[1 2 3] [1 2 3]]) |
| 19:17 | kzar | Oh I got it (apply #(map + %1 %2) [[1 2 3] [1 2 3]]) |
| 19:18 | amalloy | kzar: a little over-verbose there |
| 19:18 | rata_ | $(apply map + [[1 2 3] [1 2 3]]) |
| 19:18 | rata_ | ,(apply map + [[1 2 3] [1 2 3]]) |
| 19:18 | clojurebot | (2 4 6) |
| 19:18 | amalloy | &(apply map + [[1 2 3] [1 2 3]]) |
| 19:18 | sexpbot | ⟹ (2 4 6) |
| 19:19 | rata_ | it was &, not $ |
| 19:20 | kzar | oo thanks guys |
| 19:25 | rata_ | good bye guys, see you tomorrow |
| 19:25 | kzar | cya |
| 19:25 | KirinDave | ,1 |
| 19:26 | clojurebot | 1 |
| 19:26 | KirinDave | So why did that syntax change? |
| 19:26 | KirinDave | Oh, it didn't. |
| 19:26 | KirinDave | It's a new bot. |
| 19:26 | dysinger | it's so useful |
| 19:26 | dysinger | :| |
| 19:26 | KirinDave | Whee. |
| 19:27 | KirinDave | Sometimes it helps when explaining something |
| 19:27 | amalloy | sexpbot has been around for quite a while, KirinDave |
| 19:27 | KirinDave | amalloy: I've never seen him used for anything before today. Usually it's clojurebot |
| 19:27 | amalloy | yeah, he's not as popular. getting more so though |
| 19:28 | dysinger | calling it "he" might be contributing to that |
| 19:28 | amalloy | he also has some &|(apply str (repeat 3 "sweet "))|& new features |
| 19:28 | sexpbot | ⟹ "sweet sweet sweet " |
| 19:29 | KirinDave | Oh that's coo |
| 19:30 | amalloy | yeah. it also allows multiple evals per msg: &|(range 4)|& vs &|(take 4 (drop 4 (range)))|& |
| 19:30 | sexpbot | (range 4) ⟹ (0 1 2 3) |
| 19:30 | sexpbot | (take 4 (drop 4 (range))) ⟹ (4 5 6 7) |
| 19:33 | KirinDave | That's pretty awesome. |
| 19:33 | KirinDave | dysinger: What's wrong with anthropomorphizing technology? I think it's probably an essential skill for our craft! |
| 19:34 | dysinger | :) |
| 19:34 | amalloy | KirinDave: the only complaint i've heard is that lambdabot is female so why aren't clojurebot and sexpbot |
| 19:34 | KirinDave | amalloy: Lambdabot sounds like a female |
| 19:34 | KirinDave | sexpbot being called female makes implicit sex jokes. |
| 19:34 | amalloy | does she? i haven't been in #lisp forever |
| 19:35 | KirinDave | amalloy: I mena the name. |
| 19:35 | amalloy | or do you just mean the name ends with a |
| 19:35 | amalloy | ah |
| 19:35 | hiredman | clojurebot is a cold unfeeling genderless mechanism |
| 19:35 | technomancy | that way we don't feel as bad about abusing it |
| 19:35 | amalloy | hiredman: Cool story, bro |
| 19:35 | hiredman | ~clojurebot is a cold unfeeling genderless mechanism |
| 19:35 | clojurebot | Ok. |
| 19:39 | amalloy | KirinDave: you prefer explicit sex jokes? (ha, ha) |
| 19:39 | KirinDave | amalloy: Do you really want to get into this conversation at 4:30 on a friday? :D |
| 19:39 | KirinDave | I've got clojure to write. |
| 19:43 | qed | Does anyone know the link to that blog post or talk that demonstrated how clojures patens are on the outside instead of inside? |
| 19:52 | scgilardi | this mentions it (search for "fewer"): http://thinkrelevance.com/blog/2008/08/12/java-next-2-java-interop.html |
| 19:54 | danishkirel | I am playing with protocols: https://gist.github.com/665050 Unfortunately I don't get what I am expecting. Can I extend protocols with interfaces like I am trying to do? |
| 19:56 | amalloy | danishkirel: not a protocol expert here, and this doesn't address your question at all, but why have nsim? just (def nsim (complement sim)) once and you're done forever |
| 19:56 | danishkirel | The goal is to be able to compare vectors of numbers that are nearly but not identical (due to numerical precision). |
| 19:57 | danishkirel | Hey. Thanks. Didn't think about that. |
| 19:58 | amalloy | i wouldn't expect you can extend-protocol to interfaces, but i don't know. you could do this with a multimethod instead, which would be my choice |
| 19:58 | amalloy | but maybe just because i understand multimethods and not protocols :P |
| 19:58 | danishkirel | I tried to extend clojure.lang.PersistentVector which accomplishes what I need but I thought doing it on ISeq is way cooler |
| 19:59 | amalloy | you also don't need to do the manual loop yourself. check for equal lengths, then: |
| 19:59 | amalloy | (every? (partial apply sim) (map vector a b)) should be the same as your loop |
| 19:59 | danishkirel | multimethods would probably work. I just thought the dispatch would also work on implemented Interfaces. |
| 20:01 | danishkirel | Yeah amalloy but the check for equal lengths might double the costs - I might have to traverse the seq twice. |
| 20:01 | amalloy | &(counted? []) |
| 20:01 | sexpbot | ⟹ true |
| 20:01 | amalloy | &(counted? ()) |
| 20:01 | sexpbot | ⟹ true |
| 20:02 | amalloy | &(counted? (range 10)) |
| 20:02 | sexpbot | ⟹ false |
| 20:02 | amalloy | hm |
| 20:03 | dysinger | amalloy: you know that your clojure repl at the command line on your desktop can evaluate clojure too right ? |
| 20:04 | amalloy | dysinger: hilarious, but i'm pointing this out for danishkirel, who was worrying about the cost of (count seq) |
| 20:05 | dysinger | :) |
| 20:05 | amalloy | dysinger: actually i do all my work via /msg sexpbot (...) |
| 20:05 | amalloy | it's getting to be a pain for larger programs |
| 20:06 | danishkirel | Great! Didn't know counted? and also didn't know Lists can be counted in constant time in clojure :) |
| 20:10 | amalloy | danishkirel: just note the thing about (range) - lazyseqs aren't counted, and i think that's true even if you walk them then count them |
| 20:11 | amalloy | yeah, thinking about it i'm sure they never get counted |
| 20:12 | danishkirel | Lot's of work to count infinite lazy seqs... |
| 20:13 | amalloy | yeah, and even finite ones are a problem |
| 20:14 | danishkirel | I think (every? identity (map sim a b)) is sexier than (every? (partial apply sim) (map vector a b)) :o |
| 20:15 | danishkirel | Thanks for the insights amalloy. Good night everyone. |
| 20:17 | tomoj | too bad every? isn't variadic |
| 20:17 | tomoj | *(every? < [1 2 3] [4 5 6]) |
| 20:20 | amalloy | &(every? identity (map < [1 2 3] [4 5 6])) ; isn't that bad |
| 20:20 | sexpbot | ⟹ true |
| 20:20 | tomoj | s/too/a bit/ |
| 20:38 | Raynes | dysinger: I saw you at the Conj. I should have introduced myself. :< |
| 20:38 | Raynes | Fun lightning talk, by the way. |
| 20:38 | dysinger | :) |
| 20:38 | dysinger | sorry to hear you got sick |
| 20:39 | Raynes | Yeah. I was just happy it didn't kick in until after the conference ended. |
| 20:39 | qed | chouser: Have a link to your finger tree slides handy? |
| 20:39 | Raynes | Was a crappy trip home though. Especially getting through ATL. |
| 20:39 | qed | Im at a bar and am struggling to explain |
| 20:39 | qed | <- defn |
| 20:40 | Raynes | qed: I think they're in a repository on github. |
| 20:41 | qed | Ah cool. Kudos if you provide a link before I can find it on mu phone |
| 20:42 | Raynes | qed: https://github.com/Chouser/talk-finger-tree |
| 20:42 | qed | Thanks buddy |
| 20:42 | amalloy | Raynes: nearly done with word wrap. for some reason it's not wrapping the line with <sexpbot> right |
| 20:43 | Raynes | Is the arrow screwing it up? |
| 20:43 | pppaul | i made cons! |
| 20:43 | amalloy | not sure. it shouldn't |
| 20:43 | Raynes | Also, did I hardcode 'sexpbot' as the bot's name? |
| 20:43 | Raynes | If so, fix that please. Look for the :name key in the irc map. |
| 20:44 | Raynes | I've got to run again. Keep me posted. |
| 20:45 | chouser | qed: http://talk-finger-tree.heroku.com/ if you haven't found that already |
| 20:45 | qed | You rule. |
| 20:45 | qed | Thanks. |
| 20:45 | qed | chouser: What was your impression of cljc? |
| 20:46 | qed | Was that a "good" attempt? |
| 20:46 | chouser | qed: haven't looked at it deeply enough yet |
| 20:47 | amalloy | k |
| 20:47 | amalloy | and yeah, you hardcoded |
| 20:48 | qed | Im very interested to know if it is solid. A ton of work to just plop into a github repo. |
| 20:48 | pppaul | finger trees sound creepy |
| 20:48 | qed | Surprising he didn't solicit |
| 20:48 | qed | Much help |
| 20:49 | amalloy | Raynes: okay, it was wrapping fine, but i was too dumb to notice |
| 20:50 | pppaul | (double-list [1 2 3 4]) |
| 20:50 | pppaul | &(double-list [1 2 3 4]) |
| 20:50 | sexpbot | java.lang.Exception: Unable to resolve symbol: double-list in this context |
| 20:50 | pppaul | &(double-list 1 2 3 4) |
| 20:50 | sexpbot | java.lang.Exception: Unable to resolve symbol: double-list in this context |
| 20:50 | chouser | pppaul: they're not in clojure itself |
| 20:51 | pppaul | noticed |
| 20:51 | seancorfield | chouser: someone indicated you might be responsible for clojure-dev mailing list approvals? |
| 20:51 | pppaul | &(triple-list 1 2 3 4 5) |
| 20:51 | sexpbot | java.lang.Exception: Unable to resolve symbol: triple-list in this context |
| 20:52 | pppaul | &(lusty-list 1 2 3 4 5) |
| 20:52 | sexpbot | java.lang.Exception: Unable to resolve symbol: lusty-list in this context |
| 20:52 | seancorfield | ->(triple-list 1 2 3 4 5) |
| 20:52 | sexpbot | java.lang.Exception: Unable to resolve symbol: triple-list in this context |
| 20:52 | seancorfield | is there any difference between & and -> for sexpbot ? |
| 20:53 | chouser | seancorfield: sorry, no. I have some privs on the clojure group, but not clojure-dev. |
| 20:53 | seancorfield | 'k... just curious... |
| 20:54 | pppaul | &(prn /u20002) |
| 20:54 | sexpbot | java.lang.Exception: Invalid token: /u20002 |
| 20:54 | pppaul | &(prn "/u20002") |
| 20:54 | sexpbot | ⟹ "/u20002" nil |
| 20:54 | pppaul | &(prn "\u20002") |
| 20:54 | sexpbot | ⟹ " 2" nil |
| 20:55 | pppaul | &(prn \u20002) |
| 20:55 | sexpbot | java.lang.IllegalArgumentException: Invalid unicode character: \u20002 |
| 20:55 | pppaul | &(prn \u2002) |
| 20:55 | sexpbot | ⟹ \ nil |
| 20:56 | amalloy | seancorfield: no, & and -> are the same |
| 20:56 | pppaul | &(def cons :cons) |
| 20:56 | sexpbot | java.lang.SecurityException: Code did not pass sandbox guidelines: (def) |
| 20:56 | amalloy | (except that there's an &|'inline|& version and no such thing for ->) |
| 20:56 | sexpbot | ⟹ inline |
| 20:57 | pppaul | it would be really nice if sexpbot wasn't in a sandbox |
| 20:57 | amalloy | pppaul: no, it wouldn't. you could abuse the bejeezus out of him, even by accident |
| 20:57 | amalloy | you have a repl for that |
| 20:57 | pppaul | lol |
| 20:58 | seancorfield | thanx amalloy |
| 20:58 | pppaul | it would be nice for it to have some more freedom |
| 20:58 | pppaul | it would be cool if it could store some stuff in memory |
| 20:59 | amalloy | pppaul: what if i did &(def str +) |
| 20:59 | amalloy | then anyone who wanted to use str would be screwed |
| 20:59 | pppaul | could implement limitations |
| 20:59 | amalloy | yes, we did. it's called the sandbox :P |
| 20:59 | pppaul | ahaha |
| 20:59 | wsimpson | lol. |
| 20:59 | pppaul | i want to bring my own sand in |
| 20:59 | amalloy | everything that's sandboxed is because it's dangerous to leave open |
| 21:00 | pppaul | &(System.getProperty "java.class.path") |
| 21:00 | sexpbot | java.lang.ClassNotFoundException: System.getProperty |
| 21:00 | amalloy | ppp System/getProperty |
| 21:01 | pppaul | oh yeah |
| 21:01 | pppaul | &(System/getProperty "java.class.path") |
| 21:01 | sexpbot | java.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read) |
| 21:01 | amalloy | okay, granted. we could probably allow that |
| 21:02 | pppaul | it would be cool if you could allow people to define new symbols |
| 21:03 | Raynes | amalloy: No, we couldn't allow that. |
| 21:03 | amalloy | Raynes: "probably" :P...why not? |
| 21:03 | Raynes | amalloy: The JVM sandbox doesn't allow that. In general, stuff like that should be left alone. |
| 21:03 | Raynes | ,(System/getProperty "java.class.path") |
| 21:03 | clojurebot | java.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read) |
| 21:03 | Raynes | He agrees. |
| 21:03 | amalloy | Raynes: the jvm sandbox has configurable permissions |
| 21:04 | Raynes | I'm aware. But I don't like cherry picking. |
| 21:04 | Raynes | :p |
| 21:04 | amalloy | sure. i'm not volunteering to allow it either |
| 21:04 | amalloy | but it wouldn't be harmful |
| 21:05 | Raynes | Yeah. |
| 21:05 | pppaul | it would be really nice to allow for new symbol creation :) |
| 21:05 | Raynes | pppaul: There are a whole crapload of complications that come from allowing for def. |
| 21:05 | pppaul | really? |
| 21:05 | Raynes | Even if they could be resolved perfectly, it's not really worth the trouble. The best thing would be to have a per-person sandbox that deletes itself. |
| 21:06 | Raynes | It's something to think about anyway. |
| 21:06 | amalloy | yes, per-person sandbox is on my "don't i wish" list |
| 21:06 | pppaul | this sandbox sounds lonely |
| 21:07 | pppaul | what would be rules for deleting/resetting? |
| 21:07 | amalloy | N idle minutes would be my guess |
| 21:07 | amalloy | cause sandboxes cost memory |
| 21:08 | pppaul | sounds like it could be confusing for people who use it |
| 21:08 | amalloy | yep |
| 21:08 | amalloy | so: one sandbox |
| 21:09 | pppaul | &(dotimes 1e100000 (* 1e500 1e500)) |
| 21:09 | sexpbot | java.lang.IllegalArgumentException: dotimes requires a vector for its binding |
| 21:09 | pppaul | aw |
| 21:09 | pppaul | (doc dotimes) |
| 21:09 | clojurebot | "([bindings & body]); bindings => name n Repeatedly executes body (presumably for side-effects) with name bound to integers from 0 through n-1." |
| 21:09 | amalloy | &(dotimes [_ 1e100000] (* 1e500 1e500)) |
| 21:09 | sexpbot | java.lang.IllegalArgumentException: Value out of range for int: 9223372036854775807 |
| 21:10 | pppaul | &(dotimes [i 1e1] (prn i)) |
| 21:10 | sexpbot | ⟹ 0 1 2 3 4 5 6 7 8 9 nil |
| 21:10 | pppaul | &(dotimes [i 1e1] (prn (range i))) |
| 21:10 | sexpbot | ⟹ () (0) (0 1) (0 1 2) (0 1 2 3) (0 1 2 3 4) (0 1 2 3 4 5) (0 1 2 3 4 5 6) (0 1 2 3 4 5 6 7) (0 1 2 3 4 5 6 7 8) nil |
| 21:11 | pppaul | &(Thread/sleep 100) |
| 21:11 | sexpbot | ⟹ nil |
| 21:11 | pppaul | &(Thread/sleep 1e1000000) |
| 21:11 | pppaul | zzz |
| 21:11 | sexpbot | Execution Timed Out! |
| 21:12 | pppaul | how did you guys set up the time-out? |
| 21:13 | pppaul | (doc consl) |
| 21:13 | clojurebot | Excuse me? |
| 21:14 | pppaul | (doc clojurebot) |
| 21:14 | clojurebot | Gabh mo leithscéal? |
| 21:14 | pppaul | what do people think of the finger trees? |
| 21:17 | pppaul | the finger trees are supposed to replace vectors right? |
| 21:19 | Raynes | amalloy: Using a dirty deprecated Thread method. |
| 21:20 | pppaul | always walking on the dirty side |
| 21:20 | Raynes | https://github.com/Raynes/sexpbot/blob/master/src/sexpbot/utilities.clj#L17 |
| 21:20 | Raynes | I believe Chousuke wrote the original version of that function. |
| 21:23 | amalloy | Raynes: what? i wasn't watching |
| 21:23 | Raynes | amalloy: I replied to the wrong person. |
| 21:23 | Raynes | Sorry. |
| 21:25 | amalloy | Raynes: how do i find the bot's name? i'm trying (-> @bot :config ((:server irc)) :bot-name) but getting NPE, i assume i'm using the wrong key somewhere |
| 21:25 | Raynes | Don't look in bot. |
| 21:25 | Raynes | Look in irc. |
| 21:25 | Raynes | Under :name |
| 21:25 | Raynes | (-> @irc :name) |
| 21:25 | amalloy | oh |
| 21:25 | amalloy | k |
| 21:26 | Derander | Hey, is it possible to clojure.xml/parse a string containing xml? |
| 21:26 | Raynes | The name can change during runtime, so looking in the configuration wont suffice. |
| 21:27 | pppaul | (doc clojure.xml/parse) |
| 21:27 | clojurebot | "([s] [s startparse]); Parses and loads the source s, which can be a File, InputStream or String naming a URI. Returns a tree of the xml/element struct-map, which has the keys :tag, :attrs, and :content. and accessor fns tag, attrs, and content. Other parsers can be supplied by passing startparse, a fn taking a source and a ContentHandler and returning a parser" |
| 21:27 | jjido | pppaul: finger trees are great as immutable structure, vectors are more useful as mutable structure |
| 21:27 | amalloy | Raynes: https://gist.github.com/665108 - any other features you want before i push? |
| 21:27 | Derander | pppaul: that's the one. is it possible to make a string act as a file, inputstream or string? |
| 21:28 | pppaul | yeah, make it a stream |
| 21:28 | pppaul | somehow |
| 21:28 | Raynes | amalloy: That's great. |
| 21:28 | pppaul | i haven't used java in a long time |
| 21:28 | jjido | Derander: strings are standard Java strings |
| 21:28 | pppaul | maybe there are some examples |
| 21:28 | amalloy | Derander: there's something in clojure.java.io that does this |
| 21:28 | Derander | amalloy: searching |
| 21:28 | amalloy | it's (with-in-str) or something like that |
| 21:28 | Derander | jjido: yes |
| 21:29 | Derander | amalloy: (as-file)? |
| 21:29 | Derander | tesing |
| 21:29 | Raynes | &(clojure.xml/parse (java.io.ByteArrayInputStream. (.getBytes "<x>blah</x>"))) |
| 21:29 | sexpbot | ⟹ {:tag :x, :attrs nil, :content ["blah"]} |
| 21:30 | Raynes | Derander: ^ |
| 21:30 | Derander | Raynes: thank you sir |
| 21:31 | jjido | amalloy: what did you change in the bot? |
| 21:31 | amalloy | jjido: just now? |
| 21:31 | jjido | yes |
| 21:31 | amalloy | he word-wraps truncated results when he gists now |
| 21:32 | amalloy | (though it's not live yet; just my private sexpbot) |
| 21:33 | Derander | Raynes: beautiful |
| 21:33 | jjido | amalloy: the gist does not look truncated |
| 21:34 | amalloy | &(clojure.string/join " " (repeatedly 400 #(rand-int 1000))) |
| 21:34 | sexpbot | ⟹ "218 885 379 490 168 370 927 708 923 106 250 958 47 428 498 611 788 195 892 809 108 694 519 300 880 326 887 559 608 983 127 298 118 215 24 385 365 246 379 482 733 662 551 166 902 116 406 162 695 702 347 330 53 771 496 460 682 809 618 548 747 670 874 142 405 895 7 568 894 53 179 327 355 71 243 706 56... http://gist.github.com/665110 |
| 21:34 | amalloy | jjido: he truncates here, gists the whole thing |
| 21:34 | jjido | amalloy: ooh nice! |
| 21:34 | amalloy | well, he's always done that |
| 21:34 | amalloy | i just made the gist prettier |
| 21:34 | jjido | yeah |
| 21:35 | amalloy | Raynes: pushed to new branch wrap. heading home now |
| 21:37 | alexyk | so how do we typehint with ^ -- a^String or String^a ? |
| 21:39 | alexyk | ^String a, while I so hoped for a^String... |
| 22:07 | samx | trying to get the netbeans/enclojure debugger working with clojure with little luck so far.. I'm able to start the debugger, but if I set a breakpoint and start the debugger, I just get the following error: 'Not able to submit breakpoint LineBreakpoint icm.clj : 47, reason: No executable location available at line 47 in class icm$eval3'. Anyone have a clue on what's wrong? |
| 22:11 | amalloy | samx: maybe your clojure forms were compiled without line number info in the classfiles? |
| 22:11 | amalloy | you could try javap -l icm$eval3 to see |
| 22:11 | amalloy | (that's lower-case L) |
| 22:12 | Raynes | It's obvious in my font. |
| 22:13 | Raynes | amalloy: Doooooood. That's a regeeeeeex. You're totally maintaining that monstrosity. |
| 22:13 | amalloy | Raynes: no worries. it's a pretty simple one |
| 22:14 | Raynes | No regex is simple. |
| 22:14 | Raynes | Ever. |
| 22:15 | amalloy | *smile* yeah, i know the feeling |
| 22:15 | samx | hmm.. i wasn't generating class files; maybe that's the problem |
| 22:16 | amalloy | samx: in theory it shouldn't be a problem, but it might be a way to find out what's going on |
| 22:16 | amalloy | awww Raynes, you fixed the exploit? i was planning a hilarious weekend of getting sexpbot kickbanned |
| 22:16 | Raynes | Indeed, I did. :p |
| 22:18 | Raynes | amalloy: Your changes are live. |
| 22:18 | amalloy | sweet. i was just looking at the repo |
| 22:18 | amalloy | bein like :( no changes |
| 22:20 | amalloy | Raynes: so i was kinda annoyed at having to pass bot-name through three levels of function calls. what are your thoughts about using (bindings) to make frequently-useful things like @bot and @irc available for free? i don't really know whether that's frowned on in clojure |
| 22:21 | Raynes | There isn't really a good way to do that in that plugin. |
| 22:22 | amalloy | why not? isn't that what dynamic bindings are for? |
| 22:22 | Raynes | Yeah, but what would be the default? |
| 22:22 | Raynes | There wouldn't be a default. You'd just be using dynamic binding to set it to avoid threading it through functions to get it where it needs to be. |
| 22:23 | Raynes | That isn't a very good thing to do. |
| 22:23 | amalloy | right |
| 22:23 | amalloy | okay |
| 22:26 | amalloy | Raynes: is there a reason the gh-pages branch still exists? |
| 22:26 | Raynes | No. It's useless and old. |
| 22:26 | amalloy | k. i'ma kill it |
| 22:28 | amalloy | all gone! |
| 22:28 | Raynes | amalloy: Has any changes been made to github.clj lately? |
| 22:29 | amalloy | ummmmm, not that i can recall, why? |
| 22:29 | Raynes | sexpbot stopped reporting commits a few days ago, but it's still responding to curl: curl -d"b=b" commits.acidrayne.net |
| 22:29 | amalloy | git log github.clj says last change was oct 25 |
| 22:29 | Raynes | No errors or anything. I'm inclined to think that github is broken, but that would be arrogant of me. |
| 22:29 | Raynes | What was that change? |
| 22:29 | amalloy | Raynes: github made some changes recently |
| 22:30 | amalloy | something to do with https vs http |
| 22:30 | Raynes | That could be the problem. |
| 22:30 | amalloy | ninjudd was talking about them messing up cake |
| 22:30 | clojurebot | cheesecake is delicious. |
| 22:30 | amalloy | so he might be able to help |
| 22:30 | Raynes | Shut up. |
| 22:31 | ninjudd | clojurebot: cake is http://cake.foolambda.com |
| 22:31 | clojurebot | Ok. |
| 22:31 | ninjudd | clojurebot: cake? |
| 22:31 | clojurebot | cake is http://cake.foolambda.com |
| 22:31 | ninjudd | thank you |
| 22:31 | amalloy | ninjudd: i've tried that before. he seems to forget after a while |
| 22:31 | ninjudd | cron job |
| 22:31 | amalloy | he really loves cheesecake |
| 22:31 | amalloy | clojurebot: clojurebot? |
| 22:31 | clojurebot | clojurebot is like life: you make trade-offs |
| 22:32 | amalloy | hm. what happened to cold, unfeeling mechanism? |
| 22:32 | Raynes | The https stuff wouldn't matter. It's redirection. |
| 22:32 | Raynes | I never request anything. |
| 22:32 | Raynes | I can test this though to see if it's working. |
| 22:40 | Raynes | ninjudd: It actually was. Since I configure all of the repo urls beforehand, all my configuration is wrong because it's https now. |
| 23:04 | hiredman | clojurebot: clojurebot is a multimap |
| 23:04 | clojurebot | Ik begrijp |
| 23:07 | Raynes | clojurebot: sexpbot is not a clojurebot |
| 23:07 | clojurebot | Alles klar |
| 23:08 | kzar | clojurebot: paradox is not a paradox |
| 23:08 | clojurebot | Ok. |
| 23:24 | pppaul | &(take 100 (for [x (range 100000000) y (range 1000000) :while (< y x)] [x y])) |
| 23:24 | sexpbot | ⟹ ([1 0] [2 0] [2 1] [3 0] [3 1] [3 2] [4 0] [4 1] [4 2] [4 3] [5 0] [5 1] [5 2] [5 3] [5 4] [6 0] [6 1] [6 2] [6 3] [6 4] [6 5] [7 0] [7 1] [7 2] [7 3] [7 4] [7 5] [7 6] [8 0] [8 1] [8 2] [8 3] [8 4] [8 5] [8 6] [8 7] [9 0] [9 1] [9 2] [9 3] [9 4] [9 5] [9 6] [9 7] [9 8] [10 0] [10 1] [10 2] [10 3] [... http://gist.github.com/665166 |
| 23:24 | pppaul | &(take 100 (for [x (range 100000000) y (range 1000000) :while (< (* y y) x)] [x y])) |
| 23:24 | sexpbot | ⟹ ([1 0] [2 0] [2 1] [3 0] [3 1] [4 0] [4 1] [5 0] [5 1] [5 2] [6 0] [6 1] [6 2] [7 0] [7 1] [7 2] [8 0] [8 1] [8 2] [9 0] [9 1] [9 2] [10 0] [10 1] [10 2] [10 3] [11 0] [11 1] [11 2] [11 3] [12 0] [12 1] [12 2] [12 3] [13 0] [13 1] [13 2] [13 3] [14 0] [14 1] [14 2] [14 3] [15 0] [15 1] [15 2] [15 3]... http://gist.github.com/665167 |
| 23:25 | pppaul | &(take 100 (for [x (range 100000000) y (range 1000000) :while (= (* y y) x)] [x y])) |
| 23:25 | sexpbot | Execution Timed Out! |
| 23:25 | pppaul | &(take 100 (for [x (range 100) y (range 100) :while (= (* y y) x)] [x y])) |
| 23:25 | sexpbot | ⟹ ([0 0]) |
| 23:25 | pppaul | &(take 100 (for [x (range 1000) y (range 1000) :while (= (* y y) x)] [x y])) |
| 23:25 | sexpbot | ⟹ ([0 0]) |
| 23:25 | pppaul | &(take 100 (for [x (range 1000) y (range 1000) :while (= (+ y y) x)] [x y])) |
| 23:25 | sexpbot | ⟹ ([0 0]) |
| 23:26 | pppaul | i have no idea what i'm doing |
| 23:26 | pppaul | &(take 100 (for [x (range 1000) y (range 1000) :while (= y x)] [x y])) |
| 23:26 | sexpbot | ⟹ ([0 0]) |
| 23:27 | pppaul | &(take 100 (for [x (range 10) y (range 10) ] [x y])) |
| 23:27 | sexpbot | ⟹ ([0 0] [0 1] [0 2] [0 3] [0 4] [0 5] [0 6] [0 7] [0 8] [0 9] [1 0] [1 1] [1 2] [1 3] [1 4] [1 5] [1 6] [1 7] [1 8] [1 9] [2 0] [2 1] [2 2] [2 3] [2 4] [2 5] [2 6] [2 7] [2 8] [2 9] [3 0] [3 1] [3 2] [3 3] [3 4] [3 5] [3 6] [3 7] [3 8] [3 9] [4 0] [4 1] [4 2] [4 3] [4 4] [4 5] [4 6] [4 7] [4 8] [4 9]... http://gist.github.com/665170 |
| 23:27 | pppaul | &(take 100 (for [x (range 10) y (range 10) ] [(* x y)])) |
| 23:27 | sexpbot | ⟹ ([0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [0] [2] [4] [6] [8] [10] [12] [14] [16] [18] [0] [3] [6] [9] [12] [15] [18] [21] [24] [27] [0] [4] [8] [12] [16] [20] [24] [28] [32] [36] [0] [5] [10] [15] [20] [25] [30] [35] [40] [45] [0] [6] [12] [18] [24] [30] [36] ... http://gist.github.com/665171 |
| 23:28 | pppaul | &(take 100 (for [x (iterate inc 10) y (iterate inc 10) ] [(* x y)])) |
| 23:28 | sexpbot | ⟹ ([100] [110] [120] [130] [140] [150] [160] [170] [180] [190] [200] [210] [220] [230] [240] [250] [260] [270] [280] [290] [300] [310] [320] [330] [340] [350] [360] [370] [380] [390] [400] [410] [420] [430] [440] [450] [460] [470] [480] [490] [500] [510] [520] [530] [540] [550] [560] [570] [580] [590]... http://gist.github.com/665172 |
| 23:28 | amalloy | omg pppaul. please use /msg |
| 23:28 | pppaul | ^_^ |
| 23:35 | Raynes | pppaulese use /msg :P |
| 23:53 | defn | http://www.thinkgeek.com/gadgets/travel-outdoors/ab44/ |
| 23:53 | defn | ordered. |