Scientific computing article with Clojure code

2013-03-06 Thread Konrad Hinsen
My latest article in "Computing in Science and Engineering", with example code in Clojure, in free access for a while: A Glimpse of the Future of Scientific Programming http://bit.ly/15yeIjw Konrad. -- -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: features expression

2013-03-06 Thread Brent Millare
+1 Isn't is possible to accomplish all these efforts using tagged literals? https://github.com/miner/wilkins This way the facilities for read-time code generation can be customized and any reader that supports tagged-literals will support this. All of this is data provided as arguments, no eva

Re: features expression

2013-03-06 Thread Brian Goslinga
Do we really need new syntax for feature expressions? Although it would be more ugly than CL's feature expressions, we could use a reader literal. For example #feature [ ]. Using a reader literal is simple, compatible with EDN, and allows for the feature expressions to be backported to an older

Re: ANN: Iota 1.0.2 release (Reducers for text files)

2013-03-06 Thread Paul deGrandis
I agree, this is a really cool project. Nice work! -- -- 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 from new members are moderated - please be patient with your first

Re: clojure.java.jdbc turning into a DSL/ORM?

2013-03-06 Thread Thomas Heller
Thanks for clearing that up, sounds good. :) Regards, /thomas On Wednesday, March 6, 2013 8:52:54 PM UTC+1, Sean Corfield wrote: > > On Wed, Mar 6, 2013 at 7:44 AM, Thomas Heller > > > wrote: > > I'm using [clojure/java.jdbc "0.2.3"] and wasn't sure about a function > so I > > looked at the

Re: how does one embed nrepl in his own application?

2013-03-06 Thread Chas Emerick
On Mar 6, 2013, at 3:04 PM, Jim - FooBar(); wrote: > On 06/03/13 19:30, Sean Corfield wrote: >> What's your use case that you'd have folks connecting into the nrepl >> server without a regular nrepl client? > > I was just curious about minimal ways of connecting remotely...installing > lein migh

Re: ANN: Iota 1.0.2 release (Reducers for text files)

2013-03-06 Thread kovas boguta
Very cool! Been wanting to play with something like this. On Wed, Mar 6, 2013 at 5:53 AM, Alan Busby wrote: > Hi all, > > With the release of Clojure 1.5 and it's new reducers, I figured this would > be a good time to release a library to help with file IO for reducers. As > reducers can only o

Re: how does one embed nrepl in his own application?

2013-03-06 Thread Jim - FooBar();
On 06/03/13 19:30, Sean Corfield wrote: What's your use case that you'd have folks connecting into the nrepl server without a regular nrepl client? I was just curious about minimal ways of connecting remotely...installing lein might not always be an option. Jim -- -- You received this messa

Re: clojure.java.jdbc turning into a DSL/ORM?

2013-03-06 Thread Sean Corfield
On Wed, Mar 6, 2013 at 7:44 AM, Thomas Heller wrote: > I'm using [clojure/java.jdbc "0.2.3"] and wasn't sure about a function so I > looked at the source and noticed that the git master seems to be turning > into some sort of DSL/ORM? Not really. The API (for the upcoming 0.3.0 version) has been

*clojure-version* and "feature" data

2013-03-06 Thread Brandon Bloom
Hi all, In the interest of Clojure & ClojureScript interop, I'd like to break down the discussion for dev.clojure.org/display/design/Feature+Expressions into two parts: 1) The potential syntax changes or core macro additions and 2) the underlying data source that would allow for conditional com

Re: how does one embed nrepl in his own application?

2013-03-06 Thread Sean Corfield
Ah, I didn't even know about tty support! I just take the path of least resistance and use an nrepl client (nrepl.el in Emacs or lein repl at the command line)... What's your use case that you'd have folks connecting into the nrepl server without a regular nrepl client? On Wed, Mar 6, 2013 at 1:3

Re: does a future call redirect printlns?

2013-03-06 Thread George Oliver
I found the problem -- I was blocking on a select call made from the while loop, so my shutdown function wasn't cleaning up properly (not to mention my while test was a little goofy!). Adding a timeout to the select fixes it. -- -- You received this message because you are subscribed to t

ANN Langohr 1.0.0-beta13 is released

2013-03-06 Thread Michael Klishin
Langohr [1] is a Clojure RabbitMQ client that embraces AMQP 0.9.1 Model [2]. 1.0.0-beta13 is a development release that has *breaking API changes*. Release notes: http://blog.clojurewerkz.org/blog/2013/03/06/langohr-1-dot-0-0-beta13-is-released/ 1. http://clojurerabbitmq.info 2. http://www.rabbi

How to ensure consistency when accessing database?

2013-03-06 Thread bruce li
Hello, I'm working on a piece of code that uses congomongo to access mongodb. What I want to implement is to use one collection of the DB as a queue(let's say, it's called "task"). Using congomongo, it's easy to fetch a task that is of status :queue : (def t (fetch-one :task :where {:status :queue

clojure.java.jdbc turning into a DSL/ORM?

2013-03-06 Thread Thomas Heller
Hey, I'm using [clojure/java.jdbc "0.2.3"] and wasn't sure about a function so I looked at the source and noticed that the git master seems to be turning into some sort of DSL/ORM? Just wondering if the intention is to make the DSL the primary way to work with the API or if clojure.java.jdbc.s

Re: features expression

2013-03-06 Thread Brandon Bloom
> I believe protocols can entirely alleviate the need for feature expressions. How do you figure that? One major incompatibility between Clojure and ClojureScript currently is that the protocols don't match up. If you want a deftype form that is 90% the same, but has a conditional switch for a

Re: ANN: Iota 1.0.2 release (Reducers for text files)

2013-03-06 Thread Michael Klishin
2013/3/6 Alan Busby > Code is available on Github here: https://github.com/thebusby/iota > Library is available on Clojars here: https://clojars.org/iota > Alan, Please add dependency information to the README. Otherwise beginners won't be able to use your project. If you need an example: http

Re: how to get SHA1 of a string?

2013-03-06 Thread Mark C
I used a widely accepted pattern: SHA2+Salt+Iteration, that's been used many times, e.g. in Jasypt http://www.jasypt.org/ so I think that aspect of it is pretty conservative, and virtually all the algorithm's strength lies within the SHA implementation itself - so my opportunity to screw up via

ANN: Iota 1.0.2 release (Reducers for text files)

2013-03-06 Thread Alan Busby
Hi all, With the release of Clojure 1.5 and it's new reducers, I figured this would be a good time to release a library to help with file IO for reducers. As reducers can only operate in parallel over specific collections, like vec, it requires some work to use them against files. Iota wraps a te

Re: nameclashes with java.lang

2013-03-06 Thread Jim - FooBar();
On 06/03/13 10:41, Phillip Lord wrote: Is there no equivalent to :refer-clojure for java.lang? I think java.lang is imported by the ns macro...if you don't use it then you don't get java.lang.* Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: (def function* ... ???

2013-03-06 Thread Tassilo Horn
Gary Verhaegen writes: > Just to clarify, * is a legal character in any symbol in Clojure. > > There seems to be a growing convention of having a function foo* and a > macro foo which does the same thing but with some syntactic sugar. There's a similar situation in clojure's core. let, fn, and

Re: Clojurescript bug

2013-03-06 Thread Giacomo Cosenza
just be aware of the fact that this plugin does not take into account plugins. mimmo On Mar 6, 2013, at 1:06 PM, Tom Hall wrote: > Now that's just what I need, thanks David > > On 5 March 2013 15:42, David Powell wrote: >> You could try the lein-outdated plugin. >> >> https://github.com/ato/l

Re: Clojurescript bug

2013-03-06 Thread Tom Hall
Now that's just what I need, thanks David On 5 March 2013 15:42, David Powell wrote: > You could try the lein-outdated plugin. > > https://github.com/ato/lein-outdated > > It looks at your project.clj, and tells you if there are newer versions of > any of your dependencies, and if so, what they

Re: & args destructuring in functions?

2013-03-06 Thread Marko Topolnik
I don't think that's the question here: x and y are each their own kind of argument, followed by zero or more same-kinded arguments. Take dissoc as an example and compare with select-keys. On Wednesday, March 6, 2013 12:54:13 PM UTC+1, Achint Sandhu wrote: > > I personally think the first (curre

Re: & args destructuring in functions?

2013-03-06 Thread Achint Sandhu
I personally think the first (current) approach is better since it ensures that the abstraction is not leaky from a caller's perspective, e,g. as a user I want to be able to type (+ 1 2 3 4 5) instead of (+ 1 2 [3 4 5]). The fact that the last 3 arguments end up as a collection inside the imple

Re: & args destructuring in functions?

2013-03-06 Thread Marko Topolnik
One criterion would be how often you expect to call with zero or one z. If a lot, use &; otherwise prefer calling with an explicit collection. On Wednesday, March 6, 2013 12:45:38 PM UTC+1, Dave Sann wrote: > > a minor thing. > > which do you prefer? > > (defn blah [x y & zs] ...) , or, (defn bla

& args destructuring in functions?

2013-03-06 Thread Dave Sann
a minor thing. which do you prefer? (defn blah [x y & zs] ...) , or, (defn blah [x y zs] ...) clojure core usually uses the first form. assoc, conj and so forth I have used this because it seems nicer for the caller (blah x y z1 z2 z3) rather than (blah x y [z1 z2 z3]) However, if you regu

Re: Understanding map laziness in relation to vectors

2013-03-06 Thread Achint Sandhu
Thank you Dave. Very much appreciated. Cheers, Achint -- -- 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 from new members are moderated - please be patient with your firs

Re: Understanding map laziness in relation to vectors

2013-03-06 Thread Dave Sann
It's to do with the chunking of sequences. they are taken in blocks of 32. So minimum of 32 will be executed. (first (remove nil? (map foo (vec (range 1 1000) Exeuting for... 1 Exeuting for... 2 Exeuting for... 3 Exeuting for... 4 Exeuting for... 5 Exeuting for... 6 Exeuting for... 7 Exeuting

Understanding map laziness in relation to vectors

2013-03-06 Thread Achint Sandhu
Hi, In the sample code below, I'd like to rerun the first value that returns a non-nil result upon the application of a function (foo in the code sample below). In the real use case , the computation of the function is expensive, so I'd only like to run foo until I find the first non-nil value.

nameclashes with java.lang

2013-03-06 Thread Phillip Lord
Is there no equivalent to :refer-clojure for java.lang? I've built a library for building OWL ontologies. It does this by liberal use of Clojure vars, each pointing to a Java object representing an ontology concept. The difficulty is that I can and do get name clashes. Sometimes these are wit

Asciidoc in clj / cljs ?

2013-03-06 Thread Laurent PETIT
Who will be the first to port asciidoc parser / generators to clj / cljs ? :-) -- -- 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 from new members are moderated - please be

Re: how does one embed nrepl in his own application?

2013-03-06 Thread Jim - FooBar();
On 05/03/13 23:05, Sean Corfield wrote: nrepl uses a specific protocol so you can't use telnet. You'll need an nrepl client of some sort. Leiningen is the easiest one but I believe there are nrepl clients in other languages than Clojure? thanks Sean, I found out that nrepl comes with a tty tran

Re: (def function* ... ???

2013-03-06 Thread Gary Verhaegen
Just to clarify, * is a legal character in any symbol in Clojure. There seems to be a growing convention of having a function foo* and a macro foo which does the same thing but with some syntactic sugar. I believe this practice originates from, or at least was widely publicized by, Christophe Gran

Re: wouldn't it make sense for identity to take variadic args?

2013-03-06 Thread Gary Verhaegen
The multi-arity version of your function, which I would definitely not call identity, could be something along the lines of (fn [& args] (first args)) On 27 February 2013 14:22, Jim foo.bar wrote: > On 27/02/13 13:10, Marko Topolnik wrote: > > A side note: since spans? is a constant within the ma