#clojure logs

2009-08-02

00:01mebaran151_svn always seemed too much for me
00:01Anniepooso is *compile-path* an atom, or what? it's not very useful to tell us it needs to
00:01mebaran151_the nice thing about mercurial, you don't need any server
00:02Chouser*compile-path* is a var. Use 'set!' to change it at a repl.
00:02AnniepooA loader classfile will produced in my/domain/lib__init.class, under *compile-path*, which must be in the classpath
00:02Anniepoothanks
00:03Anniepoook, amazingly
00:03Anniepooit persists the state of the repl
00:03AnniepooLOL
00:03AnniepooI think that's how I 'corrupted' my old project
00:09mebaran151_oh that's happened to me a couple times
00:09mebaran151_wondered why my nice fixed functions were neither nice nor fixed
00:09clojurebothttp://clojure.org/rationale
00:10Anniepooyes, but I've been working on this project for a couple weeks, have rebooted the machine many times
00:10Anniepoojust how long is that supposed to persist?
00:11mebaran151_does IntelliJ give you an option to reset th repl?
00:11AnniepooI work inside the Second Life environment. LSL has this problem - there's no save, only passivate,
00:12Anniepooso you can have scripts that have weird old state
00:13mebaran151_smalltalk had a solution to this whole conundrum but I forgot what it was
00:13Chouserheh
00:13JAS415save the whole damn thing?
00:13mebaran151_explicit saving is bad because it means you can lose work, but non-saving means you have less control of what actually goes in
00:14mebaran151_in smalltalk you dev'ed inside this pretty neat image that saved saved the entire state of the app, not just the src
00:15Anniepoothere's a commercial product sold in second life that lets you record and play back an animation on an object
00:16mebaran151,(= (fn []) (fn []))
00:16clojurebotfalse
00:16mebaran151ah nuts, you can't test function equality
00:16Anniepooit works by recording into a list. Many people have used this to make other commercial products, all of which depend on their state not being reset
00:16JAS415,(let [x (fn [])] (= x x))
00:16clojurebottrue
00:17JAS415you can test equality they're just different object or w/e
00:17mebaran151but I wanted to see if two separately instantiated functions that were the same bytecode wise would compare the same
00:18mebaran151it also means I probably can't usefully use functions as keys in my index map :|
00:29Anniepoook, superstition reigns
00:30Anniepoobefore I try to use sh again I'm going to check everything into SVN
00:30AnniepooLOL
00:30JAS415superstition and voodoo are the ways of software development :-)
00:31JAS415but you have to have superstition and voodoo locally bound when you are macroexpanding your forms or else you get a null pointer error which you can't locate
00:32AnniepooI worked at a place, they had a programmer who had heard about some crazy method of
00:32Anniepoosaving a few cycles in an assembler loop - so he did this all the time with his java
00:39JAS415i do maintenance on code of the 'spaghetti' variety, so its not so much a matter of figuring out the best way to fix it, it is the minimizing the negative side effects of bugfixes
00:39JAS415is not so much software engineering, but controlling chaos
00:41AnniepooI worked at a place where the boss was going slowly insane. Literally.
00:42Anniepooit didn't help his code much
00:42clojurebothttp://www.khanacademy.org/
00:43JAS415i can imagine it would make for amusing comments though
00:43Anniepoono, sadly just scary ones
00:44JAS415that's too bad :-/
00:45Anniepoohe was a rather polite guy, a 'jolly chinaman' sort. We started finding wildly obscene comments in his code
00:45Anniepoogroan, I just noticed I imported all my class files
00:45mebaran151how would one convert an integer into 4 bytes in clojure
00:46mebaran151I seem to be failing
00:46mebaran151poor guy
00:53Chouser,(seq (.toByteArray (.toBigInteger 23456M)))
00:53clojurebot(91 -96)
00:53Chousermebaran151: there's probably a better way
00:54JAS415you can probably do something with byte masking
00:54mebaran151 (into-array
00:54mebaran151 (reverse (map
00:54mebaran151 #(byte (bit-and (bit-shift-right n (* %1 8)) 0x000000FF))
00:54mebaran151 (range 0 4)))
00:54mebaran151 ))
00:54JAS415?
00:55mebaran151this is what I've got
00:55mebaran151I think it's right but I'm not one hundred percent confident especially with negative numbers (where's uint when you need it...)
00:56Chouser,(map #(byte (bit-and % 255)) (take-while pos? (iterate #(bit-shift-right % 8) 23456)))
00:56clojurebot(-96 91)
01:00mebaran151heh, yours is cooler, but I think we do the same thing
01:00mebaran151except you can handle longs with your fancy iterate method
01:01mebaran151now what I really want is lexographically orderable numbers (ie the largest into would be straight 1's and the smallest integer would be straight 0'))
01:01clojurebot(pl reverse $ (↕reduce range $ 10 () λxy (↕conj inc $ y x)))
01:02Anniepoo ok, putting all this in a repository is going to wait
01:03Anniepooafter classpath hell I'm not in the mood to deal with it
01:04mebaran151eh
01:04mebaran151mercurial is super easy
01:04mebaran151hg init
01:04mebaran151hd addremove
01:04mebaran151hd commit -m "I'm done!"
01:04mebaran151*hg
01:05Anniepoowell, I know how to use svn
01:06Anniepoowith the tortoise client it's pretty brainless as well
01:06Anniepoobut I don't want to sort through what does and doesn't get added
01:07Anniepoobefore I go back to sh hell I'm going to go relax a bit
01:07Anniepoosee ya
01:08mebaran151good luck
01:08JAS415oh man
01:08JAS415clojure checks the namespaces inside of (comment *) things
01:08mebaran151huh?
01:08JAS415yeah for serious
01:09mebaran151how does it check?
01:09Chouserwhat do you mean by "checks the namespaces"?
01:09JAS415i had for example (twitter-api/blah-function stuff)
01:09JAS415wrapped in a comment
01:09JAS415ooh
01:09mebaran151and if you want a super comment #_() is your best bet
01:09Chouser,(comment made-up/stuff blah/blah)
01:09clojurebotnil
01:09JAS415no it was checking
01:09JAS415it was checking the tokens themselves
01:10JAS415i had (comment (foo twitter-api/ ))
01:10Chouser,(comment made-up/)
01:10clojurebotInvalid token: made-up/
01:10Chouseryeah, it has to be readable.
01:10Chouser,(command ###)
01:10clojurebotNo dispatch macro for: #
01:10JAS415,(comment ######)
01:10clojurebotNo dispatch macro for: #
01:11JAS415oh well
01:11mebaran151it actually reads my contractions just fine (things like I'd and extra periods..)
01:11JAS415,(comment i'd rather not write the code this way, but such is life)
01:11clojurebotnil
01:12JAS415,(comment i'd rather not write the code this way; but such is life)
01:12clojurebotEOF while reading
01:13Chouserreal block comments are on the to do
01:16mebaran151I've just been using ;;
01:16mebaran151doesn't #() work?
01:16mebaran151,(comment I'd rather not work this hard)
01:16clojurebotnil
01:17mebaran151#_(comment I'd rather/ not work this hard)
01:17mebaran151,#_(comment I'd rather/ not work this hard)
01:17clojurebotInvalid token: rather/
01:17mebaran151oh it still reads it: interesting
01:24Anniepooand, without changing the code any, when I get back to my sh problem it now has a different error
01:25Anniepoo8cD
01:25JAS415o
01:25JAS415what's the error now
01:27mebaran151this channel by far has the most functional ircbot
01:30clojurebotthey like me! they like me!
01:35Anniepoothe new error is more reasonably my problem
01:36Anniepooit's all working now
01:36AnniepooI don't like all the hidden 'what's my directory' games
01:37Anniepoo8cP The next error, fittingly for today, is that repainting is triggering the process that launches photoshop
01:52Anniepoois sh taking place in a transaction? it shouldn't get retried
01:56mattreplhrmm, CPBezierPath appears to no longer have a setStroke:, setFill:, or set: to indicate the color used when drawing. I must be missing something
01:57Anniepooit probably picks up the Java2D stroke/fill?
01:58Anniepooand what lib is this?
01:58Anniepoocause I could use a bezier
01:58mattreploh my.. it's late here... =) that was meant for #cappuccino. sorry for the noise
02:52mebaran151is let a special form in clojure or does it do it scheme style by translating the let block into an anonymous closure (at least how I understand it)
02:56hoeck1mebaran151: its a special form, but compiles into a inner class, like fn does
02:56hoeck1r/a/an
02:57mebaran151compiler doesn't do a straight substitution?
03:04hoeck1mebaran151: oh, you're right, seems it doesn't generate the same code as with fn
03:05mebaran151interesting
03:06mebaran151the fn solution always seemed really pure
03:06mebaran151that scope was determined by execution
03:06hiredmansure "pure" but so is cons cells made from lambdas
03:06hiredmanbut no one does that either
03:07hiredmanI have not looked at clojure's specificly, but the logic for handling lambdas can be significantly more complex then what is needed for let
03:09mebaran151all lets could be resolved at compile time can't they?
03:10hiredmanresolved?
03:12tomojI wonder how long it will take me to have any clue what the hell you people are talking about in here
03:12mebaran151as in you wouldn't need to keep any trace of them around
03:13mebaran151there shouldn't be any need to have the extra layer of functional indirection so I guess it's a wise compile time optimization
03:13hiredmanI dunno, my interpreter handles lambdas and lets, but I have gotten around to adding handling of anything besides λ to the compiler
03:14hiredmanhaven't
03:16mebaran151tomoj, I was just wondering if clojure handled lets the way scheme does, by building essentially an anonymous function
03:17tomojI guess it would be helpful if I had learned scheme and really learned lisp well. only toyed around with lisp some.
03:19mebaran151let [x y 1 2] (g x y) => (fn [x y] (g x y)) 1 2)
03:19mebaran151see
03:19hiredman(mentioned in the mit sicp videos)
03:20mebaran151I read the book rather than watching the movie :)
03:23hoeck1mebaran151: you can use sth. like http://java.decompiler.free.fr/ to decompile clojure generated bytecode
03:23hoeck1and see how it handles lets and fns
03:24mebaran151might do it
03:31hiredmanclojurebot: en to sp metaphor
03:31clojurebotHuh?
03:31hiredmanclojurebot: translate en to sp metaphor
03:31hiredmanclojurebot: translate en to es metaphor
03:31hiredman:(
03:36mebaran151I've gotta admit, clojurebot is the most functional ircbot I've seen in the programming channels on freenode
03:37hiredmanhis translation function seems to have bitroted
03:40hiredmanclojurebot: translate to es: metaphor
03:40clojurebotmetáfora
03:41hiredmanstill works, I just forgot how to use it
03:55jwhitlarkWhat do you do in clojure when you would use an event loop in another language?
03:56jwhitlarkidiomatic clojure, I mean.
03:57hiredmandepends
03:57hiredmanthere is always loop/recur
03:57jwhitlarkmmm, just an infinite loop that way, ok, that makes sense.
03:58mebaran151is there a programmatic macro to express every loop recur as a while?
03:59mebaran151I find myself writing a lot of loop (if blank recur) (return result stuffs)
04:01hiredmanwhile only breaks the loop if the test ever becomes nil, which can only happen via some kind of side-effect
04:01hiredmanso loop/recur is more general
04:02hiredmanthe other option is to replace an infinite loop with an infinite seq
04:02hiredmanpossibly using interate or repeatedly
04:04jwhitlarkhuh, as simple as (loop [] recur))
04:04hiredman,(loop [] (recur))
04:05clojurebotExecution Timed Out
04:05hiredman,(take 10 (iterate inc 0))
04:05clojurebot(0 1 2 3 4 5 6 7 8 9)
04:08jwhitlarktnx. that does the trick. I just wanted to make sure i wasn't learning a bad habit.
04:12mebaran151hiredman, if I have a let binding that references a global variable which I rebind inside a function body, will the variable I assigned using let point to the old global or the new thread local?
04:13hiredmanmebaran151: you can use a lexical binding to capture a dynamic binding
04:13mebaran151okay
04:13mebaran151I think that'll work out
04:14hiredman,(binding [+ 1] (let [+ +] (future +)))
04:14clojurebot#<Object$Future$IDeref@1ab6c1c: 1>
04:14hiredman,(binding [+ 1] (future +))
04:14clojurebot#<Object$Future$IDeref@108f060: :pending>
04:14hiredmanzounds
04:15mebaran151(defn scoper []
04:15mebaran151 (let [g *global*]
04:15mebaran151 (binding [*global* 2]
04:15mebaran151 [g *global*])))
04:15mebaran151this works as it should actually (sorry about the flood)
04:32lbjMorning guys
04:39LauJensenI've decided on a nick! :)
04:39LauJensenDoes anyone here have a Youtube account ?
04:40LauJensenHey my friend
04:40kotarakHi Lau!
04:40LauJensenTell me - Hows uploading handled? Does it accept all formats and converts them to a fixed size?
04:40kotarakOerk.
04:41kotarakI uploaded something there once, and it was bad quality afterwards. :/
04:41kotarakBut there are a lot of information on the net, which codec to use and which format.
04:41LauJensenIm working on a site which accepts video uploads and I need some hints on how to handle it
04:43kotarakJust some random google result: http://www.pcmag.com/article2/0,2817,2330990,00.asp
04:43kotarakThere is much more.
04:44kotarakBut I don't know the details. I'm happy that I got done the screencasts like they are now. :) Let alone tune things...
04:45LauJensenAlright, thanks
04:47LauJensenWow, I'll need a new server, they accept 1GB uploads
05:40tomojis there a nokogiri for clojure?
05:40tomojor should I just use java stuff?
05:47tomojenlive looks promising
06:07lisppaste8Sofra annotated #84536 "untitled" at http://paste.lisp.org/display/84536#1
06:42LauJensentomoj: I dont know about nokogiri, but if youre looking for a functional parser, best bet is Enlive
06:42tomojLauJensen: thanks, just got it working a minute ago, looks great
06:43LauJensenYea, check out clj-me.blogspot.com for more from the creator
06:43tomojI do like being able to type css selectors as strings better, but eh
06:58LauJensenAtt Chouser rhickey or whoever manages clojure.org, there are still links pointing to google code under libraries.
07:10rhickeyLauJensen: thanks, fixed
07:10LauJensenrhickey: np :)
07:14LauJensenrhickey: Did you have a specific argument for not implementing import foo.*, or is it something thats coming later?
07:28rhickeyLauJensen: import * makes a mess
07:29rhickeyimports are runtime-enumerable, not just a compiler thing
07:29rhickeyand, given only selective imports, we might be able to use them to do more inference on host calls (not yet implemented)
07:31LauJensenAh ok - Good to know. I had the impression that this was strictly something that the compiler needed to handle, so why should I be bothered? :) Thanks for clearing it up
07:33LauJensenBtw rhickey. I have put some working into wrapping JMonkey, which ultimately is making a bunch of Java classes and then extending them. like VehicleClass would be extended with cannons etc to become a tank class. Im currently using only gen-class, but is this a use case of new new ?
07:35rhickeythe intended usage of new new is: define (or use existing) statically-named interfaces, make factory fns that call new new to make anonymous implementations of those interfaces. If that fit, sure, use it
07:35rhickeyin many cases people use named classes and explicit ctor calls when they shouldn't
07:38LauJensenThat doesnt fit unfortunately, I was looking forward to using it. Im not sure I understand how you would make the distinction between when its correct to use named classes and explicit ctor calls though.
07:38rhickeyonly when forced to
07:40LauJensenk
08:26LauJensenI have a project with many namespaces nested. In the top namespace foo, I want to import a static javaclass that I can reference like Priority/DEBUG. Can I make that automatically available to all namespaces beneath foo, like foo.bar, foo.baz, foo.bar.baz etc without having to specificially import priority in those namespaces, and without giving a fully qualitfied name
08:29ChousukeLauJensen: As far as I know, no.
08:36LauJensenOk
10:00l0st3dnewbie question: if I have a lazy list of things, how do I find out if the count is larger than a number or not, without necessarily traversing the whole list
10:00rhickeyl0st3d: there isn't a built-in limited count like that
10:01rhickeyeasy enough to write, but you will realize as much of the list as needed
10:02l0st3drhickey: ok, so I guess I'd like a little help in writing that
10:02l0st3drhickey: do I take-while?
10:04l0st3drhickey: I'm not sure how to write the predicate without a temporary variable
10:05rhickeyl0st3d: loop/recur should work. Give it a try and paste something
10:05rhickeylisppaste8: url
10:05lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
10:08lenst(defn count-larger? [coll n] (> (count (take (inc n) coll)) n))
10:10l0st3dlenst: oh - thanks ... that's a much better solution that the one I was in the middle of concocting
10:16Jomyootdo you guys recommend vanila emacs or cocoa emacs for OS X?
10:16cooldude127Jomyoot: cocoa emacs is now the official one
10:16cooldude127Jomyoot: emacs 23 uses cocoa, and it is now the stable release
10:16Jomyootwhat do you mean?
10:17Jomyootbut it is still different from the aquamacs?
10:17Jomyooti was talking about aquamacs sorry
10:17cooldude127i recommend plain emacs 23
10:17cooldude127aquamacs has had certain things not work for me that work on other platforms
10:18cooldude127colorschemes in particular are a problem
10:21Jomyootcooldude127: what do you use for directory browser, or project browser?
10:22cooldude127nothing. i use ido-mode for easy file navigation in the minibuffer but that's about it
10:22gkoYep, I also use standard Emacs on my Mac, no Aquaemacs.
10:22cooldude127Jomyoot: you could use ecb or speedbar if you wanted though
10:25l0st3dJomyoot: I like eproject : http://wiki.github.com/jrockway/eproject - it's also available in ELPA
10:39lisppaste8l0st3d pasted "compare the length of a seq" at http://paste.lisp.org/display/84623
10:40l0st3dlenst: decided on this - thanks
10:46rhickeyimportant enhancement to mutable vectors in chunks branch: http://github.com/richhickey/clojure/tree/chunks
10:47rhickeynow protects against use in multiple threads, prevents use after immutable! call
12:02LionessWhat does the EPL mean? Are all programs that have been programmed in Clojure, automatically under EPL because clojure.jar is necessary? Or can you choose other licenses for programs (GPL, BSD, proprietary)?
12:13danlarkinLioness: the latter
12:16Lionessdanlarkin: Thanks for the information. But how could I have found that out myself? I read the text of the EPL, but I find it not easy to understand. For example, in "3 Requirements": if I distribute object code I must do so in compliance with the terms and conditions of the EPL (wo I guess under the EPL), if I distribute source code, it must be "under this Agreement". What do I misunderstand? It's probably easy, once you have experience with
12:18danlarkinthe EPL doesn't cover code you write (unless you want it to, of course), only clojure itself
12:18LionessOkay, so the difference to the GPL is what is usually called "viral" and the EPL is not "viral", right?
12:19danlarkinyou can use gcc (GPL) to compile proprietary code, can't you?
12:19Lionessonly by special exception for libgcc (which I would see quite similar to clojure.jar)
12:22danlarkinoh, is that correct? That's not my understanding
12:23Chousukeyeah, the GCC licence contains an exception
12:24Lionesslibgcc2.c says: "In addition to the permissions in the GNU General Public License, the Free Software Foundation gives you unlimited permission to link the compiled version of this file into combinations with other programs, and to distribute those combinations without any restriction coming from the use of this file. (The General Public License restrictions do apply in other respects; for example, they cover modification of the file, and di
12:24clojurebotthis is not a bug
12:28danlarkinLioness: well I see your point now more clearly
12:29ChousukeLioness: the EPL FAQ says that you can combine EPL-licenced code with proprietary code. However, it seems that if you actually modify the EPL-licenced code itself and distribute it, you need to distribute the modifications as well.
12:31Chousukeso it seems you can't take Clojure, modify it, and then start distributing closed-source copies of it. You can, however, take clojure as is, use it with proprietary code, and distribute the result under your own licence.
12:34LionessI have no idea how the topics "linking" or "derivative" are generally dealt with in the Java world, coming more from a C background. I was just thinking about the FSF's stance, that all Emacs Lisp programs have to be GPL'ed. But I see I'll have to read the EPL FAQ in detail (thanks, I didn't know it existed) and understand, which situations are covered by answer 17 ("the EPL portion") and what exactly is deemed a "module".
12:34LionessChousuke: But your interpretation sounds plausible and sensible.
12:36Chousukewith lisp, it gets even messier because of macros :P
12:36Chousuke*technically* if you use a clojure macro in a lisp program, you're introducing EPL code to it.
12:38danlarkininteresting
12:38LionessChousuke: Sure, but I'm doing it with every special form, not just defmacro. Even when using a macro the result should be *my* work, since I have defined the transformation, right?
12:38Chousukesince I suppose it can't be argued that you've *modified* the code, it should not be a derivative work. And I'm sure it's not Rich's intent either.
12:41ChousukeLioness: if the macro is defined in the Clojure library, you're not the one who defines the output; you're simply passing it the parameters and the macro generates code for you.
12:41ChousukeTemplates in C++ are similarly problematic I suppose.
12:43wtetznerwell, technically macros are just functions, right?
12:43Chousukewell, yeah
12:43wtetznerit's just that they're called at compile time
12:44mebaran151is there any more elegant way to pass a macro like a function
12:44Chousukemebaran151: that rarely makes any sense.
12:45Chousukebut if you need to, you can use #'macroname
12:45mebaran151I was thinking of something like (reduce and [all my booleans])
12:45mebaran151actually I guess I could use every now that I think about it
12:45LionessChousuke: Yes, but I think it doesn't differ substantially from other special forms. I cannot use "def ..." with the JVM, I need clojure.jar. Using Clojure's language features surely involves CLojure's code. And that's basically where my question arouse: I depend on EPL code not unlike the C concept of "linking"
12:46mebaran151isn't this the whole reason for a classpath exception?
12:47Chousukemebaran151: hm. yeah, you definitely should use every
12:47LionessThe FSF takes a really broad stance in that regard, btw: They consider all Emacs Lisp code to be covered by the GPL, as far as I know.
12:47Chousukethough the vars of macros have an interesting property:
12:47Chousuke,(#'and 1 nil 3)
12:47clojurebot(clojure.core/let [and__4012__auto__ 1] (if and__4012__auto__ (clojure.core/and nil 3) and__4012__auto__))
12:47Lionessmebaran151: That's probably the Java counterpart to the libgcc- and the system library exception?
12:49ChousukeVars forward calls to them to the underlying value, which in the case of a macro happens to be the function that produces the macro expansion :P
12:49Chousukenot very useful in practice though.
12:49mebaran151interesting
12:50Chousukeand you can make a macro out of any function by calling .setMacro on it.
12:52Chousuke,(.setMacro #'+)
12:52clojurebotnil
12:52Chousuke,(let [foo 1] (+ foo 1))
12:52clojurebotjava.lang.RuntimeException: java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number
12:52Chousuke,(alter-meta #'+ dissoc :macro)
12:52clojurebotjava.lang.Exception: Unable to resolve symbol: alter-meta in this context
12:52Chousuke,(alter-meta! #'+ dissoc :macro)
12:52clojurebot{:ns #<Namespace clojure.core>, :name +, :file "clojure/core.clj", :line 629, :arglists ([] [x] [x y] [x y & more]), :inline-arities #{2}, :inline #<core$fn__4091 clojure.core$fn__4091@14ef239>, :doc "Returns the sum of nums. (+) returns 0."}
12:53Chousuke,(alter-meta! #'and dissoc :macro)
12:53clojurebot{:ns #<Namespace clojure.core>, :name and, :file "clojure/core.clj", :line 503, :arglists ([] [x] [x & next]), :doc "Evaluates exprs one at a time, from left to right. If a form\n returns logical false (nil or false), and returns that value and\n doesn't evaluate any of the other expressions, otherwise it returns\n the value of the last expr. (and) returns true."}
12:53Chousuke,(and 1 2)
12:53clojurebot(clojure.core/let [and__4012__auto__ 1] (if and__4012__auto__ (clojure.core/and 2) and__4012__auto__))
12:53Chousuke:P
12:54Chousuke,(alter-meta! #'and assoc :macro true)
12:54clojurebot{:macro true, :ns #<Namespace clojure.core>, :name and, :file "clojure/core.clj", :line 503, :arglists ([] [x] [x & next]), :doc "Evaluates exprs one at a time, from left to right. If a form\n returns logical false (nil or false), and returns that value and\n doesn't evaluate any of the other expressions, otherwise it returns\n the value of the last expr. (and) returns true."}
12:54Chousukehm
14:46gnuvince"C'est à mon mononcle!" -Guerre de Tuques
15:01MarkVolkmannThe doc for commute says "At the commit point of the transaction, sets the value of ref to be:
15:01MarkVolkmann(apply fun most-recently-committed-value-of-ref args)".
15:01MarkVolkmannLooking at the source code in LockingTransaction.java, that doesn't seem to be the case.
15:01MarkVolkmannI see this:
15:01MarkVolkmannf.fn.applyTo(RT.cons(vals.get(ref), f.args))
15:02MarkVolkmannvals is a HashMap of in-transaction values, not most recently committed values.
15:02MarkVolkmannIs it possible the doc string for the commute function is wrong?
15:05LauJensenBig question :)
15:06MarkVolkmannI'll ask it again on the mailing list.
15:14LauJensenGood idea
15:15LauJensenI have a question also. I'm implemented a small webchat which updates by polling a servlet for recent posts in the chatroom. How would I go about removing the polling and instead pushing to the clients ? (ala, CLs Symbolic Web)
15:16waltersLauJensen: the typical trick is to do a HTTP request which only returns when there are changes
15:16LauJensenHow long will one such linger?
15:16waltersas long as possible, if it breaks just do another
15:18LauJensenOk - Do you have example of this floating around somewhere, it sounds interesting
15:19waltersLauJensen: http://xmpp.org/extensions/xep-0124.html
15:20LauJensenI'll have a read, thanks
16:00cgrandMarkVolkmann: look at the if(!sets.contains(ref)) a few lines above, it retrieves the latest value
16:03mebaran151where should I put test packages?
16:50slaneyI am messing around in the REPL, and finding that using integers as keys for maps, so I can randomly generate the keys, doesn't work as I expected.
16:50slaneyhttp://gist.github.com/160207
16:53hiredmanDoubles are Doubles
16:53hiredmanIntegers are Intergers
16:53LauJensenslaney: Baz is a Long
16:53slaneyI figured it was something to do with Typing
16:53hiredmanLongs are Long
16:53slaneyheh
16:54hiredmanetc
16:54slaneywhen I called (integer?) on them, they both return true
16:54slaneybut, you are saying that doesn't matter?
16:54LauJensenCall class
16:54slaneyk
16:54hiredman,(doc integer?)
16:54clojurebot"([n]); Returns true if n is an integer"
16:54hiredman,(integer? (double 1))
16:54clojurebotfalse
16:55hiredmanhrrm
16:55slaneyok, so 1 is an Integer, and bar is a Long
16:55hiredmanMath/round returns a long
16:55slaneycan I cast it?
16:55hiredmansure
16:56slaneyk
16:56slaneyI will look that up
16:56hiredmanint, long, double, etc
16:56slaneythanks
16:56slaneygot it
16:56slaneythanks
16:56slaneyuser=> (foo (int bar))
16:56slaney"foot"
16:57hiredman,(class (first (keys foo)))
16:57clojurebotjava.lang.Exception: Unable to resolve symbol: foo in this context
16:57slaneyyeah, it returns in Integer
16:58slaney*an
16:58hiredmanhmmm
16:58hiredman,({1 :foo 2 :bar} (int 1))
16:58clojurebot:foo
16:58hiredman,({1 :foo 2 :bar} (long 1))
16:58clojurebotnil
16:58hiredman,({1 :foo 2 :bar} (Integer. 1))
16:58clojurebot:foo
16:59hiredman*shrug*
16:59slaneyheh, those are more succinct examples, but yeah
16:59hiredmanI would start a new repl to make sure everything is as you think it is
16:59slaneytrue
16:59LauJensen~seen blackdog
16:59clojurebotno, I have not seen blackdog
16:59LauJensenAnybody know what happend to him ?
17:05arbschtblackdog's last appearence in my log is in March
17:14LauJensenThats a shame, he had an interesting take on webdevelopment
17:15LauJensenBut - Denmark is approaching midnight, good night to all in Clojure land :)
19:47JAS415classpath so frustrating
19:47JAS415argh! :-P
19:52JAS415ah there we go...
21:53mebaran151does apply work with lazy-seqs?
21:53mebaran151(apply #(lazy-cat %) (drop 1 (iterate fetcher from))) << needs to be lazy
22:09Chousermebaran151: I don't think that'll come back, but it's more because of lazy-cat than apply
22:09Chouserwhat are you actually trying to do?
22:09mebaran151I'm reworking by wrapping fetcher to return a lazy-seq
22:10Chouserok
22:10mebaran151I'm trying to fetch records from a bdb n at a time
22:10mebaran151so I have a function fetcher that knows how to get 10 more records
22:12mebaran151and I'd like to automatically get more records when the user iterates past the ones we've already gotten
22:19mebaran151to get more I can pass the collection, fetch the last one and restart the cursor from there
22:27mebaran151if I concatted a collection created from iterate, it would maintain its laziness correct?
22:49Chousersure
23:48Chouserhuh. gen-class isn't a good substitute for gen-sym
23:48Chouserof gensym for that matter