Re: macro woes (deftype generator)

2013-09-12 Thread Karsten Schmidt
Hi Mike, thank you, I've checked out your vectorz lib in the past and am also aware of Zach's clj-tuple (which this concrete part is much closer too), but I'm looking for a pure Clojure & CLJS compatible solution (using CLJX). This alI is part of a longwinded (on/off 2+ yrs now) refactoring/total r

Re: Clojure and freelancing

2013-09-12 Thread Mamun
Pedestal is powerful framework, I don't try it. Because it is still changing very frequently. On the other hand I am not sure what type of application Pedestal is good choice. I mean game, messaging (Chat, Real time Chart) or traditional CRUD based web application. But if you are looking somet

Re: macro woes (deftype generator)

2013-09-12 Thread Karsten Schmidt
Hi Konrad, yeah, I already saw that the k# is being unravelled in this version, but I don't understand why. Calling swizzle* with an existing deftype instance directly is working absolutely fine, just not when called from within the other macro. So my confusion remains about maybe needing somewhere

Re: Possible bug in LockingTransaction

2013-09-12 Thread Brandon Ibach
Thanks for the confirmation, Alex. Ticket filed. :) Aaron, as shown in the test case attached to the ticket, I'm calling the Clojure library from Java code, so I use the Agent.dispatch() method. The project where this issue was found is attempting

Re: macro woes (deftype generator)

2013-09-12 Thread Mike Anderson
Understood. vectorz-clj is going to stay JVM-only for the foreseeable future, so it won't fit if you need ClojureScript. On the other hand, core.matrix is pure Clojure and totally protocol-based, so it should (I think!) be pretty easy to port to ClojureScript, and it's easy to extend the protocols

Re: Possible bug in LockingTransaction

2013-09-12 Thread Meikel Brandmeyer (kotarak)
Hi, Am Donnerstag, 12. September 2013 11:11:36 UTC+2 schrieb Brandon Ibach: > > Aaron, as shown in the test case attached to the ticket, I'm calling the > Clojure library from Java code, so I use the Agent.dispatch() method. The > project where this issue was found is attempting to use Clojure'

Re: macro woes (deftype generator)

2013-09-12 Thread Meikel Brandmeyer (kotarak)
Hi, maybe this gives you a hint, one why it happens: user=> (let [k :xyz] (macroexpand-1 '(swizzle* Vec3 v k {}))) (new Vec3 (. v k) {}) The problem is that swizzle* is a macro. It has no access to runtime information! It sees only the symbol not its value. Calling it with a literal keyword wo

Re: The Eclipse Public License is not a good license

2013-09-12 Thread Phillip Lord
This is an interesting thread. I think, though, it repeats what is a misconception about GPL -- that you cannot produce GPL code using Clojure. This isn't true, as far as I can see -- you can write GPL code using any language, because it doesn't usage restrictions in GPL do not percolate through a

Re: Clojure, floats, ints and OpenGL

2013-09-12 Thread Alex Fowler
Does somebody from the development team read this user group? Or maybe I have addressed my questions to a wrong place? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts

Re: Sorting a collection on multiple fields

2013-09-12 Thread ulsa
The thing is that I need to provide some kind of sorting specification in my Pedestal app, and I thought the MongoDB way of using an object with { field: 1/-1 } was a nice spec. That's why I went all the way up to a function that takes such a spec. Obviously, I can't use the (. f (compare x y))

another game of exploding heap, via clojure.string/split

2013-09-12 Thread Brian Craft
After working around the seq + closure = death problem, I still had a severe memory leak in my code, which took many hours to find. Holding a reference to a string returned by clojure.string/split is somehow retaining a reference to the original string. In my case I needed to hold the first col

Why this difference between nrepl and standalone jar?

2013-09-12 Thread Denis Papathanasiou
I've got a simple function which loops through a list of strings, accumulating the total length of each, and returning a summary tuple based on some criteria. The last part of the function looks like this: (loop [eligible-strings eligible-strings, counted-length 0, ind -1] (if (>= cou

Re: finding retained head

2013-09-12 Thread Brian Craft
or perhaps it's that macroexpand drops the ^:once On Thursday, September 12, 2013 10:55:28 AM UTC-7, Brian Craft wrote: > > I think my monkey-patch of jdbc/transaction didn't take. Doing > user/sourcery on it shows your version, but doing a macroexpand-all shows > the original. > > My code calls

Re: finding retained head

2013-09-12 Thread Brian Craft
After patching both transaction and with-connection (which is also used by korma.db/transaction, and also creates a closure), I can pass in the seq w/o leaking. Thanks, Christophe. On Thursday, September 12, 2013 11:20:11 AM UTC-7, Brian Craft wrote: > > or perhaps it's that macroexpand drops t

Re: [ANN] clojuretip.herokuapp.com

2013-09-12 Thread Ruslan Prokopchuk
Oh, where this awesomeness has been lost today? Heroku replies: *No such app* On Saturday, September 7, 2013 8:09:06 PM UTC+3, Steven Degutis wrote: > > Yesterday in #clojure: > > To get your random API learnin' of the day, just run: (->> > clojure.core quote the-ns ns-publics seq rand-nth val m

Re: Clojure, floats, ints and OpenGL

2013-09-12 Thread Christophe Grand
As others have already said: long & double only is a restriction for function args. Not for interop. Not for local computations. Not for args to definterface methods. The reason for this restriction is the combinatorial explosion. (So you may have to roll your own interface and a couple of helper m

Re: finding retained head

2013-09-12 Thread Sean Corfield
The latest java.jdbc snapshot (of 0.3.0) includes this fix so you can either get it via Leiningen from the sonatype snapshots repo or git clone it and do mvn install (or lein install since java.jdbc has a project.clj file now). I'll try to cut an official alpha5 release shortly once I've reviewed

Re: docs for ^:once

2013-09-12 Thread Brian Craft
Hm, I think I'm wrong about that workaround. On Thursday, September 12, 2013 12:10:44 PM UTC-7, Brian Craft wrote: > > Thanks. > > In my case, I started with code something like > > (defn load-exp [myseq] > (kdb/transaction body)) > > where body has references to myseq. Christophe's patch of jdb

docs for ^:once

2013-09-12 Thread Brian Craft
I still don't really understand ^:once. Are there docs anywhere? Is there a way to inspect a function for this property? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts

Re: another game of exploding heap, via clojure.string/split

2013-09-12 Thread Andy Fingerhut
Clojure's substr, and many other functions that return substrings of a larger one (e.g. re-find, re-seq, etc) are based on Java's java.lang.String/substring() method behavior. Before Java version 7u6 or thereabouts, this was implemented in O(1) time by creating a String object that referred to an

Re: finding retained head

2013-09-12 Thread Brian Craft
I think my monkey-patch of jdbc/transaction didn't take. Doing user/sourcery on it shows your version, but doing a macroexpand-all shows the original. My code calls via korma as kdb: => (clojure.walk/macroexpand-all '(kdb/transaction nil)) (if (clojure.java.jdbc/find-connection) (clojure.java.j

Re: [ANN] CloCoP - constraint programming for Clojure

2013-09-12 Thread Alex Engelberg
It's under the Eclipse Public License (as stated in project.clj), with pull requests welcome. I just added the license info to the Readme as well. Sorry about the confusion. I've also created a 0.2.1 branch (without any changes yet) for people to pull-request new features into. (Though if you'r

[ANN] *Extended Deadline* CFP for 2013 Workshop on Scheme and Functional Programming

2013-09-12 Thread William Byrd
The paper submission deadline has been extended one week, to Friday, Sept. 20 (anytime in the world). We do not anticipate any further deadline extensions. Please note that short (6 pages + references) papers are encouraged. Clojure papers are welcome, as are first-time authors. Cheers, --Wil

ANN Meltdown 1.0.0-beta1 is Released

2013-09-12 Thread Michael Klishin
Meltdown [1] is a Clojure message passing library built on top of Reactor. 1.0.0-beta1 is a development milestone release. Release notes: http://blog.clojurewerkz.org/blog/2013/09/12/meltdown-1-dot-0-0-beta1-is-released/ 1. https://github.com/clojurewerkz/meltdown -- MK http://github.com/michae

Re: docs for ^:once

2013-09-12 Thread Christian Sperandio
You'll find a case of use of this term here: http://clj-me.cgrand.net/2013/09/11/macros-closures-and-unexpected-object-retention/ Le 12 sept. 2013 20:56, "Brian Craft" a écrit : > I still don't really understand ^:once. Are there docs anywhere? Is there > a way to inspect a function for this pro

Re: ANN How to Write a Useful Change Log

2013-09-12 Thread John Gabriele
One thing I like to see under each release's heading in the ChangeLog.md file is a date indicating when the release was made. -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that

[ANN] modern-cljs tutorials updated

2013-09-12 Thread Mimmo Cosenza
Hi All, after a very long (and beautiful vacation) I came back on the modern-cljs series of tutorials to update its dependencies and correcting few deficiencies regarding CLJS unit test. I still have to reach a much better understanding of the lein profiles to fix the second part of the Tutorial

Re: docs for ^:once

2013-09-12 Thread Brian Craft
Thanks. In my case, I started with code something like (defn load-exp [myseq] (kdb/transaction body)) where body has references to myseq. Christophe's patch of jdbc/transaction works. I can also work around it like (defn load-exp [& args] (apply (^:once fn [myseq] (kdb/transaction body))

Different behaviour when using (def ^:macro ...) outside top-level

2013-09-12 Thread André Gustavo Rigon
Hi! If I evaluate (def ^:macro my-defn1 #'defn) a macro named 'my-defn1' is defined, which I can use like 'defn'. However, if I use instead (if true (def ^:macro my-defn2 #'defn)) the var for 'my-defn2' doesn't have the :macro metadata set and I can't use it as a macro, even though the 'de

Re: another game of exploding heap, via clojure.string/split

2013-09-12 Thread Andy Fingerhut
I have just added some discussion of this on ClojureDocs.org for the function clojure.core/subs, and references to that discussion for several other Clojure functions that I am pretty sure are affected, e.g. re-find, re-seq, re-matches, clojure.string/split, replace, replace-first http://cloju

Re: [ANN] Ayler - A simple namespace/documentation browser

2013-09-12 Thread Joel Holdbrooks
This is really cool! Nice work! On Wednesday, September 11, 2013 8:35:31 AM UTC-7, babysnakes wrote: > > Hi > > As a clojure noob I constantly find myself browsing through various API > docs to see what's available in a library. While this data is available in > a REPL it's not easy to look for

ANN How to Write a Useful Change Log

2013-09-12 Thread Michael Klishin
The ClojureWerkz team recently started writing a series of blog posts about how we do things (and why). The series were started a while ago in [1]. Here's the second part, on writing useful change logs: http://blog.clojurewerkz.org/blog/2013/09/07/how-to-write-a-useful-change-log/ If you have exa

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

2013-09-12 Thread Brent Millare
I want to support that notion. For the purpose of information gathering, you should create visuals for your project since not everyone can try it out on whatever computer they are on. On Thursday, September 12, 2013 2:25:53 AM UTC-4, martin_clausen wrote: > > Looks very interesting. > > While th

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

2013-09-12 Thread Jason Gilman
Sorry for the oversight. I've heard this on multiple channels now. I'll have pictures up soon. Thanks for the feedback. On Thu, Sep 12, 2013 at 7:52 PM, Brent Millare wrote: > I want to support that notion. For the purpose of information gathering, > you should create visuals for your project s

Re: Clojure, floats, ints and OpenGL

2013-09-12 Thread Mikera
On Friday, 13 September 2013 00:07:03 UTC+8, Christophe Grand wrote: > As others have already said: long & double only is a restriction for > function args. Not for interop. Not for local computations. Not for args to > definterface methods. The reason for this restriction is the combinatorial

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

2013-09-12 Thread Jason Gilman
I've updated the README files with images in vdd-core and vdd-core-examples. https://github.com/Element84/vdd-core https://github.com/Element84/vdd-core-examples On Thu, Sep 12, 2013 at 8:31 PM, Jason Gilman wrote: > Sorry for the oversight. I've heard this on multiple channels now. I'll > ha

Re: [ANN] modern-cljs tutorials updated

2013-09-12 Thread Cedric Greevey
On Thu, Sep 12, 2013 at 2:47 PM, Mimmo Cosenza wrote: > Hi All, > after a very long (and beautiful vacation) I came back on the modern-cljs > series of tutorials... > Oh, c'mon. Would you write (map #(* % 2.0 my-seq))? We're Lispers! We're supposed to get our parenthesis placement right! :) --

Re: Clojure, floats, ints and OpenGL

2013-09-12 Thread Mikera
People *have* run into this problem a lot. People have just worked around it. The existence of great libraries like HipHip and vectorz-clj and some of Zach's stuff is IMHO to a large extent because people have needed high performance operations (often involving primitives / primitive arrays / c

Re: another game of exploding heap, via clojure.string/split

2013-09-12 Thread Cedric Greevey
On Thu, Sep 12, 2013 at 3:33 PM, Andy Fingerhut wrote: > I have just added some discussion of this on ClojureDocs.org for the > function clojure.core/subs, and references to that discussion for several > other Clojure functions that I am pretty sure are affected, e.g. re-find, > re-seq, re-matches

Re: another game of exploding heap, via clojure.string/split

2013-09-12 Thread Brian Craft
Ouch. Thanks for the explanation. On Thursday, September 12, 2013 9:46:47 AM UTC-7, Andy Fingerhut wrote: > > Clojure's substr, and many other functions that return substrings of a > larger one (e.g. re-find, re-seq, etc) are based on Java's > java.lang.String/substring() method behavior. > > Be

Re: [ANN] CloCoP - constraint programming for Clojure

2013-09-12 Thread Daniel Jomphe
So then you'd also need a 0.3.0 branch to allow people to pull-request new features and/or breaking changes, since those things are not semantically ok to do in a patch release (the 1 in 0.2.1). Of course there are many other ways to look at this workflow thing around pull requests, versioning

Re: Clojure, floats, ints and OpenGL

2013-09-12 Thread Timothy Baldridge
>> If we can do away with the interface generation, then support for arbitrary primitive arguments should become relatively straightforward. How would we even call a function without an interface? Remember everything is defined behind vars, so you simply can't assume that a function won't be re-de

Re: Clojure, floats, ints and OpenGL

2013-09-12 Thread Timothy Baldridge
There are a combination of issues all contributing to the lack of response on this subject. But before I continue let me state that these opinions are my own. I have worked on Clojure and core.async, but these comments are going to be personal conjecture and opinions: 1) As mentioned there is a hi

Re: [ANN] Ayler - A simple namespace/documentation browser

2013-09-12 Thread Haim Ashkenazi
Thanks. On Fri, Sep 13, 2013 at 12:55 AM, Joel Holdbrooks wrote: > This is really cool! Nice work! > > > On Wednesday, September 11, 2013 8:35:31 AM UTC-7, babysnakes wrote: >> >> Hi >> >> As a clojure noob I constantly find myself browsing through various API >> docs to see what's available in

Re: Different behaviour when using (def ^:macro ...) outside top-level

2013-09-12 Thread Gunnar Völkel
`def` does not handle `:macro true` metadata on the provided symbol. But you can work around that like clojure.core does, e.g. for the macro `defmacro` after the `(def ... defmacro ...)` call the following is called: `(. (var defmacro) (setMacro))` -- -- You received this message because you

Re: Different behaviour when using (def ^:macro ...) outside top-level

2013-09-12 Thread Cedric Greevey
On Fri, Sep 13, 2013 at 1:08 AM, Gunnar Völkel < gunnar.voel...@googlemail.com> wrote: > `def` does not handle `:macro true` metadata on the provided symbol. > Umm ... according to the OP, it worked perfectly when the def was a top-level form, just not when it was nested in an if. If your claim w

Re: docs for ^:once

2013-09-12 Thread Jozef Wagner
There is also a recent discussion on IRC about that, http://clojure-log.n01se.net/date/2013-08-29.html#10:47 and official documentation mentions it at the end of http://clojure.org/lazy JW On Thu, Sep 12, 2013 at 8:56 PM, Brian Craft wrote: > I still don't really understand ^:once. Are there