Possible bug in LockingTransaction

2013-09-10 Thread Brandon Ibach
I have found what appears to be a bug in LockingTransaction, albeit one that probably wouldn't occur often. But, I suppose that's a given for a previously undiscovered problem in oft-used code that hasn't changed for some while. :) I'm using the Clojure 1.4 library strictly from Java code and

Re: new ClojureDocs experiment

2013-09-10 Thread Steven Degutis
All very good points. One of my assumptions was that people don't use wikis simply because it's Yet Another Account to sign up for, so this being hosted on github would be a much lower barrier-to-entry for contributing examples. But I'm not sure that's a valid assumption for anyone besides just me

Re: new ClojureDocs experiment

2013-09-10 Thread John Gabriele
On Sunday, September 8, 2013 4:07:33 AM UTC-4, Steven Degutis wrote: > > https://github.com/sdegutis/clojuredocs/wiki > > {snip} > > Thoughts? > > Hi Steven, This is a nice piece of work. Thank you. Some thoughts: * Wikis are difficult to keep nice. And, seemingly contradictory to that, it

Re: finding retained head

2013-09-10 Thread Armando Blancas
> > I also suspected the closure over the matrix argument as being the > root cause but was puzzled when using doseq instead made the problem > go away... > > Right, it doesn't seem to be a hold in the closure, unless the compiler could tell when to release it, which is the case when the code

Re: finding retained head

2013-09-10 Thread Brian Craft
(defmacro transaction [& body] `(transaction* (fn [] ~@body))) I'm not sure how to avoid that. The anonymous function created here doesn't take parameters. On Tuesday, September 10, 2013 8:55:42 PM UTC-7, Brian Craft wrote: > > Ah. So the root of my problem is that the jdbc/transaction macro

Re: finding retained head

2013-09-10 Thread Brian Craft
Ah. So the root of my problem is that the jdbc/transaction macro creates a closure in my function.. (defmacro transaction On Tuesday, September 10, 2013 7:34:32 PM UTC-7, Armando Blancas wrote: > > Can anyone explain to me what's happening here? Something about creating a >> anonymous function?

Re: finding retained head

2013-09-10 Thread Sean Corfield
FWIW, Brian and I were looking at this off-list and we changed (dorun (map identity matrix)) to (doseq [x matrix] (identity x)) and that seemed to work just fine - even in Brian's more complicated case. Given that dorun specifically says it doesn't hold on to the head, I would have expected the two

Re: Clojure & Jruby (Ruby on Rails) Interop

2013-09-10 Thread Ron Toland
Rodrigo, We went with RabbitMQ over ZeroMQ mostly because we were more familiar with it. As I understand it, ZeroMQ is less of a message-queueing system and more "sockets on steroids." Which one is best will depend pretty strongly on your particular usecase. In our case, our messages are prett

Re: finding retained head

2013-09-10 Thread Armando Blancas
> > Can anyone explain to me what's happening here? Something about creating a > anonymous function? > The problem is not creating the anonymous function but that it closes over the matrix argument. The closure passed on to blah will keep a reference to matrix until blah returns. This won't ha

Re: [ANN] Introducing VDD Core - Visualization Driven Development in Clojure

2013-09-10 Thread Mark Mandel
Thanks for posting this - at first glance it looks very cool :) See you at Strangeloop - I've been looking forward to this talk :) Mark On Wed, Sep 11, 2013 at 10:13 AM, Jason Gilman wrote: > I've just released a new open source tool, VDD Core, to help enable > Visualization Driven Development

Re: finding retained head

2013-09-10 Thread Brian Craft
Copying the pattern of jdbc/transaction*, I tried this: (defn blah [func] (func)) (defn load-exp [file timestamp filehash matrix] (blah (fn [] (dorun (map identity matrix) which also consumes the heap. Can anyone explain to me what's happening here? Something about creating a anonymo

Re: finding retained head

2013-09-10 Thread Brian Craft
It seems to be something about the jdbc/transaction macro. If I rewrite load_exp so it does nothing but walk the seq, it still consumes the heap: (defn load-exp [file timestamp filehash matrix] (jdbc/transaction (dorun (map identity matrix If I remove the jdbc/transaction call, it's f

Re: Clojure newbie code review

2013-09-10 Thread Igor Demura
Thank you Philipp, this is really helpful! Marshall's guess where *read-eval* from is right. I didn't googled what does it mean, just left as-is from the Leiningen template. Talking on replacement to join. For this function I'll link additional library. My question how this works: in C++ world,

Re: Clojure newbie code review

2013-09-10 Thread Andy Fingerhut
Regarding your question about join: The clojure.string namespace contains the join function recommended to you. All functions in the clojure.string namespace, and several other namespaces (see below for a complete list) are part of the Clojure JAR file, and in that sense come at "no additional cha

[ANN] Introducing VDD Core - Visualization Driven Development in Clojure

2013-09-10 Thread Jason Gilman
I've just released a new open source tool, VDD Core, to help enable Visualization Driven Development in Clojure. Visualization Driven Development and VDD Core are the subject of my Strange Loop talk ( https://thestrangeloop.com/sessions/visualization-driven-development) next week. VDD Core's goa

[ANN] Blackwater 0.0.8

2013-09-10 Thread Christopher Allen
https://github.com/bitemyapp/blackwater Single-line SQL query formatting, separate Korma and c.j.j namespaces, ability to use a custom fn with set-logger! now as well. Any additional feature requests/changes should continue to hit the Github issues. Cheers all. --- Chris -- -- You received

Re: finding retained head

2013-09-10 Thread Brian Craft
Trying jhat now, reference chain here: --> cavm.h2$load_exp$fn__165@0x2aaab4b04660 (56 bytes) (field matrix:) --> clojure.lang.LazySeq@0x2aaab4b05388 (48 bytes) (field s:) --> clojure.lang.Cons@0x2aaab4b0fe08 (48 bytes) (field _more:) --> clojure.lang.LazySeq@0x2aaab4b10330 (48 bytes) (field s:) -

finding retained head

2013-09-10 Thread Brian Craft
>From jmap output it's pretty clear I'm retaining the head of a seq somehow, but I have no idea how, or where. Is there any way to find the reference, besides staring at code waiting for enlightenment? -- -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: new ClojureDocs experiment

2013-09-10 Thread Steven Degutis
Thanks :) By the way, it's probably *not* a good idea to use this github-wiki version of clojuredocs. Everyone's still using clojuredocs.org, and we don't want to scatter data (examples, etc) between two websites. My reason for posting this was to hear the community's thoughts on this alternate i

Re: Functional purity and "globals" in Clojure

2013-09-10 Thread Christopher Allen
I do a hybrid in Bulwark. github.com/bitemyapp/bulwark/ Defaults to accepting a closure of a config map for nice testing and hygiene, with a fallback to a global atom map for configuration for muggles. Works well for me. On Tuesday, September 10, 2013 12:19:35 AM UTC-7, Alexandr Kurilin wrote:

Re: Clojure newbie code review

2013-09-10 Thread Marshall Bockrath-Vandegrift
Philipp Meier writes: > (alter-var-root #'*read-eval* (constantly false)) > => why do you think this is necessary? Some versions of the Leiningen `app` template put this in the skeleton initial source file. I assume that’s where this came from. -Marshall -- -- You received this message beca

Re: Functional purity and "globals" in Clojure

2013-09-10 Thread Softaddicts
This presentation is funny from Stuart is interesting and funny to watch as usual :) The "mud ball" issue is not new and you can face it in other languages than Lisp that lack a single straight jacket with which anything needs to be defined (like classes). Freedom comes with a price, you cannot

Re: Functional purity and "globals" in Clojure

2013-09-10 Thread Timothy Baldridge
This Clojure/West talk deals with many of these concepts. http://www.infoq.com/presentations/Clojure-Large-scale-patterns-techniques Timothy On Tue, Sep 10, 2013 at 6:35 AM, Philipp Meier wrote: > > > Am Dienstag, 10. September 2013 12:58:46 UTC+2 schrieb Luc: > >> I agree more or less, I hat

Re: Functional purity and "globals" in Clojure

2013-09-10 Thread Philipp Meier
Am Dienstag, 10. September 2013 12:58:46 UTC+2 schrieb Luc: > > I agree more or less, I hate having my configuration data spread > everywhere. > I prefer to dedicate a name space to maintain/access configuration data. > I usually split access to resources using bundles. > A bundle can reflect

Re: [ANN] core.typed 0.2.5, News

2013-09-10 Thread Leonardo Borges
Thanks for all your work ambrose! Core.typed is quite a feat. And I can confirm ambrose is amazingly responsive on freenode. Every time I bug him, it works :) On 10/09/2013 9:57 PM, "Ambrose Bonnaire-Sergeant" < abonnaireserge...@gmail.com> wrote: > Hi, > > Pushing another release of core.typed

[ANN] core.typed 0.2.5, News

2013-09-10 Thread Ambrose Bonnaire-Sergeant
Hi, Pushing another release of core.typed, mostly bug/documentation fixes. We now push a "slim" jar which does not include AOT file. See the README for dependency information. See the CHANGELOG for specific changes. I'm also starting to provide functions t

Re: Functional purity and "globals" in Clojure

2013-09-10 Thread Softaddicts
I agree more or less, I hate having my configuration data spread everywhere. I prefer to dedicate a name space to maintain/access configuration data. I usually split access to resources using bundles. A bundle can reflect anything you want in your design, including a controller... This allows you

Re: Clojure newbie code review

2013-09-10 Thread Philipp Meier
Am Dienstag, 10. September 2013 01:24:10 UTC+2 schrieb Igor Demura: > > Hi Clojure community, > > (I tried codereview.stackaxchange.com before, but no responses where) I'm > Clojure newbie, and feel very excited about it and functional programming > in general. I wrote tiny app (59 lines of code

Re: Functional purity and "globals" in Clojure

2013-09-10 Thread Philipp Meier
Am Dienstag, 10. September 2013 09:19:35 UTC+2 schrieb Alexandr Kurilin: > >- Something in the middle where perhaps you agree to never directly >reference the configs map from your models (again, thinking MVC here) and >instead only ever access it from controllers, and pass the neces

Functional purity and "globals" in Clojure

2013-09-10 Thread Alexandr Kurilin
I'm trying to determine how to best deal with the concept of globals in Clojure. Say I have a map of configuration values for my Ring app, populate at app startup from disk or env, and I need to reference the contents of this map from all over the project. Assuming MVC, models and controllers a