#clojure logs

2010-12-17

00:03amalloyjoshua__: i'd suggest designing it as some non-database data structure first. since mongo is pretty strongly associative, you can probably translate it pretty directly
00:05joshua__Alright that sounds good.
00:05amalloyeg a graph with the connection properties you want, and then turn the links into object references
00:07joshua__I had heard that it was possible to embed documents within documents in mongo. I was wondering whether that meant you could just literally have one document per post with other documents embeded within it.
00:08joshua__Or does that sound like something that doesn't fit mongo?
00:09amalloyjoshua__: i don't actually know that much about mongo. i do know that each object/entry can have links to other entries
00:10amalloyi mostly think of mongo as a persistent linked-list/map
00:13joshua__What I'm wondering really: {:top_id 1 :value 2 :children [{:top_id 2 :value 3 :children []}} might have a way to index on all_top ids.. So If I asked the database for top_id 2 it would give it to me.
00:21mjiwas looking for some help with format string vulnerbility in C .. ?
00:23amalloyjoshua__: i don't think so
00:24tonyl$mymail
00:24sexpbotYou have no messages.
00:24joshua__amalloy: I'm reading up on how indexing works right now. I'll get this figured out eventually ;).
00:25duckinatorHey, I'm working on just a minor rewrite of someone's code which uses "hiccup", and found (defn home [] (html ...)), and I can't tell if it's the same as (defhtml home ...) - i'm looking at http://weavejester.github.com/hiccup/hiccup.core-api.html#hiccup.core/defhtml
00:28amalloyduckinator: you can try macroexpanding them both and see what they look like. from a quick glance at hiccup it looks to me like defhtml does more than just wrap in an html, but i've never used it
00:36joshua__amalloy, it sounds like you can do what I was thinking of, not sure yet
00:38joshua__amalloy, nvm
01:21arnabdHello guys - starting up with clojure (following https://github.com/technomancy/leiningen/blob/master/TUTORIAL.md) - need a bit of help
01:22amalloyarnabd: okay, shoot
01:22arnabdi created a new lein project - and everything was fine until I added this to the project.clj:
01:22arnabd:main clojure_url_synopsizer.clj)
01:23arnabdand added a clojure_url_synopsizer/core.clj file with:
01:23arnabd(ns clojure_url_synopsizer.core
01:23arnabd (:gen-class))
01:23arnabd(defn -main [& args]
01:23arnabd (println "Hello from Clojure! What did you mean by? " args))
01:23amalloyarnabd: :main wants a namespace, not a filename
01:23arnabdhowever lein uberjar fails saying: java.io.FileNotFoundException: Could not locate clojure_url_synopsizer/clj__init.class or clojure_url_synopsizer/clj.clj on classpath:
01:24arnabdyeah - I guessed that. And I tried the ns as clojure-url-synopsizer
01:24amalloyso :main clojure_url_synopsizer.core
01:24amalloyno .clj
01:25amalloyie, the value of :main should be exactly identical to what comes right after (ns
01:25arnabd*duh. Got it.
01:25arnabdthx - it works
01:25amalloygreat, enjoy
02:56auserso... if I have a (defn funcA []... in namespace A and in namespace b I call (:require [namespace.A :as a), shouldn't I be able to call (a/funcA)?
02:56auseror am I misunderstanding something
03:01replacaauser: do you want to share the real (ns ...) statement and real require statement?
03:01ausersure, I can most definitely
03:01replacagenerally that idea should work
03:04auserit's here replaca: https://gist.github.com/c15dd8de27fc76a0e81b
03:05replacaauser: look here for an example: https://github.com/clojure/clojure/blob/787938361128c2bc21ed896dd4523651b59cb420/src/clj/clojure/template.clj#L28
03:05auseryeah, that's "similar" to what I have actually
03:06auserexcept the function takes no arguments
03:06auserthe one that I have, that is
03:06replacawell, you have circular requires, which won't work
03:06auseroh
03:06auseryeah
03:06auserI was wondering about that
03:07auserI think I can remove that, actually
03:07replacabut I don't know why it would throw *that* error
03:07auseryeah
03:07auserI thought I had the syntax right
03:07auserit's been boggling me for the better part of the hour
03:08replacaotherwise it looks ok to me
03:08replacatry it without the circular ref and see if that makes it go away
03:08auserremoving that dependency has been the only thing that fixed it... I can prolly still call methods in the other namespace by using the entire namespace, right?
03:08auseryeah, it did
03:08auserinteresting
03:08ausermy tests still fail, but that's cleared up the error
03:08replacasometimes clojure's errors are not so clear
03:08replaca:)
03:09auseryeah... I come from erlang, trust me... these are much better errors
03:09replacahaha
03:09auserwell, at least from '03
03:09auserrather R13B03
03:10auser:) thanks replaca
03:10replacanp
03:14auserone more quickie question... how can I get the name of the namespace I'm *currently* in?
03:14auserif you know
03:21replacaauser: *ns*
03:21auserthat's it? sweet
03:21auserthx
03:36gju_hello, i'm looking for a good way to get started with clojure. can someone suggest some good ressources except the plain docs?
03:40LauJensengju_: I've been running a blog for over a year now on Clojure, it has topics from easy/entry-level to very advanced: http://www.bestinclass.dk/blog.html
03:41LauJensenNow tell me, is this cool or crazy? https://github.com/LauJensen/clojureql/commit/1e7e8e933ed19bd71bed6be1607b84c2bfa3c2ab
03:42gju_LauJensen: thx, i'll give it a shot.
03:44AWizzArdLauJensen: useful
03:49LauJensenk
03:53ordnungswidrighi
03:57ordnungswidrigis there a plugin for lein to show for which dependencies there are newer versions available?
05:30bobo_LauJensen: maybe its just me, but wouldnt it be even niser if you only select the email in the query, and then only get the email back? ie, single item single row retuns just one item?
05:30bobo_*nicer
05:49LauJensenbobo_: Example?
08:40FireSnakeanyone know how to set the classpath in leiningen
08:41FireSnakeI have a project that can't find my compojure/core.clj file because it's not on the classpath
08:47stuartsierraYou don't need to set the classpath per se, you need a dependency.
08:48FireSnakeStuart thank you so much -- where do I set it
08:48stuartsierrain project.clj
08:49FireSnakeok thanks -- so I set dev-dependencies to what compojure.core and that will do it?
08:49FireSnakethe dev-dependencies pulls in stuff outside the classpath
08:49FireSnake?
08:49stuartsierraNo, you want :dependencies
08:49FireSnakeok thanks
08:49stuartsierranot :dev-dependencies, those are for local development only
08:49stuartsierraAnd you set it to the name of the library as reported on clojars.org
08:51FireSnakeDo I set it as compojure/core.clj or compojure.core -- what is the difference between / and . in this context
08:52FireSnakethanks so much stuart
08:52FireSnakeI'll play with it
08:54stuartsierraLibrary names — the name of a JAR file in a public repository — do not necessarily correspond to namespace names like "compojure.core"
09:03chouserstuartsierra: well, we've got 2 or 3 dozen lazytest tests now
09:03stuartsierrawow
09:03chouserwe're not taking advantage of all the features yet
09:03stuartsierraHow's it going?
09:04chouserHad to fiddle around a bit to get :watch working properly
09:04chouserthe .clj files were getting copied into targets, and while lazytest was watching the src ones correctly when it would trigger a reload it would only reload the (still old) ones in target
09:05stuartsierrahmm, yeah, that's a problem
09:05chouseronce I figured out how to ask maven to copy none of our .clj files, that wasn't a problem anymore
09:05chousernot sure if there will be negative consequences later for not copying the .clj files, but it's fine for now.
09:06stuartsierraAs usual, the problems come down to managing the classpath.
09:06chousernot much else to say, which is good -- it pretty much just works.
09:07stuartsierragreat!
09:07stuartsierraAre you using the "describe/it" style or the "deftest" style?
09:07chouserI know so little about maven and hudson still -- some of our other projects in hudson have a nice graph of unit test passes over time. ...anything like that for lazytest?
09:07chouserwe're using describe/it
09:08stuartsierraRe graphing, Hudson is probably using the XML output of JUnit or some other standard Java testing lib.
09:10stuartsierraI haven't implemented any other output formats, but the reporting is designed to be pluggable.
09:10chouserok
09:18stuartsierraRe describe/it, are you using "it" or "do-it" most of the time?
09:19chouserwe're using 'it', but I don't think we've weighed the options.
09:20stuartsierraI'm asking because the difference has been confusing for some people. I'm considering making "it" work like "do-it", more RSpec-like.
09:21chouserI have no testing habits or baggage that I'm bringing to this process
09:21stuartsierraok
09:21chousernor do the others on my team, afaict.
09:21stuartsierraIs the requirement that "it" contain just one single expression ever a problem?
09:21chouserwe've all written tests before, and see some pragmatic value in having them, mainly to prevent regression I think.
09:21chouserbut no zealots here
09:23chouserhm... maybe. several of our 'it' clauses are wrapped in the same 2 or 3 macro calls just to get the mocking environment right
09:23chouserif we used do-it, could we do that once and replace the several 'it's with several 'expect's?
09:23stuartsierraYes, and the test would halt on the first failure.
09:24stuartsierra"it" expands to (do-it "docstring" (expect …))
09:24chouserah
09:24chouserno docstring on expect though?
09:25stuartsierradocstrings on "expect" are optional
09:25stuartsierra"it" or "do-it" creates a function.
09:25chouserdoes the expect docstring show up in the success/failure report?
09:25stuartsierra"expect" is a fancy version of "assert"
09:26stuartsierraI don't actually remember. It's available, but probably not included by default.
09:26chouserhm
09:27mister_robotoSorry... jumping in the middle but is someone making a change to have maven plugin avoid copying clj files to target?
09:28stuartsierramister_roboto: no
09:28chouserI think I probably prefer what we've got now, then.
09:29chousermister_roboto: you can tell it to do that now.
09:29stuartsierrachouser: ok, good to know
09:29chousermister_roboto: in your plugin configuration tag, add: <copiedNamespaces><namespace>!*</namespace></copiedNamespaces> <copyDeclaredNamespaceOnly>true</copyDeclaredNamespaceOnly>
09:30mister_robotoOk thought it was gonna be a default or something
09:30chouserbut like I said, I don't know what the implications are for that when it comes time to build and distribute jars
09:30stuartsierrafor applications, probably not a problem.
09:31stuartsierraFor distributing libraries, it's a disaster, as widely reported already.
09:31chousernot copying to targets implies not including in the jar?
09:31stuartsierraI expect so.
09:32chouserthat suggests to me that I'd like something like lazytest:watch to be copying the appropriate .clj files (as well as some resources?) from src to targets when it sees they've changed.
09:32chousera sort of fast "live" build
09:33stuartsierraThis is a deeper problem with Maven & Clojure that I've encountered before.
09:33chouserbut my instincts around how maven should behave seem to be often wrong, at least according to those who know maven better.
09:33chouser(hi cemerick!)
09:34stuartsierraMaven is designed around a static compilation workflow.
09:34stuartsierraAdapting it for interactive development is awkward.
09:34stuartsierraEspecially around copying files/resources.
09:36stuartsierraIdeally, the classpath for interactive development should contain src/*/clojure, src/*/resources and dependent libraries.
09:36stuartsierraIt should not contain anything in target/ unless you need compiled classes for Java interop.
09:36chouserhm
09:36chouserseems like it pretty much needs both
09:37chouserbut that the src paths should override the targets ones
09:37stuartsierraThat's almost impossible given how classpaths work.
09:37chouserwe have not only compiled .java, but also *generated* and then compiled .java.
09:38stuartsierraYeah, so it's hard to get right.
09:38stuartsierraI don't have a good solution for this yet.
09:41AWizzArdHow would a without-reflection-warnings macro look like?
09:41AWizzArdTo me it seems set! won't work when inside a let or with-local-vars form.
09:41AWizzArdAnd `(binding [*warn-on-reflection* false] ~@body) also doesn't seem to do the trick.
09:42AWizzArdI would like to turn *warn-on-refletion* of, execute a body and then have *warn-on-reflection* get restored to whatever it was set to before.
09:43chouserAWizzArd: it's because *warn-on-reflection* is examined by the compiler at compile time
09:43stuartsierrayes
09:43chouserso the binding is happening too late
09:43AWizzArd(defmacro without-reflection-warnings [& body] `(do (set! *warn-on-reflection* false) ~@body (set! *warn-on-reflection* true))) works great, but this will always turn it on.
09:44chouseryou might be able to do something like `(do (set! *warn...* false) ~@body)
09:44AWizzArdbut as soon the do goes away and gets replaced by a (let [wor *warn-on-reflection*] ...) it won't work anymore.
09:44chouseryes
09:44AWizzArdchouser: yes, that would work, but leave *wor* set to false.
09:45AWizzArdSo, there is currently no trick to do this?
09:45chouserat the top level `do` is special, each interior form is compiled and run separately
09:45AWizzArdI have a macro that expands into a defrecord and into a defn.
09:45AWizzArdThe defrecord triggers a reflection warning for the .contains call.
09:46AWizzArdSo I wanted: (do *wor-off* (defrecord) *restore-wor* (defn))
09:46AWizzArdThe *restore-wor* part is that won't work.
09:47chouserAWizzArd: perhaps `(do (set! *old-wor* *wor*) (set! *wor* false) (let [v# (do ~@body)] (set! *wor* true) v#))
09:48AWizzArdchouser: I guess (set! *wor* true) was supposed to be (set! *wor* *old-wor*)
09:49chouserer, right
09:49AWizzArdAnd how can I introduce root-bindings such as *old-wor*, which are set!able?
09:50chouseroh
09:50chousercan't
09:50AWizzArdOtherwise this would have worked.
09:50chouserjust use def
09:50chouser(def old-wor *wor*)
09:50AWizzArdHmm yes, also fine.
09:51AWizzArdchouser: yes, this def trick works. I can just make it a private var of my NS.
09:51AWizzArdGood idea :)
09:54stuartsierraYou can even gensym the name to avoid any possibility of clashes.
09:58AWizzArdstuartsierra: and then ns-unmap it :)
10:01stuartsierrayes
10:08AWizzArdCompojure users here? Am I able to stop Compojure or Ring from doing the full reply? Currently I can return an object and a Map is built from it. Number=>Status, String=>Body, Map=>can set headers, etc. What I would like to do is to stream the response.
10:09AWizzArdI am doing a sql query and get, say, 20k results. Currently I need to do one (pr-str results) and return this as my full response body.
10:10AWizzArdInstead I would like to stream results. So I would in principle need the output stream that Jetty will use after the status code and headers where sent.
10:10AWizzArdThat way my handler needs to fire the header and not return, but instead loop through the results and write them into the stream.
10:15stuartsierracemerick: Where do we stand with contrib Maven builds?
10:43AWizzArdIs it possible to specify the return values of protocol fns?
10:43AWizzArdThe type of the return values that is.
10:48stuartsierraI believe they can be hinted
10:48stuartsierra^SomeClass on the arg vector, if I recall
10:49AWizzArdI will give it a try.
12:24auseris it possible to write custom java and load it from within a clojure project?
12:24AWizzArdYes.
12:24auserI wonder if leningen will compile it... that is prolly more important to find out
12:24AWizzArdAny custom Java code that you write (that is, all classes you implement yourself) can be used. Just compile them and put them into the cp.
12:24auserhm.
12:25auserah
12:26auserwell... actually, really what I'd like to do is mimic the 3rd line here: http://hazelcast.com/documentation.jsp#ClusterInterface (new MembershipListener()...)
12:27auser(new to clojure, not to functional programming, though). I'm kind of stumped on how to do that...
12:28mrBlissauser: http://clojuredocs.org/clojure_core/clojure.core/proxy
12:28auserwell... that'll help
12:28auserthanks mrBliss
12:29mrBlissnp
12:40auserthanks!
12:41mrBlissauser: my pleasure
12:42ohpauleezRaynes: merged in, thanks man
12:42ohpauleezYou might want to make a new drop on clojars
13:03bortrebI'm playing around with the compile function, and it works the first time I compile, but not the second
13:03bortreb(after I delete the compiled files the first time)
13:03bortrebis there a way to make it always output files?
13:09amalloybortreb: restart your repl, or modify the clojure files
13:10bortrebthere's no way to do it without restarting the repl?
13:10amalloy(compile 'foo) loads the bytecode into memory, as well as writing .class files. if the bytecode is already in memory, i think it just uses that
13:10bortrebmaybe with binding or something?
13:10bortrebis there an unload?
13:12amalloynot really my area of expertise, i'm afraid
13:12amalloybortreb: why do you need it to happen?
13:14bortrebwell, I'm trying to use clojure with the java code at work, and so I'm including everything as a jar file in the svn repo so that others can just call the clojure I write like any other java thing
13:14bortrebI don't want to use lein, because I want to keep track of dependencies myself
13:14amalloyhrm
13:15KirinDaveThat sounds like a lot of not-fun. :)
13:15bortrebso I want a function that compiles all the namespaces I care about and puts them in a jar file
13:15amalloybortreb: that function is called lein :)
13:16bortrebbut we use a lot of jars as dependencies that don't exist in any public repos and setting up hudson is beyond my capabalities
13:16amalloyif you have dependencies lein can't manage automatically, you should still be able to install them to your local repo
13:17bortrebwhat about other clojure projects that I'm developing as well and other java code that is just randomly lying around ?
13:18bortrebI can get a repl with everything loaded correctly
13:18amalloybortreb: so write a shell script that loads that repl, writes (compile 'blah), and exits
13:19amalloyi think trying to change code post-repl-launch in an environment as delicate as yours is asking for trouble even if there were a way to recompile
13:21bortrebthat would certainly work and is a great fallback, but I was hoping for a clojure function that I could call from the repl that would just package everything I'm working on and send it off in a jar to the rest of the project
13:22gtrakat run-time it doesn't exist as a jar?
13:22bortrebmaybe I'm doing it wrong....
13:23bortrebI've never really found a clear explanation of how to integrate clojure code into an existing java codebase
13:24bortrebwe have a pretty standard collection of java code in an SVN that everyone checks out into eclipse
13:26bortreball our dependencies are part of the svn repo, because they're random NLP programs, custom jars made by other projects, etc, and we want to managed dependencies manually so that new people can checkout something that just works
13:27bortrebthat system works really well for us and has saved many headaches
13:27bortrebso now, I want to come in with clojure and write some cool things --- I figured that I could include clojure and clojure-cotrib with the other jars
13:28bortreband then compile my namespaces into one more jar which is all of the actual code I write in clojure, AOT compiled
13:29bortrebthen, I'd also include the clojure source right along with the other java files in the corresponding packages
13:30bortrebpeople would be able to see the clojure code in its proper place in eclipse and use the code, but they wouldn't be able to change it by changing the source files
13:30bortrebis that reasonable?
13:30bortrebplease help a newbie :)
13:39bortrebdid I scare everyone away?
13:41bortrebI really do want to know the right way to do this
13:41bortrebany advice?
13:41gtrakI'm not an expert on this stuff, but i think you can package up the clojure jar with lein jar or lein uberjar
13:42gtrakmaybe you can keep the clojure source off by itself and just bring in the jar as a dependency
13:43bortrebI was thinking about that, but the code isn't a separate idea from our main java code base
13:44amalloybortreb: no offense, but the right way to do it is to let build tools manage your build and your dependencies. "do everything in the repl" won't scale very well if clojure gains any momentum at your company
13:45amalloyfailing that, launching a new repl doens't seem like an onerous requirement
13:49bortrebnone taken -- thanks for your help! but how can I use leinengen and still write code that uses all our dependencies as well as the java code in the project itself?
13:51bortrebI guess, how would you go about taking something like an apache commons library or your other favorite java library and rewriting one function in clojure?
13:52cemerickchouser, stuartsierra: I was paged? :-)
13:53stuartsierracemerick: check out latest http://dev.clojure.org/display/design/Common+Contrib+Build
13:53cemerickYeah, I just saw the diff
13:54stuartsierracore lang releases are ready to patch
13:54stuartsierraWe need to hash out what's left in contrib releases
13:55amalloybortreb: rewriting one function is harder than a whole class. but i think you could write clojure function to do what you need, compile it into a class/jar, and rewrite the java source of that method to delegate to the new AOT clojure function/class
13:55cemerickstuartsierra: Yes; I have two last items to work on re: the release cycle, but that's small potatoes.
13:56gtrakbortreb, or write to interfaces and create a new implementation class that calls the clojure functions
13:56stuartsierracemerick: what are they
13:58cemerick(a) verifying the semantics of the nexus goals (i.e. if they're smart enough to not touch staging repos unassociated with the coordinates of the project for which one is looking to close/promote)
13:58cemerick(I mentioned that a while ago)
13:58stuartsierrayes
13:58cemerick(b) looking around for some kind of sane way to manage N probably-nearly-identical contrib hudson job configs
13:59stuartsierraah yes
13:59cemerickso, (b)'s not release cycle related, but it's on my list anyway
13:59stuartsierraI assumed (b) had no good answer
14:00cemerickI'm going to sniff around a few other large users of hudson, see what they do.
14:00cemerick#jboss will be the first stop. Legend has it they have the largest-known hudson cluster.
14:01stuartsierragood idea
14:01cemerickThey're surely not messing around with the administrative interface on a regular basis
14:01stuartsierraSecond question...
14:02bortrebamallory: indeed --- but _how_ do you actually go about the compiling into a class/jar part when your clojure code depends on interfaces defined in the java part of the project? if you're using lein, how do you tell about those interfaces?
14:03stuartsierraIf we go with Clojure language *not* inheriting from a parent POM, is there any value in separating oss-deploy/baseline/contrib POMs?
14:09dnolenLack of TCO - 0, Lazy Sequences 1
14:10gtrakbortreb: it all gets easier if you have a build system, you could make the interfaces their own module, some packages do that, for instance there's a jaxb-api and jaxb-impl you can download
14:15gtrakthat way there's no circular dependency
14:20jweisswhat's the difference between binding and with-bindings ?
14:22bortrebThanks for your help everyone
14:23bortrebI'll ponder this for a while
14:23stuartsierrajweiss: with-bindings is a lower-level function
14:23stuartsierratakes a map of Var => value
14:31cemerickstuartsierra: sorry, got multiple things brewing at the moment. Will you be around later this afternoon?
14:33stuartsierrayes
14:33stuartsierra'till 5
14:34cemerickstuartsierra: OK -- poke me by 4 if I haven't gotten back to you
14:35stuartsierrasure
14:40jcromartiewhen I run "lein deps" on one machine, I get: "java.lang.NoClassDefFoundError: and"
14:40jcromartieCould not find the main class: and. Program will exit.
15:08dnoleninteresting the compiler doesn't automatically convert self calls in the tail position to recur.
15:09chouserlike scala does
15:09stuartsierraooh, fightin' words :)
15:10chouserhttp://clojure-log.n01se.net/date/2010-12-13.html#19:51
15:13dnolenand does recur work on protocol fns?
15:13chouserhm, without testing I would guess that it recurs without re-dispatching, like it does on multimethods
15:16dnolenchouser: hmm, recur doesn't like the 'this' argument. so really ... it doesn't work.
15:17chouserhm, what if you leave of the 'this'?
15:17dnolenbad stuff happens in my code anyway. but yeah, doesn't prove anything.
15:18chousernow that I say that, I remember recur being a consideration in the design, or at least the syntax, of protocols
15:22chouserstuartsierra: I meant to mention before, I'm getting this: [WARNING] Attempting to build MavenProject instance for Artifact (com.stuartsierra:lazytest-maven-plugin:1.0.1-20101213.125247-3) of type: maven-plugin; constructing POM artifact instead.
15:22chouserDoesn't cause any problem that I'm aware of, just thought you might be interested.
15:22stuartsierrahmm
15:24stuartsierrano idea
15:24stuartsierraprobably a Maven plugin API thing
15:24stuartsierraWhat Maven version are you using?
15:25chouser2.0.9 because that's apparently what hudson supports
15:25stuartsierraAh, I compiled the plugin against 2.2.1
15:25chouseroh, ok.
15:25stuartsierramaybe I can drop it back to 2.0
15:25chouserno big deal
15:26stuartsierraback in a few
15:40dnolenhuh, guess I should seen this long ago, but continuations seem great for error handling ...
15:42dnolenso I guess clojure.contrib.condition doesn't require gen-class anymore now that we have deftype ?
15:44stuartsierradeftype cannot extend concrete classes
15:45dnolenstuartsierra: yeah I had forgotten about that.
15:58bhenry1ah mega brain fart. i can't think of the term for extracting parts out of arguments like {:keys [something something-else]} some-map
15:59mrBlissbhenry1: do you mean destructuring?
15:59bhenry1YES
15:59bhenry1thank you
16:27cemerickstuartsierra: no, a monolithic contrib POM would be fine in that case
16:27cemerickwhich we could refactor back into a split if/when core clojure stops using its own local config
16:31stuartsierrathat was my thought
16:32stuartsierraPerpetrated on a branch: https://github.com/clojure/build.poms/tree/contrib-pom-only
16:34cemerickstuartsierra: Q: if c-m-p is no-go in core clojure, why is it OK in contrib?
16:35stuartsierrab/c Rich doesn't care
16:35stuartsierraor, I should say, the standards for contrib are lower
16:35stuartsierraBut I haven't really confirmed that as such.
16:35cemerickThe "unsanitized" response is *way* better IMO. :-)
16:36cemerickI'm happy to not open that can of worms in that case.
16:36stuartsierrawe've been using it on clojure-contrib for months anyway
16:37cemerickgood point
16:38cemerickWhich then makes the decision to not use it in core even more confusing to me.
16:38stuartsierraMostly, because core doesn't compile well with it.
16:38cemerickbecause of the odd load order issue?
16:38stuartsierrayes
16:39cemerickWas there any theory about that in your discussions?
16:40stuartsierranot really
16:40stuartsierraI have some ideas, haven't had time to test them out
16:41stuartsierraBut the whole discussion got me thinking about c-m-p in general.
16:43stuartsierrahttp://dev.clojure.org/display/design/Clojure+Maven+Plugin
16:43cemerickstuartsierra: re: 322: are you saying that the compile-interop-forms name is nebulous, or something more?
16:44stuartsierramore
16:44stuartsierraI'm asking if it is possible, generally, to determine what an interop form *is*
16:45stuartsierraMaybe it is, in which case great, I'm just not sure.
16:45cemerickAnything that emits a classfile based on the value of *compile-interop-forms*? :-P
16:46stuartsierrawel...
16:47stuartsierraBasically, is there a situation where compile-interop-forms would get you into trouble the same way transitive AOT does now?
16:47stuartsierraFor example, deftype with in-line method definitions
16:48cemerickRight; well, if you're looking to do named-class-interop, then that trouble is necessary / a benefit.
16:49cemerickActually, do inline method defs have AOT problems? They're not entangled with (potentially) changing Clojure interfaces, etc.
16:49stuartsierraare you sure about that?
16:50cemerickNo, just hypothesizing.
17:00rata_hi
17:26joshua__How can I get the size in kilobytes of a string?
17:29stuartsierradepends on the encoding
17:29stuartsierra(/ (count (.getBytes "the string" "UTF-8")) 1024)
17:30joshua__Thank you so much that puts me on the right track at least.
17:30stuartsierra'welcome
17:32laurusWill there ever be a version of Clojure that is not on JVM/.NET?
17:33amalloyhm. i want to do something like (with-in-str "1 2 3" (repeatedly read)), but laziness causes the read to actually occur outside the with-in-str context
17:34joshua__&(doc with-in-str)
17:34sexpbot⟹ "Macro ([s & body]); Evaluates body in a context in which *in* is bound to a fresh StringReader initialized with the string s."
17:35tonyllaurus: where you thinking of some platform in specific?
17:35laurustonyl, C :P
17:36tonylThe idea of clojure is going for the VMs I don't think language ports go with it
17:36amalloychouser: you're the one i usually bother when laziness gets confusing
17:36laurustonyl, yeah... I know. I wish they would have a C implementation though.
17:36amalloylaurus: why?
17:37laurusamalloy, both of those VMs are corporate
17:37Raynesamalloy: So that there wouldn't be any libraries, of course!
17:37tonylthere is open versions of the jvm
17:37laurusRaynes, one reason I stopped being interested in Clojure is the fact that you constantly have to use Java libraries...
17:37amalloyin order to do all the magic stuff clojure does, you'd have to reimplement most of java and c# in c anyway
17:37tonyl*are
17:38Rayneslaurus: You don't have to use any Java libraries if you don't want to. It's kind of silly not to when you have them at your disposal though.
17:38joshua__larus: maybe a java to c compiler exists?
17:38amalloylaurus: that's a feature, not a bug
17:38RaynesBut, if you like reinventing the wheel, you can certainly do that! :>
17:38laurusIt's okay, I'm just not that into the Java infrastructure, is all
17:39laurusAnyway, it was just a question. I thought the "Clojure-in-Clojure" work might lead to the direction of something like a "C-Clojure".
17:40RaynesIt could happen one day. Don't expect it any time soon.
17:40tonylthe idea of platform independent does makes my eyes shine
17:40tonyls/makes/make/
17:40sexpbot<tonyl> the idea of platform independent does make my eyes shine
17:40laurusRaynes, I won't, but thanks for your input!
17:41laurustonyl, it would make Clojure useable for small scripts, etc.
17:41RaynesClojure in Clojure is more of a backseat thing at this point. Some 1.2 features that were added had Clojure in Clojure in mind, but it is not the priority or goal at this point in time.
17:41laurusRaynes, ah, ok
17:41Raynescake does that!
17:42laurusYes I knew someone would say that :p
17:42amalloychouser: never mind. if i stick a doall in at the right place, it works, which i guess is reasonable
17:42RaynesI'm not saying persistent JVMs are the 'solution' or that they solve the problem. They are, of course, a band-aid. Does the trick for my purposes though.
17:43laurusRaynes, that's cool... I just wish there was a C implementation of Clojure is all, but I understand it's not a priority for the project
17:44RaynesI'd be interested in a Parrot implementation.
17:45laurusHonestly I wish there would be a Guile implementation, but that's probably wishful thinking :P
17:45RaynesEverybody seems to want a JavaScript implementation
17:45laurusHmm...
17:50tonylor Erlang
17:50tonylthe VM
17:51laurustonyl, the thing that is so cool about the Guile VM is it is basically the Scheme programming language
17:51laurusSo it would be pretty neat for Clojure, IMO
18:16dnolenLogos 0.2 aka Life w/o Tail Call Optimization, http://dosync.posterous.com/life-without-tail-call-optimization
18:36KirinDaveHum
18:36KirinDaveStuart's article on ibm.com is good
18:37KirinDavebut I still don't get how protocols don't encourage massive code duplication without being explicitly merged in maps
18:38dnolenKirinDave: also macros, I've been using macros to when I need to extend types to the same protocol with identical implementations.
18:38KirinDavednolen: Yeah, I haven't published it yet but I have this thing that lets you define a static and dynamic default behavior in unison.
18:39KirinDavednolen: So you can do sensible defaults.
19:38bortrebwhat's the best way to do file-system operations with clojure like delete a directory tree, copy files, etc? I'm seeing the jakarta commons io as being pretty good, but was wondering if there is something better>
19:40amalloyclojure.java.io might be good; i don't know it very well
19:40Raynesclojure.java.io doesn't have operations for a lot of stuff like that. Rather, you'd want to check out the java.io.File API.
19:40Rayneshttp://download.oracle.com/javase/6/docs/api/java/io/File.html
19:41RaynesIn this case, you'd be looking for the 'delete' method. (.delete (File. "/path/to/some/directory/"))
19:41bortrebFile alone doesn't have too much either... you can't recurvisely delete a folder for example
19:41RaynesThere is also a function for creating File objects in clojure.java.io
19:42Raynesbortreb: I feel your pain. commons-io has a lot of useful stuff.
19:42bortrebis that the "standard" way to get the functionality that's not in File?
19:43bortrebjust use jakarta.commons.io?
19:43Rayneshttp://commons.apache.org/io/apidocs/
19:43Rayneshttp://commons.apache.org/io/
19:44auserHow about this Raynes? http://commons.apache.org/vfs/
19:44RaynesI've only ever used commons-io.
19:49bortrebcool, thanks Raynes, auser
20:57jk_ls