#clojure logs

2008-11-29

00:22ryrunfrnfis there an autiomatic documentation function for clojure?
00:22ryrunfrnfor should i wirte one?
00:32arohnerryrunfrnf: what do you mean by automatic documentation?
00:33arohnerthe days off are throwing off my schedule
00:33arohnerI keep anticipating breakfast "tomorrow"
00:34arohnersorry, wrong window
00:42sdfsfl
01:12sdfsfhow do i have a string withint a string?
01:12hiredmanuh
01:12hiredmanspeak sense
01:20sdfsf"hhello "you fool" there"
01:22danlei(println "hhello \"you fool\" there")
01:22sdfsfah nice
01:26peter_12join #django
01:41ryrunfrnf(re-seq #"(defn [a-zA-Z0-9-]*[\[][a-zA-Z0-9][\]]" "defn")
01:42ryrunfrnfanyone good with res?
01:42ryrunfrnfi want to match (defn f [a b c]
02:04hiredmanclojurebot: brain dump is http://clj.thelastcitadel.com/clojurebot
02:04clojurebotYou don't have to tell me twice.
03:13hiredmanclojurebot: where are you?
03:13clojurebothttp://gist.github.com/27733
11:22emacsenClojure study in DC next week
11:23rhickeyemacsen: cool - how many people do you expect?
11:23emacsenrhickey, I have no idea. I suggested it but I somehow got dropped from the list and found out from friends on other lists that it was happening
11:24emacsensomewhere between 4 and 10 maybe?
11:24emacsenno idea really
11:29emacsenit's a spinoff group from FringeDC but I think we'll attract other people from the Java and Ruby community maybe
12:38mtrimpeDoes anyone know if there's a way to persist the history for refs?
12:39mtrimpe(where history is all the references the ref has had, so kind of like versioning in a sense)
12:41arohnermtrimpe: there's no built in support for that yet
12:42mtrimpearohner: Has there been put some thought into preparing clojure for that? (i.e. are there any obvious roadblocks)
12:42arohnerI'm not aware of any
12:43mtrimpeOK, cool. Is there any persistence available already for objects to start with?
12:43arohnerI think all it's missing is a 'hook' function. It sounds useful, because I'm not aware of a way to see which value of the ref 'won', in a non-racing way
12:45mtrimpeOkay good to know ... and just for a reality check ...
12:46mtrimpeI'm planning on building a system in Red5 and using clojure as the functional backend to store a versioned history of the important application state and adding a cells like implementation on top of it that builds up the UI, so that you can basically get 'replayable apps' or apps where the interaction is fully versioned.If that's feasible I'd love to put some work into building it ...
12:47mtrimpeWould that be do-able in Clojure?
12:48arohnerI don't know what red5 is, but the rest of it sounds doable
12:50mtrimpeCool! That means I'll have some serious clojure exploring to do in the next couple of months. Red5 is an open-source Java based Flash server b.t.w. .. basically meaning I'll be doing it for Flash.
13:30duck1123_If I have a list of numbers, what's the best way to get the list of numbers that are missing?
13:30duck1123_ie. (1 2 4 5 6 8 9) returns (3 7)
13:31duck1123_I tried using difference, but I'm getting errors and don't know what I'm doing wrong.
13:31lvijayis your list of numbers always sorted?
13:31duck1123_yes
13:31lvijaydo you know what the lowest and highest bounds are?
13:31duck1123_and distinct, no nulls
13:32lvijayfor example (1 2 4 5) could return (3 6 7 8 9 10)
13:32kotarak(reduce disj (into #{} (range 1 10)) [1 2 4 5 6 8 9]) (not tested)
13:32duck1123_if there's an easy way to get the last element of a list
13:32duck1123_can easily be made a vector
13:34rhickey_(clojure.set/difference (set (range 1 11)) (set [1 2 4 5]))
13:35lvijay(first (reverse vector))
13:35kotarak(first (rseq vector))
13:36lvijayright
13:36lvijayreverse is not lazy
13:36lvijaykotarak: thanks
13:36duck1123_I'm already consuming the whole seq
13:36duck1123_to sort it
13:37lvijayyou don't need to do it twice
13:37lvijayrseq is constant time
13:37lvijayif you don't want to use rseq
13:37duck1123_This is just code to manipulate my data structure into a new format, this won't have to be run again
13:37lvijayyou can access the last index of the vector
13:38kotarakThere's also last.
13:38kotarakAnd for a vector peek.
13:38lvijaybut last is linear time isn't it?
13:38kotarakYes. peek is not.
13:39lvijayok
13:39Chouserlast is constant time on vectors, in case that wasn't clear.
13:40lvijaythe documentation needs to make that more clear then
13:40lvijay(peek coll) For a list or queue, same as first, for a vector, same as, but much more efficient than, last. If the collection is empty, returns nil.
13:40Chouseroh! hm, let me double-check my statement then.
13:41Chouserno, I'm completely wrong.
13:42Chouserlast is linear time regardless of collection type -- it works strictly on seqs
13:46Chouserthat's good to know. thanks! :-)
14:07Lau_of_DKChouser: enjoyed the holidays? :)
14:14ChouserLau_of_DK: still enjoying them, yes!
14:19Lau_of_DKalways with the leaves... :)
14:37rhickey_big enhancements to gen-class in SVN 1129: http://clojure.org/compilation
14:38AWizzArdrhickey_: will that cause changes for your examples in http://clojure.org/compilation ?
14:38rhickey_AWizzArd: the examples have been changed there
14:43AWizzArdI am just trying to understand how exactly gen-class works. Can you say in one or two sentences what the big enhancements are?
14:45rhickey_The big enhancement is that gen-clas can now be called stand-alone, thus one or more named classes can be generated from a single file. These classes can all be implemented in a single namespace if desired. You can now control the mapping to the implementing namespace, whether or not it gets loaded, and the prefix for functions implementing methods
14:45rhickey_the small change is that no named class will be created for a ns unless you put at least and empty (:gen-class) directive in ns
14:45AWizzArdwow :-)
14:48Lau_of_DKGood work rhickey_ :)
14:50AWizzArdthis is mostly important if someone wants to provide a lib for use in Java?
14:50Lau_of_DKrhickey_: consider streaming your desktop and doing a virtual session out of it? :)
14:51AWizzArdLau_of_DK: probably yes, if we pay him a 100mbit upstream connection *g*
14:51Lau_of_DKAWizzArd: All Americans have 5x100Mbit lines forged with pure gold
14:51AWizzArdduh!
14:51Lau_of_DK...for every pc
14:51danlarkinclojurebot: where are you?
14:51clojurebothttp://gist.github.com/27733
15:02Chousergen-interface got only 4 votes from the 44 responses
15:03ChouserI would never presume, though, to suggest anything about how rhickey_ should be spending his time. :-)
15:03kotarakReally?
15:04kotarakI'm sure I voted for it.
15:04kotarakIt's a nice complement for gen-class.
15:04kotarakconsidering Java interop
15:05AWizzArdThis interop with Java is in my opinion the most complex and ugly part about Clojure. I understand that there is no way around it to have something like that, to profit from the rich set of libs in Java.
15:05rhickey_Chouser: unfortunately, people will use gen-class rather than gen-interface + proxy, which is the right thing more often than not
15:05AWizzArdI just wished that they all were implemented in Clojure, then this level of complexity would simply go away
15:06AWizzArdrhickey_: what is often the right thing? a) gen-class or b) gen-interface + proxy?
15:06rhickey_AWizzArd: b)
15:06rhickey_people generally use named concrete classes too often
15:08AWizzArdI don't know Java well enough to understand why this is not so good. Is gen-class more complex in usage?
15:09lisppaste8A.Nonymous pasted "user defined exceptions" at http://paste.lisp.org/display/71233
15:09AWizzArdI thought Interfaces are just not-yet implemented classes, to allow a cleaner substitution for multiple inheritance
15:11rhickey_AWizzArd: an interface is just that, an interaction agreement, it specifies no implementation details, and is thus the right thing for both basing actual implementations and defining connections between components
15:15AWizzArdrhickey_: in http://clojure.org/compilation you say: ":init functions (-ctor in this case) are unusual, in that ...". But -ctor is now called -init since you updated that page.
15:16rhickey_AWizzArd: fixed - thanks
15:17AWizzArdin the java docs about java.util.Iterator I see that this interface also has a remove method. Why don't you have to implement that as well?
15:19rhickey_AWizzArd: remove is an optional operation, if you don't support it you need to throw an UnsupportedOperationException, which is what gen-class will generate for an undefined interface method
15:22AWizzArdokay, so this means: whenever I see an interface in the javadoc that lists UnsupportedOperation in its "Throws"-list, I can then decide to not implement it. But all other methods that don't list this exception must be implemented. Yes?
15:23rhickey_AWizzArd: the JavaDoc says: optional operation
15:24rhickey_Tehnically, you only need to implement the methods you know will be called, but then you aren't a proper implementation, under the hood, all the methods are implemented
15:26AWizzArdoh okay, so Clojure provides "empty" implementations?
15:26gnuvince_rhickey_: does the dash prefix come from the meaning that it's an instance method?
15:26AWizzArdor maybe the dash has to do with privacy?
15:26gnuvince_AWizzArd: in ObjC, - is used to denote an instance method and + a class method. I think this convention is also present in UML
15:27kotarakAWizzArd: defn- is private -foo is method. They are orthogonal.
15:27rhickey_gnuvince_: the dash is an arbitrary mechanical way to avoid clashes with Clojure names, else every gen-class involves a name-conflict-resolution session
15:27AWizzArdk
15:27rhickey_The prefixes are now user-defineable, dash is just the default
15:28gnuvince_ok
15:28rhickey_so if you generated a bunch of classes in a single file you could give them all unique prefixes
15:28rhickey_All subject to macro-fu
15:34AWizzArd@Java people: the :constructors argument of gen-class takes a map in which we map the parameter types of our generated class to the ones of the super class. Is this done because in Java a constructor always must call its superclass constructor?
15:35stuarthallowayAWizzard: yes
15:36AWizzArdso if someone does not do this in Java manually, will javac then a) complain or b) call the constructor under the hood? If b), with what args would that happen then?
15:37AWizzArd( b) in Clojure is manually taken care of, because we must provide this. )
15:37stuarthallowayAWizzArd: Java does (b) if it can figure out, e.g. a default constructor, or (a) if it can't
15:38AWizzArdoki, thx
15:39stuarthallowayAWizzArd: "javap -c" is a great way to spelunk around and see what the Java compiler does behind the scenes
15:39stuarthalloway...or any other to-bytecode compiler, for that matter
15:40AWizzArdI see
15:40AWizzArdstuarthalloway: please look into your /query windows
15:57AWizzArdwould it make more sense to match the position of constructor and superclass constructor in :constructors in gen-class and in the vector that -init returns?
15:58AWizzArdRight now it is :constructors {[subclass] [superclass]} and (defn -init [x] [[superclass constructor] [state of this class]])
16:00rhickey_AWizzArd: people are used to constructing their superclass before setting up their own state
16:00rhickey_the constructors map isn't really related
16:00AWizzArdI see
16:32moreqwertythanuim the qwertiest!
16:34Lau_of_DKhehe
16:47AWizzArdrhickey_: again about your http://clojure.org/compilation example at the bottom. You said :state state and later in -hasNext and -next you use it via (.state this). Why is this .state method needed? Wouldn't it be easier to simply have state available in all the methods?
16:49rhickey_AWizzArd: state is a field of the object, it is available, via .state
16:49AWizzArdso in reality this is the only field of the class that clojure generates. And into that we can put for example a clojure hashmap inside which we have the real fields that we want to use.
16:50AWizzArd(in your example :s and :index)
16:51AWizzArdBut why has it to be this way? Is there any use for "state" itself after having mentioned it in gen-class? Or will it in all cases be only called in combination with this, as in (.state this)?
16:52rhickey_AWizzArd: he functions that implement the methods really have no connection to the objects, they are real fns, not methods
16:53AWizzArdHmm, so is it not possible to simply make "state" available in all the methods magically? @state vs @(.state this)
16:54rhickey_no, it's an indirection that allows for a lot of flexibility. For instance, you could have a single fn handle methods for multiple classes, a multimethod as a method handler etc.
16:55AWizzArdokay, sounds plausible
16:56Lau_of_DKIs there being put any serious work into an sql wrapper for Clojure?
16:57AWizzArdLau_of_DK: is the one from contrib not good enough?
16:57Lau_of_DKAWizzArd: it seems half-baked, at least last I looked at it
16:58AWizzArdDo you have an example of what is missing there? I haven't looked at it in great detail.
16:58Lau_of_DKThen take a look, you'll see
16:59Lau_of_DKOrOr let me get back to you on that one, I'll check it out myself, was just poking for alternatives
16:59AWizzArdMaybe you remember a specific example? Transactions and prepared statements seem to be in there.
17:24AWizzArdfor (let [{a "ja" b "nein"} {:x 4 "ja" 8}] (println a b)) I expeted that 8 nil will be printed.
17:25AWizzArdThis is the case. But for (let [{a "ja" b "nein" :or {"nein" "doch"}} {:x 4 "ja" 8}] (println a b)) I expected to see 8 doch. But I still got 8 nil. Why is that?
17:26Chousertry :or {b "doch"}
17:27AWizzArdOkay, I see
17:28rhickey_SVN 1130 adds gen-interface to AOT
17:28AWizzArdso fast!
17:29AWizzArdHow many hours do you sleep per day? ;-)
17:30rhickey_sleep?
17:30Lau_of_DKhaha
17:30danlarkinsleep doesn't help cultivate mad scientist hair
17:31kotarakhttp://en.wikipedia.org/wiki/Sleep
17:32Lau_of_DKrhickey_: I have a sincere question. Besides the head-knowledge that youve accumulated, the years of experience in various language and denying sleep. How do you cultivate the type of insight that you have into programming? I mean, there a people who have more experience than you in various languages, yet they never produce anything that comes close to Clojure. How do you hone that quality in you?
17:35rhickey_Lau_of_DK: that's very flattering but I'm really just a regular programmer
17:36kotarakrhickey_: you are more of an engineer: practical solutions for practical problems. Take what's good and improve it. If that means to leave the lisp weenies behind ("iihhh, what's this [] in the syntax"), then so be it if you get a better result.
17:37kotarak(Just an example. Nothing agains lisp weenies.)
17:37kotarak(Could as well be lock weenies or whatever)
17:37AWizzArdI honestly don't understand what some Lispers have against [] and {}
17:38Lau_of_DKrhickey_: I wasnt trying to flatter, Im just trying to develop my own abilities. But if you dont see it that way, I cant convince you that youre a genius, but you can report back here once you come to that conlusion, well pick up the topic again :)
17:39gnuvince_Lau_of_DK: "just say no"
17:40Lau_of_DKgnuvince_: not understood
17:40gnuvince_Lau_of_DK: no to extra features of limited use, no to bloat, etc.
17:41Lau_of_DKgnuvince_: not related to expanding your mental capacity without the use of drugs
17:41rhickey_http://clojure.org/compilation updated with gen-interface usage
17:41gnuvince_If there's one thing I learned since I started using Clojure is that a lot of things people have asked for have not gone in, and Rich has usually provided a good, technical reason why instead of just "because I said so!"
17:43Lau_of_DKuser> (import '(this.doesnt.exist))
17:43Lau_of_DKnil
17:43Lau_of_DK
17:43Lau_of_DKWhy is this failing silently ?
17:46hiredmanit is not failing
17:46hiredmanyou are importing nothing from nothing
17:46hiredmanfailure is impossible
17:47Lau_of_DKI want a Does Not Exist error, so that I dont get any surprises later
17:47hiredmanthen import something from nothing
17:47hiredman(import '(foo.bar baz))
17:48AWizzArdis also * allowed in the place of baz?
17:48kotarakno
17:48AWizzArdI think in Java one can use it.. import java.util.*;
17:49kotarakyes. But not in Clojure.
17:49waltersshould avoid it in Java too - an IDE will manage your imports for you
17:49AWizzArdis there a good way to import all classes from a package?
17:50hiredmansometimes clojure seems like a completely different language than java
17:50hiredman:)
17:50AWizzArdI am not a java guy and don't know if it makes sense to import everything. I just assume it does, as Java supports this * thingy.
17:51hiredman* is just for when you are lazy and sloppy
17:55Lau_of_DKclojurebot: * is just for when you are lazy and sloppy
17:55clojurebotYou don't have to tell me twice.
17:56kotarakClojure is similar: (use 'some.namespace) vs. (use '[some.namespace :only (foo)])
17:58AWizzArdis there a way to get a list of all classes of a specific package?
17:59AWizzArdIn that case one would have a semi easy way to import everything from a package
18:01notallamawhy do you need to import everything?
18:01hiredmanrhickey_: what do you think about putting something like (show ...) in core?
18:01notallamais it because you're using everything?
18:02AWizzArdnotallama: I don't need it and as I said a few moments before, I don't even know if that makes sense when working with java classes. But if it really makes no sense, why does java then support it?
18:03Lau_of_DKAWizzArd: (import '(javax.swing *)) would certainly make a few programs more concise, you quickly use almost all the components anyway
18:04dudleyfAWizzArd: It's not that it makes no sense, it's just that it's usually better to be explicit about what you're using
18:04AWizzArdSo it typically is a source of problems when people import *?
18:06dudleyfIf you're importing from several different packages, it can get confusing as to where a particular class came from
18:06dudleyfBut it's more of a style thing, I think
18:07AWizzArdIs there something like (.listAllClassesInPackage "javax.swing")?
18:08waltersnope
18:08walterswould be nice, but basically class loading is lazy
19:30moreqwertythanuanyone can recommend specific EWDs?
19:30moreqwertythanu(edsger dijsktars notes)
19:35hoeckmoreqwertythanu: "Elegance is not a dispensable luxury but a factor that decides between success and failure."
19:37timjrI'm trying to understand the odd behavior (read-line) gives me at the slime repl... it doesn't end up reading the next line of input that I type
19:38timjrif I hop over to the *inferior-lisp* buffer and send some input, then eventually one of the lines of input gets picked up by read-line
19:39timjrI haven't understood that yet. But I noticed that (. *in* read) behaves oddly, slime or no slime... I supposed because the readers buffer up some extra stuff, and *in* is not the same reader as the one the repl uses
20:30Chouserrhickey: I'd be interested in hearing, sometime, your rationale for getting rid of the dynamic class generation stuff (gen-and-load-class, gen-and-load-interface)
20:41heathQuick question: is (find) supposed to function as a predicate?
20:42Chouserit returns nil if the key is not found, so that could be used as false in a boolean context.
20:43heathIt definitely works, I'm just wondering if it's idiomatic...
20:43Chousercan you show how you're using it? If you're just using it as a predicate, you can probably use the map itself instead.
20:45heathI have a list of legal characters, and I need to test if an argument is legal by seeing if it's among them
20:46rhickeyChouser: the basic problem with dynamic class generation is that classes are static, i.e. they can't be changed and reloaded. Another reason is that most usage of dynamic things in that area, say, add-classpath, are due to laziness, and yield a system that is unnecessarily dynamic as regards static things, with much ensuing classloader grief
20:46rhickeyproxy is still there, and is ideal in that it doesn't promise any specific classname
20:47Chouserrhickey: I like proxy a lot. it is different from gen-class both in its lack of given classname as well as its inability to add methods.
20:47rhickeydynamically loaded classes must be loaded from a custom classloader, which creates all kinds of difficulties in certain hosting environments
20:48heathChouser: I can see you're in the middle of a heavy discussion, so no worries about my question :) I'll just profile it
20:48Chouserheath: (:a {:a 1 :b 2})
20:48rhickeyso people dynamically load classes and complain they can't see them from classloaders not related, especially the system loader
20:49abrooksrhickey: Perhaps this can be done with proxy but the only way I know to use JNA is gen-and-load-class and gen-and-load-interface.
20:49heathChouser: Thanks!
20:49rhickeyI also think that adding methods not present in an interface is bad design
20:49rhickeygenerally
20:49rhickeypeople should program to interfaces
20:50rhickeyI like how gen-interface has worked out and hope people use it + proxy a lot
20:50rhickeyabrooks: are you saying there's no way to use the new gen-class for JNA?
20:51abrooksrhickey: This is quite possibly my horribly shallow Java knowledge showing but I wasn't able (at the time) to get gen-class working for this: http://groups.google.com/group/clojure/browse_thread/thread/77e626c5440bf1a0
20:52holmakI have a question regarding agents when you folks have a minute: http://paste2.org/p/108746
20:52holmak(await ...) is throwing a "Exception in thread "main" java.lang.Exception: Can't await in agent action (incr-agent.clj:0)"
20:53holmakMy (poor) understanding of agents is that you await after sending to block until all the sends are applied?
20:56abrooksrhickey: I'll look into this later -- it's been a long time since I touched JNA calling and all the proxy / class loading has changed since then. I'll post to the group if I can't get some workable solution with the mechanisms that are already there.
20:56rhickeyabrooks: I don't see a reason it wouldn't work, but would require AOT compilation
20:56abrooks... log time apparently being two months ago... ;-)
20:56abrooks^log^long
21:00holmakI understand that (await ...) can't be used within an agent action, but why is it throwing an exception in top-level code, there?
21:00rhickeyChouser: so my biggest reservation is the potential for abuse - I can see valid dynamic use cases but can't prevent misguided ones, yet have to support them. The code for gen-and-load-class (in the new model) is sitting there
21:03Chouserrhickey: hm, ok.
21:04rhickeyholmak: don't call your agent *agent* - didn't you get an error about that?
21:04holmakI did not -- I didn't know that was bad.
21:04rhickeyholmak: I got: java.lang.Exception: Name conflict, can't def *agent* because namespace: user refers to:#'clojure.core/*agent
21:05lvijayholmak: your code is fine except for the *agent* special variable conflict and old dotimes syntax
21:08holmakI may actually be using an incredibly outdated build...
21:10lvijayrhickey: is there a way to find out which version of clojure you're currently on from, say, the repl?
21:10Chouserlvijay: no
21:10lvijayok
21:11lvijayany plans to add one?
21:12Chouserlvijay: it has been discussed on a couple occasions on the google group, with all sort of problems dug up and few clear paths forward.
21:12Chouserperhaps for the official releases beginning with 1.0, but it's hard to say.
21:13rhickeysvn info
21:13Chouserrhickey: that works unless they downloaded an actual release .zip, right?
21:14rhickeythe releases have dates as names
21:14lvijayjava and common lisp provide ways to find out the version so my question. what were the problems? a link to the discussion would suffice
21:14Chouseris there any indication in the dir unpacked from the .zip?
21:14lvijaythe zip name has the date
21:15rhickeyChouser: no, just that there are that many releases, and the files have dates...
21:15rhickeyaren't
21:18holmakrhickey: I'm definitely not getting an exception from having "(def *agent* (agent nil))".
21:18holmakBut doing things the right way works, so, thanks for the help.
21:21Chouserlvijay: http://groups.google.com/group/clojure/browse_thread/thread/1ae7eae292765d40/f0843d43ba678d7e and http://groups.google.com/group/clojure/browse_thread/thread/9fa07b00c88280fc/9feb32c95acbaef9
21:21lisppaste8rhickey pasted "jnatest via AOT/gen-interface" at http://paste.lisp.org/display/71245
21:22rhickeyabrooks: that works fine ^^
21:22lvijayChouser: thanks.
21:27rhickeyabrooks: once: (compile 'clojure.examples.jnatest) ;will run when compiled due to top-level commands
21:27rhickeyabrooks: from then on: (load "/clojure/examples/jnatest")
21:27rhickeyruns like a script
21:28Chouserit just seems such a shame to require a compilation pass. I suppose someone could make a jna-clojure lib that requires the dynamic classloader and does the class gen, loading, and passing off to jna.
21:29rhickeyChouser: I agree for a one-off, but otherwise people build the gen-and-load-class calls into their app and it grows and then they wonder why they can't see the classes everywhere
21:30rhickeysame thing happens with add-classpath, it has valid use at repl, but...
21:31rhickeyI like the dynamic capabilities too, I just have to think of appropriate warning labels, but correct usage in these areas requires more Java savvy than a lot of users have at present
21:32Chouserok, I guess I'm finally with you. If the JVM were different such that this kind of dynamic behavior could be fully supported, that would be one thing. But since it is what it is, trying to pretend it can be as dynamic as gen-and-load requires just leads to confusion.
21:32rhickeyChouser: it's also so easy to build a single file now that gens a bunch of stuff - wouldn't you just wrap a lib once and treat the wrapper as a lib?
21:34rhickeyChouser: that's why I built in the indirections, so the implementations could still be dynamic, and they are very much so
21:38Chousersure. it's about as good as we can get on the JVM right now. The dynamism of clojure functions, namespaces, and even getting it into some class methods is impressive.
21:40ChouserI guess requiring occasional recompiles and re-runs of your app in order to add new class definitions or JNA/native-lib wrappers is just a cost of the JVM.
21:41Chouserthough I suppose you can write up a new file and namespace, and then compile and load it dynamically.
21:50MarkVolkmannI want to print all the items in a collection on separate lines. Why doesn't this work? (map println [1 2 3])
21:51Chouserit does, except that map is lazy, so you get extra nils mixed in
21:51Chousertry: (doseq [x [1 2 3]] (println x))
21:54MarkVolkmannAh, much better. Thanks!
21:54Chouseryou're welcom
21:55Chousere
22:02MarkVolkmannIf you accidently output an infinite sequence in a REPL, is there a way to stop it without killing the REPL?
22:02Chousernot that I know of.
22:03Chouserbut you might choose to set *print-length* in the future to avoid such situations.
22:14MarkVolkmannIs there an initialization file that the REPL automatically reads or do I need to modify my script that starts the REPL to specify the file path using --init?
22:15Chouserthere is user.clj but that happens too early for *print-length*
22:16ChouserI start clojure with ~/.clojurerc.clj on the command line before whatever .clj I'm actually loading.
22:16MarkVolkmannOkay. I'll modify my script to do that.
22:18Chouserthat's where I set *print-length* and also defn 'show'
22:20MarkVolkmannWhat is defn show?
22:22ChouserMarkVolkmann: http://groups.google.com/group/clojure/msg/96ed91f823305f02
22:24MarkVolkmannThanks! I'll give that a try.
22:37MarkVolkmannSeems like I'm tripping over things that should be easy.
22:37MarkVolkmannI created this lazy sequence ... (def my-seq (iterate inc 0))
22:37MarkVolkmannWhy doesn't this produce any output?
22:38MarkVolkmann(doseq [x (take 5 my-seq)] println x)
22:38rhickeyMarkVolkmann: (println x)
22:39MarkVolkmannThanks ... and sorry for the noise ... silly mistake.
23:45timjrI used proxy to implement an interface that has a few different methods called "read" in it. I only want to override one of the read methods, but it seems as though the proxy class overrides them all. Is that the case? Is there a way to specify which one to override?