#clojure logs

2009-08-05

00:47JAS415If I create anonymous functions, do I eventually get the memory back from them, or is it lost forever to the Java GC Gods?
00:52JAS415looks like its ok
00:58prospero_is there a difference between (int-array 1) and (make-array Integer/TYPE 1)?
00:58prospero_is one unboxed and the other boxed?
00:58hiredman~def int-array
01:00hiredman,(class (int-array 1))
01:00clojurebot[I
01:01hiredman,(class (make-array Interger/Type 1))
01:01clojurebotjava.lang.Exception: No such namespace: Interger
01:01hiredman,(class (make-array Integer/Type 1))
01:01clojurebotjava.lang.Exception: Unable to find static field: Type in class java.lang.Integer
01:01mebaran151why is there int array and long array but no byte array
01:01hiredman,(class (make-array Integer/TYPE 1))
01:01clojurebot[I
01:01prospero_hiredman: isn't there an implicit boxing when you ask for the class?
01:02mebaran151as in int-array and long-array
01:02hiredmanugh, github is murder on netbook
01:02hiredmanprospero_: arrays are not boxed
01:03prospero_hiredman: ok, thanks
01:04konjGuys, can I easily create a program that allows me to draw points in a loaded image using clojure? Is there a widget for something like this in some GUI toolkit?
01:27carkKONJ DID YOU HAVE A LOOK AT THE JAVA API ,
01:27carkhum oops
01:27carkdidn't mean to shout
01:28konryes, I'm reading about Swing
01:28carkanyways had good success doing nice stuff with it
01:28konrapparently, I can draw in a canvas
01:28carkright
01:28konrwill I be able to do it with Clojure?
01:28carkyep
01:29konrsounds great, then!
01:29konreasily creating a GUI application in a Lisp Dialect still sounds like a dream, though
01:30carkwith clojure it's not a dream anymore
01:30carkyou have plenty opions within the java world
01:30carkoptions*
01:31carkyou might do everything programmatically, or use a java IDE for design and use the result from clojure
01:55JAS415I'm using hash tables to hold window description and proxy/anonymous functions to add listeners to things
01:56JAS415is actually very clean
01:56JAS415get a nice MVC separation and easy access/modification to stuff inside your windows
01:59tomojclojure.test says "you can use nested tests to set up a context shared by several tests". does that mean via binding?
02:49tomojI take back what I said about preferring css selector strings to enlive's syntax
02:49tomojenlive's syntax rocks
03:01tomojwhat's the function that composes two functions?
03:01tomojoh, comp
03:03cgrandtomoj: what makes you prefer enlive's selectors syntax over css syntax?
03:05tomojcgrand: [:tr #{:.tbon :.tboff :.tb}]
03:06tomojvs. tr.tbon, tr.tboff, tr.tb
03:06tomojand I imagine it goes deeper
03:18lisppaste8cgrand annotated #84716 "lazy-union" at http://paste.lisp.org/display/84716#1
03:32mebaran151distinct is lazy?
03:33mebaran151whoa
03:34mebaran151that's ... insane: to think hiredman had said it couldn't be done
03:34mebaran151ha
03:41mebaran151in the end it became a trivial one liner
03:55tomojsay you have a map with a :content key, the value of which is a vector. each element in the vector can either be another map with a :content key and similar value or a string
03:55tomojhow would you recur through and just concat all the strings, depth-first?
03:59mebaran151recursive map it with a function that takes either a hash or a string, return output at string, or mapping itself when presented a collection
04:00tomojthe "recursive map" is my problem I think
04:00tomojwell all the attempts I have tried using map ended up returning results that were still nested
04:00tomojbut no map will really work as far as I can tell, since recur needs to be in tail position
04:02mebaran151to unnest, try apply concat
04:02mebaran151(that's how flatteners work underhood)
04:02mebaran151you probably want some clever combination of apply concat to specific output and recursively mapping
04:03tomojbut what does "recursively mapping" mean?
04:07tomoj(apply str (map my-function arg)) works, but that's evil
04:12tomoji.e. the call-stack could blow if there is a bunch of nesting
04:12tomojin my case there won't ever be a bunch of nesting, so I guess I'll settle for this for now..
04:13hiredmantomoj: there is always reduce
04:14hiredman,(reduce str (map char (range 90 100)))
04:14clojurebot"Z[\\]^_`abc"
04:14tomojbut doesn't that still leave no place for `recur` ?
04:15tomojI imagine the problem is that I'm not thinking functionally
04:15hiredmansorry, I haven't really read up
04:16hiredman,(reduce str [(map char (range 90 100)) (map char (range 80 90))])
04:16clojurebot"clojure.lang.LazySeq@5d68f306clojure.lang.LazySeq@d6720cc6"
04:16hiredmanwhoops
04:18tomojthis is what I have http://gist.github.com/162589
04:18tomojignore the '*'
04:18tomojit works, but no TCO
04:19hiredmanso you want a flattened sequence of strings that you can turn into one string
04:19tomojthat would be fine
04:19tomojthat code just returns one string
04:20hiredman,x
04:20clojurebot{:content ["foo " {:content ["bar " "baz "]} "biz"]}
04:21tomojwut
04:21hiredmansshhh
04:21tomojhax?
04:21hiredmandon't worry about it
04:21hiredmanwait
04:21hiredmanhold the phone
04:22hiredman,(doc tree-seq)
04:22clojurebot"([branch? children root]); Returns a lazy sequence of the nodes in a tree, via a depth-first walk. branch? must be a fn of one arg that returns true if passed a node that can have children (but may not). children must be a fn of one arg that returns a sequence of the children. Will only be called on nodes for which branch? returns true. Root is the root node of the tree."
04:22tomojah, nice
04:22hiredman,(tree-seq map? :content x)
04:22clojurebot({:content ["foo " {:content ["bar " "baz "]} "biz"]} "foo " {:content ["bar " "baz "]} "bar " "baz " "biz")
04:22hiredman,(remove map? (tree-seq map? :content x))
04:22clojurebot("foo " "bar " "baz " "biz")
04:22hiredman,(apply str (remove map? (tree-seq map? :content x)))
04:22clojurebot"foo bar baz biz"
04:23tomojok, now I will go try to figure out what the heck that's doing :)
04:23tomojthanks
04:23tomojI suspected there would be a nice one-liner
04:23hiredmanmy pleasure
04:24tomojoh, I see. tree-seq gives you all the nodes, but I only want leaves
04:34gko`
04:35gko?
04:35hiredman¿
04:35gkosorry, wrong window...
04:47gkoHow do you protect concurrent access to a socket in clojure?
04:47jdzwhat concurrent access?
04:48gkoone socket, three threads use it to send requests.
04:49jdzwhy?
04:49jdzyou can't send 3 requests at once, can you?
04:49gkothat's why I ask: how do you protect?
04:50jdzno, that's a wrong question, really
04:50cgrandyou can use an agent (whose value is the socket) to serialize access to it
04:50cgrandbut I agree it seems wrong to share a socket between threads
04:50jdzgko: you want only one thread to do the socket interaction
04:51jdzgko: and as cgrand suggested, agents is one way to do it
04:52gkoOK... I'll try with the agent.
04:55gkoThanks.
06:46ennuiSlime: Does slime-edit-definition (M-.) work for you on functions compiled by slime's interactive compile commands (like C-c C-k)?
07:10jdzennui: source location information is recorded only when loading/compiling whole files
07:38ennuijdz, thanks, but doesn't slime-compile-and-load-file (C-c C-k) exactly do that?
07:39jdzennui: that i cannot tell. my feeling is that it should.
08:06cemerickhopefully clojure-in-clojure will make the path to userland reader macros more clear. Putting together an xpath-esque query language without them is not pretty.
08:30tomojI thought the clojure dude didn't want reader macros
08:30tomojcemerick: ^
08:44cemericktomoj: I'm not sure that rhickey ever said he "doesn't want" reader macros -- I think he's (rightly) more concerned with various issues associated with them (namespacing, for one, IIRC)
08:44cemerickthat said, they're an incredibly useful (in some cases, invaluable) tool, so I'm rooting for them.
08:45cgrandrhickey: https://www.assembla.com/spaces/clojure/tickets/166-TransientHashMap first cut, rather crude
08:48tomojgithub is just slow today
08:49cgrandthanks
08:49rhickeycgrand: have you got a repo I can pull to try it out rather than deal with patches yet?
08:50cemerickseems like a chronic problem lately
08:50cgrandshould be in master here: git://github.com/cgrand/clojure.git
09:14Chousukecemerick: I'm working on a simple (rather ad-hoc) clojure reader at the moment. It's not yet usable though.
09:17ChousukeI suspect it would blow up if you had a *really* deeply nested list :)
09:18cemerickChousuke: it's definitely worthwhile.
09:18cemerickIIRC, it's not the impl of reader macros that was blocking things -- it's how they're integrated into the environment
09:22Chousukehmm, blows up with a list 10000 levels deep :/
09:22Chousukecan handle 1000 though.
09:22alinphi
09:22alinp(defn sum-list [list acc]
09:22alinp (if (zero? (.size list))
09:22alinp acc
09:22alinp (recur (rest list) (+ (first list) acc))))
09:23alinpcam this be considered tail call optimized ?
09:23Chousukeif it works, it is tail recursive
09:23alinpas far as I know, clojure doesn't have TCO
09:23Chousukerecur throws an exception if it's not in tail position
09:23alinpthat's why I asked
09:23alinpoh
09:23Chousukethat's why recur exists :)
09:23alinppretty smark :D
09:23alinp*smart
09:23alinp:)
09:23alinpthanks
09:23Chousukeanyway, (apply + yourlist) :P
09:24alinpyeah ... but is just a proof of concept you know
09:24Chousuke(and use (count list) instead of .size)
09:24alinpoh, count :)
09:24alinpforgot about that
09:24Chousukethough even more idiomatic would be (if-not (seq list)
09:24alinpbeside of (apply) we have reduce
09:24alinpafaik
09:24alinpI could use that
09:25Chousukethey're almost identical in this case.
09:25Chousuke+ uses reduce internally for more than 2 args
09:25alinpuser=> (reduce (fn [x y] (+ x y)) (list 1 2 3))
09:25alinpyeah
09:25Chousukealinp: (reduce + [1 2 3]) works
09:25alinpyeah, true
09:26Chousukeit's so easy to make those unnecessary lambdas :P
09:26Chousukeanother common one is (map #(foo %) ...)
09:26Chousukewhen (map foo ...) is equivalent and probably faster
09:30cemerickI stumbled across some of my first clojure (from ~14 months ago) a few weeks ago, where I did exactly that: (map #(foo %) ...) :-/
09:31konrIs clojure fast for webservices? I'll have to migrate my PHP system because it is running too slow, but I'm not sure to what.
09:32konrThe main task is querying a MySQL database and creating a bunch of .html pages.
09:34eevar2konr: profile your existing app before you start rewriting
09:34cemerickkonr: roughly as fast as Java (which is pretty darn fast), especially for web stuff (since I/O is the prime bottleneck there)
09:35eevar2if you don't know your bottlenecks, optimization is just wasted effordt
09:35eevar2butterfingers++
09:37rhickeycgrand: got any test code at hand you can paste?
09:38Chousukehm
09:38ChousukeI wonder if people will ever need to read a single datastructure that's over a thousand levels deep :P
09:39cemerickChousuke: should probably count on it *shrug* Just think of stuff emitted by prn or print-dup
09:42Chousukelooks like the limit is around 2000 for nested empty lists.
09:42eevar2Chousuke: preallocated array? or running out of stack space?
09:42Chousukestack space
09:42Chousukemy reader is recursive. (recursion makes things so simple...)
09:42eevar2bleh, that's what -Xss is for ;)
09:43ChousukeI guess I'll just write this thing so it's half way usable first
09:45Chousukeregular clojure programs would have no problem I guess. at most ten to twenty levels of nesting.
09:45eevar2konr: otoh, clojure+postgres is vastly better to work with, which might warrant a rewrite for no other reason ;)
10:04Fossithis goddamn lazyness
10:04AWizzArdIt's good, isn't it?
10:04Fossione day i'll get it. or become it? ;)
10:05lisppaste8cgrand pasted "some tests" at http://paste.lisp.org/display/84818
10:05Fossii always fall for map (fn-for-sidefx) something
10:05Fossii even go and ty it on the repl
10:06Fossiand mystically, it works
10:06jdzi use doseq when i want sideffects
10:07rhickeycgrand: thanks, although I think your proxy hashcode dominates and blurs the true speed diff
10:08Fossijdz: good idea
10:09cemerickFossi: map is *always* lazy. There's doall and dorun, but that's hacky (IMO)
10:09cgrandrhickey: I just noticed a gross bug and pushed the fix
10:09lisppaste8rhickey annotated #84818 "transient map string keys test" at http://paste.lisp.org/display/84818#1
10:10Fossiyeah, doseq is a vey good idea
10:11rhickeycgrand: got it, thanks
10:11rhickeycgrand: so it looks good - thanks very much! I had a bit of trouble tracking the ensureEditable responsibility
10:14rhickeycgrand: surprisingly a 3-5x boost, I didn't think it would do that well with compressed inner nodes, since there is still a lot of new allocation
10:15cgrandfor inner nodes, we can suppress the allocation for the Node itself and assign nodes to the new array
10:16rhickeycgrand: yes, but if arrays of 32 we wouldn't need new arrays, although as with the vector there is lots of logic using the array lengths :(
10:17rhickeyI also got rid of the box when I revisited vector, not sure if we could with hashmap
10:17rhickeyso many vector ops do no alloc at all once on writable nodes
10:17rhickeybut you did the right thing to preserve existing functionality - too easy to break
10:18cgrandmy question about amortized O(1) for persistent! was about performing some cleanup (eg trimming inner nodes) when perssitent! is called. The clean-up cost can be amortized on updates
10:19rhickeycgrand: I don't think that's worth it. I'd rather have a heuristic on using bitmapped indexed node. Chances are good once > 50% full would pay to use full-sized arrays and get rid of the bitcount call
10:21rhickeythis both for transient use and not
10:23cgrandyesterday you mentioned ideas about getting rid of LeafNode, could you elaborate?
10:25rhickeycgrand: yes, I'd like to avoid allocating a holder object for the leaves and instead hold the key and val in the next level higher. the array would then be a mix of INode ptrs and keys, and there would be a second array for vals
10:26rhickeyif INode, you need to traverse down, else is key and same index in vals is value
10:26rhickeyOverall I think this would use less memory and many fewer objects
10:27cgrandtwo arrays or a single interleaved array?
10:27rhickeycgrand: dunno, would try both
10:28rhickeyif you are interested, what I was going to do was explore all of these ideas with a new hashed set based on newnew, one not based on a dummy map. It wouldn't need the second array/interleaving since only keys, but a place to explore a simpler node model
10:28rhickeyso, hashed set written entirely in Clojure
10:30cgrandI haven't touched to newnew yet, it could be interesting. Have you written some code so far?
10:31rhickeycgrand: just swapped out some proxies, but it is quite simple, as it would be to define in terms of proxy, just proxy could never be fast enough. new new is
10:33rhickeythe only thing missing from new new is non-reflective self calls, which would make helper methods slower, but self-call method resolution is coming
10:33rhickeyvolatile (a la mutable fields) is there
10:33rhickeyalthough mostly the collection mutate arrays
10:36rhickeyyou can derive from supers with no arg ctors, so can use j.u.Abstract*
10:37Jomyoothow would I collect results of (with-query-results) into a non-lazy seq?
10:38rhickeyJomyoot: (vec lazy-thing) -> non-lazy vector
10:38Jomyoothmm
10:38Jomyootthanks
10:39Jomyootis there benchmark of transient yet?
10:40cemerickJomyoot: vectors are here: http://clojure.org/transients
10:40cemerickmaps appear to be en route
10:41cemerickrhickey: ssssshhh! We're trying to do some marketing over here ;-)
10:41rhickeytransients rock!
10:41rhickeythat's marketing
10:41cemerickthere ya go :-D
10:42rhickeycgrand: so, how do you feel about the transient map patch?
10:43cemerickrhickey: you'll know clojure's "made it" when you see articles like "Improve your POJOs' performance with clojure transients"
10:44rhickeyscary
10:44cemerickyup
10:44cgrandrhickey: rather confident (I didn't rework existing functionality) but not happy with all the allocation that is still going on
10:46rhickeycgrand: that allocation is just what was happening before though, right? so just a future opportunity we need not pursue now (in an effort to preserve integrity of existing logic). I think the current 3-5x speedup is tangible and worth it
10:47rhickeydoes your patch on assembla have your latest fix?
10:47Jomyootwhat is similiar to for-each in clojure
10:47cgrandnot yet -- git guys: is there a way to bundle all my commits into one?
10:48Jomyootwhere you need side effecs
10:48ChousukeJomyoot: doseq
10:48cemerickcgrand: interactive rebase, with squashing
10:48rhickeyI guess I could just merge here...
10:48Chousukecemerick: git rebase --interactive branch-to-rebase-on
10:49cemerickindeed, although -i is a lot shorter than --interactive
10:49rhickeycgrand: I don't like squashing
10:50Chousukeyou don't have to squash everything though. :)
10:50rhickeywhat's wrong with the truth?
10:50Chousukerhickey: well, if you happen to have a silly mistake in your history that breaks the build, it'll make bisecting real problems more difficult.
10:51cemerickI often commit in bits and pieces, each step of which may or may not work, then I squash into a functional chunk.
10:51Jomyootwill error reporting get improved?
10:51Jomyootit's hard to find where error is
10:51cemerick(may not work on its own, that is)
10:51rhickeyChousuke: otoh, if at the end you discover that some intermediate step broke something it won't be there to bisect
10:52Chousukewell, yeah, if you squash too much that can happen
10:52rhickeyno one can help you see where you went wrong
10:52rhickeycan't go back to an old idea that proved better
10:52ChousukeI tend to use --patch to *split* things in addition to squashing silly commits :)
10:52rhickeyit's not like people are going to be randomly pulling down one of your interim commits just for fun
10:54cgrandrhickey: I uploaded another patch but if you chosse to merge you'll get the patch for #165
10:54Chousukebut sometimes you might end up committing something that's very clearly not working, just to get it into version control (if you have to work on something else for example)
10:54cemerickrhickey: people won't, but hudson, etc., will...so if any particular changeset isn't kosher, you're going to get false negatives
10:54cemericknot an issue with clojure (atm!), but anyway...
10:55rhickeytracking systems that force things that don't work to be out of the system are... not very useful
10:55Jomyootclojure is like RPN calculator
10:56Chousukebtw, can someone write me syntax-quote as a macro? I tried to do it yesterday myself but it is not easy :>
10:57ChousukeI had some success using the syntaxQuote method from SyntaxQuoteReader but that's cheating :P
10:57Jomyootwhat's cool about clojure is i can make a lot of guesses . most of the time i am right
10:57cemerickrhickey: well, something that trips hudson will trip a real person too (e.g. anyone closely tracking HEAD) *shrug*
10:58rhickeycemerick: I disagree, if I just pulled 26 commits from cgrand, I don't care if #17 didn't build
10:58rhickeyit has to do with the granularity of transfers, not of commits
10:58cemerickit's a race condition -- if you happened to pull when HEAD was #17...
11:00rhickeycemerick: in a single-repo/branch situation, yes, but in a "I'm at a good spot, try it" situation no
11:00cemerickoh, sure. Coordination definitely helps just about everything.
11:00rhickeypush/pulls have coarser granularity than commits
11:01rhickeyif they happen at stable points the interim commits shouldn't matter
11:05rhickeywhat's this about from git am? "warning: 2 lines add whitespace errors."
11:06Chousuketrailing whitespace somewhere.
11:06Chousukegit can be configured not to complain, but I can't recall how :P
11:07cemerickChousuke: http://www.nabble.com/git-warning-about-whitespace--td19730533.html
11:08cemerickcore.whitespace looks to be the most relevant config variable
11:08Jomyootrhickey: are you going to come up with web framework for clojure as well?
11:08Chousukehm. I need to replace magit with egg ;/
11:08Jomyootrhickey: i think we can do very well if we have something like rails writtein with clojure
11:08Chousukemagit is ... spartan.
11:09fffejjomyoot: have you seen Compojure?
11:09Jomyootit does not have database and backend stuff
11:09Jomyooti thought compojure is for frontend
11:09cemerickJomyoot: clojure can be used with just about any of the 100's of java web frameworks
11:10gkoOr use Clojure for creating applications on Eclipse.
11:10gkoClojure for Eclipse = Emacs Lisp for Emacs ?
11:11Jomyootyep
11:11Jomyootbut rather have something in pure clojure
11:11Jomyootrather than having to do the interop thing
11:11Jomyootit's not lispy
11:11gkoyep
11:19rhickeywhile not showing up in github UI, transient support for persistent hash maps is up in master - thanks to cgrand!
11:21cemerickcgrand: I raise my tea to you, sir! :-)
11:24cemerick11sies? onesies? hrm.
11:24rhickeyI don't suppose 'Clojure is for tea drinkers' is much of a slogan
11:25cemerickrhickey: yeah. No more marketing for you. ;-)
11:25rhickey:(
11:25cemerickI'm not an *actual* tea-drinker, though. Diet raspberry snapple.
11:26Chousukerhickey: sets to go. I suppose they're rather similar to maps?
11:26rhickeycemerick: that truly qualifies as "not actual"
11:27cemerickbut it says it's tea! *right on the bottle*! :-P
11:27cemerickI've been hooked on the stuff since college.
11:29cgrandChousuke: right now sets are far easier since they delagate everything to a map
11:39arohnerI have a recursive function that it's not convenient to recurse in the tail position. What is a good rule of thumb for how many times I can recurse in a non-tail position before blowing the stack?
11:41Chousukegranted, it just calls java...
11:41Chousukebut it works!
11:43ChousukeI wonder how much of Clojure expects the reader to work with a PushbackReader
11:45ChousukeMy reader just expects a sequence of lines, though wrapped in a map so I can number them
11:53danlarkincould you use metadata for that instead of a map?
12:00Chousukedanlarkin: Can't stick metadata on strings :/
12:00danlarkinChousuke: *doh*! that always gets me
12:07gkohow to create a sequence of X items in a list by calling X times the same function which has no argument? Add arity 1 parameter to call the arity 0 function, so one could (take X (iterate my-function (my-function))) ?
12:08ChousukeI think I need to figure out a saner way to skip whitespace.
12:08stuartsierra,(doc repeatedly)
12:08clojurebot"([f]); Takes a function of no args, presumably with side effects, and returns an infinite lazy sequence of calls to it"
12:08Chousukecurrently, the reader returns a *skip* object and I filter them out :P
12:09gkostuartsierra: thanks!
12:20stuartsierrawelcome
12:21Chousukehmm.
12:21ChousukeI pushed my WIP on github but github's apparently slow to update :P
12:31LauJensenGood evening gents
12:38mebaran151how would one encode a data in a lexograhically sortable format?
12:42fffejmebaran: do you mean encode a date? if so, ISO 8601
12:46mebaran151new to the Java libs, so what's the easiest way to make one of these, say for the current Time
12:47fffejJoda time is my favourite, check out http://joda-time.sourceforge.net/
12:47cemerickyou can very easily emit ISO 8601 with the standard DateFormat
12:57jwhitlarkstuartsierra: is that your post on blog.law.cornell.edu?
13:04jwhitlarkhiredman: what's clojurebot's command to see when someone was last online? I've seen it used, but can't find it in the docs...
13:08cemerick~seen Chouser
13:08clojurebotChouser was last seen quiting IRC, 1732 minutes ago
13:08cemerickjwhitlark: ^^
13:08jwhitlarkthanks!
13:09jwhitlarkah, that would explain it, seen isn't in http://clj.thelastcitadel.com/clojurebot, and I didn't want to clutter the channel with experiments. (that aren't about clojure :-)
13:09jwhitlark~seen stuartsierra
13:09clojurebotstuartsierra was last seen in #clojure, 49 minutes ago saying: welcome
13:11leafwjcip
13:11leafw~jcip
13:11clojurebotjcip is Java Concurrency in Practice
13:14stuartsierrajwhitlark: yes, that's my article on VoxPopuLII: http://blog.law.cornell.edu/voxpop/2009/08/05/tidying-up-the-law/
13:17jwhitlarkit's interesting. As an ex-accountant, I strongly agree.
13:17stuartsierrathanks
13:18jwhitlarkI'd have much rather read tax law as code, then what it is now ;-)
13:18rhickeystuartsierra: nice read
13:19stuartsierrathanks
13:19stuartsierraClojure is helping to further the goals of democracy!
13:20jwhitlarkdemocracy can certainly use all the help it can get.
13:23rhickeystuartsierra: I love that about Clojure!
13:25jwhitlarkI'll tell you, I'm attempting projects in clojure I wouldn't have dreamed of trying in another language. My favorite to date is python, and I get lots done with it, but clojure just seems to open new horizons.
13:48LauJensenstuartsierra: Did you read James Reeves reply to my Long Live HTTP connections post?
13:49stuartsierrano
13:49LauJensenYou'll find backing for your argument last night, and a solution :)
13:51stuartsierracool, where was this?
13:52Chousukehmm
13:55LauJensensec
13:55LauJensenstuartsierra: http://groups.google.com/group/compojure/browse_thread/thread/1f0df9d6656fa069
13:56stuartsierranice, thanks
13:56LauJensennp
13:56stuartsierraI didn't realize Java could handle "a few thousand threads"
13:57Chousukegah.
13:57ChousukeWhy does my emacs insist on using tabs
13:57LauJensenJames never seizes to amaze me with the answers he gives on the group
13:57ChousukeI'm pretty sure I have told it not to.
13:57LauJensenHmm, I think I meant 'ceases'
13:58cemerickjeez, $60 for a mass-market programming paperback?
13:58cemericksorry, wrong chan
13:59LauJensencemerick: Yea, looks like it belongs in #grumpyoldmen
14:00cemerickhuh, I figured that sentiment would be widespread. Most paperbacks I see top out at ~$40
14:00jwhitlarkIs http://clojure101.blogspot.com/2009/05/creating-clojure-repl-in-your.html still the best way to go about embedding a repl in an application to be connected to over the network?
14:00cemerickLauJensen: but :-) anyway
14:00rsynnottstuartsierra: modern operating systems can manage quite a few threads without getting bogged down
14:01rsynnottcemerick: could be worse. Medical textbooks are often _hundreds_ of euro
14:01cemerickjwhitlark: yes, we use the enclojure REPL library...though our wrapper for it is a lot smaller than the one on that page....
14:01rsynnott(even while being mass-market paperbacks)
14:03cemerickrsynnott: I just wish there was some sanity to it all. $30 for the terracotta paperback (or any random "popular" programming topic, e.g. spring, whatever), but $60 for this other title (a Netbeans book).
14:13Neronussince commit b75cdb8b61e0fd4e83934e29d5ddaf78296ba7a7 clojure doesn't build for me. Sorry if this has already been mentioned
14:14rhickeyNeronus: doesn't build and does what?
14:15Chousukefails to build for me too
14:15rhickeyfails how?
14:15Chousukefails to find symbol; symbol : method copyOf(java.lang.Object[],int)
14:15Chousukeon line 333 of PersistentArrayMap.java
14:16Neronushttp://paste.lisp.org/display/84843
14:16NeronusWhat Chousuke says :)
14:17rhickeyah, cgrand used a Java 6 API
14:17Neronusjava -version
14:17Neronusjava version "1.6.0_14"
14:17ChousukeNeronus: the buildfile specifies a 1.5 target
14:17Neronusahh
14:17Chousukeit's still a bug though, Clojure targets 1.5 :)
14:19LauJensenWhy are we targeting 1.5 ?
14:19stuartsierraLots of big deployments are still on 1.5
14:19Chousukeprobably because rhickey has a mac :P
14:19stuartsierrathat too
14:20LauJensenChousuke: I'm on a Mac too, with 1.6 :)
14:20stuartsierrabig Java deployments, that is
14:20ChousukeLauJensen: yeah, but 1.6 is 64-bit only, and fairly recent.
14:20Chousukeon OS X that is.
14:20LauJensenChousuke: Sure, but ofc Im not using OSX :)
14:20Chousuke:P
14:21ChousukeCoding Clojure is too much fun sometimes.
14:21ChousukeI want to continue working on my reader, but I'm getting tired so I think I won't.
14:21rsynnottno doubt all part of Steve Jobs' evil plot to keep Java down :P
14:21ChousukeI'm still on the easy part of reader-writing though.
14:22Chousukejust many defmethods
14:23LauJensenWhich reader?
14:23ChousukeClojure :P
14:23LauJensenSomething which reads Clojure code?
14:24Chousukesomething which reads strings and produces clojure code ;)
14:24LauJensenWhats the use case?
14:24Chousukereplacing the java thing in clojure, if it turns out good enough.
14:24Chousukeif not, well, it's educational!
14:25LauJensenOk, looking forward to seeing the result
14:26ChousukeMy design for now is to keep things as simple as possible.
14:26ChousukeEven if it needs to be rewritten I hope some of the functions can be salvaged :P
14:26NeronusWhat about the bug? Will someone contact cgrand, or will we expect that he reads this?
14:27LauJensenNeronus: I expect rhickey is already on it ?
14:28ChousukeThis is what it looks like right now http://github.com/Chousuke/clojure/blob/240ab60e56cf031aea1300135a9610fa8833f1ae/src/clj/clojure/lang/reader.clj
14:29Chousukeit can read simple stuff, but no support for numbers yet :P
14:29Chousukeand I cheated with syntax-quote :D
14:29LauJensenInteresting. Have you checked out SICP before doing this? I think one of their final lectures is on the topic
14:30rhickeyfixed
14:30Chousukemaybe I should.
14:30rhickeyNeronus: fixed
14:30Neronusrhickey: Okay, thanks
14:30rhickeythanks for the report
14:30Chousukethe biggest problem with that design for now is that it's recursive.
14:31Chousukeit blows up if you have over 2000 levels of nesting :P
14:31rhickeyI was still set up for java 6 here, for work on ForkJoin stuff
14:31drewrI'd like to do something like (size (range 1000)) where size returns the amount of memory used by the resulting seq; has anyone done that yet? is it possible apart from a profiler?
14:31Neronusrhickey: You're welcome
15:23grosoursHi
15:26LauJensenyo
15:33cgrandNeronus, rhickey & al: drat, sorry
15:33rhickeycgrand: np, quick fix
15:33rhickeyI was in Java 6 mode here too and missed it
15:34kotarakrhickey and contrib contributors: Is it ok to include a notice "Copyright © Rich Hickey et al. All rights reserved." and the EPL when using contrib? There is still some CPL.txt in the root of contrib. Is that obsolete? Must be done something else to not get into legal trouble?
15:47rhickeykotarak: yes, copyright and epl, can copy those from any of the Clojure .clj files
15:47kotarakk
15:49lisppaste8stuartsierra pasted "Lazy map with New new" at http://paste.lisp.org/display/84852
15:50rhickeystuartsierra: did you need the ~'s? new new should ignore any namespace on the methods names
15:51stuartsierraok, wasn't sure if I needed them
15:51rhickey~'s always trouble me
15:51clojurebotexcusez-moi
15:56stuartsierratrying to figure out how to implement lazy-assoc
15:58Chousukehmm
16:01lisppaste8stuartsierra annotated #84852 "Lazy map with New new, take 2" at http://paste.lisp.org/display/84852#1
16:02Chousukedoes find use entryAt?
16:02stuartsierrayes
16:03Chousukejust wondering if you'd get a lazy seq of delays
16:03ChousukeThat would be rather pointless :P
16:03stuartsierrano, consuming the sequence forces all the delays
16:05kotarakstuartsierra: you can also new new the MapEntry to a LazyMapEntry to be as lazy as possible.
16:05stuartsierraah, yes
16:06stuartsierrakotarak: nothing personal; I like the idea of lazymap, wanted to see if I could do it with newnew
16:06stuartsierrahaven't gotten assoc working yet, though
16:06kotarakstuartsierra: if it would work out that would be cool. would remove quite a bit of code, from a first glance at your paste.
16:07Chousukestuartsierra: maybe you need (make-lazy-map (assoc base-map k v))
16:08stuartsierraI think that's redundant with lazy-assoc. It throws an AbstractMethodError on assoc
16:09mebaran151why don't atoms and refs support metadata?
16:09mebaran151is there a good reason
16:09stuartsierrathey do
16:09Chousukemaybe you need to type hint it? :/
16:10mebaran151,(with-meta (atom 2) {:a 1})
16:10clojurebotjava.lang.ClassCastException: clojure.lang.Atom cannot be cast to clojure.lang.IObj
16:10Chousuke:/
16:10Chousukestuartsierra: APersistentMap has two assocs
16:10kotarak,(meta (atom 2 :meta {:foo :bar}))
16:10clojurebot{:foo :bar}
16:10Chousukesomething is wrong with that...
16:12mebaran151can symbols have meta-data
16:12Chousukeyes
16:13hiredmanthere are two meta data interfaces
16:13mebaran151so what is the with-meta macro good for?
16:13hiredmanone uses with-meta
16:14mebaran151sorry, I meant keywords
16:14ChousukeIIRC no.
16:16kotarakI think there is really only one Keyword with the same name, but there might be many Symbols with the same name. That's why Keywords don't have metadata.
16:16kotarakIIRC, that is.
16:16lisppaste8stuartsierra annotated #84852 "Lazy map with New new, take 3" at http://paste.lisp.org/display/84852#2
16:18mebaran151ah
16:19mebaran151I was also wondering why for things that didn't support meta-data (that come from Java land), why clojure couldn't maintain a built in hash-map indexed by hashcode deep in the bowels of its runtimes
16:19mebaran151so that you could add metadata to strngs (which would be pretty useful)
16:19_hrrld`Is there the opposite of xml/parse? Something that will take a nested struct and give the xml text stream?
16:20kotarakmebaran151: I think this was discussed before and the hashmap would a perf bottleneck. Search clojure-log.n01se.net and the google group. You should find rhickey rationale on that one.
16:20stuartsierramebaran151: it's been discussed, basic answer is it's impossible to do efficiently
16:20mebaran151ah I see
16:20kotarak_hrrld`: clojure.xml/emit
16:21mebaran151but it can't be any worse than rolling my own right?
16:21mebaran151keeping the hashmap in memory seems like it could only hurt when I actally need the metadata
16:22_hrrld`kotarak: thanks, might be good to include the docs for xml/emit on http://clojure.org/api at some point.
16:22hiredmanmake sure to use a weakhashmap
16:23hiredmanand weakhashmap isn't synchronized
16:32LauJensendrewr: Thanks for your report for ClojureQL, I'm working on it right now and hope to have something done within 1 hour, I'll keep you posted
16:39stuartsierraStill getting AbstractMethodError on assoc -- could this have something to do with the duplicate definitions of assoc in clojure.lang.Associative and clojure.lang.IPersistentMap?
16:40ChousukeTry adding #^c.l.IPersistentMap in front of (assoc ...)
16:41hiredmanit goes inside in the paren I believe
16:41stuartsierraok
16:41cemerick...commenting on a topic from 2 hours ago: java 1.5 compatibility for clojure is *critical* in order to ensure that clojure libraries, etc., are widely usable. I don't know if there's hard figures, but we currently see a 20/60/20 split between 1.4/1.5/1.6.
16:41hiredman(#^c.l.IPersistentMap assoc …)
16:42Chousukeit goes there? I thought it was before the list.
16:42stuartsierrastill getting AbstractMethodError
16:42cemerickBesides, 1.6 didn't add anything compelling that impacts the clojure impl, I don't think (although the VM is obviously much improved under the covers).
16:42Chousukecemerick: You're probably right. :)
16:42kotarakcemerick: +1 (have only 1.4 as standard and 1.5 by some extra installation by the IT at work)
16:43Chousukecemerick: I think 1.7 and 1.8 will be more interesting for Clojure.
16:44cemerickChousuke: definitely -- but 1.5 compat will be needed for a *long* time. I know Rich has some ideas for feature-based reader stuff (e.g. basically ifdefs, which a couple other lisps have in various forms)
16:44cemerickWe're only just now planning on dropping 1.4 compat (mostly because we're using clojure :-) )
16:44cemerick(for our products, that is)
16:45Chousukecemerick: Common lisp has the #+bool (expr) think I think
16:45Chousukething*
16:45cemerickyeah, something like that
16:45cemerickhaving something like that that is also extensible would be super-handy (e.g. "if the user's license allows X, do this, otherwise do that")
16:46ChousukeI might implement that for my reader, just for fun. :P
16:49stuartsierraCompile-time conditionals create a lot of headaches.
16:51stuartsierrare assoc: I think the problem is that clojure.core/assoc calls clojure.lang.RT.assoc(), which casts the collection argument to clojure.lang.Associative instead of clojure.lang.IPersistentMap
16:51Chousukedoes APersistentMap implement Associative?
16:51stuartsierrayes
16:52stuartsierraindirectly, because IPersistentMap extends Associative
16:52cemerickstuartsierra: it simply has to be available for stuff like jvm versions, though, right? The alternative runtime checks would be impractical in a lot of contexts.
16:53stuartsierraYeah, but portable Common Lisp libraries become so full of +this and -that they're nearly unreadable
16:55drewrLauJensen: cool, thanks!
16:55Chousukeanyone know of a emacs extension writing primer that is not the emacs manual?
16:56Chousukethe manual seems a bit daunting, I'm wondering if there's a more compact option to get started with.
16:56jwhitlarkhttp://www.emacs.uniyar.ac.ru/doc/O%27Reilly_Emacs/Writing%20GNU%20Emacs%20Extensions.PDF
16:57jwhitlarkshould be this book: http://oreilly.com/catalog/9781565922617/
16:57Chousukeoh, cool
16:57jwhitlarkit's pretty good.
16:57ChousukeI need to extend gist.el so that I can specify syntax colouring for gists
16:58jwhitlarkit's from '97, so a little has changed, but the old code usually still works, there just might be a better way.
16:58Chousukenot a big thing I imagine, but I do not know anything about emacs lisp best practices :)
16:58LauJensendrewr: HEAD now runs the entire demo with PostgreSQL also
16:59jwhitlarkother than not using vi, I think you can get away with a lot. :-)
16:59Chousukejwhitlark: I use viper :P
16:59jwhitlark:-[
16:59jwhitlarkI used to also, though.
16:59ChousukeI prefer vi motions to ctrl-stuff still.
17:00lisppaste8stuartsierra annotated #84852 "Lazy map with New new, take 4" at http://paste.lisp.org/display/84852#3
17:00jwhitlarkyea, I just found I was causing myself more trouble when I had to use regular vi. It's easier to keep them straight when they're really different.
17:00stuartsierraNow assoc works.
17:01ChousukeI'd like my gist thing to be major-mode sensitive: it would be nice if I could specify the colour coding for diffs to be different from say, clojure-mode buffer gists :)
17:02kotarakstuartsierra: hmmm... I would prefer inheriting from APersistentMap..... It's a pity of that doesn't work. :/
17:02drewrLauJensen: great, I'll try it
17:03drewrwow, getting c.c.sql to use multiple db connections is a pain
17:04drewrthat's what I was hoping clojureql would make easier (among other things)
17:04stuartsierrakotarak: I think the problem is the duplicate definition of assoc in Associative and IPersistentMap.
17:04stuartsierraThis might be a newnew bug, it might be a bug in way the interfaces are defined.
17:06kotarakdrewr: it should be possible to go for the low-level (with-connection [conn1 *info1*] (with-connection [conn2 *info2*] (execute-sql query1 conn1) (execute-sql query2 conn2))).
17:06kotarakWill work on with-connection to allow multiple connections.
17:06kotarakSimilar to with-open.
17:07LauJensenGreat point to bring up drewr, thanks
17:09drewrkotarak: I don't see how with-connection can take a vector for its first arg
17:09LauJensen(sql/with-connection [c *conn-info*]
17:09LauJensen (sql/compile-sql stmt c))
17:13drewrLauJensen: wait, is that c.c.sql or cql?
17:13LauJensenMr. Drewr: Its all CQL :)
17:14drewrexcellent
17:14drewryou're going to get much more pgsql usage :-)
17:15LauJensenYou're very very welcome to contribute psql extensions if you feel the urge coming on :) I focus mostly on mysql and kotarak mostly on Derby these days
17:16drewrwill-do
17:22kotarakdrewr: cql HEAD: multiple connections with with-connection
17:24wtetzner_is there a way to get the "this" pointer?
17:25lisppaste8stuartsierra annotated #84852 "Lazy map with New new, finished" at http://paste.lisp.org/display/84852#4
17:25hiredmanwtetzner_: in what context?
17:25kotarakwtetzner_: of what? There is no "this pointer" in clojure.
17:25arbschtthere is in newnew, right?
17:25wtetzner_i'm extending HttpServlet, and i need to be able to reference the servlet
17:26hiredmanwtetzner_: using gen-class?
17:26wtetzner_yeah
17:26hiredmanthe first arg to all the fn backing methods is this
17:26LauJensenkotarak: Man that was quickly you extended ClojureQL to handle multiple-connections so elegantly! Good job
17:27wtetzner_hiredman: so i would do (defn -init [this config] ..do stuff) instead of (defn -init [config] ..do stff)
17:27LauJensenHope you put it to good use drewr :)
17:27wtetzner_?
17:28stuartsierrawtetzner_: yes
17:28wtetzner_thanks
17:32hiredman,(* 85 2)
17:32clojurebot170
17:39drewrkotarak: thanks!
17:45drewrLauJensen, kotarak: what's an example of, say, create-table with a connection arg?
17:46drewrthe one I see doesn't take a conn
17:46LauJensenI actually pasted one a little while ago.
17:46drewror I'm misunderstanding the interface
17:46kotarak(execute-sql (create-table ...) conn)
17:46LauJensenYou dont give your query-forming statements a connection arg, they just return a cql-statement which yuo then pass to something like execute-sql
17:46drewrkotarak: you're right; I glossed over that
17:47kotarak... or combine them to other queries.
17:51wtetzner_when using gen-class, how would you call a method from the super class?
17:52wtetzner_in java you just do super.method()
17:52cemerickthat newnew usage looks fantastic. So incredibly concise compared to gen-class...
17:53Chousukeit doesn't generate a new class for each call, does it? :P
17:54cemerickNo, it behaves like proxy in that way IIUC
17:55rhickeycemerick: right
17:56rhickeybut missing bridge method generation as stuartsierra discovered :( - will come
17:56rhickeythen he could have derived from APersistentMap like he wanted to
17:57cemerickhrm...bridge methods?
17:57rhickeywhen you have covariant returns you need to gen a method for one that calls the other
17:57cemerickah
17:58rhickeyAssociative assoc(...) and IPersistentMap assoc(...)
17:58rhickeyproxy does this, but new new not yet
18:00cemerickrhickey: just how much more complicated would things get if arg-ful super ctors were added into the mix? (Just curious, the barbarians aren't at the gate yet ;-) )
18:02rhickeycemerick: right now, I can describe newnew without talking about constructors at all
18:02kotarakwtetzner_: you have to a do (gen-class .... :exposes-methods {someMethod superSomeMethod}) Then you can do (.superSomeMethod foo) to get the method of the super class
18:02wtetzner_kotarak: thanks
18:03rhickeyand, if I let you name your new new classes when AOT, you can use them to write what would be "abstract supers" by simply not closing over anything
18:04rhickeyif I let you call supers with ctors args, you'll want to write classes with ctor args, you'll need ctors, there will have to be a relationaship between ctors and closed overs and you'll probably need fields explicitly
18:04rhickeyeventually all of java leaks in
18:05cemerickwe better find a strong door.
18:06rhickeyright now new new is sort of an expansion of fn/closures, where the 'code' part of lambda can have multiple named parts (methods). That's it, no fields, no ctors etc
18:06cemerickI'm sure some enterprising fellow will come up with a gen-class newnew frankenstein that will satisfy those who happen to need to call ctors with args...
18:06cemerick(and all of the rest of the java morass)
18:07rhickeyso, I'm emphasizing what is Clojure the language's capabilities directly. That's not to say at some point calling super ctors with arg might be an interop feature not part of the semantics of Clojure
18:08rhickeybut what I want is a recipe for people to write high-performance data structures like CLojure's in Clojure, and what I've defined in new new (+ def/gen-interface) is all you need
18:08hiredmanwill it continued to be called new new
18:09Chousukeit's "new". it's called "new new" because it's new :P
18:09rhickeyhiredman: I don't know, when I think about its use as a Clojure feature for new code I think maybe overloading new, which is otherwise a host-interop thing, might be a bad idea
18:10jwhitlarknew**2? new^2? new v2? last sounds like a car... ;-)
18:10cemerickit's nice to have another special form, or reserved short name
18:10rhickeyso, renaming new new to something else is still an open question
18:10rhickeyobj
18:10cemericknice to NOT have another special form, I mean
18:10Chousukemulti-lambda :>
18:10rhickeycemerick: yeah, but overloading when not appropriate is no bargain
18:10hiredmanwe could really cheese the old lisps by calling it lambda :P
18:11Chousukeor pick another greek letter.
18:11rhickeyit's a really interesting thing to think about what new new does, and what lambda does, and the true nature of closure
18:12rhickeywhen written in terms of new new, it seems obvious lambdas aren't primitive but a special case
18:12hiredmanα is nice if you think of it as first thing
18:13rhickeythey certainly have composite behavior - creating code, capturing environment, instantiating a callable 'thing'
18:13cemerickif it were possible, I'd much rather have new new become "new" and old new become "jnew" or something, especially since no one uses the old new (Foo. has been idiomatic for some time now).
18:14rhickeycemerick: in any case, another special form is likely. renaming old new to jnew is breaking
18:14rhickeyso, candidate welcome
18:14rhickeycadidates
18:14rhickeycandidates
18:15hiredmanα
18:15rhickeyhiredman: bzzzt
18:15cemerickis breaking (likely old) source that uses (new Foo arg1 arg2) a problem at this point?
18:15hiredman:/
18:15rhickeyascii please
18:15rhickeycemerick: I think there are people that prefer to write (new classname ...) and still do
18:15cemerickthat's interesting
18:16cemerickI'd still vote for breaking. newnew is going to be far more "core" to clojure than oldnew, especially as it becomes multiplatform.
18:16hiredmanI still see alot of using . directly
18:16rhickeyanyway, breaking changes are a last resort moving forward
18:17Chousukeprovide? too plain? :P
18:17rhickeycemerick: but new doesn't describe newnew particularly well either
18:17rhickeynot any better than lambda
18:17cemerickho-ho, that'd rile some people
18:17cemerickI'm not sure we'll find anything that does better than new.
18:18cemerickzen? ;-)
18:21fsodomkaprototype?
18:22fsodomkatemplate
18:23hiredmanit generates a a thing when you call it, and the the thing it generates isn't a thing used to create other things
18:24cemerickkappa (as in, preceding lambda?)
18:24cemerickno one would ever get it
18:25fsodomkainstance - sample - representative :-)
18:25Chousukeit makes me think of the japanese folk tale goblin thing :P
18:25rhickeyit does three things: captures bindings, defines named bits of code, and instantiates an object through which you can get to that code
18:25cemerickbox?
18:25rhickeycemerick: what's after lambda?
18:25cemerickmu
18:25clojurebotdefmulti doc is ugly
18:25rhickeyreify
18:25cemerickwhich isn't bad
18:26dreishSounds like something you do to a checkers piece after it reaches the other side of the board.
18:27fsodomkamake ?
18:27rhickeydreish: that's rexify
18:28dreishrhickey: Ah, thanks. I was close.
18:28hiredman,(reify [] (toString [] "foo"))
18:28clojurebot#<sandbox$eval$obj__3333 foo>
18:29hiredman,(reify [IDeref] (deref [] "foo"))
18:29clojurebot#<sandbox$eval$obj__3339@1d6fad7: "foo">
18:29fsodomkacreate, incarnate, manifest
18:29fsodomkaobjectify :-)
18:29hiredmanreify makes sense, but I had to pull up a wikipedia page for it did
18:29fsodomkaentify :-)
18:29fsodomkacool words in thesaurus :-)
18:30hiredmanbefore
18:30Chousukehiredman: that's just a good thing.
18:30hiredmanman, I've leaving words and syllables while typing all day
18:30hiredmanI've been
18:31hiredmanout
18:31hiredmangoodness
18:31Chousukehiredman: if you have no clue what it does, that leaves little room for misunderstanding :)
18:31Chousukeworse than ignorance is thinking you know what you're doing :P
18:31Chousuke(when you don't)
18:32cemerickmu, make, and reify all seem decent
18:33cemericknothing super-inspiring, though
18:35fsodomkaif obj as object
18:35fsodomkawhat other words for object?
18:35fsodomkaitem? entity?
18:36fsodomkashould it be noun or a verb?
18:36fsodomkainstantiate?
18:36hiredmanI think a verb is good
18:37Chousukefsodomka: instantiate is overloaded
18:37Chousukeand smells of OOP
18:41fsodomkaconstruct?
18:41fsodomkaoriginate?
18:42fsodomkainitiate?
18:42ataggartforge
18:43ataggartooh, no: spawn
18:43cemerickthat's thread-related
18:44ataggartbah
18:45fsodomkadraft, establish, form
18:47ataggartsummon
18:47fsodomkainit and make are my favorite so far
18:48hiredmanhttp://en.wikipedia.org/wiki/Reification_(computer_science)
18:49hiredmanif a) rhickey likes reify b) and he intends to construct to be used for reification of interfaces then reify seems good
18:49hiredmanugh
18:49hiredmanand he intends the construct
18:50cemerickwell, that's hard to argue with: "The etymology of the term reification is from Latin res (thing) + facere (to make)"
18:54cemerickit isn't actually reification, though, is it? newnew doesn't make anything newly available that was previously an implementation detail or otherwise abstracted away...
18:55cemerick(I'm comparing to reification of stack frames and reified types vs. erasure, FWIW)
18:57hiredmanit depends on how you look at new new
18:58hiredmanif you look at it as the cornerstone of cinc then it is reifying, allowing the implementation of things that where implemented in java in clojure
18:59hiredmanpulling stuff up from java into clojure
18:59ataggartplus it's a cool word
19:00hiredmanalso if you look at new new as implementing fn teh code generation and closing over of fn become accessable
19:00hiredmanon the other hand if you look at it as just a replacement for proxy, then I guess not
19:02cemerickbut it's not making the code generation accessible, it's just abstracting it in a different way...
19:04hiredmanI have not looked at the implementation of new new, but my understanding is new new methods are not backed by fns
20:03rhickeycemerick: it reifies an interface, which isn't directly instantiable
20:54wtetznerdatum?
20:54wtetzner(datum [] (toString [] "hello"))
21:23MarkVolkmannIs there a reason why RetryEx in LockingTransaction.java extends Error instead of Exception?
21:34cemerickMarkVolkmann: probably so that retries cut through typical (catch Exception e ...) forms.
21:38MarkVolkmannIt just struck me as unusual since the javadoc for Error says "indicates serious problems that a reasonable application should not try to catch".
21:53ataggartYeah, and Exceptions need to be explicitly handled, except when the child of Exception happens to be RuntimeException.
22:01rhickeyif you catch retsy exceptions in your application code you will mess up the STM
22:13ataggartMy comment was meant to be tongue-in-cheek
22:14admneed help
22:34bpattisonwhat's the name of the function to list out all of the member functions of a java class?
22:36wtetzner,(seq (.getDeclaredMethods (class :item)))
22:36clojurebot(#<Method public java.lang.Object clojure.lang.Keyword.applyTo(clojure.lang.ISeq) throws java.lang.Exception> #<Method public java.lang.String clojure.lang.Keyword.getNamespace()> #<Method public java.lang.Object clojure.lang.Keyword.call() throws java.lang.Exception> #<Method public java.lang.Object clojure.lang.Keyword.throwArity()> #<Method public java.lang.Object clojure.lang.Keyword.invoke() throws java.lang.Exceptio
22:36wtetzner,(map #(str %) (.getDeclaredMethods (class :item)))
22:36clojurebot("public java.lang.Object clojure.lang.Keyword.applyTo(clojure.lang.ISeq) throws java.lang.Exception" "public java.lang.String clojure.lang.Keyword.getNamespace()" "public java.lang.Object clojure.lang.Keyword.call() throws java.lang.Exception" "public java.lang.Object clojure.lang.Keyword.throwArity()" "public java.lang.Object clojure.lang.Keyword.invoke() throws java.lang.Exception" "public java.lang.Object clojure.lang
22:38wtetzner,(take 2 (map #(.getName %) (.getDeclaredMethods (class :item))))
22:38clojurebot("applyTo" "getNamespace")
22:39admI plan to develope a web app prob with some framework(with providing minial support, since apart from web server plan to write other things like dispatch, html generation etc) in which I need to talk to a process talking on socket
22:39admhow do I do that>
22:39adm?
22:40wtetzneradm: you could try compojure
22:40wtetznerhttp://github.com/weavejester/compojure/tree/master
22:40wtetznerand the wiki is here: http://en.wikibooks.org/wiki/Compojure
22:42wtetzneradm: for sockets, just use the java socket stuff
22:42wtetznerhttp://www.javaworld.com/jw-12-1996/jw-12-sockets.html
22:42admwhat about the other thing?
22:43admoh, ok
22:43admwtetzner: thanks
23:24Jomyootis there guide to writing unit tests with clojure?
23:24Jomyootfor ex. i want to unit test my rails app with clojure
23:27drewolsonssh #ubuntu
23:28drewolsonwhoops, sorry :)
23:32Jomyootooh
23:33Jomyootit would be cool if I could tap into a long-running clojure process and start querying its internal states
23:36hiredmanit should be pretty easy
23:54Carkh~def *warn-on-reflection*
23:54clojurebotexcusez-moi
23:54Carkhhum how did that work again hiredman ?
23:57hiredman,(doc *warn-on-reflection*)
23:57clojurebot"; When set to true, the compiler will emit warnings when reflection is needed to resolve Java method calls or field accesses. Defaults to false."
23:57Carkhright, but i was looking for the source code
23:58Carkhthough i won't find it it seems
23:58Carkhanyways i'm trying to set a *deployed* global var
23:58Carkhthe software will act differently if it is true or not
23:59Carkhso i wanted to be able to (set! *deployed* false)
23:59Carkhlike warn-on-reflection
23:59Carkhbut it does not work =/
23:59hiredman,(doc binding)
23:59clojurebot"([bindings & body]); binding => var-symbol init-expr Creates new bindings for the (already-existing) vars, with the supplied initial values, executes the exprs in an implicit do, then re-establishes the bindings that existed before."
23:59hiredman,(doc set!)
23:59clojurebot"/;nil; "
23:59hiredmanbah