2009-02-03
| 00:39 | durka42 | so -- what is a "logical collection"? |
| 00:39 | durka42 | is it different from "a seq or nil" |
| 00:40 | durka42 | or is it just a duck that promises to turn into a seq or nil when you call seq on it |
| 00:55 | gordongecko | could a reader macro allow something like ([1][1,2,3]) -> 2 |
| 00:55 | gordongecko | could a reader macro allow something like (#[1][1,2,3]) -> 2 |
| 00:55 | gordongecko | could a reader macro allow something like (#[1:3][1,2,3,4,5]) -> [2,3] |
| 00:58 | durka42 | no, probably, and probably |
| 00:58 | durka42 | but clojure doesn't have reader macros |
| 00:59 | gordongecko | is there a slice function? |
| 00:59 | durka42 | subvec |
| 00:59 | durka42 | (doc subvec) |
| 00:59 | clojurebot | Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done.; arglists ([v start] [v start end]) |
| 01:00 | durka42 | ,(subvec [1 2 3 4 5] 2 3) |
| 01:00 | clojurebot | [3] |
| 01:00 | durka42 | ,(subvec [1 2 3 4 5] 1 3) |
| 01:00 | clojurebot | [2 3] |
| 01:00 | durka42 | also |
| 01:00 | durka42 | ,(range 5) |
| 01:00 | clojurebot | (0 1 2 3 4) |
| 01:00 | durka42 | ,(range 3 700 50) |
| 01:00 | clojurebot | (3 53 103 153 203 253 303 353 403 453 503 553 603 653) |
| 01:15 | hiredman | ,(use '(clojure.contrib.repl-utils)) |
| 01:15 | clojurebot | nil |
| 01:15 | hiredman | ,show |
| 01:15 | clojurebot | java.lang.Exception: Unable to resolve symbol: show in this context |
| 01:15 | hiredman | ,(use 'clojure.contrib.repl-utils) |
| 01:15 | clojurebot | nil |
| 01:15 | hiredman | ,show |
| 01:16 | clojurebot | #<repl_utils$show__1120 clojure.contrib.repl_utils$show__1120@688954> |
| 01:16 | hiredman | ,(source for) |
| 01:16 | clojurebot | Source not found |
| 01:16 | hiredman | :( |
| 01:18 | durka42 | ,(source subvec) |
| 01:18 | clojurebot | Source not found |
| 01:18 | durka42 | it does that if you've updated clojure.jar out from under the running program |
| 01:19 | hiredman | hmm |
| 01:19 | hiredman | I have not |
| 01:19 | durka42 | hmm |
| 01:19 | durka42 | security crap preventing it from opening files? |
| 01:19 | hiredman | ah |
| 01:19 | hiredman | Yes |
| 01:20 | durka42 | ,(File. "/") |
| 01:20 | clojurebot | java.lang.IllegalArgumentException: Unable to resolve classname: File |
| 01:20 | durka42 | ,(java.io.File. "/") |
| 01:20 | clojurebot | #<File /> |
| 01:21 | durka42 | ,(.listFiles (File. "/")) |
| 01:21 | clojurebot | java.lang.IllegalArgumentException: Unable to resolve classname: File |
| 01:21 | durka42 | ,(.listFiles (java.io.File. "/")) |
| 01:21 | clojurebot | java.security.AccessControlException: access denied (java.io.FilePermission / read) |
| 01:21 | durka42 | good |
| 01:24 | hiredman | hmmm |
| 01:24 | hiredman | the sandbox should really be using java.util.concurrent.Executors |
| 01:29 | gordongecko | im gonna sin |
| 01:30 | durka42 | are you asking forgiveness? :p |
| 01:36 | gordongecko | im gonna go ! |
| 01:36 | gordongecko | for-loops naturally encourage sideeffects |
| 01:36 | gordongecko | im tryong to translate gaussjordan elimination from python to clojure |
| 01:38 | hiredman | ,(doc dotimes) |
| 01:38 | clojurebot | "([bindings & body]); bindings => name n Repeatedly executes body (presumably for side-effects) with name bound to integers from 0 through n-1." |
| 01:38 | hiredman | ,(doc doseq) |
| 01:38 | clojurebot | "([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil." |
| 02:25 | lisppaste8 | gekko pasted "gauss jordan elimination" at http://paste.lisp.org/display/74770 |
| 02:25 | gordongecko | anyone could take a look at that and point me to the right direction? this is typical for the problems i have with functional langs |
| 02:26 | gordongecko | it uses a lot of for loops at state and it alwyas becomes so messy when doing in a pure way |
| 02:43 | Lau_of_DK | Good morning everyone |
| 02:48 | knapr | how do you nest loop/recur? does recur always recur to the closest loop? there is no magic there? |
| 02:49 | Lau_of_DK | I believe it always recurs to the closet loop |
| 02:50 | hiredman | knapr: recur always recurs to the closest frame |
| 02:50 | hiredman | which maybe a loop or a fn |
| 02:50 | hiredman | if you use a macro that makes fns around statements this can lead to unpredictable results |
| 02:52 | knapr | is there no function-global def? |
| 02:52 | hiredman | huh? |
| 02:53 | Lau_of_DK | def is global |
| 02:53 | knapr | i want to use def inside a function, can prevent that variable form becoming global to the program? |
| 02:53 | hiredman | nope |
| 02:53 | hiredman | def != schemes define |
| 02:54 | hiredman | you can sometimes emulate that behaviour with let |
| 02:57 | Lau_of_DK | hiredman: He left before you answered :) |
| 02:57 | hiredman | so he did |
| 02:57 | Lau_of_DK | For local-scope defs he should probably use defn- from contrib |
| 02:57 | hiredman | erm |
| 02:58 | gordongecko | i thought defn- was in core |
| 02:58 | hiredman | defn- is not from contrib |
| 02:58 | Lau_of_DK | Fair enough, but you get the picture |
| 02:58 | Lau_of_DK | I think defn- originated from contrib |
| 02:59 | hiredman | defn- is not local |
| 02:59 | hiredman | it is private |
| 02:59 | Lau_of_DK | oh, thats not quite the same |
| 02:59 | gordongecko | yes |
| 02:59 | Lau_of_DK | Then his option is using bindings ? |
| 02:59 | hiredman | nah |
| 02:59 | hiredman | let |
| 03:00 | hiredman | and the fn in defn closes over what is bound with let |
| 03:01 | Lau_of_DK | Ok, I see that binding is primarily for redefining something which is already bound to a value |
| 03:01 | hiredman | ... |
| 03:03 | hiredman | ,(.codePointAt "..." 0) |
| 03:03 | clojurebot | 8230 |
| 03:03 | hiredman | ,(int \...) |
| 03:03 | clojurebot | 8230 |
| 03:06 | hiredman | ,(short \...) |
| 03:06 | clojurebot | java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number |
| 03:06 | hiredman | hmmm |
| 03:45 | AWizzArd | Hi |
| 03:48 | Lau_of_DK | Hey AWA |
| 03:53 | AWizzArd | clojurebot: max people |
| 03:53 | clojurebot | max people is 137 |
| 03:53 | AWizzArd | uh :-) |
| 03:53 | AWizzArd | hi cg |
| 03:53 | cgrand | hi! |
| 04:26 | newb12345 | how good is clojure for real world computing? stuff like parsing html files |
| 04:33 | cgrand | newb12345: at least as good as Java :-) for parsing html you can use TagSoup for example. In the mailing list, there are examples of integrating TagSoup + zippers |
| 04:36 | newb12345 | zippers? as in haskell/functional zippers? |
| 04:38 | cgrand | I'm not an Haskeller, but zippers as in functional artifacts to navigate/mutate trees |
| 04:38 | newb12345 | whoa |
| 04:39 | newb12345 | so clojure is elegant like lisp, but practical like java? |
| 04:39 | AWizzArd | indeed |
| 04:39 | newb12345 | to play devil's advocate |
| 04:40 | newb12345 | why hasn't it taken over the world yet? |
| 04:40 | AWizzArd | because Clojure 1.0 is not published. |
| 04:40 | AWizzArd | In October there were around 70-80 people in this room. |
| 04:40 | AWizzArd | clojurebot: max people |
| 04:40 | clojurebot | max people is 137 |
| 04:40 | newb12345 | how do i get the size of a channel? |
| 04:40 | AWizzArd | with about 750 members in the Google Group |
| 04:40 | metaperl | when using 'ant' to build Clojure, what advantage does that give you? I dont have much java background. |
| 04:41 | AWizzArd | newb12345: depends on your irc-client |
| 04:41 | newb12345 | for yours, what is it? |
| 04:41 | newb12345 | i'll just try it in mine |
| 04:42 | AWizzArd | metaperl: in a project of 619 files you won't need to type 619x javac, but only one time ant. |
| 04:42 | AWizzArd | And don't forget dependencies. |
| 04:42 | metaperl | does it make it easier to use clojure from the command line? |
| 04:43 | metaperl | right now, I downloaded clojure to a temp directory and run the REPL from there... I'm wondering if using 'ant' will perform a 'system install' and make clojure available from any directory. |
| 04:44 | AWizzArd | metaperl: http://www.google.com/search?q=ant |
| 04:44 | cgrand | metaperl: ant is make for java |
| 04:48 | Lau_of_DK | <newb12345> how good is clojure for real world computing? stuff like parsing html files |
| 04:48 | Lau_of_DK | This is a classic quote :) |
| 04:48 | Lau_of_DK | cgrand: Why are you always pushing SoupBox, did you make it? |
| 04:50 | cgrand | no Mr Lau, it's just my reflex answer to "how to parse html in javaland" |
| 04:51 | cgrand | and its author created this irc channel :-) |
| 04:53 | Lau_of_DK | uuuh :) |
| 04:54 | Lau_of_DK | Still funny: real world computing = parsing html |
| 04:55 | gregh | you never know when you're going to be walking down the street and trip over some unclosed tags! |
| 04:55 | Lau_of_DK | thats certainly true |
| 04:55 | Lau_of_DK | cgrand: And you primarily a Git man, or an Svn girl ? |
| 04:58 | cgrand | Lau_of_DK: I'm agnostic |
| 04:59 | Lau_of_DK | Thats odd |
| 05:01 | cgrand | plus, I don't answer sexist questions :-) |
| 05:02 | Lau_of_DK | oh man, you really are french! |
| 05:03 | cgrand | warum? |
| 05:03 | Lau_of_DK | hehe, Im not german. It just matched my stereotype of a french person, react that way to a git/svn joke :) |
| 05:07 | cgrand | Seriously, having to work crossplatform, I tried hg two years ago but it's quite recently that I tried git again |
| 05:22 | Lau_of_DK | cgrand: Git is pretty well supported for Windows isnt it? |
| 05:23 | cgrand | Lau_of_DK: except git-svn, it seems to work well |
| 05:24 | cgrand | (but cygwin/git-svn works ok) |
| 05:30 | Lau_of_DK | Ah ok |
| 05:39 | Lau_of_DK | cgrand: But to me its primarily a business case: Which gives minimal overhead without loss of relevant features? Git was a clear winner, and since our migration at the company, the feedback has been 100% positive |
| 05:41 | gordongecko | is there a function to update a vector at a specific pos? |
| 05:42 | cgrand | gordongecko: assoc |
| 05:42 | gordongecko | ah assoc works there too |
| 06:00 | lisppaste8 | gordongecko pasted "matrix update" at http://paste.lisp.org/display/74776 |
| 06:00 | gordongecko | can ^^ be improved to something shorter and more clear? |
| 06:02 | Chousuke | is your matrix a vector of vectors? |
| 06:02 | Chousuke | if so, use assoc-in |
| 06:03 | Chousuke | ,(assoc-in [[1 2 3] [4 5 6]] [1 1] :a) |
| 06:03 | clojurebot | [[1 2 3] [4 :a 6]] |
| 06:03 | gordongecko | ok |
| 06:03 | gordongecko | is assoc O(1) ? so if i want to make a matrix it is efficient to sue evctirs? |
| 06:03 | gordongecko | vectors |
| 06:03 | Chousuke | the performance of assoc depends on the data structure. |
| 06:04 | Chousuke | vectors might not be the most efficient matrix representation, at least for large matrices. |
| 06:05 | gordongecko | wellf or sparse amtrices i guess id use a hashmap but for dense ones? |
| 06:05 | Chousuke | assoc is not O(1) for vectors, but close enough. |
| 06:06 | Chousuke | log32 or something. :) |
| 06:08 | gordongecko | how would you do the equivalent of: a={} for r in rows: for c in cols: a.update{(r,c): 0} ? |
| 06:09 | gordongecko | ie nest for loops and accumulate to a variable that is global in the function |
| 06:12 | Chousuke | you want to zero the array? :/ |
| 06:13 | Chousuke | that doesn't really make sense in clojure, unless you're dealing with mutable data. |
| 06:16 | Chousuke | gordongecko: you could simply define A to be full of zeros to begin with, for example, (vec (take rows (repeat (vec (take cols (repeat 0)))))) |
| 06:17 | AWizzArd | in Clojure in principle evrything are constants |
| 06:18 | Chousuke | compared to traditional languages, I suppose. |
| 06:18 | AWizzArd | yes |
| 06:18 | Chousuke | in clojure a constant would be a name that always is bound to the same value. |
| 06:19 | AWizzArd | you mean that the value is bound to the name? |
| 06:19 | Chousuke | or that. |
| 06:19 | AWizzArd | ;-) |
| 06:21 | Chousuke | gordongecko: it's important to keep in mind that once you have a value, there's *no way* to change it, if it is one of the clojure basic data types (and not some java stuff). You can only create *new* values based on the old one. |
| 06:34 | knapr | i want to generate all pair-combinations of 2 ranges, like (range 1) (range 1), should gen [0 0] [0 1] [1 0] [1 1] |
| 06:37 | AWizzArd | knapr: (for [a (range 2) b (range 2)] ...) |
| 06:38 | AWizzArd | (for [a (range 2) b (range 2)] [a b]) |
| 06:45 | knapr | can you map over a hashmap somehow? |
| 06:45 | knapr | do soemthing to eahc value i mean |
| 06:48 | Chousuke | yeah |
| 06:48 | Chousuke | just use map |
| 06:48 | Chousuke | each key-value pair will be given to your function as a [k v] vector |
| 06:50 | AWizzArd | knapr: you can map over (vals your-map) |
| 06:51 | Chousuke | ,(apply hash-map (map (fn [[k v]] [v k]) {:a 1 :b 2})) |
| 06:51 | clojurebot | {[1 :a] [2 :b]} |
| 06:51 | Chousuke | hm |
| 06:51 | Chousuke | not quite :/ |
| 06:51 | AWizzArd | (map #(+ 7 %) (vals my-mep)) |
| 06:52 | Cark | awizzard : been reading cll again, i think trampolines are just perfect, the parser combinator think mentioned by JH makes no sense, the user of your library would of course need to adapt his programing style to use trampolines as well |
| 06:52 | Chousuke | ,(int0 {} (map (fn [[k v]] [v k]) {:a 1 :b 2})) |
| 06:52 | clojurebot | java.lang.Exception: Unable to resolve symbol: int0 in this context |
| 06:52 | Chousuke | gah |
| 06:52 | Chousuke | ,(into {} (map (fn [[k v]] [v k]) {:a 1 :b 2})) |
| 06:52 | clojurebot | {2 :b, 1 :a} |
| 06:53 | AWizzArd | Cark: yes, for nearly (and maybe all) practical cases Trampolines should be enough. |
| 06:58 | AWizzArd | newb12345: I use irssi, and for me the command is /names |
| 07:15 | gordongecko | but lets say i want to keep some metadata like rows and cols to make some calcs faster, how would you do that? pass that along a s a struct or can you have metadata ona hashmap? |
| 07:16 | AWizzArd | you should not put cache data into the metadata |
| 07:17 | AWizzArd | instead you can memoize your function |
| 07:17 | gordongecko | yes but for a matrix it makes sens e to just pass around the matrix-hashmap and rows and cols |
| 07:17 | gordongecko | asa struct |
| 07:17 | gordongecko | no? |
| 07:17 | Lau_of_DK | gordongecko: I would say so |
| 07:39 | gordongecko | does clojure have something like haskells show? |
| 07:40 | AWizzArd | gordongecko: (str your-object) |
| 07:40 | AWizzArd | (str 10) ==> "10" |
| 07:41 | AWizzArd | ,(str {"key" 'value}) |
| 07:41 | clojurebot | "{\"key\" value}" |
| 07:41 | gordongecko | how can I map println without nil? |
| 07:42 | AWizzArd | gordongecko: don't use map for side-effects. Use (doseq [obj collection] (println obj)) |
| 07:43 | gordongecko | hmm? |
| 07:43 | gordongecko | (doseq println [[1 2 3] [4 5 6] [7 8 9]]) |
| 07:43 | gordongecko | ah |
| 07:44 | Lau_of_DK | ,(doseq [idx (range 10)] (println idx)) |
| 07:44 | clojurebot | 0 1 2 3 4 5 6 7 8 9 |
| 07:55 | clojurebot | svn rev 1248; [lazy] added sequence? |
| 07:56 | gordongecko | does clojure have something like haskell's show? so if i have a struct X i can write a function show for it so when you do x int he repl it shows not X but some other version of X, a prettyprinted one? |
| 07:57 | AWizzArd | you mean you want your own printed representation of an object? |
| 07:57 | durka42 | gordongecko: print-method is a multimethod that dispatches on class |
| 08:01 | durka42 | see Chouser's recent patch: http://clojure.googlecode.com/issues/attachment?aid=3251654005916676481&name=print-iref.patch |
| 08:07 | Cark | with the upcoming changes regarding nil punning, would it be safer to use the empty? predicate to test if a collection is empty ? |
| 08:07 | Cark | or take the doc advice of using seq instead |
| 08:08 | rhickey | Cark: please no! empty? is still defined as (not (seq x)), and the preferred Clojure idiom is still (when (seq coll) ...) |
| 08:09 | Cark | thank you rhikey |
| 08:11 | Cark | see i have this trie library, and sometimes need to use the data as a seq, using the high order functions and lazy-cons is 10x slower than using loop recur to build a vector |
| 08:11 | Cark | actually no, it's 5 times slower |
| 08:11 | Cark | but still =/ |
| 08:13 | rhickey | but if you are a die-hard Schemer or prefer termination conditions first, you can (cond (empty? x) foo :else bar), but not my preference |
| 08:13 | rhickey | I am interested in reports of actual nil puns in the field broken by the lazy branch |
| 08:14 | AWizzArd | rhickey: so concat now has the role of lazy-cat? |
| 08:14 | bakkdoor | hi |
| 08:15 | AWizzArd | hey bak |
| 08:15 | rhickey | AWizzArd: lazy-cat still exists, because, as a macro it suspended the entire argument expressions, but if those expressions are just other sequence calls, there's no need for lazy-cat, just use concat |
| 08:16 | bakkdoor | i'm somehow having a problem with the clojure-contrib.jar. it doesnt show up within my repl in emacs, i mean the namespace doesnt. do i need to tell it somehow to load it? i use jline, have that installed and have the clojure.conf in my home folder as described in the tutorial. i also have the clojure-contrib.jar in ~/.clojure (with my jline.jar) and loading clojure with jline seems to work |
| 08:16 | rhickey | user=> (macroexpand '(lazy-cat xs ys zs)) |
| 08:16 | rhickey | (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs)) |
| 08:17 | AWizzArd | ah okay, so lazy-cat was also adopted to the new lazyness |
| 08:17 | rhickey | so if xs ys and zs are already sequence calls, they're already fully lazy and lazy-cat is redundant |
| 08:17 | gordongecko | is ther eno function forturning a vector into a hashmap? |
| 08:17 | ayrnieu | bakkdoor - (.contains (System/getProperty "java.class.path") "clojure-contrib.jar") ? |
| 08:17 | AWizzArd | gordongecko: with keeping all indexes? |
| 08:18 | bakkdoor | => true |
| 08:18 | bakkdoor | ayrnieu: => true |
| 08:19 | gordongecko | if i have this common idiom in my functions for (defstruct matrix :repr :rows :cols) where i take the repr, do soemthing ot it, then do (struct matrix new-repr (m :repr) (m :cols)), could i abstract that out? with -> perhaps? |
| 08:19 | ayrnieu | (use 'clojure.contrib.javadoc) (javadoc String) ? |
| 08:19 | bakkdoor | this is my classpath: "/home/bakkdoor/opt/clojure/clojure.jar:/home/bakkdoor/.clojure/clojure-contrib.jar:/home/bakkdoor/.clojure/jline.jar" |
| 08:20 | bakkdoor | hm works, opens my browser |
| 08:20 | ayrnieu | so what are you trying that doesn't work? |
| 08:20 | AWizzArd | gordongecko: if you do this often you could think about having a ref/agent/atom on your structured-map |
| 08:20 | bakkdoor | now it also shows the clojure.contrib.javadoc.browser and hell-out when tab-completing |
| 08:21 | gordongecko | AWizzArd: well then i make it mutable, thats not what iw ant |
| 08:21 | AWizzArd | the map is still immutable |
| 08:21 | AWizzArd | only the ref is mutable |
| 08:22 | bakkdoor | ayrnieu: i wanted to use clojure.contrib.math.expt.. but after doing (use 'clojure.contrib.math) it now works.. hmm so is there a way to also load the stuff in clojure.contrib to be displayed with tab completion like the clojure.jar stuff is by default? |
| 08:25 | ayrnieu | bakkdoor - you could cache tab-completion emacs-side; you could load all of the contrib modules. |
| 08:27 | bakkdoor | where would i put this? will it check for a .clojurerc file in my home directory or something where i can put some code i want it always to run when starting? |
| 08:28 | ayrnieu | you can have your 'clj' script load ~/.clojurecl if it exists: http://aur.archlinux.org/packages/clojure-svn/clojure-svn/clj |
| 08:28 | ayrnieu | ~/.clojure.clj , there |
| 08:28 | clojurebot | clojure is the bestest programming language available. |
| 08:29 | bakkdoor | ah alright, thanks ;) |
| 08:40 | clojurebot | svn rev 1249; [lazy] restore step fns in filter/drop |
| 08:42 | leafw | is there any clojure contrib in git, officially endorsed |
| 08:42 | leafw | kevin oneil's doesn't load. |
| 09:03 | cemerick | Good morning, all. I've been away for a while. I was hoping someone could clue me in on the latest "stable" rev in svn (e.g. the lastest prior to any experimental additions rolling in)...? |
| 09:05 | ayrnieu | clojurebot: latest |
| 09:05 | clojurebot | latest is 1249 |
| 09:05 | ayrnieu | the eperimental additions are rolling into the lazy branch. |
| 09:07 | cemerick | wow, branches in a clojure svn? Shocked, I am! ;-) |
| 09:09 | Lau_of_DK | rhickey: Did you get that pic I sent you regarding the trunk ? |
| 09:09 | rhickey | Lau_of_DK: no - where? |
| 09:09 | cemerick | rhickey: I may have forgotten all of my svn-foo by then. ;-) We moved to git over the holidays, despite all of my anti-git agitations. |
| 09:10 | Lau_of_DK | hang on |
| 09:10 | Lau_of_DK | rhickey: http://images.nonexiste.net/irc/2008/10/13/git_two.jpg |
| 09:11 | danlarkin | Lau_of_DK: I don't get it? |
| 09:11 | Lau_of_DK | you dont? Git has no trunk, SVN has everything in trunk... |
| 09:11 | danlarkin | oh.... :-/ |
| 09:11 | ayrnieu | (what you gon' do with all that origin? All that junk inside your origin?) |
| 09:20 | Lau_of_DK | rhickey: I take it you dont appreciate that kind of humor? |
| 09:22 | rhickey | Lau_of_DK: I don't git it at all |
| 09:22 | Raynes | Lol'd. |
| 09:30 | clojurebot | svn rev 1250; [lazy] more returns Sequence |
| 09:31 | rhickey | http://clojure.org/lazier enhanced - feedback wanted, it is making sense? |
| 09:51 | cgrand | rhickey: what is the problem with loop in filter/drop? |
| 09:51 | rhickey | cgrand: consumes memory while skipping |
| 09:54 | cgrand | rhickey: ah yes, thanks! |
| 09:54 | LordOfTheNoobs | Would it be odd for `if' to call `seq' on any `(sequence? x)'? Conditionals would then consume at least one item from any sequence submitted to them, `(when (filter pred coll) foo) would consume coll until pred, etc. That would restore nil punning, no? Testing to see if our collection is populated rather than that we have a lazy collection that is potentially populated seems the better default. Maybe that is just me. (when (seq |
| 09:54 | LordOfTheNoobs | (filter pred coll)) foo) seems likely to introduce errors, and is, to me, somewhat unintuitive. |
| 09:55 | rhickey | cgrand: I explain the new closed-over clearing at the bottom of: http://clojure.org/lazier |
| 09:56 | rhickey | LordOfTheNoobs: adding any overhead to something as primitive as 'if' would be unacceptable |
| 09:58 | rhickey | LordOfTheNoobs: also would mess with your ability to distinguish something empty from nothing |
| 09:58 | cemerick | rhickey: I just finished a first read/skim of /lazier and /streams. Looks nifty, and I don't have much to add. FWIW, it seems like we're almost to #t and #f for truthiness. |
| 09:59 | cemerick | ...which I'm mostly neutral about, so it's a wash for me for the most part |
| 10:01 | rhickey | cemerick: It may seem so on the surface, but there is still quite a bit of leverage to nil, using whens as seq bodies, when-first et al |
| 10:02 | rhickey | cemerick: seq/nil much more useful than #t/#f |
| 10:03 | cemerick | rhickey: yeah, I'm sure there's a lot of formal advantages to it. Of course, I'm one of those who like to have termination conditions first, so I do a bunch of (if-not ...) anyway, which I know you hate :-P |
| 10:04 | rhickey | cemerick: eah, I much prefer (when something-to-do do-it) |
| 10:04 | cemerick | I certainly will miss the current behaviour, just from a syntax/usability perspective. Python introduced me to empty-is-false, and I'll miss it. |
| 10:05 | cemerick | rhickey: well, I'm not much of a programmer, so don't pay any attention to me |
| 10:05 | rhickey | cemerick: 'empty' is false still for seqs, were you doing much (if (filter foo) ...)? |
| 10:05 | ayrnieu | (defn only-for-vecs ":(" ([[]] 0) ([_ & xs] (+ 1 (only-for-vecs xs)))) |
| 10:06 | Chouser | ayrnieu: trying to do pattern matching? |
| 10:06 | cemerick | rhickey: I can't say one way or the other right this minute. I've been away from programming for a solid month, so I can't even remember where I put my keyboard. |
| 10:09 | ayrnieu | Chouser - I was trying to show that destructuring isn't seq-agnostic, but that example fails for other reasons. |
| 10:13 | ayrnieu | (defmulti length empty?) (defmethod length true [_] 0) (defmethod length false [[_ & xs]] (+ 1 (length xs))) |
| 10:16 | Chousuke | ayrnieu: I'd call that abuse of multimethods :P |
| 10:17 | Chouser | or clever |
| 10:17 | ayrnieu | well, enjoy rewriting your less-robust code when lazy hits :-) |
| 10:18 | Chouser | ayrnieu: I'm still not sure what you're trying to show there. |
| 10:18 | ayrnieu | how would you write that for a PersistentList? |
| 10:19 | Chouser | (length '(a b c)) returns 3 for me on trunk |
| 10:19 | Chouser | does it not on lazy? |
| 10:21 | ayrnieu | huh. OK, nevermind. |
| 10:27 | jkantz | anyone have an example use-case for with-local-vars? |
| 10:29 | ayrnieu | http://github.com/search?language=clojure&q=with-local-vars |
| 10:30 | cgrand | rhickey: hmm since LazySeq extends AFn can we have named lazy-seqs? (defn cycle[coll] (lazy-seq this (concat coll this))) :-) |
| 10:34 | lisppaste8 | ayrnieu pasted "named lazy-seq" at http://paste.lisp.org/display/74786 |
| 10:37 | cemerick | Given an class with static members (e.g. an enum), referring to a non-existent member ends up throwing a "No such namespace" error. I understand that the Classname/Membername syntax has to fall back to checking for namespace/var-name, but it seems like if a class with the given name is in scope, an error message should be emitted that assumes that the code was referring to the imported class. |
| 10:37 | Chousuke | not just (defn cycle [coll] (lazy-seq (concat coll (cycle coll)))) or something? |
| 10:37 | jkantz | so when using with-local-vars are is closing over the local vars disallowed? |
| 10:37 | Chousuke | I think rhickey demonstrated something like that earlier. |
| 10:38 | Chousuke | I guess the name makes it a bit simpler :/ |
| 10:52 | rhickey | cgrand: I'm not promising that derivation (from AFn) |
| 10:53 | rhickey | just an allocation optimization right now |
| 10:54 | LordOfTheNoobs | During a break I switched some personal code ( a parser combinator ) to use the lazy branch. The inability to nil pun isn't much fun in `if-let's and recursive function application through nested lazy sequences. :p |
| 10:57 | rhickey | LordOfTheNoobs: any examples of changes you had to make that you could paste? |
| 11:00 | jayfields | has anyone use clojure to generate JUnit tests? I can't find anything on the web. |
| 11:00 | jayfields | (other than an old edition of Stu's book which has a gen-and-save-class example, but I was looking for something more dynamic) |
| 11:21 | gordongecko | how do i throw an exception? |
| 11:21 | cooldude127 | gordongecko: (throw (Exception. "blah")) |
| 11:22 | AWizzArd | It seems gordongecko is about to learn all of Clojure within 1 or 2 days... |
| 11:23 | LordOfTheNoobs | rhickey: I was on a break at the time, sorry for the delay. I've github'd the code for the curious. Most `problems` will be easily solved when lazy merges. I'll just code some `if-seq-let` type functions. |
| 11:23 | LordOfTheNoobs | http://github.com/knome/clojure-parser-combinator/blob/39604ab7f0a24f442da1b6ef40caebce544eea9e/parser.clj |
| 11:25 | gordongecko | gordongecko is out of jail for inside trading ready to take over the world |
| 11:40 | paramond | Hi! Does anybody know how to load a Java class file at the repl? Something like (load-class "MyJavaClass.class") |
| 11:41 | Chousuke | paramond: you can't load class files directly, but you can add directories and jars to the classpath |
| 11:41 | Chousuke | (doc add-classpath) |
| 11:41 | clojurebot | Adds the url (String or URL object) to the classpath per URLClassLoader.addURL; arglists ([url]) |
| 11:41 | Chousuke | Though I guess that could work for class files directly too :/ |
| 11:42 | paramond | Thanks, i will try that out. |
| 11:43 | cooldude127 | is there a way to split a namespace into multiple files? |
| 11:45 | jayfields | how do I get an environment variable? (the equivalent of System.getenv("USERNAME")) |
| 11:46 | Chousuke | cooldude127: sure; you can just declare the namespace in a master file and use (load-file) |
| 11:46 | cooldude127 | Chousuke: ok thank you, my file is getting big but i don't want to split the namespace |
| 11:46 | Chousuke | cooldude127: load-file is like include I suppose :) |
| 11:48 | rhickey | cooldude127: look at the end of core.clj where it loads the proxy/print and genclass stuff |
| 11:48 | cooldude127 | ok |
| 11:48 | Chousuke | jayfields: System/getenv; though apparently that's deprecated. |
| 11:48 | cooldude127 | how is that deprecated? |
| 11:48 | Chousuke | it says in the docs you should instead use properties |
| 11:49 | jayfields | thanks |
| 11:49 | cooldude127 | oh lamer |
| 11:49 | cooldude127 | *lame |
| 11:49 | Chousuke | well, it's more portable I guess. |
| 11:49 | cooldude127 | eh, since when does java care about portability ;) |
| 11:49 | Chousuke | :P |
| 11:52 | shoover | paramond: you will need your class's directory on the classpath and then call import to get the class. at the REPL: (import '(my.package MyJavaClass)), where the parent of directory my/package is on the cp |
| 12:08 | paramond | shoover: should i left my.package out if i didn't declare MyJavaClass in a package? |
| 12:09 | Chousuke | paramond: you need to declare it in a package I think |
| 12:10 | paramond | paramond: but isn't there something like an unnamed package in java? |
| 12:10 | paramond | shoover: but isn't there something like an unnamed package in java? |
| 12:13 | kotarak | which is discouraged to be used in java land.... |
| 12:14 | paramond | of course |
| 12:14 | duck1123 | Won't it end up in some default package? like 'user or some such. |
| 12:14 | duck1123 | or is that only in a repl |
| 12:14 | nsinghal | I have classpath with "classes" and "src" directory of a java project in that order. When i do (require :reload-all 'org.cc.file) - it is not reevaluating the changed clj file. If i delete the classes files (file__init.class) than the new clj is getting loaded. |
| 12:15 | gordongecko | java.lang.IllegalStateException: No transaction running (NO_SOURCE_FILE:0) |
| 12:15 | gordongecko | why not? |
| 12:15 | duck1123 | is the clj file newer than the classes? |
| 12:16 | nsinghal | yes |
| 12:16 | kotarak | nsinghal: this is a known issue. |
| 12:16 | cooldude127 | gordongecko: if you're doing something that needs a transaction, you probably need to wrap it in (dosync ...) |
| 12:17 | nsinghal | kotarak: thanks. is it being considered for fix? |
| 12:17 | kotarak | nsinghal: it's in the tracker: http://code.google.com/p/clojure/issues/detail?id=38 |
| 12:19 | kotarak | nsinghal: so that tracker mainly consists of issues approved by rhickey it's probably fix at some point. |
| 12:19 | nsinghal | kotarak: thanks again. i will keep an eye on it |
| 12:22 | kotarak | But probably not after a working day... |
| 12:24 | gordongecko | if im nesting 3 for loops fo i need to dorun on all? |
| 12:25 | kotarak | gordongecko: for is not a loop. If you do this for side effects use doseq |
| 12:26 | kotarak | gordongecko: if you are interested in the results and still need side-effects, wrap the for in a doall. |
| 12:27 | Chousuke | does doall realise the seqs recursively? |
| 12:27 | Chousuke | for somewhat unfortunate naming; but if you ask me, it's C that uses the name "for" wrong :P |
| 12:27 | kotarak | hehe |
| 12:28 | gnuvince | Chousuke: more succinctly: C is wrong. |
| 12:28 | gnuvince | ;) |
| 12:28 | kotarak | gordongecko: do you have some code? |
| 12:28 | Chousuke | nah |
| 12:28 | kotarak | lisppaste8: url |
| 12:28 | lisppaste8 | To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste. |
| 12:28 | Chousuke | C is nice. |
| 12:28 | Chousuke | C++ is wrong :( |
| 12:28 | kotarak | here's a place to put it. Looking at an example might help to help you. |
| 12:29 | gnuvince | Chousuke: I guess that's subjective, but there are a lot of things wrong with C. |
| 12:30 | Chousuke | Well, yeah |
| 12:30 | replaca | C is a very nice portable assembly language |
| 12:30 | Chousuke | but if you keep it simple, it does the job it's supposed to. |
| 12:30 | kotarak | Chousuke: I think it depends on how the for's are nested. if the inner for produces a seq for the outer for it's evaluated I think. If the outer for generates a seq containing the inner for as elements.... |
| 12:32 | lisppaste8 | gekko pasted "sideeffecting problem" at http://paste.lisp.org/display/74798 |
| 12:32 | lisppaste8 | gekko annotated #74798 with "untitled" at http://paste.lisp.org/display/74798#1 |
| 12:32 | kotarak | gordongecko: you want doseq instead of for |
| 12:33 | Chousuke | using a ref like that looks wrong. |
| 12:33 | gordongecko | anyone could take a look at that? i thnk imdoing the same as the java-code |
| 12:33 | Chousuke | it's simulating mutation; you need to figure out a more functional way to do it. |
| 12:34 | gordongecko | yes but it should work anyway right? |
| 12:34 | kotarak | gordongecko: as I wrote, you want doseq instead of for |
| 12:35 | gordongecko | yes i mgihtn want that but what im saying it should work like this too no? |
| 12:36 | Chousuke | it should, I guess. |
| 12:36 | Chousuke | assuming assoc-inc is just a typo in the paste :) |
| 12:37 | Chousuke | but that's really not a good way of doing it. |
| 12:39 | lisppaste8 | gekko annotated #74798 with "untitled" at http://paste.lisp.org/display/74798#2 |
| 12:39 | gordongecko | http://paste.lisp.org/display/74798#2 |
| 12:39 | gordongecko | assoc-inc is my own fucntion |
| 12:40 | kotarak | gordongecko: I suspect get-at also |
| 12:41 | cooldude127 | gordongecko: funny, i'm also working matrices in clojure :) |
| 12:41 | cooldude127 | except it's all functional. no refs or any mutation at all |
| 12:42 | gordongecko | im only using mutation here |
| 12:42 | gordongecko | i wrote the damn thing in haskell first |
| 12:42 | gordongecko | worked nicely |
| 12:43 | gordongecko | u know there is colt(java lib) for hardcore matrix stuff right? |
| 12:43 | gordongecko | both sparse and dense |
| 12:43 | cooldude127 | no i didn't, but part of the reason i'm writing it is educational |
| 12:43 | cooldude127 | help myself learn the stuff i'm doing in my calc 3 class |
| 12:44 | cooldude127 | just coded up some really shitty row reduction code |
| 12:44 | cooldude127 | but i need to go, i'll be back on soon |
| 12:45 | gordongecko | calc uni or hs? |
| 12:58 | Chousuke | gah, I can never quite remember how matrix multiplication works :( |
| 13:00 | Chousuke | I always get confused about the order in which to multiply the component vectors :/ |
| 13:09 | durka42 | doesn't seem like you should need side effects for matrix multiplication |
| 13:21 | jbondeson | the more code i write in C# the more i love immutable datatypes |
| 13:21 | Nafai | jbondeson: Why do you say that? I'm not closely familiar with C# |
| 13:23 | jbondeson | just happen to be writing a new datatype and keeping track of data changing is a bitch. soooo much cleaner when your enclosed type can't change. |
| 13:23 | gnuvince | Either he uses mutable data structures which cause him endless problems, or he uses immutable data structures which don't give him nearly as many problems. |
| 13:24 | Nafai | Heh |
| 13:25 | jbondeson | what's really annoying is having to realize that structs and classes are treated so much differently by the CLR, not to mention that sometimes structs are immutable in the BCL, and sometimes mutable. |
| 13:26 | jbondeson | makes you want to throw your hands up in despair and just code some more clojure |
| 13:27 | cooldude127 | jbondeson: clojure is my relief from my data structures class in java |
| 13:27 | cooldude127 | i wrote a b-tree, then did some clojure code to make me feel better |
| 13:27 | jbondeson | heh |
| 13:29 | cooldude127 | i think i just made myself a lot more productive in emacs by simply switching to the bar cursor instead of a box |
| 13:30 | cooldude127 | apparently i spent a lot of time wondering what stuff was underneath my cursor |
| 13:30 | technomancy | you can't see through it? |
| 13:30 | cooldude127 | no, i guess my theme doesn't have it that way |
| 13:30 | jbondeson | The box is more explicit for me, especially in insert mode |
| 13:30 | technomancy | maybe your graphics card doesn't have enough transparency support |
| 13:32 | cooldude127 | technomancy: i doubt that |
| 13:32 | cooldude127 | jbondeson: insert mode? |
| 13:33 | cooldude127 | i used to be able to see through it, not sure when that stopped happening. i like the bar anyway tho |
| 13:41 | Lau_of_DK | Good evening gents |
| 13:42 | cooldude127 | good afternoon lau |
| 13:42 | duck1123 | I used to use the bar cursor, but I lost it a couple revisions ago when I was cleaning up my .emacs |
| 13:44 | cgrand1 | good evening Mr of_DK |
| 13:44 | Lau_of_DK | :) |
| 13:44 | jbondeson | cooldude127: sorry, in emacs it's "Overwrite" mode |
| 13:44 | jbondeson | as in after you hit the "INS" key |
| 13:44 | cooldude127 | jbondeson: oh, that. never used it :) |
| 13:44 | duck1123 | I've disabled it |
| 13:44 | jbondeson | hah |
| 13:45 | cooldude127 | mac doesn't even have an ins key, so i forgot about it |
| 13:45 | jbondeson | i use it for correcting capitalization, which as you can tell my my dislike of the shift key, happens quite a bit |
| 13:45 | duck1123 | (put 'overwrite-mode 'disabled t) |
| 14:08 | jayfields | is there a target date for Clojure 1.0? |
| 14:09 | cooldude127 | technomancy: wooo! my clojure-update function actually did its job! i just got some updated slime |
| 14:10 | gnuvince | cooldude127: what function? |
| 14:10 | durka42 | slimier than ever! |
| 14:10 | danlarkin | jayfields: no |
| 14:10 | cooldude127 | gnuvince: an emacs function to complement technomancy's clojure-install function |
| 14:10 | technomancy | cooldude127: high-five! |
| 14:10 | cooldude127 | updates your copies of clojure, clojure-contrib, swank-clojure, and slime |
| 14:10 | technomancy | I committed it to clojure-mode btw |
| 14:10 | gnuvince | nice |
| 14:11 | cooldude127 | oh and recompiles clojure |
| 14:11 | cooldude127 | technomancy: cool |
| 14:11 | gnuvince | I got a python script to update swank-clojure, slime and clojure-mode and I do clojure and clojure-contrib by hand. |
| 14:11 | technomancy | cooldude127: I took out the part that runs ant in clojure-contrib though since I realized it's unnecessary; just add clojure-contrib/src/ to the classpath instead. |
| 14:11 | cooldude127 | technomancy: does clojure-slime-config take care of that? |
| 14:11 | technomancy | yups |
| 14:11 | cooldude127 | cool |
| 14:12 | cooldude127 | technomancy: i notice you haven't pushed that yet |
| 14:12 | technomancy | cooldude127: not to master, no |
| 14:12 | cooldude127 | technomancy: installer on github doesn't include it either |
| 14:12 | technomancy | oh crap |
| 14:12 | technomancy | you are correct |
| 14:12 | technomancy | done |
| 14:14 | cooldude127 | technomancy: i think i spot an erro |
| 14:14 | cooldude127 | r |
| 14:14 | cooldude127 | (concat clojure-src-root "/clojure-contrib/clojure-contrib/src/") |
| 14:15 | cooldude127 | why two clojure-contribs? |
| 14:15 | cooldude127 | i only have one in my checkout |
| 14:15 | technomancy | you are right |
| 14:15 | cooldude127 | wooo i'm on a roll today |
| 14:15 | technomancy | that's one way to think of it. |
| 14:15 | technomancy | (the other being that I'm losing it.) |
| 14:15 | cooldude127 | lol |
| 14:16 | cooldude127 | technomancy: you are really quick |
| 14:16 | technomancy | it's not a hard fix. =) |
| 14:17 | cooldude127 | true |
| 14:17 | cooldude127 | technomancy: i was going to ask why clojure-update didn't get an autoload, but then i realized that if you're using clojure-update, you probably already called clojure-slime-config |
| 14:18 | technomancy | aye |
| 14:21 | cooldude127 | technomancy: you killed off the save-window-excursion part tho |
| 14:22 | technomancy | cooldude127: oh dang; I was playing around with it and forgot it |
| 14:22 | cooldude127 | lol |
| 14:22 | technomancy | you had it around the compilation part, right? |
| 14:22 | cooldude127 | yeah |
| 14:22 | cooldude127 | in the normal case, the update part doesn't need it, they are one-liners |
| 14:22 | technomancy | will put that back in |
| 14:22 | cooldude127 | cool |
| 14:29 | cooldude127 | got the fix |
| 14:39 | BigTom | Where can I get a gentle intro into swank/slime etc? |
| 14:39 | BigTom | I seem to spend all me time lookin for how to do things rather than doing Clojure |
| 14:39 | BigTom | so I'm back to JEdit and a REPL again |
| 14:41 | BigTom | I had more luck with Erlang so I don't think its Emacs (though I stumble around with that to some extent) |
| 14:41 | cooldude127 | BigTom: what's going wrong for you? |
| 14:42 | BigTom | Its not 'going wrong' as such, I just cannot seem to get anything going I'm trying clojure box so It should have installed ok |
| 14:43 | cooldude127 | BigTom: you on windows i figure if you're doing clojurebox? |
| 14:43 | BigTom | yup |
| 14:43 | BigTom | my work machine |
| 14:44 | cooldude127 | i probably won't be too much help, but technomancy's clojure-mode fork has some good support for installing and setting up clojure and slime. don't think it will work well on windows tho |
| 14:45 | BigTom | maybe I'll try it on my linux box |
| 14:45 | BigTom | Once I get over this hump |
| 14:45 | cooldude127 | well i g2g |
| 14:46 | technomancy | BigTom: let me know if it works for you |
| 14:46 | BigTom | I have a bad habit of pissing time away on dev environments rather than learning the language so I am being a bit conservative |
| 14:46 | technomancy | if you can get it working on w32 I'd take some patches, but I don't think I could help much with it myself |
| 14:46 | BigTom | technomancy: thanks |
| 14:46 | jbondeson | BigTom: http://www.pchristensen.com/slimecommands.pdf |
| 14:46 | technomancy | BigTom: well this should be a single command, so it shouldn't take long to see if it works or not |
| 14:47 | BigTom | jbondeson: that looks good |
| 14:48 | jbondeson | C-c C-l is the big one, it load and evaluates a file |
| 14:48 | jbondeson | C-c C-c evaluates a form |
| 14:48 | jbondeson | if you just changed on form |
| 14:49 | jbondeson | one thing to realize is that you need to save your file before C-c C-l |
| 14:49 | jbondeson | also some of those commands may not be available with swank-clojure |
| 14:52 | technomancy | jbondeson: there's another command that just loads w/o prompting you like C-c C-l |
| 14:53 | jbondeson | yeah, C-c C-k |
| 14:54 | BigTom | ok, I have clojurebox slime running, I have loaded a file and load it (C-c C-l) |
| 14:54 | BigTom | Then I display the REPL |
| 14:54 | jbondeson | also, i don't know how clojure-box comes set up, but you can split a window horizontally with C-x 3, and vertically with C-x 2 |
| 14:55 | BigTom | how do I get the REPL to execute? It just gives me a new line. |
| 14:55 | jbondeson | depending if you have a namespace defined, you may have to do a (in-ns) at the repl |
| 14:55 | jbondeson | you're not getting results? |
| 14:56 | BigTom | no, just working my way down the REPL |
| 14:58 | jbondeson | when you type in a form it's not displaying the results? |
| 14:58 | BigTom | nope |
| 14:58 | jbondeson | o_O |
| 14:58 | jbondeson | what does your repl say? |
| 14:59 | BigTom | A new 'unloaded' REPL works |
| 14:59 | jbondeson | I'm not quite following you. |
| 15:00 | BigTom | Does clojurebox have its own Clojure.jar? |
| 15:00 | jbondeson | I believe clojure-box comes with a clojure.jar and clojure-contrib.jar |
| 15:01 | BigTom | jbondeson: First time round the REPL was a bit dead, seems healthier now |
| 15:01 | BigTom | (after restart) |
| 15:01 | BigTom | I am going to have to replace the clojure jars, I need the new watchers |
| 15:02 | jbondeson | you can open up the .emacs file and change the location |
| 15:02 | BigTom | jbondeson: Ah, thanks |
| 15:02 | shoover | BigTom: how old is your clojure box? the one on the site matches clojure svn r1235 |
| 15:03 | BigTom | shoover, I think I grabbed it a couple of days back |
| 15:03 | BigTom | jbondson: I take it I need my own .emacs, I don't have one yet, hang on |
| 15:04 | shoover | I would recommend grabbing again. I just uploaded yesterday |
| 15:04 | BigTom | ah, will do |
| 15:04 | shoover | you don't need .emacs. clojure box handles the initialization. but if you do have .emacs, it could mess up clojure box |
| 15:04 | shoover | (if you change settings it wants a certain way) |
| 15:04 | hiredman | hmmm |
| 15:05 | hiredman | someone renamed the google map |
| 15:05 | BigTom | shoover: ok |
| 15:05 | jbondeson | BigTom: Sorry, I thought it simply came with a preconfigured .emacs file. |
| 15:05 | hiredman | the clojure google map has been renamed to "William Hidden" |
| 15:05 | shoover | it comes with a preconfigured default.el in the site-start directory |
| 15:05 | BigTom | shoover: I got it from bighugh, is that the right place? |
| 15:06 | shoover | BigTom: yes |
| 15:06 | shoover | hiredman: I don't blame that person... adding a point is hard to figure out |
| 15:06 | hiredman | yeah |
| 15:18 | BigTom | shoover: Hi again |
| 15:18 | shoover | and? |
| 15:19 | BigTom | shoover: I have the latest and it compiles stuff and the REPL works out of the box |
| 15:20 | shoover | good |
| 15:20 | BigTom | The current problem is that I cannot run expressions from a file I have loaded (Unable to resolve symbol) |
| 15:20 | shoover | hmm, I just did a C-c C-l on fnparse and it resolved ok |
| 15:20 | cooldude127 | BigTom: using clojurebox? |
| 15:20 | BigTom | how do I sort the classpath out? |
| 15:21 | BigTom | cooldudel27: yes |
| 15:21 | hiredman | does the file declare a namespace at the top? are you in the namespace declared by the file? |
| 15:21 | cooldude127 | oh |
| 15:21 | BigTom | hiredman: yes |
| 15:21 | hiredman | yes to both? |
| 15:22 | BigTom | clojurebox and namespace in file |
| 15:22 | BigTom | filename euler.clj namespace euler |
| 15:22 | cooldude127 | BigTom: and it does (ns euler) at the top? |
| 15:23 | BigTom | coldudel27: yes (ns euler) |
| 15:23 | cooldude127 | hmm |
| 15:23 | BigTom | how do I work out "where" the REPL thinks it is? |
| 15:24 | shoover | run ProcMon :) |
| 15:24 | Chousuke | hmm |
| 15:24 | Chousuke | there was some java property |
| 15:24 | Chousuke | maybe user.dir |
| 15:25 | cooldude127 | BigTom: like what directory? |
| 15:25 | cooldude127 | cuz that shouldn't matter in this case |
| 15:25 | BigTom | cooldudel27: ok, thanks, so the file location doesn't matter? |
| 15:26 | shoover | I can access symbols with a namespace-qualified name, but I can't use or require the namespace |
| 15:27 | BigTom | everything I do with my code gets ; Evaluation aborted |
| 15:27 | shoover | BigTom: how are you trying to access the symbols from the loaded file? use? require? fully-qualified? |
| 15:28 | hiredman | clojurebot: what do you think of emacs? |
| 15:28 | clojurebot | "Learning Emacs and SLIME was just about the most painful computer experience I've ever been through." |
| 15:28 | BigTom | I've tried (use 'euler) and (euler-euler-1 100) |
| 15:28 | shoover | euler/euler-1 |
| 15:29 | cooldude127 | yeah |
| 15:29 | BigTom | I mean(euler.euler-1 1--) |
| 15:29 | shoover | use a / |
| 15:29 | shoover | or you can (do (refer 'euler) (euler-1 100)) |
| 15:29 | BigTom | shoover: Doh! |
| 15:29 | Ariens | clojurebot: what do you think of textmate? |
| 15:29 | clojurebot | Huh? |
| 15:29 | BigTom | (euler/euler-1 100) worked |
| 15:29 | hiredman | ,(.codePointAt "..." 0) |
| 15:29 | clojurebot | 8230 |
| 15:30 | shoover | for use and require, you will have to (add-classpath "file:///path/to/eulers/parent") |
| 15:30 | cooldude127 | BigTom: apparently you just had the wrong namespace separator |
| 15:30 | hiredman | clojurebot: how about that add-classpath? |
| 15:30 | clojurebot | classpath is (System/getProperty "java.class.path") |
| 15:30 | hiredman | clojurebot: add-classpath? |
| 15:30 | clojurebot | add-classpath is bad, avoid it. I mean it! |
| 15:30 | shoover | clojurebot: why? |
| 15:30 | clojurebot | why not? |
| 15:30 | BigTom | cooldudel27: at the end, I think the add-classpath will be the trick |
| 15:31 | BigTom | hiredman: is that bad then? |
| 15:31 | hiredman | BigTom: it is unreliable |
| 15:31 | cooldude127 | BigTom: but really, if this is your own code, with slime you just load the file with your code, and run C-c C-k which compiles all your code into the repl |
| 15:31 | cooldude127 | i've never once used add-classpath |
| 15:33 | BigTom | cooldude127: How do you invoke your expressions? |
| 15:34 | cooldude127 | BigTom: when i first load slime, i run C-c C-k to load a file for the first time. after that, when i change a function, i run C-c C-c to compile just that function (or macro or any other toplevel expression) |
| 15:35 | BigTom | cooldude127: when you are testing them do you call them from the REPL with fully qualified names? |
| 15:36 | shoover | BigTom: try (refer 'euler). Normally that would be done as part of the ns at the top, but from the REPL refer should work after C-c C-k |
| 15:36 | cooldude127 | BigTom: no, i usually change into the namespace they are in with ,!p |
| 15:36 | cooldude127 | comma performs slime commands |
| 15:36 | cooldude127 | !p is an abbreviation for change-package |
| 15:37 | BigTom | cooldude127: that got it, thanks |
| 15:37 | cooldude127 | cool |
| 15:37 | BigTom | cooldude127: when yoy say it would normally be done as part of the ns, am I missing something? |
| 15:37 | BigTom | cooldude127: in my code? |
| 15:38 | cooldude127 | well shoover said that, but he means in code, you wouldn't use (refer blah), as that would be done in your (ns) declaration at the top. but for the repl, you don't have one, so (refer) is ok |
| 15:39 | BigTom | cooldude127: thnaks |
| 15:39 | cooldude127 | no problem |
| 15:39 | technomancy | you can call ns in the repl |
| 15:39 | BigTom | One last question, if I want to load a load of dependent jars (I am playing with compojure) what is the most convenient way? |
| 15:39 | technomancy | but if you'd rather not; yeah just call use or refer etc. |
| 15:40 | cooldude127 | technomancy: you can, but it's usually easier to use the others if you're just messing around in user |
| 15:40 | technomancy | BigTom: I add them to swank-clojure-extra-classpaths before launching slime |
| 15:40 | cooldude127 | BigTom: configure swank-clojure-extra-jars |
| 15:40 | cooldude127 | BigTom: listen to technomancy, i was guessing |
| 15:41 | technomancy | cooldude127: the advantage of running IRC in Emacs is you can type swank-clojure- followed by M-/, and it will autocomplete from all loaded lisp symbols. =) |
| 15:42 | cooldude127 | technomancy: you're right, the thought to do that didn't even occur to me :) |
| 15:42 | BigTom | technomancy: that's in swank-clojure.el? |
| 15:42 | cooldude127 | yes |
| 15:42 | technomancy | it's called intelligence augmentation. =) some of us need a little more help than others. |
| 15:43 | cooldude127 | technomancy: apparently today you do ;) |
| 15:43 | technomancy | "I'm not... normally like this..." |
| 15:43 | cooldude127 | lol |
| 15:43 | cooldude127 | i have my own problems today |
| 15:43 | BigTom | And on that note I will go and do family stuff |
| 15:43 | cooldude127 | i have no idea why my code to compute matrix inverses isn't correct, but i do know it's wrong |
| 15:44 | BigTom | Thanks everyone for all the help |
| 15:44 | cooldude127 | no problem |
| 15:44 | shoover | BigTom: you're welcome. Read the README.rtf in c:\program files\clojure box for how to customize that variable |
| 15:45 | jbondeson | cooldude127: because computing the inverse of matricies is friggin' evil. |
| 15:45 | ayrnieu | really? I don't know how anyone could find http://mathworld.wolfram.com/MatrixInverse.html unclear. |
| 15:46 | cooldude127 | jbondeson: i have two ways of doing them, and one of them is very wrong for anything more than 3x3 |
| 15:46 | cooldude127 | but then apparently that method doesn't work for that |
| 15:47 | cooldude127 | which i didn't know |
| 15:47 | jbondeson | anything over 3x3 (which mean 99.999% of the time) needs to use more advanced linear algebraic methods. |
| 15:48 | jbondeson | friggin' LU Decomposition |
| 15:48 | cooldude127 | jbondeson: i have LU sort of working |
| 15:48 | cooldude127 | it doesn't handle the bad cases well tho |
| 15:48 | cooldude127 | 0's kind of trip it up |
| 15:49 | cooldude127 | stupid row reduction |
| 15:50 | ryszard_szopa | I already know add-classpath is evil. Can anybody explain me why? (apart from the fact that it doesn't seem to work;)) |
| 15:50 | cooldude127 | ryszard_szopa: that's probably it |
| 15:50 | jbondeson | that would probably be a good reason it's evil... |
| 15:51 | ryszard_szopa | well, I guessed that if that was it I would see people complaining and other fixing stuff... |
| 15:52 | ryszard_szopa | *other people |
| 15:52 | cooldude127 | ryszard_szopa: naw, we just ignore it |
| 15:52 | cooldude127 | pretend it's not there ;) |
| 15:54 | jbondeson | it's useful at the repl, but otherwise should be treated like a leper at a party: kept away from the chip bowl |
| 15:55 | technomancy | ryszard_szopa: apparently the JVM makes it impossible to implement correctly |
| 15:55 | technomancy | I think that's the Official Story |
| 15:55 | technomancy | even though somehow JRuby manages it... |
| 15:55 | jbondeson | ruby involves deep magic... best not dwell upon it |
| 15:56 | cooldude127 | i believe the underlying philosophy of ruby is magic |
| 15:57 | technomancy | the underlying philosophy of Ruby is "you can do it at runtime"... which can often mean magic. =) |
| 15:57 | cooldude127 | lol |
| 15:57 | hiredman | jruby most likely has more layers of indirection between it and the jvm, so it has room to shuffle stuff around |
| 15:58 | ryszard_szopa | well, I know next to nothing about Java (I have mainly Common Lisp and Python experience), and being able to poke around and see how some Java libraries work would probably help me a lot. |
| 15:58 | technomancy | whereas with Java it's like, "What do you mean you don't know your classpath at boot time? Haven't you held the requisite planning meetings to decide what jars you're going to use?" |
| 15:58 | jbondeson | it still kills me that ruby on the jvm is faster in many cases than ruby on it's own vm |
| 15:58 | technomancy | jbondeson: that was true two days ago... =) |
| 15:58 | cooldude127 | technomancy: lol |
| 15:58 | technomancy | jbondeson: before Ruby had its own VM. now with its own VM it's usually faster than JRuby |
| 15:59 | ryszard_szopa | the present implementation of add-classpath is around 6 lines long |
| 15:59 | ryszard_szopa | do you think it is really that hard to fix? |
| 15:59 | hiredman | the jvm is pretty cool and my respect for all the tools in the java runtime grows and grows |
| 15:59 | jbondeson | technomancy: ruby: when you're starting to look bad, make some breaking change that'll slow down the opposition? |
| 16:00 | technomancy | hehe |
| 16:00 | hiredman | ryszard_szopa: it doesn't seem to bother people enough to try and fix it |
| 16:02 | jbondeson | i just avoid the whole problem by rolling one nice big jar with clojure and contrib in it (for my own stuff, no distribution) |
| 16:03 | kotarak | clojurebot: macro |
| 16:03 | clojurebot | macro help is http://clojure-log.n01se.net/macro.html |
| 16:08 | ryszard_szopa | OK, so how can I check what is the current classpath, ie. if add-class has worked? |
| 16:08 | ayrnieu | ,(System/getProperty "java.class.path") |
| 16:08 | clojurebot | java.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read) |
| 16:08 | ryszard_szopa | (. System (getProperty "java.class.path")) seems to show me what was specified at the command line |
| 16:09 | technomancy | ayrnieu: that only gives you the boot classpath |
| 16:09 | technomancy | ryszard_szopa: AFAIK there's no way to get anything other than the boot classpath |
| 16:09 | technomancy | sad but true |
| 16:10 | ryszard_szopa | technomancy: does this mean there's no way of checking if add-classpath has succeeded? |
| 16:10 | technomancy | ryszard_szopa: apart from trying an "import" and seeing if it fails, no |
| 16:11 | technomancy | ryszard_szopa: it sucks to maintain your classpath list manually... the best I've been able to come up with is to have a jars directory and construct your classpath dynamically from its contents. |
| 16:11 | technomancy | but AFAIK there's no getting around restarting the JVM. which is sad. |
| 16:11 | ayrnieu | the jars directory is what I do. CLASSPATH is not unlike C's LD_LIBRARY_PATH , ldconfig , etc. |
| 16:12 | technomancy | I've fought this fight... it's not worth it. accept the annoyance and move on; you'll have more fun. |
| 16:12 | ayrnieu | it's just that the small bit of architecturing you have to do for CLASSPATH, your OS already does for C. |
| 16:12 | ayrnieu | and perhaps your expectations are higher. Of *course* C doesn't let you switch between clojure-trunk and clojure-lazy at runtime. |
| 16:13 | technomancy | ayrnieu: I've been spoiled by other lisps. |
| 16:13 | Raynes | Is there a function to get Console input in Clojure? |
| 16:13 | ryszard_szopa | does writing a shell script to maintain a sane classpath count as fighting the system? ;-) |
| 16:13 | ayrnieu | well, let the advantages of jars spoil these other lisps for you in other respects :-) Then you'll be too bitter to use anything. |
| 16:13 | technomancy | ryszard_szopa: btw, I *think* the problems with add-classpath only apply to jars that contain java... it might be fine to use it with directories full of clj files. |
| 16:14 | ryszard_szopa | and, are there any drawbacks of having a large classpath? |
| 16:14 | rhickey | technomancy: do you know about java.ext.dirs? |
| 16:14 | durka42 | ,(.. clojure.lang.RT getRootClassLoader getURLs) |
| 16:14 | clojurebot | #<URL[] [Ljava.net.URL;@77a748> |
| 16:14 | durka42 | ,(map prn (.. clojure.lang.RT getRootClassLoader getURLs)) |
| 16:14 | clojurebot | nil |
| 16:14 | durka42 | the above is not a stable API |
| 16:14 | technomancy | ryszard_szopa: as long as your shell script doesn't enumerate each jar but builds it up from a glob, I'd say you're good |
| 16:14 | durka42 | but that is where add-classpaths go |
| 16:14 | ayrnieu | ryszard, I have eight lines of CLASSPATH in my ~/.zshrc, and three add every .jar in a specific directory to it. I also have a Makefile that I say 'make lazy' 'make trunk' to, to swap out .jars |
| 16:15 | technomancy | rhickey: have read about it but haven't used it yet. does it allow you to add in a jar after the JVM has booted? |
| 16:15 | technomancy | vs building a static list at boot time |
| 16:16 | AWizzArd | where again can I find the roadmap for Clojure? |
| 16:17 | ayrnieu | java -Djava.ext.dirs=/directory/of/jars ... |
| 16:17 | StartsWithK | why not java -cp "lib/*" clojure.lang.Repl |
| 16:18 | StartsWithK | loads all jars under lib/ |
| 16:18 | durka42 | so only specifically mentioned (or globbed) jars are added to the classpath, but everything in the extdirs? |
| 16:18 | technomancy | StartsWithK: right, but you can't add anything after you've booted |
| 16:19 | technomancy | if java.ext.dirs allows for that, then that would pretty much take care of my issues |
| 16:19 | technomancy | it's a little inside-out from what I'm used to, but it'd still allow for what you need. |
| 16:21 | Chouser | I think people have had some issues with java.ext.dirs. something about it being meant for extensions (native libs?) not regular .jars. |
| 16:22 | rhickey | http://java.sun.com/j2se/1.4.2/docs/guide/extensions/spec.html#deployment |
| 16:23 | ryszard_szopa | ayrnieu: do you think that generating my classpath with something like `mdfind -onlyin /usr/ "kind:jar"` would be overkill? ;-) |
| 16:24 | rhickey | Chouser: I think it is specifically for the kind of "installed on my machine" use you always wanted |
| 16:24 | rhickey | with a single indirection |
| 16:24 | rhickey | vs a true global install |
| 16:31 | Chouser | This is the message I was thinking of: http://groups.google.com/group/clojure/msg/7f0c9775ba70d169 |
| 16:32 | Chouser | or perhaps this one: http://groups.google.com/group/clojure/msg/f65dd874f779b15c |
| 16:32 | Chouser | in which case the only issue may be if your OS is already assuming (or has set) a java.ext.dir for you. |
| 16:33 | Chouser | in which case it might be better to simply install your jars there instead of resetting java.ext.dir |
| 16:43 | hiredman | does import not work with classes in jars added with add-classpath? |
| 17:01 | lisppaste8 | ryszard_szopa pasted "memfn for static methods?" at http://paste.lisp.org/display/74820 |
| 17:01 | ryszard_szopa | is there something like memfn for static methods? |
| 17:03 | Chouser | ryszard_szopa: that last example is what I always do |
| 17:06 | ryszard_szopa | Chouser: well, it works, but somehow it doesn't seem "right". otoh from the character count point of view #(Foo/bar %) may be optimal... |
| 17:08 | Chouser | I think it should be possible for the compiler to recognize a static method reference in a value position and generate a little fn wrapper on the fly. |
| 17:08 | Chouser | dunno if rhickey would take a patch for that or not. |
| 17:08 | Chouser | hm, seems plausible that it could even recognize the .foo syntax and write #(.foo %) for you, though I guess that's a rather less common scenario |
| 17:10 | Chousuke | I think he mentioned possibly auto-memfn:ing java methods in value position once. |
| 17:12 | Chouser | http://clojure-log.n01se.net/date/2008-11-19.html#21:00a-21:04 |
| 17:16 | rhickey | Chouser: the problem with the auto-memfning is overloads, once you need to distinguish #() wins |
| 17:19 | Chouser | arity overloading, right? |
| 17:19 | durka42 | couldn't overloads be handled as normal? |
| 17:20 | durka42 | ,(map #(Math/ulp %) [(float 1.23) (double 1.23)]) |
| 17:20 | clojurebot | (1.1920929E-7 2.220446049250313E-16) |
| 17:20 | Chouser | because it's unlikely that you'd be able to avoid reflection anyway |
| 17:23 | rhickey | Chouser: you can type-hint % |
| 17:23 | Chouser | right, but you'd have to do it explicitly on the arg. |
| 17:23 | rhickey | ? |
| 17:23 | rhickey | user=> (set! *warn-on-reflection* true) |
| 17:23 | rhickey | true |
| 17:23 | rhickey | user=> #(Math/ulp %) |
| 17:23 | rhickey | Reflection warning, line: 9 - call to ulp can't be resolved. |
| 17:23 | rhickey | #<user$eval__29$fn__31 user$eval__29$fn__31@2db45934> |
| 17:23 | rhickey | user=> #(Math/ulp (float %)) |
| 17:24 | rhickey | #<user$eval__36$fn__38 user$eval__36$fn__38@7be4d80b> |
| 17:24 | Chouser | the compiler's not going to infer the type for the arg based on the seq passed to 'map', for example. |
| 17:24 | rhickey | that doesn't mean reflection is unavoidable |
| 17:25 | rhickey | you can pick the overload with the type hint |
| 17:25 | Chouser | yes, I was too vague |
| 17:27 | Chouser | I just meant that #(Math/ulp %) by itself would use reflection. You have to add something to that expression itself to avoid the reflection. |
| 17:28 | Chouser | So is the occasional need for #(Math/ulp (float %)) a good enough reason to never allow Math/ulp by itself? |
| 17:29 | rhickey | Chouser: I came to that conclusion |
| 17:30 | rhickey | putting in un-hintable reflective sugar seems a false benefit |
| 17:30 | rhickey | I guess the sugar could reject type-overloaded methods |
| 17:30 | Chouser | even if someone else wrote the patch for you? :-) |
| 17:31 | rhickey | will the patch author answer all 'how do I speed up (map Math/udp ...) questions? :) |
| 17:32 | rhickey | I had worked on this, including gen-class style Math/udp-float discrimination syntax |
| 17:33 | Chouser | oh. ew. |
| 17:33 | rhickey | well, without that or a prohibition on type-overloaded methods I think it's a non-starter |
| 17:34 | Chouser | It seems to me the transition from Math/ulp to #(Math/ulp (float %)) is not that much bigger a hurdle than from #(Math/ulp) |
| 17:34 | rhickey | by the time you are mapping a method you are atthe point where you are calling it often enough to care about the reflection costs |
| 17:34 | Chouser | either way you have to be thinking about reflection and type hints |
| 17:35 | rhickey | maybe so |
| 17:35 | Chouser | But (map Integer. (line-seq my-file)) is so pretty. |
| 17:35 | rhickey | #(Math/ulp #^Float %) works too, less of a change if you were doing #(Math/ulp %) already |
| 17:36 | rhickey | Chouser: I agree completely about the prettiness, but there are limits to pretending a thing (method) is something it's not (a fn) |
| 17:37 | rhickey | I just though it would encourage a lot of inefficiency, and that seems to be a focus of the community right now, for better or worse |
| 17:38 | Chouser | Yeah, I don't know if it's for better or worse, esp. in the long run. But it's a mismatch with my personal interests, so I'm occasionally annoyed by it. |
| 17:39 | rhickey | yeah, certainly the microbenchmarks are tiresome |
| 17:39 | hiredman | :( |
| 17:40 | Chouser | the only performance metric that I'm at *all* unhappy with is startup time, and I think that's been addressed as much as possible. |
| 17:40 | Chouser | I intend to play with nailgun at some point and see how that feels. |
| 17:40 | rhickey | so, while you may say ew at Math/udp-float, it makes the construct hintable. Alternatives for that would be welcome too |
| 17:41 | hiredman | Chouser: the solution to that is, start once and run forever |
| 17:41 | rhickey | disallowing type-overloaded methods would disallow many methods |
| 17:41 | Chouser | Hints already strike me as a (sometimes) necessary evil. I don't mind the extra #(%) noise if I'm also going to have type-hint noise. |
| 17:42 | rhickey | It's one thing to adorn what you've already got, another to have to switch constructs |
| 17:43 | rhickey | you are giving up too easily |
| 17:44 | Chouser | it's 5 characters. If they weren't all puncutation I would have given up sooner. |
| 17:44 | rhickey | :) |
| 17:45 | Chouser | still no pricing up on ILC 2009. I can't decide if it's worth the trip out there. |
| 17:45 | ayrnieu | translating Java to Clojure, I like the hints for documentation. I actually do a lot of "what *type* is this?!" reading Java; it helps to cache the lookups. |
| 17:46 | rhickey | Chouser: are you using exceptions for conditions? |
| 17:46 | rhickey | I had conditions in an early prototype of Clojure |
| 17:46 | rhickey | but exceptions are the only non-local flow control, and user catches can interfere |
| 17:47 | rhickey | still, I had to use them for transactions |
| 17:47 | Chouser | rhickey: well, I don't think I'm going to do a straight port, but yeah I have to use exceptions in some places. |
| 17:48 | Chouser | I'm reading about CL's system, trying to make sure I at least have an excuse for any features I leave out. |
| 17:49 | rhickey | Chouser: fwiw, I used exception (actually Error) object identity for handler matches, custom derive your own Error type and neuter fillInStackTrace |
| 17:50 | Chouser | why neuter fillInStackTrace? |
| 17:50 | hiredman | performance? |
| 17:50 | ryszard_szopa | rhickey: do you plan to make to make Clojure more Java (as in Java-the-language, not Java-the-vm-and-platform) independent in the future? Most of the time I spent learning Clojure consisted of reading about Java :-) |
| 17:50 | rhickey | because it's a huge overhead you don't need |
| 17:50 | Chouser | ah. hm. |
| 17:51 | rhickey | Chouser: it's a standard technique when using exceptions for flow control |
| 17:51 | hiredman | there was something on reddit yesterday about exceptions that mentioned it |
| 17:51 | Chouser | well, my #1 goal is a simple compile-free way to "throw" and "catch" custom "exceptions" |
| 17:52 | ayrnieu | hiredman - this? http://www.reddit.com/r/programming/comments/7u3jc/languages_on_the_jvm_can_implement_nonlocal/ |
| 17:52 | hiredman | ayrnieu: looks like it |
| 17:52 | rhickey | Chouser: really, that's all? |
| 17:52 | Chouser | but once starting down that road it seems a shame to leave out any useful features from CL's condition system, at least the ones that anyone ever uses. |
| 17:52 | Chouser | rhickey: yeah, I don't know CL well enough to have any larger ambitions |
| 17:52 | Chouser | :-) |
| 17:53 | durka42 | wait, what do you mean compile-free |
| 17:53 | ayrnieu | Chouser, you could a variant of 'try' that rethrows the type of exception that you use for this other purpose. |
| 17:53 | rhickey | The main point of conditions is to allow code to intervene before the stack unwinds |
| 17:53 | Chouser | yes, and I've got that already |
| 17:53 | Chouser | no Exceptions needed |
| 17:53 | hiredman | durka42: no need to gen-class and (compile ...) |
| 17:53 | Chouser | http://paste.lisp.org/display/72867 |
| 17:54 | Chouser | durka42: yeah, what hiredman said |
| 17:54 | Chouser | but if you want to restart anywhere other than the lowest level, or not restart at all, then I don't see how to avoid an Exception. |
| 17:54 | Raynes | read-line if broke in whatever version of Clojure Programming Clojure's sample code is using. |
| 17:56 | ayrnieu | Raynes, where do you see read-line ? I don't see it in the book or in the sample code. |
| 17:56 | gnuvince_ | ,(/ 25000 365) |
| 17:56 | clojurebot | 5000/73 |
| 17:56 | gnuvince_ | ,(double (/ 25000 365)) |
| 17:56 | clojurebot | 68.4931506849315 |
| 17:56 | Raynes | ayrnieu: I was using read-line, with his version. It's not in the book. |
| 17:56 | hiredman | clojurebot: clojurebot is also like life: you make trade-offs |
| 17:56 | clojurebot | Ack. Ack. |
| 17:56 | Raynes | Also, *is in my previous statment. |
| 17:57 | hiredman | ugh |
| 17:57 | hiredman | stupid completeion |
| 17:57 | Raynes | statement* |
| 17:57 | Raynes | -.- |
| 17:57 | hiredman | clojurebot: clojure is also like life: you make trade-offs |
| 17:57 | clojurebot | Ik begrijp |
| 17:58 | danlarkin | Raynes: testbuttsecks.clj? jeez... |
| 18:00 | Raynes | danlarkin: :| You try to think of a namespace name at 2 am after being awake for 36 hours :| |
| 18:01 | ayrnieu | just go with 'no namespace'. |
| 18:01 | Raynes | The file name is main.clj, the package is testbuttsecks |
| 18:01 | danlarkin | Raynes: :) nah I don't blame you, I'm still nameless for a project I've been working on for a few weeks |
| 18:01 | technomancy | I bet *that*'s awkward. |
| 18:01 | ayrnieu | clojurebot: jure words |
| 18:01 | clojurebot | http://gist.github.com/54847 |
| 18:01 | technomancy | oh no, please no. =) |
| 18:02 | technomancy | we have enough *jure projects already |
| 18:02 | technomancy | except injure. that would be awesome. |
| 18:03 | hiredman | clojurebot: Xiphojura? |
| 18:03 | clojurebot | 2009:Jan:29:16:03:17 <hiredman> I call Xiphojura |
| 18:03 | danlarkin | hahaha oh man |
| 18:03 | danlarkin | inure |
| 18:03 | danlarkin | injure rather |
| 18:03 | danlarkin | that's the only acceptable -jure name |
| 18:03 | durka42 | antipleajure |
| 18:04 | durka42 | seijure |
| 18:04 | durka42 | that's enough of that i think |
| 18:04 | Raynes | Heh, you should see the Haskell project names :| |
| 18:04 | Raynes | They all start with an H :| |
| 18:05 | technomancy | ruby projects all started with R until about 2005 |
| 18:06 | danlarkin | oh it's the same with everything, kde/gnome were all k--- and g--- |
| 18:07 | technomancy | I think a language outgrows that after a while. Hopefully with Clojure it can happen sooner rather than later. |
| 18:07 | duck1123 | what do you think of a clojure-based identi.ca clone named indenjure |
| 18:07 | ryszard_szopa | suo-jure would be a good name for a project that is *something* in its own right |
| 18:08 | duck1123 | I wanted to contact the .ar registar to get spec.tacul.ar |
| 18:24 | hiredman | clojurebot: two cents is <reply>� |
| 18:24 | clojurebot | c'est bon! |
| 18:25 | kotarak | clojurebot: this is not a bug |
| 18:25 | clojurebot | 'Sea, mhuise. |
| 18:26 | hiredman | ,0800 |
| 18:26 | clojurebot | Eval-in-box threw an exception:Invalid number: 0800 |
| 18:26 | hiredman | ,0700 |
| 18:26 | clojurebot | 448 |
| 18:26 | hiredman | weird, yes? |
| 18:27 | Chouser | what's wierd? |
| 18:28 | Chouser | weird |
| 18:28 | danlarkin | hiredman: prefixing a number with 0 means octal |
| 18:29 | hiredman | oh |
| 18:29 | hiredman | of course |
| 18:39 | danlarkin | Chouser: I came to the conclusion that clojure-json does belong in contrib. Or rather that contrib should have a good json library.. which it does, certainly, just that clojure-json has a few more features, but stephen's version is so much simpler, so I donno |
| 18:41 | Chouser | hm... |
| 18:42 | Chouser | have you talked to him about it at all? |
| 18:42 | danlarkin | no I haven't |
| 18:43 | danlarkin | probably should :) |
| 18:44 | ozy` | what's the word on efforts to get clojure featured in a hip new anime? |
| 18:45 | ozy` | you know, to compete with common lisp |
| 18:45 | technomancy | ozy`: there was talk of using it to replace VB for creating a GUI to track IP addresses... |
| 18:46 | danlarkin | technomancy: re: IP GUI: I'm all over that |
| 18:46 | hiredman | the first gui stuff I did with clojure was making a fake "TCP Flow Control Panel" |
| 18:48 | ozy` | technomancy: "serial experiments lain" was a -bit- more tech-savvy than CSI ;) |
| 18:49 | ozy` | I would like to make one of those interfaces where you type random keys into a window and it displays random lines and circles all over the screen |
| 18:49 | ozy` | that would be a neat prop to confuse my friends with |
| 18:50 | hiredman | ozy`: I think that is called "unicode font browser" |
| 18:50 | hiredman | ,(char 3424) |
| 18:50 | clojurebot | \? |
| 18:50 | hiredman | hmm |
| 18:50 | ozy` | hiredman: well played.... |
| 18:52 | hiredman | ,(char 1342) |
| 18:52 | clojurebot | \? |
| 18:52 | hiredman | hmm |
| 18:53 | ozy` | technomancy: played Uplink recently? that's an even niftier hacking GUI... you could remake that with 3D graphics and it would be a blast |
| 18:53 | ozy` | :p |
| 18:53 | ozy` | ,(char 1492) |
| 18:53 | clojurebot | \? |
| 18:53 | hiredman | ,(char 1111) |
| 18:53 | clojurebot | \? |
| 18:54 | hiredman | ,(char 911) |
| 18:54 | clojurebot | \? |
| 18:54 | ryszard_szopa | ,(char 666) |
| 18:54 | clojurebot | \? |
| 18:54 | mudphone | technomancy: we'll probably need angelina jolie to help out too. |
| 18:54 | ayrnieu | that character does not warrant its code. |
| 18:55 | ryszard_szopa | ,(char 777) |
| 18:55 | clojurebot | \? |
| 18:55 | ozy` | ,(map char (range 666 700)) |
| 18:55 | clojurebot | (\? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \? \� \�� \?) |
| 18:56 | Hun | oh noes. my unicode font has a hole |
| 18:56 | ryszard_szopa | well, apparently phonetics is evil |
| 18:57 | Chousuke | regarding the technical realism in CSI... didn't they use photo manipulation in one episode to look behind a corner or something? /: |
| 18:57 | Chousuke | I think that's awesome. |
| 18:57 | ozy` | yeah, I hear they do that on a regular basis |
| 18:57 | Hun | blade runner did that first |
| 18:57 | hiredman | infinite resolution security cameras |
| 18:57 | ozy` | but with blade runner he was looking under the edge of a framed photo, wasn't he? |
| 18:57 | Hun | numb3rs had some steganography a while ago |
| 18:58 | Hun | they hid text in jpgs |
| 18:58 | ayrnieu | ,(java.util.Date. (long (* 1000 1234567890))) |
| 18:58 | clojurebot | #<Date Fri Feb 13 15:31:30 PST 2009> |
| 18:58 | Chousuke | or getting the face of the attacker from the reflection in the victim's eye. |
| 18:58 | ozy` | D: |
| 18:58 | Chousuke | though that's almost believable. |
| 18:58 | Hun | and the cooldudes found it by zooming infinity plus one times in to read it |
| 18:59 | Hun | ergo zoom a single black pixel to make it become a tiny `o' |
| 18:59 | ozy` | I think it was 24 (didn't see it, only heard about it) where someone takes a guard's picture, magnifies it in a copier, and holds it up to a retina scanner to get through a oor |
| 18:59 | ozy` | *door |
| 18:59 | Hun | awesome. i need one of those xeroxen |
| 18:59 | Chousuke | heheh |
| 19:00 | technomancy | you sure that wasn't Space Quest IV? |
| 19:00 | Chousuke | see, unreal computer tech in movies is a GOOD thing. |
| 19:00 | Chousuke | endless source of amusement. |
| 19:00 | ozy` | Chousuke: and of "interesting" deadlines from easily amused management... ;) |
| 19:00 | Hun | a few years ago in cobra 11 (german police series), the goodguys had a picture of the car of one of the badguys |
| 19:01 | Hun | but a tree was blocking the sight of the license plate |
| 19:01 | Hun | so they photoshopped the tree away to read it |
| 19:02 | ryszard_szopa | do you think it would be possible in Clojure to have sql queries behave like lazy sequences? So that you could do eg. (drop 5 some-query), and that would return a query like the original but with offset 5? |
| 19:02 | danlarkin | Hun: I wish I could do that! |
| 19:03 | hiredman | ryszard_szopa: sure, just need someone to write it |
| 19:03 | Chousuke | well, hmm |
| 19:03 | ozy` | Hun: they should take that to its logical conclusion. some spies need to look inside a safe, so they take a picture from the other side of town and then photoshop it so it shows the room with the safe |
| 19:03 | Chousuke | you could write something that executes the query when realised I guess |
| 19:03 | hiredman | you have an sql query, that has a custom seq |
| 19:03 | ozy` | and then when they have trouble shooping the safe open, someone has to flip a switch from "magic" to "more magic" |
| 19:04 | Hun | ozy`: oh yays :) |
| 19:04 | ryszard_szopa | hiredman: yeah, but how to implement stuff like filter? |
| 19:05 | Hun | ozy`: and they photoshop the case away to see where the single wire to that switch goes |
| 19:05 | ryszard_szopa | hiredman: I was thinking of having some map that would get serialized to the argument right after select |
| 19:05 | Chousuke | ryszard_szopa: that sounds like you'd be better off creating a DSL with its own filter and drop functions. |
| 19:06 | ryszard_szopa | Chousuke: well yeah, but lazy seqs are so cool ;-) |
| 19:06 | Chousuke | you could still expose it as a lazy seq I guess. |
| 19:07 | Chousuke | I guess it'd be like a resultset-seq; only your DSL would allow you to manipulate the query in a functional style before you execaute it. |
| 19:07 | Chousuke | execute* |
| 19:08 | Chousuke | implementing such a system doesn't sound trivial though :/ |
| 19:09 | danlarkin | this is like how django QuerySet objects behave |
| 19:09 | ozy` | ants.clj has an internally inconsistent function definition style.... sometimes the docstring is before the arglist, sometimes after |
| 19:09 | ozy` | is there any semantic difference there? |
| 19:10 | danlarkin | Model.objects.all()[4:10] is offset 4 limit 10 |
| 19:11 | Chousuke | danlarkin: does that modify the query itself? :/ |
| 19:11 | ryszard_szopa | danlarkin: yeah, exactly... but in Python is just enough to implement a __getitem__ method |
| 19:11 | danlarkin | Chousuke: yes, django QuerySet objects are lazy |
| 19:11 | ryszard_szopa | collections just have first, rest and something else I don't remember |
| 19:11 | ayrnieu | ozy, (arglist docstring) is more common across languages, but it doesn't also work with multi-arglist functions. |
| 19:13 | ayrnieu | I found (docstring arglist) off-putting, but it puts [name list & more] closer to your (name (more (list ...)))'ing code. |
| 19:13 | technomancy | yeah, I found the different locations of the docstring kind of weird too |
| 19:14 | technomancy | makes sense why it's necessary though. |
| 19:14 | Chousuke | so wait, it works after the arglist in some cases? /: |
| 19:14 | technomancy | I have a hard time remembering to do it the clojure way |
| 19:14 | technomancy | Chousuke: I don't think so. |
| 19:14 | ozy` | technomancy: looks like rhickey does, too :p |
| 19:15 | ayrnieu | (defn foo [] "doc" ...) works, yes. |
| 19:15 | ozy` | to be clear: this code is switching back and forth between (defn foo [args] "doc" (only-one-body)) and (defn foo "doc" [args] (still-only-one-body)) |
| 19:15 | ryszard_szopa | that's kinda funny... |
| 19:16 | ayrnieu | you don't have to stick to in-function docstrings, though; you can add the documentation in a later step. |
| 19:16 | ryszard_szopa | I guess it would be saner if the lisp/python way didn't work |
| 19:17 | ryszard_szopa | oh, but if you do it the docstring-after-args way doc doesn't show the docstring |
| 19:18 | ayrnieu | oops. |
| 19:18 | technomancy | ryszard_szopa: you can put a string *anywhere* in a function body if you want. =) |
| 19:19 | technomancy | it's just not a docstring |
| 19:20 | ozy` | @stuff splices the contents of 'stuff into the current (arg)list, right? |
| 19:21 | Chousuke | ,'@x |
| 19:21 | clojurebot | (clojure.core/deref x) |
| 19:21 | Chousuke | so, no. :) |
| 19:22 | ayrnieu | ,`(def x [~@(list 1 2 3)]) |
| 19:22 | clojurebot | (def clojure.core/x [1 2 3]) |
| 19:22 | ayrnieu | ,`(def x [~(list 1 2 3)]) |
| 19:22 | clojurebot | (def clojure.core/x [(1 2 3)]) |
| 19:27 | ryszard_szopa | technomancy: so the docstring after args way *doesn't* work, after all. so it's sane. :) |
| 19:28 | ayrnieu | ,(.setMeta #'+ (assoc (meta #'+) :doc "Returns the sums of nums. (+) should never be used.")) |
| 19:28 | clojurebot | nil |
| 19:28 | ayrnieu | ,(doc +) |
| 19:28 | clojurebot | "([] [x] [x y] [x y & more]); Returns the sums of nums. (+) should never be used." |
| 20:11 | gnuvince_ | Wow |
| 20:11 | gnuvince_ | An operation on 100 files took 188 seconds |
| 20:11 | gnuvince_ | I added a type hint to some of the called functions |
| 20:11 | gnuvince_ | dropped to 60 seconds |
| 20:13 | ozy` | see, the static typing people aren't -that- crazy :p |
| 20:13 | gnuvince_ | Who said they were crazy? |
| 20:14 | danlarkin | gnuvince: use (set! *warn-on-reflection* true) to find all places you're having to reflect |
| 20:15 | gnuvince_ | danlarkin: do I need to put one per file? |
| 20:15 | danlarkin | gnuvince_: no |
| 20:15 | ayrnieu | you can set it once and then load all of your files. |
| 20:20 | gnuvince_ | I'm gonna need to find more efficient ways to improve performance |
| 20:29 | gnuvince_ | hmmm |
| 20:29 | gnuvince_ | 3 3.89% 23.43% 2216296 304693 sun.reflect.ReflectionFactory.copyMethod |
| 20:30 | gnuvince_ | 2.2M calls to copyMethod, is that usual in Clojure? |
| 20:33 | darrint | I "need" a loop to call setPosAt in Qt many times. Where do I find how to do that? |
| 20:35 | Chouser | dotimes, doseq, loop/recur |
| 20:35 | ayrnieu | dorun |
| 20:35 | darrint | dotimes looks like what I need. Much thanks. |
| 20:36 | Chouser | That's listed here under Looping: http://clojure.org/macros |
| 20:36 | sohail | hey how is the Qt interface going? is it still fugly |
| 20:37 | darrint | Hope you aren't asking me. It's prettier from here than raw C++. That's all I know. |
| 20:38 | Chouser | several people have taken swings at it |
| 20:38 | danlarkin | Chouser: pun intended? |
| 20:39 | darrint | I'm trying to make Graphics View work. So far so good. |
| 20:39 | Chouser | danlarkin: nah, but I'll take it. :-) |
| 20:41 | gnuvince_ | grrr! |
| 20:45 | darrint | "Hello World!" moving diagonally. w00t! |
| 20:46 | darrint | tomorrow, the world. |
| 20:46 | dreish | Was that in Acorn BASIC? |
| 20:46 | ayrnieu | (doto world greet conquer) |
| 20:46 | dreish | If not, too bad. I love Acorn BASIC. |
| 20:47 | dreish | Though it might be better with macros. |
| 20:48 | ayrnieu | doto: http://paste.lisp.org/display/74762 |
| 21:04 | darrint | Ok. It there a quick way to get from a vector of some objects to a java array of that object? |
| 21:04 | Chouser | (into-array myvector) |
| 21:06 | hiredman | that was pretty quick |
| 21:06 | darrint | thanks. |
| 21:08 | ayrnieu | ,[(into-array Integer/TYPE [1 2]) (into-array [(int 1) (int 2)])] |
| 21:08 | clojurebot | [#<int[] [I@15cd9a> #<Integer[] [Ljava.lang.Integer;@145d424>] |
| 21:09 | ayrnieu | oh, you don't need the (int %) in the second case. Instead: |
| 21:09 | ayrnieu | ,(into-array [1 2 "3"]) |
| 21:09 | clojurebot | java.lang.IllegalArgumentException: array element type mismatch |
| 21:10 | Chouser | right, you can't put primitives in a Clojure container. |
| 21:10 | hiredman | auto-bbbbbboxing |
| 21:11 | ozy` | ,`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`a |
| 21:11 | clojurebot | clojure.core/a |
| 21:12 | hiredman | I should figure out why clojurebot evals that to clojure.core |
| 21:12 | ozy` | ,'a |
| 21:12 | clojurebot | a |
| 21:12 | ozy` | ,''a |
| 21:12 | clojurebot | (quote a) |
| 21:12 | Chouser | I think if you run Script, it defaults to clojure.core instead of user |
| 21:12 | ayrnieu | clojure.core vs. sandbox, ozy. |
| 21:12 | ozy` | ,'~'a |
| 21:12 | clojurebot | (clojure.core/unquote (quote a)) |
| 21:12 | ozy` | weird |
| 21:12 | ayrnieu | ,*ns* |
| 21:12 | clojurebot | #<Namespace sandbox> |
| 21:12 | ayrnieu | ,`~*ns* |
| 21:12 | clojurebot | #<Namespace sandbox> |
| 21:13 | hiredman | Chouser: I run Repl |
| 21:13 | Chouser | hm... oh, new thread? |
| 21:13 | ayrnieu | ,::a |
| 21:13 | clojurebot | :clojure.core/a |
| 21:13 | Chouser | bindings go back to root |
| 21:13 | hiredman | yeah, but *ns* is bound to (create-ns 'sandbox) |
| 21:14 | hiredman | ,*ns* |
| 21:14 | clojurebot | #<Namespace sandbox> |
| 21:14 | Chouser | before you 'read'? |
| 21:14 | hiredman | oh, I see |
| 21:14 | cp2 | does anyone here have experience with lisp while on lsd? |
| 21:17 | hiredman | ,~`a |
| 21:17 | clojurebot | java.lang.IllegalStateException: Var clojure.core/unquote is unbound. |
| 21:17 | hiredman | ,`~`a |
| 21:17 | clojurebot | sandbox/a |
| 21:17 | hiredman | shaza |
| 21:26 | Chouser | hiredman: good job! |
| 21:30 | ozy` | cp2: that would be fascinating, I'm sure... |
| 21:30 | ozy` | ,`~`~(exit) |
| 21:30 | clojurebot | java.lang.Exception: Unable to resolve symbol: exit in this context |
| 21:33 | metaperl | could someone share their .emacs config to use clojure-mode.el? |
| 21:33 | metaperl | is *command-line-args* in the package user? |
| 21:34 | ayrnieu | http://paste.lisp.org/display/74008 |
| 21:34 | ayrnieu | ,(var *command-line-args*) |
| 21:34 | clojurebot | #'clojure.core/*command-line-args* |
| 21:34 | darrint | Is (connect) part of the clojure api? |
| 21:34 | cp2 | ozy`, i havent done it, but it would be interesting |
| 21:35 | cp2 | i remember the first time i used a computer while using lsd, it seemed like everything made sense |
| 21:35 | cp2 | but of course i didnt remember many details, so meh ;( |
| 21:35 | ayrnieu | darrint - no. |
| 21:36 | darrint | How can I instrospect on the symbol and figure out where it came from? |
| 21:36 | ayrnieu | ,(var *command-line-args*) |
| 21:36 | clojurebot | #'clojure.core/*command-line-args* |
| 21:36 | ayrnieu | ,(meta (var *command-line-args*)) |
| 21:36 | clojurebot | {:name *command-line-args*, :macro false, :doc "A sequence of the supplied command line arguments, or nil if\n none were supplied", :ns #<Namespace clojure.core>} |
| 21:37 | darrint | thanks |
| 21:37 | metaperl | ayrnieu: thank you, however, it appears that slime is under cvs version control - http://common-lisp.net/project/slime/ ... where did you get a git clone? |
| 21:38 | ayrnieu | metaperl - I didn't, but see http://github.com/search?q=slime |
| 21:38 | metaperl | your .emacs says ; git clone next to your load of slime |
| 21:39 | ayrnieu | that isn't mine. |
| 21:39 | metaperl | oh :) |
| 21:39 | darrint | now I get it. |
| 21:50 | lisppaste8 | metaperl pasted "(require 'clojure-auto) is failing" at http://paste.lisp.org/display/74844 |
| 21:53 | ayrnieu | does ~/emacs-contrib/clojure-mode/clojure-auto.el exist? |
| 21:53 | hiredman | clojurebot: emacs? |
| 21:53 | clojurebot | but I like using notepad++! |
| 21:54 | durka42 | clojurebot: vim? |
| 21:54 | clojurebot | Excuse me? |
| 21:54 | ayrnieu | oh, you don't need clojure-auto anyway; you already have the autoloads in your .emacs |
| 21:54 | durka42 | clojurebot: vim is <reply>Gesundheit! |
| 21:54 | clojurebot | Ik begrijp |
| 21:55 | darrint | Is there a way to force gc from clojure? |
| 21:55 | ayrnieu | ,(System/gc) |
| 21:55 | clojurebot | nil |
| 21:55 | durka42 | i suppose Runtime.getRuntime().gc() would work |
| 21:55 | durka42 | that too |
| 21:55 | hiredman | if there is a way from java there is from clojure |
| 21:55 | metaperl | ayrnieu: no ... I think that would be generated by the `update-directory-autoloads' function ... which I did not run |
| 21:56 | dreish | Occasionally I find microbenchmarks improve after a (System/gc) by more than the time (System/gc) itself took. |
| 21:56 | darrint | thanks |
| 21:56 | darrint | dreish, Occasionally I find that Qt apps hang for several seconds unless I call (System/gc) right after they exit. (maybe...) |
| 21:57 | dreish | Ooh. That's unfortunate. |
| 21:57 | dreish | At least there's a workaround. |
| 21:57 | darrint | I just keep putting (do (load-file "testqt.clj") (testqt/hello-graphics-view) (System/gc)) in the repl to test my app. |
| 21:58 | darrint | Well, got the long hang despite the gc. Mystery remains... |
| 21:58 | cooldude127 | hey what shell does everybody use? |
| 21:58 | dreish | zsh |
| 21:59 | dreish | Bash has pretty much caught up thought. |
| 21:59 | cooldude127 | dreish: i'm thinking about switching to zsh |
| 21:59 | dreish | s/t\././ |
| 21:59 | durka42 | i use zsh because i read this blog post about how awesome it is, but i haven't really found anything that's incredibly awesome |
| 21:59 | dreish | It's nice. I think Bash still only has one of the two =() <() forms. |
| 21:59 | durka42 | the smarter tab completion is annoying as often as it's helpful |
| 22:00 | ayrnieu | I used to like zsh because I thought it cute to put my directory in RPROMPT; nowadays I do nothing special with the shell. |
| 22:01 | cooldude127 | anyone have a good resource on how to customize zsh? |
| 22:02 | dreish | http://www.amazon.com/Bash-Z-Shell-Conquering-Command/dp/1590593766 |
| 22:02 | ayrnieu | http://www.dotfiles.com/index.php?app_id=4 |
| 22:03 | lisppaste8 | metaperl pasted "java.lang.NoClassDefFoundError: clojure/main" at http://paste.lisp.org/display/74845 |
| 22:12 | hiredman | ugh |
| 22:13 | hiredman | cooldude127: there are a few websites devoted to sharing .zshrc tips |
| 22:13 | cooldude127 | http://www.wunjo.org/zsh-git/ this is pretty cool |
| 22:13 | hiredman | http://zshwiki.org/home/ |
| 22:14 | hiredman | huh |
| 22:15 | hiredman | thats right, there is a zsh channel on freenode |
| 22:16 | cooldude127 | that sounds right |
| 22:20 | cooldude127 | holy jesus this is the most informative prompt i've ever seen |
| 22:20 | hiredman | :P |
| 22:21 | hiredman | the most important bit is a. hostname completion based ssh's known_hosts b. completiong of remote files for scp and rsync |
| 23:11 | metaperl | I'm not sure what the point of running ant was --- the downloaded clojure already had a clojure.jar in it... |
| 23:13 | cooldude127 | lol |
| 23:27 | newb12345 | user=> (use '[clojure.contrib.str-utils :onl (str-join)]) |
| 23:27 | newb12345 | java.io.FileNotFoundException: Could not locate clojure/contrib/str_utils__init.class or clojure/contrib/str_utils.clj on classpath: (NO_SOURCE_FILE:0) |
| 23:27 | newb12345 | how do I make this work? |
| 23:29 | durka42 | is clojure-contrib.jar on the classpath? |
| 23:31 | durka42 | newb12345, how did you set up contrib |
| 23:35 | cooldude127 | newb12345: (System/getProperty "java.class.path") <- what does that give you? |
| 23:35 | newb12345 | I run it from a dire that contains both clojure.jar and clojure-contrib.jar |
| 23:36 | cooldude127 | newb12345: that doesn't add them to the classpath |
| 23:36 | durka42 | in that case make sure the classpath contains "." (the current dir) |
| 23:36 | durka42 | also you should spell :only correctly, but that isn't the error |
| 23:36 | cooldude127 | durka42: that won't include the jars |
| 23:36 | durka42 | oh |
| 23:36 | durka42 | meh |
| 23:36 | cooldude127 | he needs to explicitly specify the jars |
| 23:36 | durka42 | i need to update smuggler to take note of that |
| 23:37 | durka42 | is there a comprehensive reference on this stuff, along with extdirs |
| 23:39 | cooldude127 | i don't know one |
| 23:39 | cooldude127 | this is just built-up experience |
| 23:39 | durka42 | extdirs is recursive though, yes? |
| 23:39 | cooldude127 | i have no idea |
| 23:41 | newb12345 | user=> (System/getProperty "java.class.path") |
| 23:41 | newb12345 | "clojure.jar" |
| 23:41 | cooldude127 | newb12345: there is problem |
| 23:41 | durka42 | how are you running clojure? |
| 23:41 | newb12345 | java -jar clojure.jar |
| 23:41 | durka42 | try: |
| 23:42 | durka42 | java -cp clojure.jar:clojure-contrib.jar -jar clojure.jar |
| 23:42 | cooldude127 | durka42: i'm not positive, but i think those options conflict |
| 23:43 | newb12345 | x@x:~/build/clojure$ java -cp clojure.jar:clojure-contrib.jar -jar clojure.jar |
| 23:43 | newb12345 | Clojure |
| 23:43 | newb12345 | user=> (use '[clojure.contrib.str-utils :only (str-join)]) |
| 23:43 | newb12345 | java.io.FileNotFoundException: Could not locate clojure/contrib/str_utils__init.class or clojure/contrib/str_utils.clj on classpath: (NO_SOURCE_FILE:0) |
| 23:43 | durka42 | oh, they do |
| 23:43 | durka42 | java -cp clojure.jar:clojure-contrib.jar clojure.main |
| 23:44 | cooldude127 | durka42: that one's a winner |
| 23:44 | durka42 | (they conflict silently... java just ignores the classpath. classy.) |
| 23:44 | newb12345 | works now |
| 23:44 | cooldude127 | lol |
| 23:44 | newb12345 | durka42: thanks |
| 23:45 | durka42 | in fairness, the behavior is documented on the man page |
| 23:46 | cooldude127 | durka42: no, that is not enough |
| 23:57 | knapr | if id o (let [x (ref a)] ...) and then change x or a, i dont change the other rght? |
| 23:57 | knapr | any plans on porting clojure to its own vm or to make it selfhosted? |
| 23:58 | durka42 | as to the second question |
| 23:58 | durka42 | i don't think so |