2009-08-16
| 00:07 | lowlycoder | what's the comment char in clojure? |
| 00:07 | Anniepoo | ; end of line |
| 00:07 | andyfingerhut | semicolon |
| 00:08 | Anniepoo | you can ifdef out a form by preceeding it with #_ |
| 00:26 | lowlycoder | so structs are just maps? |
| 00:26 | rlb | lowlycoder: yes, though optimized for the named elements. |
| 00:26 | andyfingerhut | with some space efficiency enhancements, yes |
| 00:29 | lowlycoder | interesting, thanks |
| 00:29 | andyfingerhut | kinda cool that you can still add other keys to them if you really want to |
| 00:31 | lowlycoder | clojure does not allow defining of reader macros |
| 00:32 | lowlycoder | how do I violate this condigion? |
| 00:32 | lowlycoder | *condition* |
| 00:32 | technomancy | next time someone complains about Clojure stacktraces point them to JRuby... it gets the line number significantly wrong frequently |
| 00:32 | technomancy | lowlycoder: patch LispReader.java and recompile |
| 00:33 | Anniepoo | lowlycoder - it means you can't decide that you don't like #^{} for metadata and want that to be something else |
| 00:39 | lowlycoder | technomancy: nice; thanks |
| 00:47 | lowlycoder | so I know that Java code is not tail recursive; but is even clojure code not compiled to be tail recursive? (it seems very easy to implement via trampolines) |
| 00:48 | Anniepoo | it is for the simple case |
| 00:48 | tomoj | it's only tail recursive if you make it tail recursive |
| 00:49 | tomoj | well.. any tail recursive function is tail recursive |
| 00:49 | tomoj | but clojure will not automatically optimize |
| 00:49 | tomoj | you have to be explicit if you want optimization |
| 00:55 | lowlycoder | so I can't write functions like: |
| 00:55 | lowlycoder | (defn (foo a b) (if (equal? a 0) b) (foo (- a 1) (+ b 1))) and expect (foo 1000000000 100000000) to only consume a reasonable constant amount of memory? |
| 00:55 | lowlycoder | does "optimize it myself" mean convert it to a do loop? |
| 00:56 | replaca | lowlycoder: just replace the second foo with recur and you'll be good |
| 00:58 | tomoj | that is not clojure code anyway.. |
| 00:58 | lowlycoder | hey; i'm converting over slowly |
| 00:59 | tomoj | from what? |
| 00:59 | tomoj | doesn't look like any lisp I've used either :) |
| 00:59 | replaca | ,(let [f (fn [a b] (if (= a 0) b (recur (dec a) (inc b)))) ] (f 10000000 10000000)) |
| 00:59 | tomoj | the bot isn't here :( |
| 00:59 | replaca | :( |
| 00:59 | replaca | well, running it is an exercise for the reader |
| 01:00 | tomoj | works fine |
| 01:00 | lowlycoder | why is implementing trampolines so hard? |
| 01:00 | replaca | i knew that :-) |
| 01:00 | tomoj | we have trampolines |
| 01:00 | tomoj | clojure.core/trampoline |
| 01:01 | tomoj | they aren't necessary for simple tail recursion like the above |
| 01:01 | lowlycoder | well, the above is a leaky abstraction |
| 01:01 | lowlycoder | it makes me have to think to use recur |
| 01:01 | tomoj | yup, sorry |
| 01:01 | tomoj | it's the JVM's fault |
| 01:01 | replaca | lowlycoder: yeah, it's supposed to be. Rich doesn't want to hack in a solution when it should be solved at the JVM level |
| 01:02 | tomoj | maybe the JVM will have TCO someday |
| 01:02 | replaca | that's his assumption, I think. It is under discussion, but not at the top of the list |
| 01:03 | lowlycoder | great; so we don't have a solution until the JVm changes, even thouch in theory we could? |
| 01:03 | replaca | that's probably true |
| 01:03 | replaca | unless Rich changes his mind |
| 01:03 | tomoj | weird |
| 01:04 | tomoj | I've heard multiple times that it's flat out impossible |
| 01:04 | replaca | in real life, I haven't noticed it to be much of a pain point |
| 01:04 | tomoj | without the qualification "unless we do ___, which we don't want to" |
| 01:04 | replaca | well, for the recur case, Rich could do the optimization himself in the compiler |
| 01:04 | replaca | but the trampoline case is a bunch harder |
| 01:05 | replaca | Rich has tried to compile to very clean code in general in order to best leverage the JVM's strengths |
| 02:08 | Anniepoo | architectural question |
| 02:09 | Anniepoo | I'm going to implement a database of resources |
| 02:09 | Anniepoo | essentially takes a string and returns a ID for a resource that's expensive to make |
| 02:11 | Anniepoo | so I'll keep a memory resident copy of a file (durability isn't important here) |
| 02:11 | Anniepoo | and modify and write |
| 02:12 | Anniepoo | is it better to make the file format be a def and just load it? |
| 02:40 | arbscht | so close yet so far. got clojure-clr to sort-of-kind-of build on mono, but not yet load :( |
| 02:45 | tatofoo | how can I call Graphics2D.drawPolyline(int[], int[], int) from within clojure? I've tried (doto g (.drawPolyline [0 10 10] [0 10 40] 3)) but it tells me PersistentVector cannot be cast to [I |
| 02:48 | arbscht | ,(int-array [0 10 10]) |
| 02:49 | tatofoo | arbscht: :O thanks, sorry for my ignorance but what's the , for? |
| 02:50 | arbscht | that usually triggers clojurebot to evaluate the expression |
| 02:50 | lowlycoder | what's clojure's obsession with [] ? why does let even use [] to separate the vars from the body? |
| 02:50 | tatofoo | hehe, ah ok, than you I'll try that |
| 02:50 | arbscht | however clojurebot is missing in action today :/ |
| 02:52 | arbscht | lowlycoder: it's a feature of clojure's homoiconicity |
| 02:53 | lowlycoder | what does it mena? |
| 02:53 | lowlycoder | the word's too big for me |
| 02:54 | Anniepoo | clojure code and clojure data are one and the same |
| 02:54 | arbscht | clojure's code is represented by clojure data structures |
| 02:54 | arbscht | more info at http://en.wikipedia.org/wiki/Homoiconicity |
| 02:55 | lowlycoder | this doesn't seem to explain why let is based on vectors rather than lists |
| 02:55 | lowlycoder | performane reasons? |
| 02:55 | lowlycoder | so for anyting whose length we know at compile time, use vectors instead of lists? |
| 02:56 | Anniepoo | lowly, vectors aren't assumed to be functions |
| 02:56 | arbscht | oh, partly for aesthetic reasons (too many parens), but also to differentiate from operator calls |
| 02:57 | Anniepoo | you'll come to appreciate having both structures |
| 02:57 | lowlycoder | it's also weird that (let [[x y] [1 2 3]] ... ) just drops the 3 |
| 02:58 | lowlycoder | it seems like it should throw an error of some kind |
| 03:01 | tomoj | I find it very useful that it doesn't throw an error |
| 03:03 | lowlycoder | Clojure=> (import '(package Class+)) |
| 03:03 | lowlycoder | #<CompilerException java.lang.ClassNotFoundException: package.Class+ (REPL:1)> |
| 03:03 | lowlycoder | why doesn't this work? |
| 03:04 | lowlycoder | (import '(java.io InputStream File)) |
| 03:04 | lowlycoder | why doesn't that use [] instead of () ? |
| 03:04 | lowlycoder | especailly since it'l reduce the need for ' |
| 03:05 | arbscht | (import [java.io InputStream File]) works |
| 03:07 | lowlycoder | (round 1.2) --> goes to 1, not 2 as mentioned in the book |
| 03:08 | arbscht | stu halloway's book? |
| 03:08 | lowlycoder | ya |
| 03:08 | tomoj | lowlycoder: you're not supposed to type the code in the grey boxes |
| 03:08 | tomoj | I suppose you've realized this |
| 03:08 | tomoj | it's just a typo |
| 03:12 | tatofoo | :O I was wondering about that '( in the import aswell, didn't know you could use [] :D |
| 03:16 | lowlycoder | so do is just == begin? |
| 03:17 | arbscht | what's begin? |
| 03:17 | tomoj | you mean begin from ruby? |
| 03:17 | lowlycoder | begin from scheme |
| 03:18 | tomoj | oh.. dunno |
| 03:18 | tomoj | progn from CL |
| 03:22 | lowlycoder | hmm, so recur does tail recursion on a singl efunction |
| 03:22 | lowlycoder | can i have a set of functions that recur on each other? |
| 03:22 | lowlycoder | i.e. the last expr in f is (g ...), and the last expr in g is (f ...) |
| 03:27 | tomoj | lowlycoder: that's in the book |
| 03:27 | lowlycoder | haven't gotten to there yet |
| 03:27 | lowlycoder | can you tell me? |
| 03:27 | tomoj | 5.4 |
| 03:27 | tomoj | there are a few different ways to solve that problem |
| 03:28 | tomoj | you're probably looking for trampoline |
| 03:30 | tomoj | but laziness or solving the problem another way can be prettier |
| 03:43 | lowlycoder | how does def and defn differ? |
| 03:43 | lowlycoder | I'm confused on when to use the two |
| 03:46 | arbscht | defn is defined in terms of def. use defn when you intend to define a function |
| 03:46 | lowlycoder | why not juse use def all the time? |
| 03:50 | arbscht | I guess you could if you wanted to |
| 03:50 | mudphone | convenience |
| 03:50 | arbscht | defn has the advantage of being nicer to read, with an easy way to add docstrings |
| 03:55 | lowlycoder | (defn indexed [coll] (map vector (iterate inc 0) coll)) |
| 03:55 | lowlycoder | (defn index-filter [pred coll] (when pred (for [[idx elt] (indexed coll) :when (pred elt)] idx))) |
| 03:55 | lowlycoder | (index-filter #{\a \b} "abcdbb") |
| 03:55 | lowlycoder | no way, is the ${} ... using advantage of the fact that sets are functions of it's members? |
| 04:21 | tomoj | yep |
| 04:21 | tomoj | cool, huh? :) |
| 04:21 | lowlycoder | a little too magical for my liking |
| 04:22 | lowlycoder | i think it's kind of stupid to not have a standard library function of "convert set into a function"; instead of binding this directly to the syntax, which I can't modify without breakig clojure |
| 04:22 | tomoj | there is no "convert a set into a function" in the syntax |
| 04:22 | tomoj | sets ARE functions |
| 04:24 | tomoj | #{} is just reader syntax for sets |
| 04:27 | tomoj | if you want to be more verbose for some strange reason you can use (set '(\a \b)) |
| 04:28 | tomoj | ..and if you don't like sets as functions you can go ahead and use (contains? (set '(\a \b)) \a) |
| 04:29 | tomoj | personally I think (#{\a \b} \a) is a lot cooler :D |
| 04:29 | lowlycoder | i don't like verbosity |
| 04:29 | lowlycoder | i just don't like things that are hardcoded for me |
| 04:29 | tomoj | you don't have to use the set reader macro if you don't want to |
| 04:30 | lowlycoder | i think reader macros are cool; and the syntax introdued is pretty elegant |
| 04:30 | lowlycoder | i'm just annoyed that I can't modify it to my future needs :-D |
| 04:30 | tomoj | user reader macros cause problems that rich decided were not worth the trouble |
| 04:33 | lowlycoder | does clojure require the use of capital letters at all? |
| 04:33 | lowlycoder | or are all names separated by - by default? |
| 04:34 | tomoj | names are separated by whatever you separate them with.. I don't understand the question |
| 04:34 | arbscht | names in the clojure api do not. names imported from java might |
| 04:34 | lowlycoder | langauges like c/java tend to use things like CamelCase |
| 04:34 | lowlycoder | I was just curious what clojure tends to use |
| 04:34 | tomoj | convention is lisp-case |
| 06:34 | ZabaQ | I know Common Lisp fairly well, but I have no clue about Java. How much pain am I letting myself in for? |
| 06:36 | Chousuke | Hmm. |
| 06:36 | arbscht | none, I should hope. I came to Clojure from CL and that was painless. |
| 06:36 | Chousuke | ZabaQ: You'll have to learn to read javadocs at least :) |
| 06:36 | Chousuke | because while you won't have to write java, it's still very useful to know the java libraries. |
| 06:38 | Chousuke | though clojure.contrib does contain wrappers for a lot of the basic functionality that clojure.core leaves to java |
| 06:42 | ZabaQ | Chousuke: Hmm. I haven't looked at clojure-contrb yet. Perhaps I should. |
| 06:42 | Chousuke | Yeah. Pretty much everyone uses it anyway. |
| 06:43 | Chousuke | and yet there is no proper release of it :P |
| 06:43 | Chousuke | so you'll need to git it :) |
| 06:47 | ZabaQ | I'm going to need ant |
| 06:49 | Chousuke | unfortunately :P |
| 06:50 | ZabaQ | I hate ant with a passion. Mostly because I've been forced to use it on a huge C++ project, when it wasn't really in it's element. |
| 06:50 | ZabaQ | I assume it's much happier in Java-land. |
| 06:51 | Chousuke | well, it's still a programming language with XML syntax |
| 06:51 | Chousuke | and not in a good way like xslt |
| 06:52 | arbscht | better ant than visual studio solution files... |
| 06:52 | Chousuke | but fortunately, most of my use of ant just involves calling the targets :P |
| 06:52 | arbscht | not that you have to do much more than "ant jar" or the like |
| 06:52 | arbscht | right |
| 06:58 | ZabaQ | ant complained about not being able to find tools.jar. Is that bad? |
| 06:59 | Chousuke | hm |
| 06:59 | Chousuke | you're probably missing some dependency? |
| 07:07 | ZabaQ | I wan't using the right JRE. There's an anicent one lurking on this machine |
| 07:16 | ZabaQ | clojure.contrib.monads!? |
| 07:17 | ZabaQ | hmm. there is a lot of stuff in there. |
| 07:17 | Chousuke | yeah :) |
| 07:18 | ZabaQ | BUILD SUCCESSFUl. Wahey. I think I need to read docs for a bit.. |
| 07:18 | Chousuke | which version of clojure are you using? |
| 07:18 | ZabaQ | git |
| 07:18 | ZabaQ | head |
| 07:18 | Chousuke | 'k. then contrib will work fine too |
| 07:19 | Chousuke | contrib master only works with clojure master; there's a 1.0-compatible branch too though. |
| 07:19 | ZabaQ | right |
| 07:20 | Chousuke | also see http://java.ociweb.com/mark/clojure/ |
| 07:24 | ZabaQ | javadocs are best read in an ordinary browser, I take it? |
| 07:24 | Chousuke | that's what I do. |
| 07:24 | Chousuke | and Clojure docs from slime :P |
| 07:25 | Chousuke | (well, function docs anyway) |
| 07:26 | ZabaQ | ah, I've only set up clojre to run with run-lisp. Not trying to make it work with slime as this is a windows box and my slime setup is bits of duct tape and string. |
| 07:26 | ZabaQ | (metaphorically). |
| 07:26 | Chousuke | heh. |
| 07:27 | ZabaQ | I think slime has a mode that gives you slimey functionality in an *inferior-lisp* buffer: I'll try that. |
| 08:05 | ZabaQ | It's a Lisp-1. Oh dear. |
| 08:07 | Chousuke | I haven't yet figured out how that's supposed to be a problem :) |
| 08:11 | Chousuke | I always hear stuff about how lisp-1's have hygiene problems and whatnot but I honestly don't know what they're talking about. |
| 08:11 | eevar_ | and having to use "funcall" blows chunks imo |
| 08:16 | osaunders | I wanted to have a value called range but couldn't. |
| 08:16 | osaunders | Then again maybe that would have been a bad name. |
| 08:17 | osaunders | ... in a Lisp-2 |
| 08:17 | Chousuke | well, you can have the range value but it'll shadow the function def :P |
| 08:18 | Chousuke | that's one think I'll give to lisp-2 :) |
| 08:18 | osaunders | ,(let [range (range 10)] (print range)) |
| 08:18 | Chousuke | but not worth funcall IMO :P |
| 08:18 | osaunders | Dude, where's clojurebot? |
| 08:18 | Chousuke | no idea :/ |
| 08:19 | Chousuke | hiredman is gone too so hmm. |
| 08:22 | osaunders | Is hiredman related to clojurebot? |
| 08:22 | Chousuke | he made it. :P |
| 08:22 | osaunders | Ah. |
| 08:23 | osaunders | Father then. :-) |
| 08:24 | Chousuke | Clojurebot actually started as a gist. |
| 08:24 | Chousuke | but then I wanted to hack on it a bit and cloned the gist and put it in a proper github repo :P |
| 08:24 | Chousuke | that's why the early history doesn't have very interesting commit messages. |
| 08:26 | Chousuke | (and why github says hiredman's repo is a fork of mine) |
| 08:26 | osaunders | You credit stealer you. |
| 08:27 | Chousuke | I haven't touched it in half a year, though |
| 08:30 | Chousuke | the beginning: http://github.com/hiredman/clojurebot/blob/2381e7989977b8999aa0f863ef0a50415bb6e5fc/clojurebot.clj |
| 08:34 | ZabaQ | Lisp-1 isn't a big deal, you have to be more careful about names, mainly. |
| 08:34 | Chousuke | in Clojure at worst you end up shadowing them locally |
| 08:35 | Chousuke | unless you do trickery in a macro to force a capturing expansion. |
| 08:39 | Chousuke | Syntax-quote is the best feature of clojure's macro system. it's pretty much impossible to accidentally shadow names in the expansion environment, but it's easy enough if you want it. |
| 08:40 | Chousuke | though doing it makes your macro look ugly, which is probably just a good thing |
| 08:44 | osaunders | Brainfart is Windows 7 out? |
| 08:44 | Chousuke | no. |
| 08:44 | arbscht | progress... clojure-clr now loads on mono, but dies anyway :) |
| 08:44 | osaunders | OK. Thanks for clearing that up. |
| 08:45 | Chousuke | but apparently there's an RTM build already |
| 08:45 | osaunders | Read The Manual build? |
| 08:45 | Chousuke | Release to manufacturing or something? the gold master :P |
| 08:46 | ZabaQ | It might actually tempt me to upgrade from Win2k |
| 08:46 | Chousuke | Win2k :| |
| 08:47 | osaunders | Wow I clicked on 90% of all the links on Hacker News today. |
| 08:47 | osaunders | Normally it's about 40% |
| 08:55 | ZabaQ | I don't suppose there's anything like (describe ) in CL? |
| 08:56 | danlei | (doc ...) |
| 08:57 | danlei | actually more like documentation, but closest |
| 08:58 | arbscht | (meta ...) covers some of the difference too |
| 09:01 | cemerick | well, (meta #'...), anyway :-) |
| 09:04 | danlei | (meta #'symbol) pretty much feels like (symbol-plist 'symbol), but modern CLs usually don't put such information in plists anymore. |
| 09:09 | cemerick | good thing clojure isn't a modern CL ;-) |
| 10:55 | syamajala | i'm trying to figure out swank |
| 10:55 | syamajala | user=> java.io.FileNotFoundException: Could not locate swank/swank__init.class or swank/swank.clj on classpath: (NO_SOURCE_FILE:0) |
| 11:00 | danlei | (add-classpath "file:///path/to/swank-clojure/") |
| 11:00 | danlei | (require 'swank.swank) |
| 11:01 | danlei | (swank.swank/start-server "/path/to/tmpfile/") |
| 11:01 | danlei | (swank.swank/start-server "/path/to/tmpfile.tmp") |
| 11:03 | danlei | (add-classpath is considered bad style, but it's ok for figuring things out) |
| 11:19 | syamajala | danlei: that seems to work, or at least i can do slime-connect from emacs that way |
| 11:19 | danlei | ok |
| 11:19 | syamajala | ideally i would like to just be able to do M-x slime-clojure and be presented with a repl |
| 11:20 | syamajala | and i have stuff setup that way right now in my .emacs its just that clojure can't find the swank stuff |
| 11:20 | danlei | you could also add the classpath on the command line, e.g: java -server -cp "/path/to/clojure.jar;/path/to/swank-clojure/" clojure.lang.repl |
| 11:20 | syamajala | and i know no nothing of java and all this classpath stuff. i'm coming from lisp... |
| 11:21 | danlei | in emacs, you can set swank-clojure-extra-classpaths |
| 11:22 | danlei | - here's what I have for cygwin |
| 11:22 | danlei | (when (eq system-type 'cygwin) |
| 11:22 | danlei | (setq swank-clojure-jar-path |
| 11:22 | danlei | "e:/cygwin/home/danlei/build/clojure/trunk/clojure.jar" |
| 11:22 | danlei | swank-clojure-extra-classpaths |
| 11:22 | danlei | '("e:/cygwin/home/danlei/coding/lisp/clojure/"))) |
| 11:22 | danlei | |
| 11:22 | danlei | to give you an idea |
| 11:22 | syamajala | i just used your java -server -cp line |
| 11:23 | syamajala | in a script |
| 11:23 | danlei | (actually, what I once HAD in my .eamacs :) |
| 11:23 | danlei | ok |
| 11:23 | syamajala | that seems to work |
| 11:23 | danlei | glad to hear it works |
| 11:28 | syamajala | ok now my setup is exactly the way i want it |
| 11:52 | markaddleman | hey folks... has anyone gotten clojure to work under osgi? i'd like to write an osgi activator that loads *.clj resources from a bundle |
| 12:09 | Chouser | there have been some attempts, and rich has done some work to make Clojure more amenable to osgi, but I'm not sure of the status of any of that. |
| 12:11 | markaddleman | thanks. |
| 12:15 | osaunders | You know what would help a lot. |
| 12:15 | osaunders | A related functions list for each function. |
| 12:16 | Chouser | yeah. |
| 12:16 | Chouser | I made a weak attempt at that on the clojure.org site |
| 12:16 | osaunders | Also each function could probably do with it's own page. |
| 12:16 | Chouser | listing groups of functions for each data structure. |
| 12:16 | osaunders | Where can I find that? |
| 12:17 | Chouser | http://clojure.org/data_structures#toc16 for example |
| 12:18 | osaunders | Hm, it's a good start. |
| 12:18 | Chouser | but yes, a page per function, with several examples, related function links, discussion of performance for various data structures, etc. would be nice. |
| 12:18 | Chouser | though creating it is only a fraction of the work -- then it has to be maintained. :-/ |
| 12:18 | osaunders | Exactly. I couldn't put it better myself. |
| 12:19 | osaunders | Well, it's a wiki. With enough people these things are easily maintained. |
| 12:19 | osaunders | Small corrections here and there by several people. |
| 12:19 | syamajala | is there a hyperspec-lookup type thing? |
| 12:19 | osaunders | (doc symbol) |
| 12:19 | osaunders | Is that what you mean? |
| 12:20 | syamajala | yeah i guess thats good enough for now |
| 12:20 | osaunders | I mostly don't believe in good enough. |
| 12:22 | osaunders | Is there a nice way to convert ([x y] [x y]) into [x y x y]? |
| 12:23 | osaunders | Chouser: Do you think I should post on the list with idea to improve the documentation? |
| 12:23 | osaunders | *ideas |
| 12:27 | osaunders | Oh concat! |
| 12:28 | dreish | osaunders: What good would wishing out loud do? If you want it, why not actually do something about it? |
| 12:29 | osaunders | There are many reasons not to act. |
| 13:48 | gcv | is there any way to make a thread "inherit" a dynamic binding from wherever it's created? |
| 13:48 | gcv | e.g., I'd like (binding [*x* 3] (.start (Thread. (fn [] (println *x*))))) to print 3 |
| 13:49 | gcv | (assuming something like (def *x* 5) on the outside) |
| 13:49 | Chousuke | do (let [*x* *x*] (Thread. #(println *x*))) |
| 13:50 | Chousuke | that captures the dynamic binding as a local one so the thread can access it. |
| 13:53 | gcv | Chousuke: that's pretty good, but doesn't work if the thread gets created outside the lexical scope of the let form |
| 13:54 | gcv | it doesn't allow access to *x* outside the lexical scope in general, which is what I'm trying to accomplish |
| 13:54 | Chousuke | but that way lies concurrency trouble. |
| 13:55 | gcv | sure, but *x* might be an immutable value, in which case it would be fine |
| 13:55 | gcv | there's concurrency trouble anyway with (def *x* ...), except there's just the one value of it available, the global one. I'm trying to have the same situation, but with a local value of *x* for a particular path of execution. |
| 13:56 | Chousuke | values bound with binding can be changed thread-locally. |
| 13:57 | Chousuke | I suppose you might be able to do (let [foo *x*] (Thread. (fn [] (binding [*x* foo] (somestuff))))) |
| 13:57 | gcv | not if I don't have control over the thread invocation |
| 13:58 | Chousuke | then there's no way. :P |
| 13:58 | Chousuke | you need a ref. :/ |
| 13:59 | gcv | if I want my code to start two embedded different Jetty instances, each running self-contained with different values of *x*, where *x* is a "global" variable for each one |
| 13:59 | gcv | hmmm, how would a ref help? |
| 13:59 | Chousuke | hm, I guess it wouldn't in that case. |
| 14:01 | Chousuke | I can't think of a way to do what you want. |
| 14:02 | Chousuke | is it possible for you to run an "init" function in the new thread, when it's created? |
| 14:03 | Chousuke | if you can, you could perhaps use push-thread-bindings to set up the bindings for the thread. |
| 14:03 | Chousuke | or hm, that's not in master yet I guess ;/ |
| 14:04 | Chousuke | (Var/pushThreadBindings is though) |
| 14:04 | gcv | push-thread-bindings? that sounds promising |
| 14:04 | gcv | where should I look for that code? |
| 14:04 | Chousuke | it's what binding does undercover |
| 14:04 | Chousuke | it just also does a popThreadBindings :) |
| 14:05 | Chousuke | take a look at the binding macro. it should be easy enough to understand. |
| 14:05 | gcv | yup, got it. thanks |
| 14:06 | gcv | so basically, if I can figure out how to hook into the creation of every new thread and execute pushThreadBindings with the parent thread's bindings, I should be good to go |
| 14:06 | gcv | sounds like cake :) |
| 14:08 | Chousuke | there's also getThreadBindings |
| 14:08 | Chousuke | for getting the parent thread bindings :P |
| 14:11 | gcv | Chousuke: nice. thank you |
| 14:23 | d2dchat | does anyone know why: (take 10 (iterate rand-int 100)) seems to return lots of 0's and why the #'s seem to get lower going right? |
| 14:26 | gcv | d2dchat: wow. wild. maybe something there screws up pseudorandom numbers? |
| 14:27 | dreish | (iterate rand-int 100) passes the prev rand-int return val as the argument to the next call to rand-int. |
| 14:27 | d2dchat | ahhh |
| 14:27 | d2dchat | that make sense |
| 14:27 | d2dchat | haha |
| 14:27 | dreish | There might be a better way to put it, but: |
| 14:28 | dreish | ,(take 10 (repeatedly #(rand-int 100))) |
| 14:28 | dreish | Oh, cjbot is offline. |
| 14:28 | d2dchat | ahh works :) |
| 14:31 | tomoj | that's a cool problem though |
| 14:31 | tomoj | how many numbers on average do you get before you wind up at zero |
| 14:34 | dreish | Around 5.18 or 5.19. |
| 14:35 | tomoj | yeah, but.. I wonder how you'd actually figure it out |
| 14:35 | tomoj | heading to #math |
| 15:04 | tomoj | aha |
| 15:04 | tomoj | the answer is 14466636279520351160221518043104131447711/2788815009188499086581352357412492142272 |
| 15:05 | dreish | Why? |
| 15:05 | tomoj | someone in #math gave an elegant argument for why the answer is 1+1/2+1/3+...1/n |
| 15:06 | tomoj | ie the harmonic numbers |
| 15:06 | dreish | Interesting. |
| 15:11 | konr | have you guys used qt with clojure? |
| 15:15 | d2dchat | Is there a way to rescue exceptions in clojure? |
| 15:16 | d2dchat | konr: that sounds interesting :) |
| 15:17 | d2dchat | konr: I have not but, I think there is a Java binding to Qt |
| 15:17 | d2dchat | I would start there |
| 15:25 | tomoj | d2dchat: you mean java exceptions? |
| 15:25 | d2dchat | Yes |
| 15:25 | tomoj | d2dchat: http://clojure.org/special_forms#try |
| 15:25 | d2dchat | My program is evaluating division by zero occasionally and I just want it to ignore it silently and move on |
| 15:26 | d2dchat | tomoj: ah! Thanks! |
| 15:34 | osaunders | d2dchat: Testing the divisor with zero? beforehand may be cleaner and more performant. |
| 15:35 | d2dchat | osaunders: Would be, but this framework is too generic.. :( |
| 15:35 | Chousuke | osaunders: unless you're doing millions of divisions and only a few of them will be zero |
| 15:35 | osaunders | d2dchat: OK. |
| 15:35 | Chousuke | in those cases, catching the exception may actually be faster |
| 15:36 | osaunders | Chousuke: True. |
| 15:36 | d2dchat | Well, all kinds of exceptions *could* happen |
| 15:36 | d2dchat | if one happens, I just want it to do nothing |
| 15:37 | d2dchat | and move on |
| 15:37 | d2dchat | Genetic Programming :) |
| 15:37 | osaunders | The concern with that is there may be exceptions that you don't want to ignore that you'll catch. |
| 15:37 | d2dchat | Yea, I will have to build that in somehow.. good point :) |
| 15:41 | tomoj | are you evolving sexps? |
| 15:43 | d2dchat | tomoj: yes |
| 15:43 | tomoj | awesome |
| 15:44 | osaunders | What's that? |
| 15:44 | d2dchat | I'm new to clojure |
| 15:44 | d2dchat | and it took me a week to do |
| 15:44 | d2dchat | (on and off after work) |
| 15:44 | tomoj | clojure seems intuitively harder for that than other things, but I've never tried anything like it |
| 15:44 | d2dchat | Which is pretty incredible |
| 15:45 | tomoj | I mean it seems that a randomly built clojure sexp is less likely to do anything meaningful than a randomly built program in some other language |
| 15:45 | d2dchat | Ya, I had to play with it a bit |
| 15:45 | d2dchat | Why's that? |
| 15:45 | tomoj | but like I said I've never done any genetic programming |
| 15:45 | tomoj | well, lazy seqs and first class functions and all |
| 15:46 | d2dchat | right |
| 15:46 | tomoj | seems like it would be difficult to have something write e.g. combinations of map/filter/reduce using anonymous functions that even compiled successfully |
| 15:46 | tomoj | or did anything meaningful if they did compile |
| 15:46 | d2dchat | I'm going to do some tests on lists |
| 15:46 | d2dchat | I just finished arithmetic so |
| 15:47 | d2dchat | Which worked out pretty well :) |
| 15:47 | tomoj | cool |
| 15:47 | tomoj | I'm interested in writing a neuroevolution library in clojure |
| 15:48 | d2dchat | I found the answer to life, the universe and everything using my framework just now |
| 15:48 | d2dchat | :) |
| 15:48 | tomoj | haha |
| 15:48 | osaunders | 42? |
| 15:49 | d2dchat | (* (- 2 4 2) (/ 7 2 2) (- 7 9 4)) |
| 15:49 | d2dchat | (/ (* 6 9 3) (/ 2 7 8) (* 6 3 6)) |
| 15:50 | d2dchat | oh clojurebot |
| 15:50 | d2dchat | where art thou? |
| 15:50 | osaunders | We're not sure. |
| 15:51 | osaunders | He belongs to hiredman though and he's not around either. |
| 15:59 | bryanjswift | anyone familiar with setting up vimclojure. I'm pretty sure the bit I'm missing is getting my .clj files on the classpath of the nailgun server I'm starting but I'm a little spaced as to how to do that nicely. |
| 16:45 | mebaran151 | what's the difference between doto and ->? |
| 16:46 | mebaran151 | oh I see, doto returns the original object |
| 16:49 | Chouser | mebaran151: and feeds the original object into each step. -> feeds each expression into the next. |
| 16:49 | mebaran151 | ah |
| 16:49 | mebaran151 | I just discovered ->, it's a very neat way to design stuff I'd normally do pesudo-imperatively with a number of let bindings |
| 16:50 | LauJensen | Anyone here skilled with nginx that I can hijack for a private 2 min chat ? |
| 16:51 | mebaran151 | I've kind of set up nginx before |
| 16:51 | mebaran151 | are you trying to set up a reverse proxy |
| 17:00 | ZabaQ | I'm thinking of trying to get penumbra working on 'doze, but there are some bits in it's lib directory that I can't find the win32 equivalent of. |
| 17:01 | ZabaQ | what the hell are newt and nativewindow? |
| 17:08 | JAS415 | quick question: |
| 17:08 | JAS415 | > (.split "snipper403.html" ".") |
| 17:08 | JAS415 | >#<String[] [Ljava.lang.String;@383118> |
| 17:08 | JAS415 | i try to split on a period |
| 17:08 | JAS415 | split doesn't work |
| 17:09 | ZabaQ | hmm. newt is a text UI library.. |
| 17:09 | JAS415 | >(second (.split "snippet403.html" "3")) |
| 17:09 | JAS415 | > (second (.split "snippet403.html" "3")) |
| 17:09 | JAS415 | >".html" |
| 17:09 | JAS415 | anything else works |
| 17:11 | JAS415 | ooh do i have to escape the .? |
| 17:11 | drewr | ,(.split "foo.html" "\.") |
| 17:12 | JAS415 | ah okay, thanks :-) |
| 17:12 | drewr | whoops, try (seq (.split "foo.html" "\\.")) |
| 17:12 | drewr | clojurebot must have taken Sunday off |
| 17:15 | syamajala | why does using ns break tab completion in clojure mode in emacs? |
| 17:17 | JAS415 | ahh |
| 17:17 | JAS415 | very nice |
| 17:24 | syamajala | slime with clojure is frustrating |
| 17:24 | syamajala | maybe i should try eclipse |
| 17:25 | JAS415 | what's frustrating about it? |
| 17:25 | JAS415 | rather |
| 17:25 | JAS415 | what are you finding to be frustrating |
| 17:25 | syamajala | it just doesn't seem to be as polished as slime with a common lisp |
| 17:26 | drewr | sure, slime/swank was written for CL |
| 17:26 | JAS415 | i can see that |
| 17:27 | drewr | I'm amazed at how well clojure/swank works honestly |
| 17:42 | syamajala | i think i would rather deal with slime and clojure than use eclipse |
| 17:58 | tomoj | ns doesn't break tab completion for me |
| 18:54 | lowlycoder | i asked this a few days back, but lost the answer -- what's the best opengl library for clojure? |
| 18:55 | Chousuke | And I think I suggested penumbra. :P |
| 18:56 | lowlycoder | my irc logs agree |
| 18:56 | lowlycoder | you in fact stated it at 14:54 last time |
| 18:56 | lowlycoder | oops, I think I just gave away my time zone |
| 18:56 | Chousuke | somewhere across the atlantic? :P |
| 18:57 | lowlycoder | depends on which side of the atlantic you're on |
| 18:58 | Chousuke | east side. |
| 18:58 | Chousuke | :P |
| 18:58 | lowlycoder | i don't understand geography |
| 19:01 | JAS415 | ok so |
| 19:01 | JAS415 | i'm trying to save an image to file |
| 19:02 | JAS415 | i'm using something like this |
| 19:02 | JAS415 | (javax.imageio.ImageIO/write img ext file) |
| 19:02 | JAS415 | passing this : (#<ToolkitImage sun.awt.image.ToolkitImage@1bb02e> jpg #<File /home/jon/hacking/clj/current-work/cache/images/markcc_normal.jpg>) |
| 19:02 | lowlycoder | i have no idea how to solve your problem, but I'm gong to take this opportunity to look at this and see how responsive the cloure irc community is |
| 19:02 | JAS415 | and returining |
| 19:02 | JAS415 | Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: No matching method found: write |
| 19:03 | JAS415 | this |
| 19:03 | JAS415 | followed by a stacktrace |
| 19:04 | Chousuke | your arguments probably have the wrong type. |
| 19:04 | JAS415 | im guessing it is something to do with using a toolkit image and imageio together |
| 19:04 | JAS415 | hmm |
| 19:04 | JAS415 | clojure is great, java is annoying |
| 19:05 | Chousuke | It'd help a lot if Clojure told you what parameter types the method call was attempted with |
| 19:05 | JAS415 | yeah that would be nice |
| 19:05 | lowlycoder | err, penumbra ... does it have any docs? |
| 19:05 | lowlycoder | like how the heck do I run the examples |
| 19:06 | Chousuke | check the wiki? |
| 19:06 | lowlycoder | there's a wiki? |
| 19:06 | lowlycoder | i only found mailing list posts |
| 19:06 | Chousuke | every github page has a wiki |
| 19:07 | Chousuke | but other than that, it doesn't seem there's much documentation besides the readme |
| 19:07 | lowlycoder | the readme doesn't say much |
| 19:07 | lowlycoder | want to help me get this to work? :-) |
| 19:08 | Chousuke | you'll probably just need to add everything in the /lib dir to your classpath |
| 19:09 | Chousuke | in addition to the penumbra lib of course |
| 19:10 | lowlycoder | eh, screw this; i'll just use jogl |
| 19:10 | lowlycoder | and yet write my own bindings in addition to cloggle, penumbra |
| 19:10 | Chousuke | I think in java 6, -cp lib/*:penumbra-dir-here/:clojure.jar ought to work |
| 19:10 | Chousuke | lowlycoder: or you could mail the author :P |
| 19:10 | lowlycoder | mail ... is that like asynchronous irc? |
| 19:12 | lowlycoder | okay, I can't get jvax.media.opengl |
| 19:12 | lowlycoder | i suspect this is eomthign wrong with my java installation |
| 19:12 | lowlycoder | how do I get it? |
| 19:13 | Chousuke | it's probably the set of jars in the lib/ dir of penumbra :P |
| 19:14 | lowlycoder | how can I check if my java is loading /usr/share/java/jogl-1.1.1+dak1.jar |
| 19:14 | lowlycoder | /usr/share/java/gluegen-rt-1.1.1+dak1.jar |
| 19:14 | lowlycoder | and /usr/share/java/jogl.jar |
| 19:14 | lowlycoder | /usr/share/java/gluegen-rt.jar |
| 19:14 | JAS415 | yup converting to a buffered image worked |
| 19:14 | lowlycoder | ? I have jogl installed already |
| 19:15 | JAS415 | haha |
| 19:15 | lowlycoder | ? |
| 19:15 | JAS415 | they should rename it 'BufferedImageIO' |
| 19:15 | JAS415 | ImageIO is misleading |
| 19:15 | Chousuke | lowlycoder: you'll have to specify the classpath manually anyway :/ |
| 19:15 | Chousuke | lowlycoder: it's how java works ;/ |
| 19:16 | Chousuke | there's a way to tell jvm to load all jars from a single dir though. |
| 19:16 | lowlycoder | it doesn't autoload all from /usr/share/java ? |
| 19:16 | Chousuke | no, it doesn't |
| 19:17 | lowlycoder | great, it works now |
| 19:17 | lowlycoder | thanks :-) |
| 19:20 | tomoj | the apparent lack of console ui libraries for java depresses me |
| 19:20 | tomoj | I suppose it comes with platform independence |
| 19:21 | lowlycoder | speaking of which |
| 19:21 | lowlycoder | is there a good terminal enulator in java? |
| 19:21 | Chousuke | :/ |
| 19:21 | Chousuke | I'm not aware of one. why? |
| 19:24 | tomoj | I'm thinking I need to use the JNI with ncurses or something |
| 19:30 | osaunders_ | Does first post need to be moderated on http://groups.google.com/group/clojure ? |
| 19:43 | Chousuke | osaunders_: IIRC yes. |
| 19:43 | osaunders_ | Chousuke: OK. Waiting game for me then I guess. |
| 19:54 | lowlycoder | how do I import in all the functions here: http://download.java.net/media/jogl/jogl-2.x-docs/javax/media/opengl/fixedfunc/GLLightingFunc.html#glShadeModel(int) |
| 19:55 | lowlycoder | (import '(javax.media.opengl.fixedfunc) |
| 19:55 | lowlycoder | is not cutting it |
| 19:55 | lowlycoder | (i do have an ending ), it's just not shown sinre more are included |
| 19:57 | Chousuke | lowlycoder: you don't import functions; you import classes. |
| 19:58 | lowlycoder | All Known Implementing Classes: DebugGL2, DebugGL2ES1, DebugGLES1, FixedFuncHook, FixedFuncImpl, TraceGL2, TraceGL2ES1, TraceGLES1 |
| 19:58 | lowlycoder | so i have to import one of those? |
| 19:58 | Chousuke | most likely. |
| 19:58 | Chousuke | or you can import just the interface too if you only need access to the statics. |
| 19:59 | lowlycoder | no, I need to use glShaderModel |
| 20:00 | lowlycoder | http://clojure.googlegroups.com/web/opengl-gears.clj?gda=gTJ_y0EAAABDIkriCAGxFgqh3JA2kVqHjmUnUmFxkzZFmBPeskNnImG1qiJ7UbTIup-M2XPURDQ2vNdh001Siw0x8QiEtM34WlKsreMtIDAb3JYcIi6O-A&gsc=FWPSYAsAAADf7lsqqJAqFfo_UvfMxMwC <-- can you help me get this to work? |
| 20:01 | Chousuke | I think I'll have to get some sleep now :/ |
| 20:01 | lowlycoder | fair enough, thanks for all your help :-) |
| 20:01 | Chousuke | but looks like that's very old clojure code. |
| 20:01 | Chousuke | the dotos are missing dots for java methods. |
| 20:02 | Chousuke | the old syntax for doto was (doto javaobj methodcall (methodcall2 args)), but that was changed to (doto obj .methodcall (.methodcall2 args) clojure-fn) |
| 20:03 | lowlycoder | great, it moved me on to a different error |
| 20:03 | lowlycoder | yay; thanks |
| 20:03 | lowlycoder | how has doseq changed? |
| 20:03 | lowlycoder | (doseq i (range (+ 1 teeth)) |
| 20:03 | lowlycoder | (let [angle (/ (* i 2.0 (. Math PI)) teeth)] |
| 20:03 | lowlycoder | gives: #<CompilerException java.lang.IllegalArgumentException: doseq requires a vector for its binding (opengl-gears.clj:34)> |
| 20:03 | Chousuke | it now takes [i seq] |
| 20:03 | Chousuke | like let |
| 20:04 | lowlycoder | woot |
| 20:04 | lowlycoder | if you can stay awake for another 10 mins |
| 20:04 | lowlycoder | I think I can get this to work |
| 20:04 | lowlycoder | line 46 now |
| 20:05 | Chousuke | it looks like there's not much besides the dotos and doseqs |
| 20:05 | lowlycoder | woot |
| 20:05 | lowlycoder | this runs |
| 20:05 | Chousuke | and lots of dots :( |
| 20:05 | lowlycoder | and ... gets me a blank screen :-( |
| 20:05 | lowlycoder | but no exceptions |
| 20:06 | lowlycoder | hmm, i will conttinue debuggint this |
| 20:06 | lowlycoder | thakns for all your help :-) |
| 20:06 | Chousuke | no problem. Now I will try to sleep :P |
| 20:06 | Chousuke | later. |
| 20:06 | lowlycoder | cheers |
| 20:12 | lowlycoder | crap, the javax.media.opengl.GLAutoDrawable stuff looks kinda out of date |
| 20:27 | konr | Guys, I'm following a Clojure tutorial, yet I am having an error with an example. Any idea on what could have caused the error? A missing library? Take a look: http://scorciapino.com/pub/fotos/xmonad3.png |
| 20:42 | tomoj | konr: did you eval the ns form? |
| 20:52 | konr | tomoj: yes |
| 20:52 | konr | tomoj: hmm, wait.. |
| 21:00 | tomoj | the doto needs to be evaled in the com.ociweb.demo namespace |
| 21:00 | tomoj | I can't tell what editor that is |
| 21:00 | konr | haha, vi |
| 21:00 | tomoj | in emacs I'd just C-c C-k to compile the whole file |
| 21:00 | konr | apparently, the problem is with the DISPLAY variable |
| 21:01 | konr | I've set it now to 0:0, but I'm getting the "cannot connect to display" error... |
| 21:01 | tomoj | why would DISPLAY cause an "unable to resolve classname" error? |
| 21:01 | tomoj | that's odd |
| 21:02 | konr | actually that particular error was because I hadn't evaluated the ns |
| 21:04 | konr | Hmm, I've set DISPLAY to :0 and no longer I'm getting an error, but the doto form returns nil |
| 21:05 | tomoj | that's odd |
| 21:05 | konr | (and doesn't show up the "Hello World" window) |
| 21:05 | tomoj | that means (JFrame. "Hello") is null |
| 21:05 | tomoj | is that even possible? |
| 21:05 | konr | let me comment everything else... |
| 21:06 | tomoj | doto is supposed to return the thing the stuff is done to |
| 21:07 | konr | hmm, it's not returning anything |
| 21:07 | tomoj | do you have a repl? |
| 21:07 | konr | yes |
| 21:07 | tomoj | (JFrame. "Hello") just returns nil? |
| 21:10 | konr | nope, an object, apparently: #<JFrame javax.swing.JFrame[frame2,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayout,title=Hello,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,0x0,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]> |
| 21:10 | tomoj | ok, so something is wrong with the doto |
| 21:10 | tomoj | it should return whatever (JFrame. "Hello") returns |
| 21:11 | konr | hmmm, apparently it is the "(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)" line |
| 21:11 | tomoj | that's probably a bad idea anyway, I'd think |
| 21:12 | tomoj | if you're running this in a long-running clojure session in the background |
| 21:13 | tomoj | it works in my slime repl though |
| 21:14 | tomoj | but then if I close the window, slime dies |
| 21:14 | konr | hmmm |
| 21:23 | konr | is anybody using vimclojure? |
| 21:23 | peregrine81 | konr: I was wondering the same thing |
| 21:25 | konr | peregrine81: haha, how do you deal with namespaces? it seems that after I eval a (ns) form with \et, *ns* doesn't change |
| 21:26 | peregrine81 | konr: I've never actually used it I was looking more for reviews/opinions |
| 21:26 | konr | peregrine81: hmmm, it is pretty good. Much better than the similar plugins for common lisp |
| 21:29 | tomoj | konr: maybe try doing (in-ns 'whatever.whatever) first |
| 21:29 | tomoj | in the repl or with \et I guess, not sure how vimclojure works |
| 21:30 | tomoj | and by first I mean second |
| 21:32 | Knekk | quickest way to check if elem is a member in list? |
| 21:33 | dreish | (some #{elem} list) |
| 21:34 | Knekk | thanks |
| 21:35 | tomoj | do lists return true for contains? ever? |
| 21:35 | konr | tomoj: interesting... it worked. Apparently, every repl window starts in the user namespace, and everytime I evaluate a form, it will also be in user namespace. |
| 21:36 | dreish | tomoj: If you mean (.contains '(1 2 3) 2), yes, that works too. |
| 21:36 | tomoj | no, I meant contains? |
| 21:36 | tomoj | (contains? '(1 2 3) 1) is false |
| 21:36 | paulp | hello clojure people. I am scala person investigating clojure. I'm in the market for nutty ideas that leverage both languages. Sky's the limit. Thanks for any conversation starters. |
| 21:37 | dreish | tomoj: No, it will fall through the if/else if/else if/... in Rt.contains() and return false. |
| 21:37 | dreish | RT.contains(), that is. |
| 21:38 | tomoj | ah |
| 21:38 | tomoj | seems kinda strange t ome |
| 21:38 | tomoj | (contains? #{1 2 3} 1) is true |
| 21:39 | dreish | Yes, I might have had it throw an exception if given a non-indexable object. |
| 21:39 | tomoj | or at least explain in the docs what "non-indexable" means :) |
| 21:40 | tomoj | oh, it sortof hints at the fact that it doesn't work for lists |
| 21:40 | tomoj | since it says constant/log time |
| 21:45 | konr | shouldn't the clojure server have a single *ns* variable? |
| 21:46 | dreish | paulp: The only connection I've heard of is that someone once said they'd like to see the Clojure persistent data structures in Scala. |
| 21:46 | paulp | yeah, that's kind of cheating though, just bytecode reuse. |
| 21:47 | paulp | I was hoping to tackle some kind of scala problem I can't handle with scala proper, metaprogramming maybe. |
| 21:47 | dreish | Is it just me, or is github.com heavily broken a lot lately? |
| 21:47 | paulp | dreish: it is not just you. |
| 21:47 | dreish | That's a relief. I've been getting server errors for at least a week trying to look at the Clojure network graph. |
| 21:47 | dreish | Thought maybe I was clicking it the wrong way. |
| 21:48 | paulp | I'm sitting here unable to get the clojure source, making me sad |
| 21:48 | paulp | and I pay github, too. |
| 21:48 | dreish | Okay, it's all over the twitterwebs. |
| 21:49 | paulp | the irony of github bringing a single point of failure to git never ceases to amuse |
| 21:51 | dreish | Looks like it went down about 4-5 hours ago. |
| 21:52 | paulp | wtf github gentlemen! |
| 22:21 | peregrine81 | So is pragmatic programmer: Clojure a good place to start for a first time lisper? |
| 22:37 | Chouser | peregrine81: yeah, about as good as there is at the moment. |
| 23:20 | konr | I must change the namespace with (ns *args*), right? |
| 23:25 | Chouser | or 'in-ns' |
| 23:43 | konr | is the *ns* variable something contained inside each package, ie, with a foo/*ns* and a bar/*ns*? |
| 23:51 | Chouser | no, it's clojure.core/*ns* |
| 23:51 | Chouser | ,(var *ns*) |
| 23:51 | Chouser | oh, no clojurebot. anyway, paste that in a repl to see the full name of a the var *ns* |
| 23:52 | konr | hmmm, it's strange. I have two repls connected to a server, and each of them has a different value of *ns* |
| 23:53 | konr | when I change *ns* in one of them, shouldn't *ns* change globally? |
| 23:54 | tomoj | how do you connect a repl to some running clojure code? |
| 23:54 | Chouser | vars can have thread-local values |
| 23:55 | Chouser | so if the server has one thread per connection, they'd be independant of each other. |
| 23:55 | Chouser | or it could be doing something else to keep the two repls from messing each other up. |
| 23:58 | tomoj | ah, clojure.contrib.server-socket looks helpful |
| 23:58 | konr | tomoj: I'm using vimclojure... you can start as many repls as you'd like |
| 23:58 | tomoj | yeah, your question just reminded me of that question |
| 23:58 | konr | the strange thing is that user/foobar is the same for all of them |