#clojure logs

2010-12-03

01:41technomancymmm... aether allows you to customize conflict resolution in dependency graphs.
01:55zmyrgelhi, is there a way to track program execution line by line?
01:55cemericktechnomancy: taking hints from ivy, I guess?
01:57technomancycemerick: I suppose so.
01:57cemerickzmyrgel: you might find clojure.contrib.trace interesting.
01:57technomancycemerick: I'm interested in fork-aware dependency resolution. using the group-id has issues.
01:57technomancyas I'm sure you're aware =)
01:58zmyrgelcemerick: I would be more interested debugger like approuch
01:58cemerickoh, so you're looking for a stepper
01:58technomancymy current crackpot theory is you'd need to maintain a mapping of version numbers to git shas so you can track the ancestry of any given version in a fork network to figure out which is newest.
01:59technomancyno idea if that's actually feasible, but it's probably worth some noodling
01:59zmyrgelcemerick: yeah, something like that
01:59cemerickzmyrgel: People have had good results with JSwat, Enclojure, and cdt
02:00cemericktechnomancy: ah, that's what you mean by "fork-aware"
02:00zmyrgelmy chess game tree just returns nil as result and I think it would be easier to see whats causing it if I can track the program execution step by step
02:00cemericktechnomancy: yeah, that's a pretty crazy idea. Probably the root any potential solution, though.
02:00technomancyrich convinced me linear versions are an artifact of the days of SVN
02:01cemerickI'm not sure versioning has ever been linear.
02:02technomancywell... from a human perspective it's not, but from a tooling perspective, version strings are just sorted lexographically.
02:02technomancywell not literally lexographically
02:02technomancybut the segments are
02:04cemerickSure.
02:04technomancy1.1.0-master-SNAPSHOT < 1.1.0-new-SNAPSHOT, etc.
02:04cemerickMy point was, I think wanting to be able to track releases coming out of a branch in SCM is a very recent phenomenon that exposes the issue.
02:05cemerickI'm not even sure that makes sense.
02:05technomancyright
02:06technomancyyou might want to be able to choose strategies... always pick the newest vs prefer my fork vs prefer master branch, etc.
02:06cemerickI remember a brief attempt of mine to ditch all dep mgmt and just use git submodules.
02:07cemerick(for internal stuff, that is)
02:07technomancyeep
02:07cemerickdidn't last long
02:07cemerickThat was prior to my deciding to stop bothering with the question and just use mvn.
02:08cemerickThere's a lot of craziness in the git model that makes the concept of tracking branch releases a little nuts.
02:08cemericke.g. consider an impolite rebase
02:09technomancyI'm not a fan of git's implementation of submodules
02:09cemerickThey're essentially useless.
02:10cemerickI think it's telling that they don't track refs, either.
02:11technomancywell I don't expect to come up with anything useful in the next six months; just letting it simmer.
02:13technomancywell most of what I've done so far is fairly obvious; just taking patterns that have worked in other contexts and adapting them... nonlinear versions haven't been done in any tool I'm aware of yet.
02:14technomancyof course, it's probably all been figured out by ocaml people years ago in a thesis somewhere...
02:15p_l|homehmm... I wasn't aware of the issue with submodules, but that can be redone quite easily, I think
02:16p_l|homegit, internally, isn't actually a version control system but a content-addressable write-only-with-gc system
02:18technomancyin this case I think it's an example of theoretical purity interfering with pragmatism
02:18technomancybut anyway, I must head off; ciao
02:18p_l|hometechnomancy: more like "didn't bother" :)
02:18p_l|homecontent-addressible storage makes it easy to make a versioned filesystem with simple file commands (which is how Plan9 people do it, btw)
02:20LauJensenMorning all
02:27RaynesLauJensen: Morning.
04:15bytecolortrying to implement the first example from: http://clojure.org/libs?responseToken=0cbcb26df92c8eec7f95c8f1abeb68685
04:16bytecolorI've put my_utils.clj in ~/.clojure/com/my_company/clojure/examples
04:16bytecolorecho $CLASSPATH => /home/bytecolor/.clojure
04:18bytecolorusing this to print the classpath: http://pupeno.com/blog/printing-the-class-path-in-clojure/
04:18bytecolorit does not show ~/.clojure though, and I can
04:18bytecolor*can't require the lib
04:18bytecolordoes it have to be compiled to a .jar?
04:25kjeldahl_bytecolor: Are you starting the REPL with the right parameters, and/or from the right location? How are you starting the REPL?
04:26bytecolorkjeldahl_: this in in my ~/bin/clj => java -cp ~/.clojure/*: clojure.main "$*"
04:26bytecolorI've just started playing with CLASSPATH, I found that example on the net somewhere
04:28bytecolorI have clojure.jar and clojure-contrib.jar in ~/.clojure and they both seem to work ok when I run cjl from any location
04:28kjeldahl_bytecolor: I'm no expert either, but in my case the clj script is just an alias for clj-env-dir .
04:29bytecolorkjeldahl_: where is clj-env-dir?
04:29kjeldahl_launchers/bash/clj-env-dir in clojure-contrib
04:29bytecolorhrm
04:30kjeldahl_You're getting an error when you try to "require" the source code you've written from the examples?
04:31Rayneshttp://blog.raynes.me/?p=48 You'd probably be better off with cljr or cake rather than trying to get things running properly all by your lonesome.
04:31bytecoloryes, (require 'com.my-company.clojure.examples.my-utils) => FileNotFoundException
04:32bytecolorRaynes: I'll have a look.
04:32kjeldahl_Agree. I mostly start a new project using leiningen with dependencies and stuff in place before I dive into the REPL.
04:41zmyrgelhi, I have trouble getting my gametree working
04:42zmyrgelI can build the gametree but when I try to evaluate the tree I get list of functions as a result instead of their result
04:42zmyrgelHere's relevant code: http://clojure.pastebin.com/f0PmDQ5f
04:45Rayneszmyrgel: Doesn't matter all that much, but in case you didn't know, there are some pastebins that directly support Clojure highlighting: gist.github.com, paste.pocoo.org, ideone.com, and I think even pastie.org does now.
04:46zmyrgelok, I'll remember that once I need to paste more code
04:47zmyrgelany idea why my trampoline fuction won't work?
04:49oelewapperkeI'm trying to learn a bit of clojure, so I'm trying to define a basic higher-order function like so "(defn m [n] (fn [x] (* x n))", however entering this in repl doesn't return (I've got to CTRL-C it)
04:49oelewapperkewhy ?
04:49Raynesoelewapperke: You missed a closing parenthesis.
04:50Raynes(defn m [n] (fn [x] (* x n)))
04:50oelewapperkeI'm an idiot. Thanks
04:50RaynesYou're welcome. :p
04:51oelewapperkewhat do you use as a clojure editor ? something that can help me with clogin parens etc
04:51AWizzArdIs there a way to change the namespace a thread runs in via eval?
04:52RaynesAWizzArd: Use binding to rebind *ns*
04:52RaynesI do that in clojail to run code in a sandbox namespace.
04:52AWizzArdI will try that.
04:55RaynesAWizzArd: (binding [*ns* (create-ns 'blah)] (refer 'clojure.core) (eval '(pr-str *ns*))) ; Example
04:59bartjcan't I use a "for" while reading from a file with a "with-open"
04:59bartjhere's the paste: http://pastie.org/1344017
05:00Raynesbartj: for is lazy
05:01AWizzArdRaynes: yes, this binding trick seems to work. I will now try to redefine an existing function with that.
05:01bartjRaynes, and hence can't be used with a "with-open" ?
05:01Raynesbartj: Your for runs in with-open and creates a lazy-seq, but no work is actually done. The reader is closed after the scope of the with-open is over, so when you finally try to realize the sequence, the work can't be done because the stream is closed.
05:02Raynesbartj: A way around this would be to close the stream yourself *after* you've realized all that you need from the sequence, or do so in the scope of with-open.
05:02bartjcatch-22?
05:04bartjRaynes, I tried having a close after the for...no error; but still can
05:05bartj*can't read the contents
05:05Raynesbartj: You'd have to open the stream manually and close it after your println.
05:06Raynesbartj: You can probably just wrap your for in a doall though.
05:06RaynesThat will force the entire sequence to be realized.
05:08bartjRaynes, thanks!
05:08Raynesuser=> (with-open [rdr (clojure.java.io/reader "blah")] (doall (for [line (line-seq rdr)] line))) -> ("ohai" "there")
05:09Raynesbartj: Sorry I didn't mention doall first rather than confusing you. I was trying to explain the reason it happened. :>
05:09bartjRaynes, I understand your explanation and thank you profusely for being so detailed
05:10Raynesbakkdoor|afk: Also, is that your actual code? If so, you realize you aren't really doing anything with that for, right? You could just call doall on the result of line-seq and be done with it.
05:10RaynesEr, bartj.
05:10RaynesDarn tab completion. :<
05:11notsonerdysunnyHello everybody .. can anybody help me with this .... http://groups.google.com/group/clojure/browse_thread/thread/9605dee93db81915#
05:14bytecolorthanks Raynes, I got cljr up and by dropping the example lib I mentioned in a path specified in the cljr script, it works
05:14Raynesbytecolor: Happy it helped. :>
05:14octewhy does assoc-in work on vectors but not sequences?
05:15Raynes&([1 2 3] 1)
05:15sexpbot⟹ 2
05:15Raynes&('(1 2 3) 1)
05:15sexpbotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn
05:16octe&(assoc-in ["a" "b"] [0] "x")
05:16sexpbot⟹ ["x" "b"]
05:16RaynesVectors are like maps of numeric keys to values.
05:16RaynesSequences aren't.
05:16octe&(assoc-in '("a" "b") [0] "x")
05:16sexpbotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Associative
05:16octe&(nth '("a" "b") 0)
05:16sexpbot⟹ "a"
05:16octewell that's annoying
05:17RaynesDoing ##(assoc-in ["a" "b"] [0] "x") is like doing ##(assoc-in {0 "a" 1 "b"} [0] "x")
05:17sexpbot(assoc-in ["a" "b"] [0] "x") ⟹ ["x" "b"]
05:17sexpbot(assoc-in {0 "a", 1 "b"} [0] "x") ⟹ {0 "x", 1 "b"}
05:17p_l|homeRaynes: so vectors are different from arrays/matrices in clojure? (just lurking here for now, haven't touched clojure in years)
05:18raekif you want to "change" something in the middle of a list, you need to create new cons cells for every element before the middle
05:19p_l|homeraek: no way for in-place modification of a cons cell?
05:19raekp_l|home: clojure's vectors are persistent and can share structure. they are distinct from java arrays, Vectors and ArrayLists
05:19octesince every way of morphin listish stuff returns sequences (like map, map-indexed) i'm gonna have to keep converting to vectors to be able to use assoc-in too i guess
05:19raekp_l|home: no, they are always immutable
05:19p_l|homehmm... just gathering some differences from CL, good to know
05:25raekocte: yes. calling vec on the lazy sequence returned by map will do the trick
05:26raeknote that sequences aren
05:26raek't really collections in the same as vectors
05:27octewell, no, since they're lazy and potentially infinite, etc
05:27raekthey could be described as state-less iterators
05:27octeyeah
05:27raekthe point is, don't worry about "creating a new collection"
05:32Raynesnotsonerdysunny: I just replied to your group thread.
05:32beerpagesKostenlose mini Homepages für Umfragen, Videos und vielem mehr auf www.beerpages.de - Beispiel: http://www.beerpages.de/view/1P/Magst%20du%20%C3%84pfel%3F
05:33RaynesLooks like lpetit got to it before me. :<
05:37oelewapperkewhat is the difference between something like "fn" and "lambda" ?
05:38RaynesThere isn't one. Just the name is different.
05:38RaynesA function created with fn is a lambda.
05:45dirchhExcept it looks less intimidating ;)
05:48oelewapperkeRaynes: and "lambda" just doesn't work in clojure ? strange
05:48Raynesoelewapperke: I imagine Rich decided to name it 'fn' because 'fn' is shorter than 'lambda'.
05:50bartjI like fn much better than lambda
05:50bartjthe naming convention I mean
05:56LajlaLambda is a pain to type.
05:56LajlaFor something that common.
05:56LajlaI like #( ... ) even more.
05:56RaynesAgreed.
05:56LajlaHell, I'd say that {x y & r ; body} would be kind of cool.
05:57LajlaAlso, most languages that use lambda are kind of praetentious therein, because they aren't lambda abstractions at all.
05:57Raynes$he (\x y -> x + y) 2 2
05:57sexpbot⟹4
05:57LajlaHoaskall.
05:57Lajla&he (+) 2 2
05:57sexpbotjava.lang.Exception: Unable to resolve symbol: he in this context
05:58LajlaBummer
05:58LajlaOhhh
05:58Lajla$he (+) 2 2
05:58sexpbot⟹4
05:58LajlaRaynes, does it also have Ocoaml?
05:58RaynesUnfortunately, no.
05:58RaynesIt will if I can find a satisfiable sandbox for OCaml.
05:59LajlaRaynes, what else does it have?
05:59LajlaC?
05:59LajlaPython?
05:59clojurebotpython is ugly
05:59LajlaLazy K.
05:59RaynesJust Clojure and Haskell.
05:59LajlaOhhh
05:59LajlaSo he doesn't ignor eme on hat eh?
05:59LajlaRaynes, you should add brainfuck and Lazy K.
06:00RaynesI think it actually does brainfuck.
06:00RaynesNot sure if it still works.
06:00Lajla$bf .
06:00sexpbot{:ptr 0, :cells {}}
06:00sexpbot[0]
06:00LajlaSchweet
06:00RaynesGuess do.
06:02Rayness/do/so/
06:02sexpbot<Raynes> Guess so.
06:08fliebelI commonly hear it said that one big advantage of dynamic langs is that you can change things on the fly on a web server. But if and how is this done in practice?
06:10p_l|homefliebel: in case of CL, you usually compile the files with changes you want, then load them. Or type them from the REPL - you keep a REPL open for that
06:10Raynesfliebel: The same way you'd do it in a desktop application. You'd just reload code.
06:11RaynesYou can require namespaces with a :reload option to reload those namespaces.
06:11fliebelSo you need to have a repl connected to the actual project and ssh into that?
06:11RaynesBesides that, if you have an REPL running in that instance, you can modify things normally.
06:12p_l|homeI'm not sure about atomicity of reloading in clojure or JVM, the trick with compiling first is done on Common Lisp to have the changes done atomically
06:12Raynesfliebel: That's an option. In sexpbot, I've got it set up so that I can shoot it reload commands from IRC rather than use an REPL. You can get pretty creative.
06:13fliebelRaynes: So say I have a nice ring app deployed in a servlet, how am I ever going to get a repl on that?
06:14Raynesfliebel: Whenever you start your server, start it from an REPL and bind the result to a name. You're pretty much completely in control at that point.
06:15p_l|homedoes clojure-swank allow to start a repl server from the code? If so, just make it start in initalization code of your app, then connect to it over SSH proxy
06:15Raynesp_l|home: Yes, I was just about to mention that.
06:16RaynesI used to do something similar in sexpbot pre my reload commands.
06:23fliebelRaynes: I was thinking, could I do something like nREPL over SSH?
06:24RaynesProbably. I'm not familiar with nREPL.
06:24fliebelcemerick: ping
06:24raekfliebel: I have used slime over ssh. very convenient.
06:25fliebelraek: I'm not using emacs
06:25raekok
06:26raekI think lein repl also starts a repl on a socket nowadays
06:26raekhow's nRepl going, btw?
06:27raek<3
06:28bsteuberI don't get footnote 113 in JoC
06:28fliebel<3
06:29bsteuberYou might have noticed that we explicitely bound the Var gcd to the memoization of an
06:29bsteuberanonymous function. The reason for this is that we also need to cache the intermediate results (Norvig 1991) which
06:29bsteuberwould not happen if we had instead memoized an existing gcd function
06:29bsteuberthe code given doesn't seem to memoize the immediate results, though
06:43zmyrgelhi, I got my gametree a bit further but now it seems it won't complete the min-max
06:43zmyrgelI get list of list of numbers instead of number as a result
06:43zmyrgelHere's the code: http://pastie.org/1344187
06:45rrc7czwhy does (for [[x y z] [[1 2] [3 4]]] x) return (1 3) but (doseq [[x y z] [[1 2] [3 4]]] x) returns nil?
06:45zmyrgelit seems one mix and max iteration would be needed to complete it but I can't tell why it's not doing it already
06:45Raynesfor collects it's results into a sequence, while doseq is for doing stuff with side-effects.
06:46RaynesYou only want to use doseq when you don't care about return results and just need to do something like print something.
06:47rrc7czRaynes: understood, I actually need doall in my case
07:24rrc7czis there any reason to discourage rebinding like (let [foo 1 foo (+ foo 2)]? of course the example is bunk, but the idea of refining the symbol's value in multiple steps?
07:27zmyrgelif your doing it like that you might as well be doing java :)
07:28rrc7czzmyrgel: but why? I mean I don't see how it's any better by just binding subsequent refinements to a different symbol
07:28raekI think it can be legitimate
07:29RaynesI'm not sure I really see the point.
07:29RaynesI'd enjoy seeing a legitimate usage for educational purposes.
07:30rrc7czRaynes: so in my case: (let [members (@db name) aliases (foo) members (if members (merge members aliases) aliases)
07:30zmyrgelrrc7cz: would seem quite imperative if same symbol gets refined step by step
07:31rrc7czRaynes: actually writing it out now I see the if isn't needed
07:31zmyrgelthis based on the fugly let-forms found in my own code :)
07:31rrc7czRaynes: but the idea is, load members, then merge in aliases, but it's still "members", I mean why rename it?
07:32RaynesI'd do it just so that I was perfectly clear. All of those 'members' could get confusing. Especially in a more complex example.
07:32fliebelI think every case where you'd do like that in a let should be handled by ->
07:32fliebels/should/could/
07:32sexpbot<fliebel> I think every case where you'd do like that in a let could be handled by ->
07:33jgracinHi! Where is Clojure's "local-variable clearing" documented?
07:33bobo_-> popped into my head directly when i saw that aswell
07:33rrc7czfiebel: actually that's an interesting idea. I'm going to do that
07:33rrc7czthanks guys
07:33fliebelOh, this would be nice, a fastcgi impl for ring, so you can run perl, php, python, everything under nice moustache routing and all.
07:42sholden_Hi everyone, trying to get started learning clojure. Just got lein installed, now I'm trying to decide what to use for an editor (under ubuntu). What's the most popular route? I know there are several but if one is a bit more popular in the community I'd like to go with that...
07:43fliebelI guess I must learn C first to understand FastCGI. Is a struct something like a hash-map? I haven't figured out if they use structs as a sortof JSON, or are converting them to some binary form. :( I would really love ring-fastcgi.
07:44RaynesThe majority of Clojurians use Emacs with clojure-mode. However, there is some support in Eclipse via the Counterclockwise plugin.
07:44RaynesThere is VimClojure for Vim.
07:44raeksholden_: if you are comfortable with emacs, I really recommend it
07:44fliebel.. what Raynes said
07:44bobo_sholden_: emacs and the starterkit is pretty easy to setup
07:44bobo_i think intellij's support got god the other day aswell? havent tried it myself
07:46sholden_I've never used emacs... Is it worth it to bite the bullet and learn it at the same time as clojure? Or do you think I should just do one at a time?
07:47bobo_sholden_: no, i would use what you already know
07:48jarpiainjgracin: http://groups.google.com/group/clojure/msg/9b4e268b85c20cd6
07:48bobo_netbeans,intellij and eclipse al have working support
07:48sholden_OK. I couldnt get enclojure working but I have the counterclockwise rc installed. I'll stick with that for now. Thanks
07:48bobo_or maybe netbeans doesnt anymore? havent tried it in ages
07:49RaynesA relatively bright individual with a few hours or so can get the hang of Emacs. It takes a while to reach ninja status. In any case, you should probably just use CCW or something similar for now, and get comfortable with Clojure and make sure you even like it. ;)
07:50bobo_one thing at the time is always a good idea
07:50sholden_Raynes: OK, I may play with it a bit. Honestly, in the past I saw people complain about emacs lisp and it being complicated with so many parens, but now that I'm coming around to clojure, what had happened was.... ;)
07:51sholden_I think i'll try and get a few hello worlds off in eclipse then take a dive for a while
07:51RaynesClojure doesn't have as many parens as elisp, and encourages good indentation for clarity.
07:52jgracinjarpiain: thanks!
07:54sholden_Thanks for the help, back to reading!
07:55bartjerr, is there a diff b/w "error" and "failure" in clojure.test ?
07:58kjeldahl_How can I do something like: (map #(%) [1 2 3 4]) . I'm not looking for a "why" answer. ;-)
07:59Raynes&(map #(identity %) [1 2 3 4])
07:59sexpbot⟹ (1 2 3 4)
08:00Raynes&(map (fn [x] x) [1 2 3 4])
08:00sexpbot⟹ (1 2 3 4)
08:00RaynesPick your poison.
08:01kjeldahl_Excellent, thanks.
08:07fliebelAwesome! Implementing this for ring will get me there I believe: http://jfastcgi.svn.sourceforge.net/viewvc/jfastcgi/trunk/src/net/jr/fastcgi/impl/RequestAdapter.java?revision=21&amp;view=markup
08:23fliebelIf I want to implement an interface in Clojure with deftype or one of those, and use it in Java, will it generate *real* classes, or do I still need gen-class for that?
08:24chouserfliebel: deftype and defrecord create real classes
08:25chouserIn order to expose a mechanism to create instances other than the default ctors, however, you'll need to either use Var stuff from the Java side, or gen-class to create some static methods.
08:26fliebelchouser: Look at the link above, only some methods.
08:28fliebelchouser: Would I use a record for that?
08:29chouseroh, fastcgi. we meet again.
08:30fliebelchouser: ?
08:30chouserI've known her for years. Her charms are alluring, but her betrayals cut deep.
08:31chouserdefrecord or deftype should be fine
08:32fliebelchouser: Please elaborate, before she betrays me as well.
08:32chouserI think it's always been implementation issues. The concept, the protocol, and the performance are all fine.
08:32fliebelchouser: I haven't gone past the point of no return yet.
08:33chouserbut specific implementations on either side seem to frequently have heisenbugs
08:33chouserthe apache mod, the ruby lib, the python lib, etc.
08:33fliebelchouser: I will leave all implementation to jfastgci. But I would like to add a ring addapter.
08:34chouserI don't think I've tried it from Java yet
08:34mduerksenkjeldahl, raynes: (map identity [1 2 3 4]) will do, without the ugly # stuff
08:34fliebelchouser: As long as it runs some PHP for me, I'm fine with it.
08:36kjeldahl_mduerksen: True, thanks.
08:37chouserfliebel: I think the last time I used it was with apache and python. In the end the performance was more consistently fast using the python via regular cgi than via fastcgi.
08:38fliebelchouser: Hrm...
08:43chouserI think it would respond quickly for a while, then "something" would go wrong and incoming connections would hang several seconds before continuing
08:43chouserbut I also didn't have admin access to the apache process, so could fiddle with things on that end very well
08:44fliebelhrm
08:58Thornhello
09:00fliebelThorn: Hi
09:00ThornI have a seq of booleans and I want to find if all of them are true. I do (reduce and foo) but get "Can't take value of a macro"
09:00Thornwhat's the workaround?
09:00fliebelever?
09:00fliebel*every?
09:01Thornnice, thanks
09:01fliebel&(every? identity [true true true false])
09:01sexpbot⟹ false
09:01Thornhow long do you need to learn all of those?
09:02raekThorn: this is a good start: http://clojuredocs.org/quickref/Clojure%20Core
09:02fliebelThorn: I'm still learning. But according to my quiz I know 64% of all functions in core.
09:02Thornlol
09:03fliebelThorn: https://github.com/pepijndevos/clojure-quiz
09:03neotyk,(every? true? [true false true])
09:03clojurebotfalse
09:03ThornI understand some pythonistas hate clojure exactly for this
09:03fliebelThorn: For what?
09:04chousera few hundred uncategorized functions in core?
09:04fliebelchouser: In that case I'm one of them.
09:04Thornlots of functions like map/filter/every?/reduce/take/first/rest/etc
09:05Thorn(they've never seen common lisp obviously)
09:06fliebelThorn: There are only a little over 500, adn I think you are officially allowed to call yourself a guru or master or pro or… if you know 200 of them ;)
09:06neotykfliebel: you are called like that if you wrote 200 of them ;-)
09:06Thornthat's less than the number of common kanji characters so clojure must be easier than Japanese
09:07Thornat least
09:07fliebelOf which half are macros that are composed of the other 100, and with 100 fns we're comming close to Python ;)
09:07fliebelPython has 67 I believe.
09:07chousercommon lisp hyperspec lists 978. Clojure has 560. We're well on our way. :-/
09:08fliebelThorn: You can speak Japanese without knowing all of those as well ;)
09:08neotykchouser: what is hyperspec?
09:08chouserneotyk: http://www.lispworks.com/documentation/HyperSpec/Front/
09:10Raynesfliebel: And of those 500, some of them aren't functions. Your quiz includes stuff like *print-meta*.
09:10chouserwhich are good to know
09:11fliebelRaynes: I could do (filter fn?) on the lot… Not sure about it.
09:11Raynesfliebel: I think including all vars with documentation is great.
09:11RaynesI learned some new dynamic vars that I didn't know about before.
09:12fliebelRaynes: And you use those?
09:12RaynesNo, but it's nice to know about them. :>
09:13fliebelIf I need a random Java lib that's not on Maven, am I supposed to add it to Clojars?
09:15fliebelAnd how do I make something in Clojure that is a valid Enumeration<String>? will a seq or vector-of do?
09:16kjeldahl_fliebel: Any reason you can not just copy into your ~/.m2 local maven repo?
09:16fliebelkjeldahl_: Because not everyone can access my ~/.m2?
09:16kjeldahl_(I'm assuming a lot here, haven't tested myself, only limited experience from java on this)
09:17kjeldahl_fliebel: I was thinking that "lein deps" would copy it into lib together with the rest of the stuff.
09:17fliebelkjeldahl_: Yes, but as soon as my project gets on the webs, others need it as well.
09:19kjeldahl_fliebel: lein uberjar?
09:20kjeldahl_fliebel: How are the rest of the dependencies deployed then? Fetched by maven automagically? If so, put the jar into the local repo on the deployment machines as well?
09:20fliebelkjeldahl_: Meh, I actually wanted to know if it's okay to put java stuff on clojars.
09:21kjeldahl_fliebel: Can't help you there, if at all. :-)
09:23Raynesfliebel: Yes, it is.
09:24Rayneskjeldahl_: The whole point of dependency management is for people to be able to fetch the dependencies when they're hacking on your project. If he installs his dependency in a local maven repo, other people who want to work on his project wont be able to get it. If you're going to do that sort of thing, you might as well not use a dependency manager at all.
09:25fliebelRaynes: Cool
09:25kjeldahl_Raynes: Got it now. Didn't get enough context to figure out he was looking for somewhere to stuff a jar for public distribution, not private.
09:26kjeldahl_Raynes: But the Clojars hint is fairly obvious by now.
09:32fliebelCan I also use Cake to push to Clojars?
09:33fliebelthere doesn't seem to be cake push
09:33Raynesfliebel: cake release
09:34fliebelIt's not in cake help, or I'm overlooking it, or running an outdated cake
09:34Raynescake release has been around for quite a while.
09:35RaynesJust doing 'cake release' builds a jar of your project and pushes it to clojars.
09:35fliebelOkay, thanks
09:57bartjis there a replace-ignore-case somewhere?
10:00Raynesbartj: .replace and clojure.string/replace both take regexes. You can make your regex ignore case. Don't as me how though.
10:00Raynesask*
10:00bartjRaynes, yep, figured that out
10:00bartjRaynes, Perl regexes tend to spoil you with options
10:13bartj,(replace "Б." #"б." "бульвар")
10:13clojurebotjava.lang.IllegalArgumentException: Wrong number of args (3) passed to: core$replace
10:14bartjfirstly, I am using the correct string/replace in my code
10:15bartjam I doing something wrong in the replace function?
10:15Raynes&(clojure.string/replace "Б." #"б." "бульвар")
10:15sexpbot⟹ "Б."
10:16bartj
10:16bartjmy screen prints that, is there any utf-8 settings one needs to add to run Clojure?
10:18tonyl&(clojure.string/replace "бульвар" #"б." "Б.")
10:18sexpbot⟹ "Б.львар"
10:18tonylnot as far as I know, my repl prints it fine
10:27bhenryis there something like map that isn't lazy?
10:28raek(doall (map ...))
10:29raekor (doseq [x xs] ...) if you only care about the side-effetcs
10:29raekbartj: what IDE (if any) do you use?
10:29bhenryactually i just realized the laziness wasn't my problem. i was mapping over a vector that later gets called as a function of it's keys, so i'll do (vec (msp …)) thanks though.
10:29bartjraek, vim :)
10:30raeksorry, never used that with clojure :)
10:30bartjraek, the problem is not with the IDE
10:31raekvim only acts as a terminal?
10:31bartjraek, I am currently testing on the repl in a bash shell
10:31raekbartj: you can run the following to detect encoding issues: (seq "бульвар")
10:32raekif everyting works, you should get (\б \у \л \ь \в \а \р)
10:32bartjraek, I get this: (\1 \C \; \L \2 \0 \@)
10:32RaynesYikes.
10:32raekoh, are you using line repl?
10:33raek*lein
10:33bartjyes only the Repl
10:33raekthen install rlwrap in your OS
10:33raekleiningen uses jline if it is not available
10:34raekand jline does not have support for UTF-8
10:34mvid_is there a way to print the actual text from an array of strings? everything I try just gives me the string addresss
10:34raek(rlwrap cannot be distributed with leinigen due to the licenses)
10:35raekmvid_: (seq the-array)
10:35mvid_i get output like this
10:35mvid_(#<String[] [Ljava.lang.String;@2699146a> #<String[] [Ljava.lang.String;@c0b4ef2> #<String[] [Ljava.lang.String;@3a6bf80b> #<String[] [Ljava.lang.String;@669b824>)
10:36bartjI suspect the problem is jline
10:36bartjlet me remove that!
10:36bartjmvid_, seq it!
10:36kotarakmvid_: (map seq the-array)
10:36Raynes&(map seq (repeat 3 (into-array String ["a" "b" "c"])))
10:36sexpbot⟹ (("a" "b" "c") ("a" "b" "c") ("a" "b" "c"))
10:37raekmvid_: looks like you have an array of arrays of strings
10:37mvid_0.)
10:37mvid_o.)
10:37mvid_maybe?
10:37mvid_ill have to check
10:37mvid_ah
10:38mvid_yes
10:38mvid_that was dumb...
10:38bartjraek, yeah, removing jline helped
10:39raekbartj: as I said, if you install rlwrap on your system, lein will use that instead. rlwrap does not have this problem.
10:39bartjraek, yes, I have; but how does lein come into the picture?
10:39bartjraek, I do a "sudo apt-get install rlwrap"
10:43edwAnyone here use Cascalog (apropos the BackType video)? I'm wondering how to get a query to return a sequence, not print to standard out.
10:45bartjRaynes, is the following a bug in replace?
10:46bartj&(clojure.string/replace "Б." #"б." "бульвар")
10:46sexpbot⟹ "Б."
10:46bartjI expect the output to be бульвар
10:46fliebelWhat's up with design patters in Clojure? Just as valid as anywhere else, or OO legacy?
10:46tonyl&(clojure.string/replace "бульвар" #"б." "Б.")
10:46sexpbot⟹ "Б.львар"
10:47tonylthe string goes first then the match then the replacement
10:47drdofliebel: design patterns are sad things to reuse code by copy pasting
10:47edwfliebel: Flamebait? :)
10:48fliebeledw: What? Meh I have a book about them right here on my desk, just wondering if it will do me any good.
10:48bartjtonyl, the string is Б. and the match is б.
10:48tonylwhat is the replacement
10:48bartjtonyl, and the replacement is the long word: бульвар
10:48raekbartj: I think lein will check if rlwrap is on the PATH and if so, use it
10:49bartjbut strangely this works:
10:49bartj&(clojure.string/replace "A." #"(?i)a." "xyzpqr")
10:49sexpbot⟹ "xyzpqr"
10:49bartjreplace seems to despise russian strings?
10:50raek&(clojure.string/replace "Б." #"(?i)б." "бульвар")
10:50sexpbot⟹ "Б."
10:50edwfliebel: I don't see the GoF book getting much use in a Lisp e.g. Clojure shop.
10:50tonylbut #"б." doesn't match in the "Б." string
10:51tonylbut i don't know russian chars
10:51paulrosaniabartj: your arguments are out of order, you want (replace string pattern replacement), not (replace pattern replacement string)
10:51fliebeledw: I hav Head First Design Patters, but your point stands I guess.
10:51bartjthey are the same; one is lower-case version of the other
10:51raek"By default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching can be enabled by specifying the UNICODE_CASE flag in conjunction with this flag."
10:51p_l|homefliebel: I believe the canonical quote about GoF pattern book and Lisp was "where Java programmer sees pattern, Lisp programmer sees unnecessary crufty redundance of code"
10:51tonylI would make the regex case insensitive then
10:51raekhttp://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
10:51raek&(clojure.string/replace "Б." #"(?iu)б." "бульвар")
10:51sexpbot⟹ "бульвар"
10:52raekbartj: :-)
10:52bartjraek, oh my god
10:53raekI recommend checking out the unicode goodies of that page. for example, there are character classes for letters-of-any-script etc
10:54edwfliebel: In my experience, learning how to think in terms of list (sequence?) manipulation, using higher-order functions, is going to significantly improve your productivity. In other words, learn how to look at the world through mapping, reducing, etc. operations.
10:55bartjraek, thanks a ton!
10:56miltondsilvaI'm trying to apply what I've learned in clojure to java/c.. but so far it seems that no matter what I do, java/c forces me to solve problems their way... is there something I'm mising? does somebody have tips on how to improve code quality in the C world by applying thing you learned in lisp/clojure?
10:56bartjmiltondsilva, declaring all our variables as final would be the first step, IMO
10:56tonylfunctions free of side effects. make composite functions
10:57tonylthat is what i don in imperative langs
10:57lucianmiltondsilva: I mark functions as pure and have unit tests for that
10:57lucianit works very nicely in python
10:57Raynes&(letfn [(flip [f & args] (fn [& args] (apply f (reverse args))))] ((flip cons) '(b c) 'a))
10:57sexpbot⟹ (a b c)
10:57RaynesMy favorite function ever.
10:58miltondsilvalucian: thanks never thought of that
10:58miltondsilvabartj: how do you then handle(change) them?
10:58lucianmiltondsilva: copies, most likely
10:58lucianbut probably implicit copies through function calls
10:58lucianam i guessing right?
10:59rrc7czhow can I bind swank-clojure to 0.0.0.0 when I boot w/the bin? I've tried: .lein/bin/swank-clojure 4005 "0.0.0.0" but it doesn't like it
11:00lucianmiltondsilva: there's another nice technique in some imperative languages, generators
11:00miltondsilvahmm.. ok thanks, I'll go investigate now :) and make some tests
11:00lucianmiltondsilva: I sometimes write the various steps in some data processing as separate coroutines
11:01lucianor generators, since i tend to use python
11:01lucianmiltondsilva: and you get both speed (generators are lazy lists) and functional purity/composability
11:01lucianin an imperative language
11:01lucianof course, this won't work in java or c
11:02raekrrc7cz: lein swank 4005 0.0.0.0 seems to work for me
11:03raekah, you were using a different binary
11:04raeka new leiningen feature?
11:04rrc7czraek: yeah, I'm trying to boot swank w/out a project
11:04rrc7czfrom Git readme: "If you just want a standalone swank server with no third-party libraries, you can just install swank-clojure using Leiningen. ~/.lein/bin/swank-clojure"
11:08rrc7czfrom the src it looks like the port is pulled separately, which isn't a problem for me; I can set the port fine via "swank-clojure XXXX" but when I try to add a host ip it blows up, saying "no value supplied for key: 0.0.0.0" so I'm guessing it expects a k+v for a map, but I'll have to dig in deeper to see how it parses it
12:04technomancywill probably drop jline for Leiningen 2.0; rlwrap is a better solution in every way except for distribution =\
12:05raeklicenses, rigth?
12:05technomancyno, it's just that rlwrap is a C executable
12:05technomancyrather than a jar file
12:06raekoh
12:06technomancyit's silly that libreadline isn't linked to the JDK; they actually are license-compatible IIUC
12:07technomancybut sun obviously doesn't realize there's such a thing as a command-line
12:09Raynescljandbox? Oh no, not competition.
12:09RaynesOh, *whew*. It isn't a sandboxing library.
12:09fliebel"A collection of Clojure utilities"
12:10raekah, that kind of sandbox...
12:10cloturehey all. I am familiar with the benefits of lisp, clojure, etc, but I was wondering if there are any "killer apps" for clojure? Any libraries which really show off clojure's advantages?
12:11fliebelcloture: Hm, what about Aleph and ClojureQL?
12:12dnolenrhickey: empty is pretty useful. What about empty-transient?
12:12RaynesI think ring is a nice example.
12:13fliebelRaynes: But ring is not unique to Clojure, Python and Ruby have similar concepts.
12:13chouserhow hard would it be to have clojure load a .class file in such a way that it could reload a new version of it later, the way it does with deftype classes
12:13cloturefliebel: ClojureQL looks interesting. thanks for the suggestion
12:15hiredmanchouser: can't you just re-use that mechanism
12:15hiredmanDynamicClassloader
12:21clotureis there a preferred web library for clojure? is momentum towards webjure, compojure, or something else?
12:21Raynescloture: Moustache and Compojure tend to be the most popular.
12:21clotureRaynes: thanks
12:24chouserhiredman: dunno. I guess I haven't tried.
12:25sholdencloture: I just started reading and learning clojure this morning, I'm kind of at the same stage :P
12:25cloturesholden gotta start somewhere
12:25sholdenIm getting the hang of it, but I'm trying to decide what a good app would be to write in it that would flex it and show off a bit
12:26clotureyeah I know what you mean
12:27sholdenat work we have a service that monitors updateable objects (could be 'fetch and cache url' or 'run script' etc)
12:27sholdenand there may be about 1000 of them in the system at a time
12:27sholdenupdating 5-30 sec
12:27sholdenmight see if i can write a clojure version of that
12:28hiredmanchouser: you may have to wall hack the var the compiler uses to hold the current classloader
12:29hiredmanmore maybe not
12:29hiredmanlooks like classCache is global
12:30hiredmaner
12:30hiredman"static"
12:37pedroteixeirahi, can anyone confirm that the functions keys and vals produce sequences in correct pair order?
12:37pedroteixeiraor one should not assume that.
12:38pedroteixeira?
12:38drewrone should assume that
12:38pedroteixeirathanks, drewr. glad about that :)
12:45fogus`All: Is this a fair one-sentence summation? --> You can "mix in" partial implementations if you desire, but it only takes effect at the granularity of the protocol and not on a per-function basis.
12:47fogus`In other words, this: https://gist.github.com/727273
12:48@rhickeyfogus`: I don't se the mixin there
12:48@rhickeysee
12:49@rhickeyI would reserve the term mixin for uses of extend that build the map using pieces
12:49fogus`rhickey: Do you mean a map of str=>fn used by extend?
12:49fogus`oh, I see
12:49@rhickeyand in that sense, you can build a full implementation from partial ones
12:50fogus`rhickey: So that's to say that implementations are "mixed" into the map which is then used once in extend?
12:51@rhickeyright
12:51fogus`rhickey: OK, I can use that. What would you suggest as a better term in my original statement?
12:52@rhickeyfogus`: one doesn't do mixins via multiple partial extensions?
12:53@rhickeyor, extension is at the granularity of the entire protocol
12:54fogus`rhickey: Thanks! That sounds good. I will expand on the original theme to include some talk about Clojure mixins
12:54dnolenoh yeah, I guess empty-transient isn't so useful w/ only two data structures really supporting it. rhickey: have there been any takers on that, bringing transient support to the other data structures?
12:55@rhickeydnolen: all enhancements to transients will have to wait for pods
12:55dnolenrhickey: I see.
13:46fliebelWhat are the latest 2 parameters for Clojars? http://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html
13:50stuartsierraClojars doesn't support deployment via Maven, last I heard.
13:50fliebelHuh? So how do I get a jar on there?
13:50RaynesClojars only supports ssh deployment, iirc.
13:50stuartsierraSCP
13:50stuartsierrasee clojars.org home page
13:51fliebelThey assume I can create a pom with leiningen, but I don't have one. can I at least have maven generate me one?
13:51stuartsierrano
13:51stuartsierracopy & modify from another project
13:53Raynescemerick: You were right: syntaxhighlighter evolved is teh awesome: http://blog.raynes.me/?p=82
13:54RaynesToo bad tinymce's visual mode completely borks it, because it 'cleans up' your HTML and removes whitespace.
13:57cemerickRaynes: really? wp.com must have fixed a version for what they use -- I can use the WYSIWYG editor with code in a post without a problem..
13:59Raynescemerick: In the visual editor?
13:59RaynesIn tinymce, if you switch from HTML to visual, your code is completely mangled.
13:59cemericknot on wp.com *shrug8
14:00cemericks/8/*
14:00sexpbot<cemerick> not on wp.com *shrug*
14:00cemericklike I say, they may have deployed a patched version of mce
14:00RaynesProbably.
14:00cemerickIn any case, my usual process is to drop code in in the HTML mode, tag it appropriately, and then write around it in the visual editor.
14:00Raynescemerick: Of course, I haven't tried WPs visual editor. I was using scribefire.
14:01Raynescemerick: WP's editor is the same as scribefires, but you're right in that they might have a patched version.
14:01RaynesNonetheless, syntaxhighlighter evolved explicitly mentions this flaw, so I'm not sure. I'll try it in a second.
14:01clojurebotNo entiendo
14:03Raynescemerick: Yup, still mangles it.
14:18chouserHi! Who wants to help me with maven? Some more?
14:19Rayneschouser: I want to help you with maven as much as I want to help the government find Julian Assange.
14:19RaynesBa dum *ding*
14:19ckyRaynes: Well played.
14:19chouseroh, I should say that I did get maven and antlr to play nicely together. The main problem was the antlr maven plugin used antlr 3.0.1, but we needed it to use 3.1.2, which ended up requiring a patch to the plugin itself.
14:19ckychouser: Isn't there a #maven channel for that sort of stuff?
14:19chousercky: hm, good point.
14:20ckyTo me, the only relation Maven has to Clojure is the letter "e".
14:21chousercky: well, I'm hoping to use clojure.java.io/resource, but your point is still valid
14:24chouseron the other hand, I've gotten infinitely more responses to my question here as I have in #maven
14:25chouserso, I'll go for it anyway. feel free to ignore me.
14:25RaynesPeople here actually like you and know you.
14:25chouserIf I have a file like src/main/resources/com/mydomain/foo.txt, should I be able to get to it via (clojure.java.io/resource "com/mydomain/foo.txt") ?
14:25brehautchouser: the #mavenites are going to respond to your question, but they are still waiting for the dependant questions to download
14:26chouserbrehaut: tee hee
14:26cky:-)
14:26stuartsierrachouser: Yes, after a build.
14:26chouserah!
14:26chouserseems obvious now that you say it
14:26stuartsierrathe "process-resources" phase has to run first.
14:27chouserhm, still getting nil
14:28chousercould I have disabled it somehow in my pom?
14:28stuartsierraDo "find target -name foo.txt" and see where it shows up
14:29stuartsierraWait...
14:29stuartsierraYou may need to add a <resource> directory.
14:29chouserah
14:29chouserI see a couple for clojure sources. hang on
14:29stuartsierraUnder <build>, add <resources><resource>src/main/resources</resource></resources>
14:30stuartsierraI think if you have any resource dirs defined, it overrides the default src/main/resources
14:30stuartsierrasorry that's <resources><resource><directory>src/main/resources</directory></resource></resources>
14:30chouserheh, ok, I think I understand. hang on
14:31chouserbingo
14:31stuartsierracowabunga
14:31chouserthanks bunches!
14:31stuartsierra'welcome
14:33chouseris it kosher to make up new dirs in there? like src/main/web-content ...?
14:33stuartsierrayes
14:34stuartsierraEvery <resource> will get copied into the JAR, without its base directory
14:34chouserbut they get merged into the same virtual resource tree, so I'd still need a uniquely named subdir. may not be worth it.
14:34chouserok
14:34stuartsierrae.g., src/main/web-content/foo.txt becomes "
14:34stuartsierra"/foo.txt" in the output JAR
14:35chouserright
14:35chouserthanks again, that would have taken me a long time to figure out on my own.
14:36stuartsierranp
14:58kjeldahlDoes anybody have a "cake-swank" emacs function handy? I've tried doing a search and replace on my "lein-swank", but that doesn't seem sufficient...
15:02kjeldahlProbably related to cake having a different process model.
15:08hchbaw_quile:
15:10kjeldahlGot it working. Had to modify the string-match parameter to recognize the cake output.
15:12lpetitHello
15:13mmullinsI'm having trouble with *agent* in clojure-1.3.0-alpha3. It seems to be nil when I expect it not to be. (send (agent 0) (fn [_] (println "*agent* = " *agent*))) gives *agent* = nil. I think in alpha1 and 1.2.0 this gave the agent as I expect. Am I not supposed to do that now?
15:14lpetitany ccw users in the place ? I need ideas for a feature I want to add ...
15:14hiredmanmmullins: it's a known bug
15:14mmullinsAhhh ... ok. Thanks.
15:15hiredmanbecause of the change that propagates bindings from the thread running the action, to the thread the action is run on
15:15hiredmanon the thread the action is sent form *agent* is nil
15:16mmullinsso is there a way to send the same agent another function from inside one it's doing until that's fixed?
15:17hiredmancreate your own binding of *agent* to the agent you are sending to
15:17hiredman(let [a (agent 0)] (binding [*agent* a] (send a some-action)))
15:18mmullinsI'll try it. Thanks.
15:30clotureI seem to have a problem. I am using leiningen, which had been working fine. However, when I use the "deps" command, it now just sits hangs
15:31clotureanyone familiar with the issue?\
15:33cloturehmm. when I remove one of the dependencies there is no problem
15:54chousermeh. ring is getting in my way, for perhaps the first time
15:54hiredmando share
15:55chousertrying to serve static content from resources instead of a file path
15:55chouserbut all the wrap-file stuff assumes otherwise -- breaks in several places
15:56hiredmancan wrap file take File objects?
15:57hiredmanyou should be able to generate file objects use the url from one of those getResource methods
16:07technomancycloture: that was a known bug that surfaced in one of the release candidates; it should be fixed on the 1.4.0 release
16:08cloturetechnomancy: okay. thanks for the info
16:12technomancycloture: that is to say, make sure you're running the latest; if it still happens please file a bug
16:18chouserhiredman: if you have actually seen working code like that, I'd be interested. My fumbling attempts to do it have all failed.
16:36bmhIs there a 'nice' looking way of writing a curried multimethod where the object used for dispatch is not in the first argument position?
16:38technomancy,((comp second list) 1 2 3 4)
16:38clojurebot2
16:39technomancy,((comp class second list) 1 2.0 :three "four")
16:39clojurebotjava.lang.Double
16:53clotureanyone familiar with enlive? does a template have to exist before you use deftemplate? I keep getting a null pointer exception and I'm baffled as to why that is
16:59dnolencloture: the html file the template uses does have to exist.
16:59cloturednolen: okay, I'm a bit confused. enlive doesn't generate the html from the clojure code you supply?
17:01cloturednolen: even when it exists I get an error
17:01dnolencloture: the html file need to be in the class path
17:03dnolencloture: enlive serializes the html file and processes it according to your template definition.
17:03cloturednolen: okay
17:03eaaanyone ever experience problems with multimethod dispatch blocking threads? I am getting thread contention in clojure in MultiFn.java:106 when invoking a multimethod from within a pmap via incanter.stats which invokes a multimethod to convert its argument before invoking a Java method
17:04cloturethanks for the help
17:04dnolencloture: have you looked at the enlive tutorial I wrote?
17:20aria42I have a deftype and it implements IFn for various # of args of invoke. When I use partial on an instance of the type, I get an abstract method error when I execute on a defined invoke
17:21aria42The issue is the use of apply in partial
17:22hiredmanaria42: you need to implement the apply method
17:22@rhickeyaria42: just implement applyTo
17:22aria42Ah, thanks.
17:23raekdnolen: I saw in that tutorial a while go that you called (apply str ...) on the result from enlive. is that really necessary?
17:24raekI think the ring SPEC says that the body of the response may be a sequence of strings
17:26raekalso, I enjoyed the tutorial :-)
17:27dnolenraek: it is.
17:27dnolenraek: thx!
18:00kzarWhen I slime-connect to Clojure it works fine except the slime-repl is not put into Clojure mode. Then if I load clojure-mode myself the repl breaks and I can no longer evaluate stuff. Any ideas?
18:04kzarOh I found my answer, sorry
18:04brehauti dont think you need to be sorry for solving your own problem
18:06kzarHeh I almost said 'sorry' for my eroneous apology, stack overflow Dave heh
18:09brehautkzar: im not familiar enough with SO to understand your reference
18:13kzarbrehaut: Well if you mess up some recursion, as I often do, you get a stack overflow error and I was joking that would happen to me as I kept apologising for apologising forever. Kind of a terrible joke but there you go heh
18:14cky*lol* @ brehaut, I have the same problem myself.
18:14ckyThat I read "stack overflow" as a reference to stackoverflow.com.
18:18brehauti think it might be time to brew tea
19:58jjido##(date)
19:58sexpbotjava.lang.Exception: Unable to resolve symbol: date in this context
20:02jjido&(Date.)
20:02sexpbotjava.lang.IllegalArgumentException: Unable to resolve classname: Date
20:05jjido&(java.util/Date.)
20:05sexpbotjava.lang.ClassNotFoundException: java.util
20:05jjido&(java.util.Date.)
20:05sexpbot⟹ #<Date Fri Dec 03 17:06:07 PST 2010>
20:06jjidothanks :D
21:04taliosis it possible to return a type specific object array in clojure? ( other than the predefined boolean-array, char-array etc. etc. ). I want/need to return SomeFoo[]
21:28hiredmantalios: have you read the docs on make-array? or into-array?
21:29taliosaha! I hadn't spotted those two :) Cheers. I refactor the code to use a List<XXX> on the java side anyway. Tho I might revert that for now and favour (make-array) to keep the changes to a minimal in this spike.
21:30taliosman - it's been way toooo long since I've actully done any clojure.
21:52RazWellesping dmiller2718 -- Do you have any code examples for importing a .Net dll, and instantiating a class and using a method? I can't find any docs for ClojureCLR
22:28taliosHrm - I have a namespace with a defn'd function, and a deftype type. The type doesn't seem to be able to see the functions in the namespace surrounding it. Am I missing something simple? https://gist.github.com/8bf96274a6912aaea036
22:34hiredmanI think there is too much wrong with that to debug via irc, so I would suggest more reading of docs
22:35hiredmanfor one thing I don't think ^File [] does what you think
22:36hiredmanI kind of doubt you've read up datatypes, since I would be surprised if you have a reason to use deftype over defrecord
22:38taliosmmm, defrecord just seems to add all the keyword accessors, equals/hashcode etc. etc. which I didn't seem to need.
22:42talios^File [] should have been ^File[] anyway - and seems to compile fine.
22:43hiredmanright, but it doesn't do what you ant
22:43hiredmanwant
22:43hiredmanso unless you understand what and why I suggest you stick with defrecord
22:45taliosI require the ^File[] so that the interface is satisfied. Without it I get "Can't define method not in interfaces: discoverNamespacesIn"
22:45hiredmanI suggest you run ^File[] through the reader and see what you get
22:48dmiller2718RazWelles: Use (System.Reflection.Assembly/Load "...") for things in the GAC, (System.Reflection.Assembly/LoadFrom "..." for things in your directory.
22:48RazWellesdmiller2718, thanks so much!
22:49talioshrm - empty list. so how does one type list an array?
22:49dmiller2718RazWelles: In the ClojureCLR source, look in Clojure/Clojure.Source/clojure/samples, both celsius.clj and the interop subdir.
22:49RazWellesoooh, sweet I'll go grab that from github :D
22:50RazWellesdmiller2718, also, thanks for continuing to work on ClojureCLR, I've been waiting for user binaries since the project first started :)
22:50taliosoh nasty - ok. so clojure doesn't directly support array typehints - nasty.
22:51dmiller2718RazWelles: thx. Feel free to contact directly with suggestions, etc.
22:51taliosI suspect that'll leave me back with the original problem tho
22:52RazWellesdmiller2718, definitely will do :)!
23:07taliosRight - so now back to my original problem, after cleaning up that mess of a deftype.