#clojure logs

2009-06-28

00:27replacagood evening, anyone who's here
00:28duck1123evening replaca
00:28replacaquiet night, eh?
00:28duck1123seems so
00:48agcheh i just was reading the mailing list, did anyone else see that guy who was worried that the site was down?
00:49agcto bad Rich squashed it, that was pretty entertaining :P
00:51duck1123Like I just dented, I like rich because he's not afraid to lay the smack down when he feels it's deserved
00:53duck1123of course I had a response I was working on about how just about any website is theoretically vulnerable to tampering by someone higher up the chain
00:55duck1123unless you're a direct node that you're personally guarding and using dns-sec someone could do something
00:55agcyeah the kid clearly doesn't understand the notion of hosting
00:56agcpretty funny to watch though
00:58duck1123yes it sucks that wikispaces went down for maintenance, no that doesn't mean they're going to decide to replace the api page with "forget Clojure, use Perl"
00:59agcbut but... what if they're out to get us?
01:00duck1123although I think it would be cool if clojure.org was re-written to use compojure or some such
01:00duck1123as an example of eating your own dog food
01:00agcits the first rule of web survival, never trust your host
01:00agcyeah that'd be cool
01:02duck1123truthfully, it probably wouldn't be all that hard considering at the moment it's all static content
01:02agcthats probably why it hasn't been done yet, there just not much point
01:08replacaI just read that one. I was very amused - pretty good trolling
01:09replacaI think that the web hosting of the API doc is pretty much Clojure's most important problem
01:10replacaI have been working this week on moving the contrib-autodoc over to github pages and I am "eating" our own dog food by using enlive to do "templating"
02:59danlucraft,(doc dotimes)
02:59danlucraft(doc dotimes)
03:00danlucraftwhy does clojurebot not do my bidding?
03:00danlucraft,(dotimes [_ 3] (print "ho! "))
03:01kotarakno clojurebot here, at the moment
03:01danlucraftnope
03:01danlucraftsleeping, probably
03:24danlucraftin the docs for dotimes, 'bindings' refers to a vector of name value pairs.
03:24danlucraftis this always what bindings means?
03:35cmvkkalmost definitely.
06:30agcanyone around who I can ask about translating docs to another language?
06:31Lau_of_DKIf its for your own pleasure, I think Google has a good enough translation service
06:32agcno english is fine with me, but I was just wondering if there was any attempts to translate the docs to other languages because I might be interested in doing some of that
06:34agchmm this is weird Clozure CL, http://trac.clozure.com/openmcl
06:36danleiwhat's weird about it?
06:52agcclozure, clojure ...not very original of them
06:54danleiClozure Associates is around since 2000 ...
07:37agcI dont think they were always called clozure though, the mailing list is called openmcl-devel and yes it does go back to 2001
07:38agcanyway I dont know anything about it, just thought it might be a new lisp project calling themselves clozure but I guess not
07:48danleithey renamed openmcl, because mcl itself was opensourced. besides matching "Clozure Associates", in choosing "Clozure CL" they achieved some continuity with the pre-mcl era, when it was called "Coral Common Lisp". (both are "CCL") anyway, no point in accusing them of plagiarism.
07:53Lau_of_DKDoes anyone have a clue what this is ?
07:53Lau_of_DKCan't embed object in code, maybe print-dup not defined: com.jcraft.jsch.Session@908f05
07:56danlei(clozure.com/about.html: "Clozure Associates was founded in 2000 by ...")
07:57Lau_of_DKCommon Lispers...
07:58danleihm?
08:02Lau_of_DKClozure... CL experts
08:04krumholt_clozure is the new name for openMCL. clozure was macComonLisp. when they went open-source there allready was an openMCL so they renamed it clozure
08:05danleiexactly. my point was, that the "Clozure Associates", after which openmcl was renamed have been around since almost 10 years. (in re to: "clozure, clojure ...not very original of them")
08:06danleianyway, it's just an obvious naming choice for some lisp :)
08:10danleihm ...
08:11danleisomewhere I read about inclusion of something akin to #+/#- reader macros
08:14danleican't find anything in clojure.org/reader though. is there a way to comment out a sexpr, like #+nil(...)?
08:18Chousukedanlei: change the operator to comment?
08:20Chouserdanlei: #_
08:22danleiChouser: yes, thank you! (should maybe be added to clojure.org/reader)
08:26ChousukeThe api docs ought to be somehow autogenerated from git :/
08:26Chousukethat would require a few additional files for the non-docstring documentation pages though.
08:33danleiif I have two namespaces t1 and t2, and have referred t1 from t2, is there a way to "un-refer"?
08:35hoeckdanlei: there is ns-unmap
08:35danleihm, ok
08:35danleia sec
08:37lisppaste8danlei pasted "unrefer" at http://paste.lisp.org/display/82641
08:38danleiI find it sometimes handy for repl use
08:39danleisomething like this in c.c. already?
08:50hoeckdanlei: there is ns-utils in contrib, but without unrefer
08:52danleihoeck: do you know how to apply for inclusion in c.c.?
08:53Chousukefirst you need a CA
08:54danleihm, for such a little thing. couldn't someone else commit it (if there's interest)?
08:55Chousukeyou still need a CA so that rhickey has joint copyright.
08:55danleihm I see
08:55Chousukesince stuff from contrib occasionally gets promoted to core.
08:56danleiok, thanks
08:56Chousukethe CA system does get in the way of small contributions sometimes, but it's a one time thing :)
08:56danleiif there will be some more things I find worthy, I'll do the CA agreement
08:57Chousukesometimes copyright just gets in the way of code sharing :P
08:58danleidon't know how to say it in english "mit sowas kann man mich jagen" "you can hunt me with things like this" :)
08:59ChousukeI wonder if there's any precedent regarding copyrightability of trivial code snippets
10:16AWizzArdBS argumentation, again (sigh), that Clojure is not a real Lisp: http://www.loper-os.org/?p=42
10:16Chousukeoh, that. yeah.
10:17AWizzArdThe dead body is still twitching ;-)
10:19ChousukeHe can talk about dreams all he wants. Someone else goes ahead and implements something that brings the world closer to that dream.
10:20ChousukeClojure may not be the "optimal lisp" but it really is the most fun language I have used so far, even with all its "faults" :P
10:21duck1123I can't help but wonder if he would be happier if Clojure could compile itself.
10:22ChousukeWell, that's on the todo list :P
10:22duck1123I know
10:24duck1123best review of that post: "emacsen: This statement summarizes the insane Lisper mindset, I don’t care if everybody really is more productive in Clojure than in Common Lisp." - http://identi.ca/notice/5785065
10:26AWizzArdduck1123: one point of criticism in that virtual argument is, that the current Clojure implementation depends on weaknesses of its underlying VM.
10:26AWizzArdFor example: no tagged numbers, no TC optimization, etc.
10:27AWizzArdOf course those are no real arguments in Clojure not being a Lisp.
10:30duck1123a true moddern lisp machine would be a cool thing to have
10:32AWizzArdWhy?
10:32cp2why not
10:32AWizzArdJust for hobby interests?
10:32AWizzArdcp2: The burden of argumentation is on the one who makes claims.
10:33cp2AWizzArd: ah, but i didnt make that claim =P
10:33AWizzArdtrue
10:33cp2heh
10:33cp2regardless though
10:33duck1123it would be cool to be able to control every aspect of the os from a repl
10:33cp2yeah, definitely hobby related stuff
10:33danleiif it would be "true modern", I agree (judging from what I've seen running Medley in a VM). something like a lisp-squeak (but more geared towards programmers, than children) would be very nice, too.
10:34cp2i would just want one to have as another geek toy
10:34AWizzArdOne problem with "why questions" is that they can easily be mistaken for being criticism. I am just interested to hear some arguments and don't want to criticize that idea in any way.
10:34duck1123I wish there was a clojure equivalent of stumpwm
10:34cp2duck1123: make one
10:35duck1123I couldn't find any decent java-based windows managers to base off of
10:35Raynes"You’re looking at it wrong. It’s not meant to be a serious Lisp. It’s only cosmetically descended from McCarthy’s original idea. It’s an attempt to terraform the wasteland of the JVM. It fails, of course, but it does make it at least somewhat less likely that geysers of molten arsenic will pour through your floor at 1AM."
10:35danleiturtles, all the way down? ability to modify everything in one language, and, that language being lisp, one, that is in itself somehow the creme de la creme. integration.
10:35cp2so base it off of stumpwm
10:35cp2well, er, not _exactly_
10:36cp2you could mimic the way it does things
10:36duck1123I've thought about it. I've got too much else on my plate atm however
10:37cp2yeah, pretty much the same story for me
10:37cp2ive found loads of cool stuff i wanna do
10:37Raynesduck1123: It amazes me how much you look like Richard Karn in your Twitter picture.
10:37cp2but
10:37cp2i have a queue of other things to plow through
10:39duck1123lol, I had a little girl at the beach think I was Billy Mays
10:39RaynesI've sadly not really done anything with Clojure for a long while. I've been on a Haskell learning expedition, and probably will be for a few more weeks before coming back and continuing my Clojure adventures.
10:43duck1123so is anyone here a serious user of clj-record? I want to get some feedback on some of the changes I pushed to my fork.
11:32Chouserdurka42: I've got a friend interested writing a window manager in Clojure
11:33ChouserI don't know how much code he's got, but I think he's got some JNA doing X11 stuff
11:39Jomyootdoes clojure support imperative programming too?
11:39Jomyootor is it strictly functional
11:39JomyootCL allows sequential/imperative
11:40danleiit's not strict, albeit more inclined to FP than CL
11:40ChouserJomyoot: it doesn't prevent you from writing and using functions with side-effects, but it's likely to feel like you're working against the grain.
11:40Chouserlocals are immutable -- that gets in the way of a lot of imperative idioms
11:40Jomyootwell
11:41Jomyootwhat about globals?
11:41Jomyootwould scala allow more imperatives then?
11:42Chouserglobals can be changed, though it's not common to do so as part of an algorithm.
11:42Chouserscala supports mutable locals (when you use "var" rather than "val")
11:43Chouser...though when I asked for help in #scala with code that used "var" I was frequently mocked. :-/
11:43durka42Chouser: sounds interesting
11:43Jomyootdo you think 1 year from now. clojure or scala will have more programmers?
11:44AWizzArdDoes not matter I think.
11:44Jomyooti am hoping for a webframework
11:44Jomyootlike rails or django for clojure
11:44Jomyootscala has lift already
11:44AWizzArdClojure has Compojure. But why hoping and not joining that project?
11:45Jomyootdunno
11:45Jomyootnot enough time to contribue to a framework really
11:45Jomyooti am more of a user
11:45AWizzArdBut what do you do in the time while the framework is not available? :)
11:46Jomyootuse different langauge? like ruby?
11:46Jomyooti was coding CL a while back
11:46Jomyootscheme too
11:47Jomyootthen switched to ruby for a web project
11:47Jomyooti tried haskell
11:48Jomyootbut killed myself with monads
11:48Jomyooti hope clojure does not have monads
11:48danleiit does, but not in core
11:48danleiyou're not forced to use them in any way
11:50danleiconcerning your question about globals: just yesterday I wrote a little parser for ansi-sequences, which used a kind of mutable global (an atom), then chosuke provided a stateless alternative.
11:50danleiso, in general, you're not forced.
11:51ChousukeI thought about writing a version of the parser using the state monad from contrib
11:51danleiwould be a nice read
11:51danleiI've just finished the tutorial, but I'll have to read some more, and re-read it again
11:51danleithink I've a grasp at the basics now
12:02danleihm ... (read) freezes my slime repl
12:03rhickeytype a form
12:03danlei=)
12:03danleiI did :)
12:03rhickeyhrm
12:03danleiupdated slime yesterday, swank-clojure is up-to-date
12:03danleiconnected via swank-server
12:04Chousukedanlei: too bad I have no idea how to actually use the monad library :P
12:04danleiChousuke: :)
12:05danleiChousuke: just wanted to ask you for a simple example: (inc (read)), how to isolate the read ;)
12:05StartsWithKrhickey: will there be a backport to 1.0.x series of clojure.test (with downloadable clojure-1.0.x.zip on the site)?
12:06rhickeyStartsWithK: dunno, someone has to volunteer to do it
12:06rhickeystrictly speaking that's not a .x change, as it is more than a bugfix
12:07StartsWithKi would like to ditch the clj-unit fork included in cloak (that clojure build system) for this new one
12:07StartsWithKjust to get with the program :)
12:15StartsWithKany one experimented with using java agent to manipulate bytecode at runtime in context of changing existing clojure code?
12:15StartsWithKor to inject IMeta to java.lang.String and such..
12:16Chousukehopeless
12:16ChousukeI know what I want to use for my state but I have no clue how to actually use the state monad to do the state-keeping :(
12:17StartsWithKi got the impression final classes are not a problem for instrumentation mechanism
12:18StartsWithKand by manipulationg clojure.core/+ threre would be no need for contrib.generic, and as i read it, no speed penalty eather
12:24Chousukedanlei: if you figure out how to use the state monad with the parser thingy, tell me.
12:24ChousukeI can't.
12:24danleiChousuke: I will (if I ever do) :)
12:26Chousukeit'd probably be easier to see how the types interact if clojure had static typing.
12:26Chousukebut as it is now, I just can't tell whether I'm supposed to have a monadic function, a monadic value, or the regular ones
12:27Chousukeor if I try reading the code that uses monads in contrib... it looks neat and cool, but I have no clue how it works
12:27danleiatm, I'm just reading the examples.clj of c.c.monads, and trying to find some more tutorials
12:28ChousukeI have read at least five different monad tutorials :P
12:28Chousukeit doesn't help
12:28Chousukeit looks simple in the examples, but there's nothing to bridge that so that I could produce monadic code myseld.
12:28Chousukemyself*
12:30danleiI don't even know how to isolate input. In haskell those things are IO <something>, if I remember correctly, but I wouldn't know how to do such a ting in clojure.
12:30danlei*thing
12:30Chousukeit's nothing explicit.
12:31Chousukein your earlier example, (inc (read)) is probably not what you want. I suspect you're going to do more with the return value of (read) than just increment it?
12:31danleisay, I have (inc (read)) inc is pure, read is inherently not. if one of the goals of monads are to separate pure and impure code, how would I do that?
12:31danleiit's just an example
12:32danleiread something, which is impure, and increment it, which is a pure function
12:32Chousukeso, make a function that does all that with a non-read value, then call (do-complicated-stuff (read))
12:32danleiwell, that's how I would do it without monads ...
12:32Chousukein essence, the points where you use impure functions should be well-defined and visible and few in number :)
12:33Chousukethere's no need to use monads.
12:33danleino, need, yes, but I thought those monads were supposed to help me in the process, aren't they?
12:33Chousukewell, yeah, if you know how to use them
12:33danleithat's the point, I guess :)
12:33ChousukeI prefer just using discipline, because I have no clue about monads :P
12:34danleiatm my sime REPL is more effective than any monad: prevents every use of (read) :)
12:34Chousukeheh
12:55opqdonutdanlei: mapping pure functions over an impure "action" is one of the basic monad operations
12:56opqdonutlet me check the syntax c.c.monad uses
12:56opqdonut(i come from haskell and haven't tried monads in clojure yet=
12:56opqdonut*)
12:56danleiopqdonut: thanks
12:57Chousukec.c.monads has domonad but I can't figure out how it works
12:57Chousukeor how to define a function that works the way I want ;/
12:58danlei(domonad maybe-m [x 1 y nil] (+ x y)) -> nil
12:58danleithat's how far I've come ;)
12:59opqdonutdanlei: mlift
12:59opqdonutis the thing you are looking for
12:59opqdonuter, m-lift
12:59danleiopqdonut: could you give a little example as to how to use it to separate, say, IO functions from pure ones?
13:01ChousukeI doubt m-lift is useful with the state monad
13:01opqdonutit's useful with every monad
13:01opqdonutit's the shortest way of applying a pure computation to a monadic value
13:02Chousukehow would I define a function that takes in a piece of input and uses the state monad to produce a new value and a state?
13:02Lau_of_DKSeen clojurebot?
13:02danleiyes, I too would like to see an example of such a simple ting
13:02danlei*thing
13:02danleiLau_of_DK: he's monadic these days?
13:03Lau_of_DKmonadic?
13:03opqdonuti'm sorry, I can't really supply examples in clojure syntax
13:03danleiLau_of_DK: monads are used to implement clojurebot?
13:03Lau_of_DKI didnt know - but what does it matter? Are monads prone to FAIL ?
13:03Chousukeopqdonut: haskell works too
13:04danleiLau_of_DK: :) misread you ;)
13:04Lau_of_DKOk
13:04Chousukethe domonad syntax in clojure is similar to haskell's do block
13:04Chousukebut I can't figure out which function takes what parameter and how to get to them
13:04opqdonutChousuke: so you want val->(state,val) wihtout taking in any state
13:04opqdonutthat's not really monadic at all
13:05Chousukeno, I want a monadic function that "implicitly" takes the state argument
13:05opqdonutyes, yes
13:05opqdonutso you'd say (for example) "add_state_to x = do s <- get; return (x + s)"
13:06opqdonutthat's a function that takes one parameter, and adds the state to it
13:06opqdonut(get returns the current state)
13:06opqdonuti'm guessing you'd use defmonadfn in clojure
13:07Chousukex is a monadic value?
13:07Chousukewhat if I had some input that I want to add to the state, depending on what the state is.
13:10danleiChousuke: do I understand right, that what you describe would be the function itself as a monadic thing, which has the state passed implicitly to it? (my head spins a little)
13:11Chousukedanlei: a monadic value in the state monad is a function that takes the state as its parameter. that much I know
13:11danleiand its value is the computation?
13:11Chousukebut I just can't wrap my head around how to actually use that to work with the state and the actual final return value
13:15danlei"a state monad value is a function that takes a single argument, the current state of the computation, and returns a vector of length two containing the result of the computation and the updated state after the computation" I guess, so far I understood too.
13:22Chouseris it just me, or is the g.group a bit more ...tense... laterly.
13:23Chouserlately?
13:23Chousukehmm
13:23opqdonutChousuke: x is non-monadic ther
13:23opqdonute
13:23ChousukeI'm having easier time writing out the monad functions explicitly rather than by using domonad :P
13:23opqdonutbecause bind takes care of unwrapping it when we want to use f
13:24opqdonutChousuke: that's a good thing :)
13:44Chousukehmm
13:44Chousukenow I have something monadic here
13:45Chousukenow I need to figure out how to apply that to a sequence
13:48prospero_so hypothetically, let's say I want to write a macro that reverses the names of keywords
13:48prospero_like so: (defmacro reverse-keyword [k] (keyword (apply str (reverse (name k)))))
13:49prospero_(reverse-keyword :hello) yields :olleh
13:49prospero_but (map #(reverse-keyword %) [:a :b]) yields (:34__1p :34__1p)
13:50prospero_what's going on underneath the covers here?
13:51Chouserprospero_: try: (macroexpand '#(reverse-keyword %))
13:52prospero_ha, fair enough
13:52Chouserit's a macro, so it does what it does at compile time, before the values for % are known
13:53prospero_ok, that makes sense
13:56prospero_so if I want to do a transform over a list of args inside a macro
13:57prospero_is it just that I shouldn't use anonymous functions?
13:57prospero_or is there some deeper limitation at play here?
14:02achimprospero: macros are a special kind of functions that transform syntax prior to compilation. contrary to ordinary functions, they take their arguments unevaluated. so your macro tries to reverse %, basically
14:03prospero_achim: I get that part, I was just having trouble finding an example that walks a list of args, rather than making a single transformation
14:03prospero_I'm looking at the code for "cond" now, which seems to be what I'm looking for
14:04prospero_sorry if I was unclear what I was looking for
14:05Chousukeprospero_: you can use a function to do the reversing
14:06Chousukejust defn reverse-keyword instead of defmacroing it
14:06prospero_Chousuke: yeah, that was just meant to be a toy example
14:06Chousukeyou can still use it inside a macro
14:07prospero_what I'm trying to actually do isn't defn-able, but I didn't want to actually go into the specifics
14:07prospero_probably could have come up with a less trivial example, though
14:07opqdonutprospero_: so was cond what you were looking for?
14:08prospero_opqdonut: it appears to be
14:08prospero_it applies itself recursively over a list of clauses
14:10prospero_so it will expand the entire list, which of course the anonymous function wouldn't
14:10prospero_if it doesn't work, I'll be back with more questions
14:12Chousukeprospero_: can't you do that with a function called from a macro.
14:13prospero_Chousuke: here's the macro I'm trying to apply to the args. am I missing something and it can actually be a function?
14:13prospero_(defmacro to-gl-const [k] (let [gl# ("GL_" (.. (name k) (replace \- \_) (toUpperCase)))] `(. GL ~(symbol gl#))))
14:13Chousukehm
14:13Chousukesure it can
14:14prospero_calls to "symbol" inside a function were giving me strange errors
14:14prospero_so I assumed that was only something I should do inside a macro
14:16Chousukewhat's the "GL_" supposed to be though?
14:16Chousukethat gives an error
14:16Chousukejust wrap it in an str? :)
14:18prospero_so this function is meant to translate :this-is-a-keyword to GL_THIS_IS_A_KEYWORD, which is a static constant in javax.media.opengl.GL
14:19prospero_oh, sorry
14:19prospero_I gave you a bad copy-paste of that
14:20prospero_took me a moment to see that
14:20prospero_yeah, it's supposed to be (str "GL_" ...
14:20Chousukehttp://gist.github.com/137331
14:21prospero_I didn't know you could use the template syntax outside of macros
14:21prospero_interesting
14:21Chousukeit's just a different kind of quote
14:21Chousukeyou can use it anywhere.
14:22prospero_hm
14:22Chousukeconversely, you don't have to use ` in macros either.
14:22Chousukeit's just a convenient way to construct a list
14:22Chousukewhich is what a macro usually returns
14:23_hrrldIs there anything like 'drop-nth'? like (drop-nth 1 [0 1 2]) ;;>> [0 2]
14:23prospero_Chousuke: thanks, that's really helpful
14:26Chouser_hrrld: lazy, linear time thing?
14:26_hrrldI'm working with all concrete sequences that are pretty short. I imagine doing drop-nth in a general way efficently could be very difficult.
14:26opqdonutnot really
14:26_hrrldMy datasets are small enough that perf isn't a big deal.
14:26opqdonutfor lazy sequences it's quite easy
14:28hoeck_hrrld: there is partition: (map first (partition 2 '(1 2 3 4)))
14:29_hrrldhoeck: that returns (1 3) ; the 4 got lost. :)
14:31Chouser(defn drop-nth [i coll] (concat (take i coll) (drop (inc i) coll)))
14:31hoeckoh, I supposed you wanted to drop every nth of a seq
14:32_hrrldChouser: nice. Much appreciated.
14:33hoeckfor vectors, you could use subvec and conj them together
14:40Chouserhoeck: yes, though I don't think that'd be much of a win. In order to construct the final vector, I think both subvec's would have to be walked linearly anyway.
14:42hoeckwouldn't only the second subvector conj'ed on the first one?
14:43hoeckbut this is no win either, when dropping the first of a lot of values
14:44hoeckI once had a usecase for dropping values from vectors, but then realized that I'm better off with using hashmaps instead
14:49Chouserhoeck: ah, you're right. The first part of the vector would be re-used without a linear copy.
14:49Chousersubvec's smarter there than I thought.
15:02duck1123_I'm curious. If I had a lazy-seq that used a fn to generate the rest part, and I started going through that seq and in a different thread re-defed the fn, would the seq start producing the results of the new fn, or does it hold on to the definition of the fn it had originally
15:03Chousukehmm
15:04duck1123_I suppose I could test it, it was just a thought that struck me as i was reading the list? => false thread
15:05Chousuke,(let [a (iterate inc 0) b (dorun (take 10 a))] [a (binding [inc dec] (dorun (drop 10 (take 20 a))))])
15:05Chousukeoh damn
15:06Chousukehm, not a, b :P
15:07Chousukealso, doall :P
15:07Chousukebut doesn't look like it has an effect.
15:09Chousukehowever, (let [a (iterate #'inc 0) b (doall (take 10 a))] [b (binding [inc dec] (doall (drop 10 (take 20 a))))]) does yield [(0 1 2 3 4 5 6 7 8 9) (8 7 6 5 4 3 2 1 0 -1)] :)
15:16achimlazy-seq creates a closure from its body, so thread-local bindings should do no harm
15:17achim(binding [inc dec] (apply inc [1])) -> 0
15:17achimvs (binding [inc dec] (apply #(inc %) [1])) -> 2
15:18achim("apply" to avoid inlining)
15:22Chousukeright.
15:22Chousukeand adding the var indirection with #' makes the binding work again.
15:23Chousukehmm
15:23ChousukeAtom doesn't implement IFn like the other ref types :/
15:23Chousukeapparently agent doesn't either.
16:49Lau_of_DKSo - Have everybody checked out the two demos for ClojureQL yet?
16:52duck1123where?
16:52Lau_of_DKhttp://github.com/Lau-of-DK/clojureql/tree/master
16:53Lau_of_DKWe're coming close to release 1.0, so feel free to throw feature-requests/bug-reports at us!
16:57duck1123Lau_of_DK: does clojureql handle limiting?
16:58Lau_of_DKI have a patch in my inbox from eyeris for offset/limit support, I'm looking at that now
16:58duck1123I recently got done hacking up a :limit param for clj-record, and got annoyed that derby doesn't support limit
16:59kotarakWouldn't take work in the resultset-seq?
16:59duck1123yes, but that is potentially wasteful
17:00ChousukeLau_of_DK: order-by and having etc. being functions of queries is really neat.
17:00duck1123it's better to let the db limit it to only what you need than to send it all and then filter it
17:01lisppaste8drewr pasted "delim-seq" at http://paste.lisp.org/display/82652
17:03Lau_of_DKChousuke: I'm glad you like it
17:07Lau_of_DKI've tested superficially, but it seems that drop/take it a feasible replacement for offset/limit
17:09agccan anyone give me a brief description of the eclipse public license, how is it different than gpl?
17:10agcI'm familiar with gpl/lgpl/bsd is it like any of those?
17:12duck1123http://en.wikipedia.org/wiki/Eclipse_Public_License#Other_aspects is a good description of the difference
17:12agcthanks duck1123
17:12Lau_of_DKduck1123: Potentially wasteful ?
17:13kotarakLau_of_DK: the drop issue
17:13Lau_of_DKkotarak: I wanted duck's thoughts, he sounded like he had some knowledge :)
17:14duck1123If I want to start at record 1001, I still have to send those other 1000 records over the wire
17:14Lau_of_DKOk, so same issue as we discussed
17:14Lau_of_DKI'm wondering about take, if it realizes the whole set
17:14Lau_of_DKI think we might actually get that one for free
17:15duck1123I still think that chunked seqs will be awesome for db work
17:15Lau_of_DKWhy?
17:16duck1123I'm still a little fuzzy on the details of chunked seqs, but it sounds like we'll be able to pull a chunk of records down, and then pull more when we get to them
17:16hoeckduck1123: yeah, especially if one can implement a chunked-resultset-seq
17:16duck1123if it's done the right way underneath that is
17:17duck1123it was the first thing I thought of when I first heard rich talking about them
17:18Lau_of_DKI still dont get them :)
17:18agchmm EPL seems a bit strange to me, allowing people to freely take the code and then create additions and release them under a different license even closed source
17:18Chousukeduck1123: you can do that with current seqs. it's just that they won't be able to benefit from the "chunky" internal representation
17:20duck1123I've been thinking about putting a :page param into my clj-record work so I could specify a page size in the model intl and then say (find-records {:user 4} :page 3)
17:20Chousukeduck1123: the point of chunked seqs is to allow seq consuming/producing functions to work on chunks if the internal representation is chunked (like with vectors) and minimise the laziness overhead
17:21agcI guess I just don't get the whole licensing thing, I mean if you're bascially letting people do whatever they want then why license it anyway, why not just put it out there and say "do whatever".
17:21duck1123agc: I think it's so I can't make the claim that Clojure is mine
17:22Chouseragc: one reason is because "whatever" could possibly include copyrighting your work and then suing you if you try to use it yourself. :-P
17:22agcah yeah, that would be an unfortunate way to end up in prison
17:22Chouseryes, would be annoying
17:23duck1123that's it. Rich is no longer allowed to use Clojure unless he pays me
17:23agcyou're a bad duck
17:24duck1123okay, I'll let him slide this time, but I could really use the money
17:44eevaranyone know if the master branches of clojure, contrib and swank are stable and working together right now?
17:45eevars/stable/usable for non-critical work/
17:54Chousereevar: I don't use swank, but I think I'd have heard if it wasn't working right now.
17:55dmiller2718,[ (:tag ^#'next) (:tag ^#'print-method)]
17:57weissjis the clojurebot that runs in this channel available as code to run elsewhere? hiredman's http://github.com/hiredman/clojurebot/tree/master doesn't look intended to be run by others, the #clojure channel is hardcoded in it
17:58dmiller2718evaluates to [clojure.lang.ISeq clojure.lang.MultiFn]
17:59dmiller2718:tag metadata on #'next being ISeq is reasonable, :tag on #'print-method being MultiFn seems not correct.
17:59dmiller2718As an IFn value, #'print-method's :tag should be its return type, which is not a MultiFn.
18:00dmiller2718This is true of anything defined by defmulti. Is this correct?
18:01Chousukeweissj: hm, the channel shouldn't be hardcoded :/
18:02Chousukeweissj: though I don't know hwat changes hiredman has done since my edits :P
18:02Chousukeweissj: anyway, no, that's the original source :)
18:03weissjChousuke: can you tell me how to get it running? i got the pircbot and clojure-json libs on the classpath, and i disabled a bunch of modules that were preventing it from starting
18:03weissjbut it still doesn't work
18:03weissji get java.lang.IllegalArgumentException: No method in multimethod 'new-send-out' for dispatch value: class clojure.lang.PersistentArrayMap
18:03Chousukeweissj: did you look at clojurebot.clj?
18:03weissjyes
18:04weissji set the bot-attibutes, i can actually see clojurebot join my channel
18:04weissjbut every time i talk to him he throws the above exception
18:04Chousukehm
18:05Chousukethat's something I have no idea about :P
18:05Chousukeask hiredman
18:06Chousukemost likely he has defined the multimethod in a repl and forgotten it from the sources :)
18:06weissjhehe
18:06weissjok so there probably aren't too many people running this bot then :)
18:06Chousukeprobably. :P
18:09weissjhehe "suffusion of yellow" - nice Douglas Adams reference there
18:10Chousukehm, there's a defmethod for PersistentHashMap
18:10Chousukemaybe it should be clojure.lang.IPersistentMap instead
18:11Chousuketry making that edit (in clojurebot/core.clj) and see if it works then
18:11weissjwell i suppse i could change it
18:11weissjk
18:14weissjChousuke: cool that seems to have worked, although, it won't eval things that start with ,
18:14weissjwhat are some other functions i can try
18:17Chousukeweissj: you can tell it things
18:17Chousukebotnick: foo is bar
18:18Chousukeand then try ~foo
18:20weissjah ok
18:20weissji got the sandbox working, i didn't konw "sb" was the sandbox module and had removed it :)
18:21weissj,(defn add5 [x] (+ x 5))
18:21weissjoh it's not running in this chan today hehe
18:23Chousukedefn won't work anyway :)
18:24weissjChousuke: any particular reason why that's disabled?
18:25weissjis each expression eval'd in a different space?
18:25weissji would think that would be a useful feature to define functions and call them
18:27Chousukeweissj: to prevent a DoS
18:28Chousukeif you want to disable the protection (which is probably circumventable in any case), take a look at the defang function :P
18:29weissjChousuke: i'll just make *bad-forms* an empty list and see what happens :)
18:29Chousukeheh
18:30Chousukeyou'll probably want to make it an empty *set* though.
18:30weissjsorry, set
18:30weissj(def *bad-forms* #{})
18:31weissjwill get kinda ugly having to define functions on one line though
19:46JAS415what does everyone use for GUI stuff in clojure?
19:54eevar2swing. or html
20:09sohailthere used to be jambi but that died
20:09sohailor became a community project :-)
20:11ChouserI'm still hoping those are the same thing.
20:11Chouserjambi is too good to die
20:17JAS415Swing has all of this subclassing stuff it looks like, is there an easy way to do that in Clojure?
20:17JAS415or will i have to write java?
20:23ChouserJAS415: proxy
20:23Chouser,(doc proxy)
20:28JAS415cool i will check that out, will have to read up on that then :-)
20:49JAS415(psort coll comp)
20:49JAS415(sort comp coll)
20:49JAS415are these really reverses of each other?
21:15duck1123so do you guys think it's time to move on past clojure 1.0 in my projects?
21:15duck1123now that contrib no longer compiles on 1.0
21:26Chousernah.
21:28duck1123git bisect did it's job perfectly of showing the last commit that compiled. think i should just stick with that one?
21:28Chouserjust pick a version of contrib that seems to work, test it well and let us know which it is
21:28duck1123I'm going to have to adapt to clojure.test-is sooner or later though
21:29Chouserthat should help whoever finally branches 1.0
21:29duck11232 revs ago compiles. didn't test
21:30duck1123just ran ant -Dclojure.jar=../clojure/clojure.jar
22:48justin`hey does anyone know why I can't accept user input in slime?
22:48justin`every time I use (flush) no matter what I enter I just stop getting a prompt
22:49justin`anyone around?
22:56duck1123I saw someone mention this before. (it may have been you)
22:56duck1123I don't know what the fix is
23:50eyerisWhy is (pred x) returning a reference to the function instead of the result of that function?
23:50eyerishttp://pastebin.ca/1478013
23:52eyerisThat should say "above the if construct"