Re: Workaround for CLJ-1604?

2015-02-19 Thread coltnz
I had a similar problem where I patched it back it in : https://gist.github.com/coltnz/4818581be0231207a046 On Friday, February 20, 2015 at 5:10:50 PM UTC+13, Adam Krieg wrote: > > I'm running into what appears to be the same issue described in CLJ-1604 >

Re: Accessing branches in PersistentTreeMap / sorted-map / CLJ-1008

2015-02-19 Thread Michał Marczyk
Hi David, data.avl trees and maps offer navigable map / set functionality out of the box (with a Clojure API – as mentioned in my comment on CLJ-1008, implementing the "reverse" methods would be straightforward in itself, but problematic due to interactions with other functionality I'd like to hav

Re: Using type to change the behaviour of a function

2015-02-19 Thread Tassilo Horn
Fluid Dynamics writes: > (defn lucky-numbers > ([upto] > (lucky-numbers false upto)) > ([no-max-check upto] > {:pre [(if no-max-check true (<= upto (* 10 1000 1000)))]} > ;; code as before > )) > > > Why not (or no-max-check (<= upto (* 10 1000 1000)))? Becaus

Re: Workaround for CLJ-1604?

2015-02-19 Thread Andy Fingerhut
You could build your own patched version of Clojure, with the proposed patch from the ticket, and use that. If you try that, it would be good to add a comment to the ticket of whether it fixed the problem for you, too. Note: I fully understand if you'd prefer not to do this. Simply giving anothe

Workaround for CLJ-1604?

2015-02-19 Thread Adam Krieg
I'm running into what appears to be the same issue described in CLJ-1604 , where a library that I'm using (Korma) has a function that clashes with a new function in Clojure core with 1.7, update. At the point of invocation, I get the compilation exce

Re: javac-options are ignored

2015-02-19 Thread Jeremy Heiler
On February 19, 2015 at 4:40:16 PM, Felipe Gerard (fger...@interware.com.mx) wrote: > When you set: > > :javac-options ["-target" "1.6" "-source" "1.6” ] This option is only for when you are compiling Java source. https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L249:L25

Re: Using type to change the behaviour of a function

2015-02-19 Thread Fluid Dynamics
On Thursday, February 19, 2015 at 9:54:21 AM UTC-5, Tassilo Horn wrote: > > Cecil Westerhof > writes: > > Hi! > > > At the moment the following: > > (lucky-numbers 1001) > > gives: > > AssertionError Assert failed: (<= upto (* 10 1000 1000)) > user/lucky-numbers > > > > But I would like

Re: Lucky Numbers again

2015-02-19 Thread Cecil Westerhof
2015-02-19 23:25 GMT+01:00 Steve Miner : > I found a better data structure for calculating lucky numbers. The > contrib library data.avl (from Michał Marczyk) has a persistent sorted-set > that supports nth. This runs much faster than my previous attempts. > > (require '[clojure.data.avl :as avl

Injecting html code into selmer

2015-02-19 Thread Sven Richter
Hi, I wonder if this is even possible. I have a string :foo-string "foo" and I pass this string to selmer: (render "templ.html" {foo-string "foo"}) Now in the templ.html I do this: {{foo-string|safe}} which injects this into the html: "foo" But what I need is plain html like this inside the tem

Re: Lucky Numbers again

2015-02-19 Thread Steve Miner
I found a better data structure for calculating lucky numbers. The contrib library data.avl (from Michał Marczyk) has a persistent sorted-set that supports nth. This runs much faster than my previous attempts. (require '[clojure.data.avl :as avl]) (defn lucky-avl ([max] (lucky-avl 1 (apply a

Re: Accessing branches in PersistentTreeMap / sorted-map / CLJ-1008

2015-02-19 Thread David James
Yes, we're on the same page here. I'm very glad Michał has done great work in this Clojure data structure space. Of course, I wouldn't mind if dozens of people agreed, but I'm more interested in the pros/cons before I try to mobilize support. So, to those reading this, I'd be interested to hear

javac-options are ignored

2015-02-19 Thread Felipe Gerard
When you set: :javac-options ["-target" "1.6" "-source" "1.6" ] and :profiles {:uberjar {:aot :all :dependencies [[org.clojure/clojure "1.6.0"]]} } On the project.clj When I execute: lein uberjar The classes that are generated in de target/classes pa

Re: Accessing branches in PersistentTreeMap / sorted-map / CLJ-1008

2015-02-19 Thread Andy Fingerhut
David: I see why you would want that. If you want this soon, I would recommend using data.avl as suggested by Michał, or copy the parts of the sorted-set/map implementation from Clojure and implement it yourself. If you don't want it soon, you could try persuading a few dozen people to vote on C

[ANN] rete4frames, v. 5.2.2 - CLIPS-like expert system shell

2015-02-19 Thread ru
Hello all, New version 5.2.2 of rete4frames CLIPS-like expert system shell is published on https://github.com/rururu/rete4frames. News: 1. Fixed several bugs. 2. Added several utility functions: load-facts, save-facts, slot-value, facts-with-slot-value. 3. Allowed comments in rules and facts f

Re: Accessing branches in PersistentTreeMap / sorted-map / CLJ-1008

2015-02-19 Thread David James
Andy, to take advantage of the Red-Black Tree, I'm looking for public API access to the branches. (I'm not looking for a work-around.) More discussion on this at SO: http://stackoverflow.com/questions/1981859/finding-keys-closest-to-a-given-value-for-clojure-sorted-maps Thanks to both Michał M

Re: Help with Liberator POST route

2015-02-19 Thread Sam Ritchie
Specifying POST tells Compojure that you only want to pass POST requests on to your liberator resource. That part worked. Liberator then received the request and passed it through its workflow. At the "allowed-method?" decision point, liberator checked your declaration and saw only the default

Re: Library (or libraries) for translating REST queries to database queries?

2015-02-19 Thread Bill Piel
Sooo.. it's been a while, but my team finally got around to open sourcing the library we've built to address this need. We've been using it for several months with much success. Github repo is here: https://github.com/RJMetrics/sweet-liberty/ On Tuesday, September 24, 2013 at 9:35:38 AM UTC-4,

Re: Accessing branches in PersistentTreeMap / sorted-map / CLJ-1008

2015-02-19 Thread Andy Fingerhut
I haven't checked carefully, but from at least a quick look it appears that implementing the NavigableMap and NavigableSet interfaces could be done by using the existing subseq and rsubseq functions in clojure.core? It doesn't give you access to subtree nodes directly, but perhaps it is sufficient

core.async, System/currentTimeMillis, and leap seconds

2015-02-19 Thread Matt Havener
I was talking to a coworker about the implementation of core.async timers [0], and he mentioned it uses System/currentTimeMillis. I'm not a Java expert, but I believe currentTimeMillis can be affected by a leap second in some implementations of the JVM. If so, is it possible that a timeout chan

Re: core.async: "Deprecated - this function will be removed. Use transducer instead"

2015-02-19 Thread Malcolm Sparks
You're right - thanks for that! I've updated the blog article to remove it. On 19 February 2015 at 17:37, Ben Smith-Mannschott wrote: > I'm unclear on one thing: what's the purpose of core.async/pipe? In your > blog article, you write: > > (-> source (pipe (chan)) payload-decoder payload-json-de

[ANN] Introducing pulley.cps

2015-02-19 Thread Nathan Davis
Dear Fellow Clojurians, I'm pleased to annouce release 0.1.0 of pulley.cps, a tool for transforming Clojure code into Continuation-Passing-Style. You can find it at http://github.com/positronic-solutions/pulley.cps. While this is not the first attempt at such a tool, to the best of my know

Re: core.async: "Deprecated - this function will be removed. Use transducer instead"

2015-02-19 Thread Ben Smith-Mannschott
I'm unclear on one thing: what's the purpose of core.async/pipe? In your blog article, you write: (-> source (pipe (chan)) payload-decoder payload-json-decoder) (pipe source destination) just copies elements from source to destination. How is that any different than just using source here directl

Re: How to create jar for data.int-map

2015-02-19 Thread Sam Raker
I guess by "google" I really meant "using google to search github." AFAICT, there's 0 reason to opt for anything other than Leiningen when given the choice. It makes things astonishingly easy, and nearly every more-than-alpha library has lein dependency info right up near the top. If they don't, cl

Re: Help with Liberator POST route

2015-02-19 Thread gvim
On 19/02/2015 16:20, Sam Ritchie wrote: Try adding :allowed-methods [:get :post] to your resource. You'll want to use "ANY" for all liberator routes, since they manage the responses for incorrect content types internally. If you specify GET or POST, it's up to you to return the proper response

Re: Help with Liberator POST route

2015-02-19 Thread Sam Ritchie
Try adding :allowed-methods [:get :post] to your resource. You'll want to use "ANY" for all liberator routes, since they manage the responses for incorrect content types internally. If you specify GET or POST, it's up to you to return the proper responses if the methods aren't supported (sin

Re: How to create jar for data.int-map

2015-02-19 Thread Cecil Westerhof
2015-02-19 17:00 GMT+01:00 Sam Raker : > @Cecil: while it's a little irritating that there's not more > centralization of third-party Clojure libs, I've found that Leiningen + > some googling solves the problem like 99% of the time. > ​I did come quit an end with Google, but then I was bitten by

Re: How to create jar for data.int-map

2015-02-19 Thread Cecil Westerhof
2015-02-19 16:42 GMT+01:00 Alex Miller : > The first line of the readme for the project ( > https://github.com/clojure/data.int-map) has the Leiningen jar dependency > info on it: > > [org.clojure/data.int-map "0.1.0"] > ​But if you do not know that this is mend for Leiningen … Just adding: You

Re: How to create jar for data.int-map

2015-02-19 Thread Sam Raker
@Cecil: while it's a little irritating that there's not more centralization of third-party Clojure libs, I've found that Leiningen + some googling solves the problem like 99% of the time. On Thursday, February 19, 2015 at 10:42:43 AM UTC-5, Alex Miller wrote: > > The first line of the readme for

Re: How to create jar for data.int-map

2015-02-19 Thread Alex Miller
The first line of the readme for the project (https://github.com/clojure/data.int-map) has the Leiningen jar dependency info on it: [org.clojure/data.int-map "0.1.0"] Also, the 'mvn package' command should have worked since that's how releases get built. That was a bug in the pom dependencies

Re: datomic <-> datascript transfers

2015-02-19 Thread Dave Dixon
We're having success with the Datomic <-> Datascript scenario by treating the Datascript DB as an immutable value, rather than a ref + transactor, at least in the case for user's interactively changing data. When the user loads the data required for a scenario (e.g. editing an entity), we hold

Re: Help with Liberator POST route

2015-02-19 Thread gvim
On 19/02/2015 12:56, Jonathan Barber wrote: Replace "min" with "minute" in the route (or change "minute" in the curl POST to "min"). Because the field names don't agree, the compojure destructing doesn't match and you end up trying to parseInt nil. Cheers Thanks for spotting that one :). Sti

Re: Generalisation of pre-conditions

2015-02-19 Thread Cecil Westerhof
2015-02-19 15:11 GMT+01:00 Justin Smith : > People complain about stack traces, but precisely the point of having > stack traces is that if a pre-condition fails, you don't look at the > function with the pre-condition, you look at the function that was calling > it. Duplicating pre-conditions to

Re: Using type to change the behaviour of a function

2015-02-19 Thread Tassilo Horn
Cecil Westerhof writes: Hi! > At the moment the following: > (lucky-numbers 1001) > gives: > AssertionError Assert failed: (<= upto (* 10 1000 1000)) user/lucky-numbers > > But I would like the following to be executed: > (lucky-numbers :no-max-check 1001) > > ​How would I implement that

Re: [ANN] clj-uuid: thread-safe, performant unique identifiers

2015-02-19 Thread Avi Avicenna
Thank you for providing sequential UUID. Looking forward to uuid library that provides squuid. Yours, Avicenna On Tuesday, 17 February 2015 08:25:17 UTC+7, danl...@gmail.com wrote: > > Hello Clojurians, > > I've just been polishing my modest library, clj-uuid < > http://danlentz.github.io/clj-uu

Re: Using type to change the behaviour of a function

2015-02-19 Thread Justin Smith
one approach would be a multi-method for the condition check that doesn't enforce the limit on BigInt user=> (defmulti lucky-numbers-limit type) #'user/lucky-numbers-limit user=> (defmethod lucky-numbers-limit :default [n] (< 0 n 1001)) # user=> (defmethod lucky-numbers-limit clojure.lang.Big

Re: Side Effects and compiler optimzation

2015-02-19 Thread Timothy Baldridge
In short, it doesn't. And I think the fact that Clojure is as fast as it is is testament to how little of an impact many of these optimizations have. But also, don't assume that Clojure doesn't get many of these optimizations for free from the JVM. Auto-caching is a weird one, I think most people

Re: core.async why 42 extra threads?

2015-02-19 Thread Robin Heggelund Hansen
Ahh ok, makes sense :) -- 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 post. To unsubscribe from this gr

Re: Generalisation of pre-conditions

2015-02-19 Thread Justin Smith
People complain about stack traces, but precisely the point of having stack traces is that if a pre-condition fails, you don't look at the function with the pre-condition, you look at the function that was calling it. Duplicating pre-conditions to callers, as a general pattern, would scale very

Re: core.async why 42 extra threads?

2015-02-19 Thread Timothy Baldridge
The number of threads is meant to be semi-tolerant to usage of blocking IO in go blocks. You can't be certain that some go block won't call a function that calls a function in some library that blocks for just a few milliseconds. So we tried to make it high enough to be tolerant of mis-use, but lo

Re: Help with Liberator POST route

2015-02-19 Thread Jonathan Barber
On 18 February 2015 at 22:35, gvim wrote: > On 18/02/2015 15:32, Andy- wrote: > >> Without having tested it: I think you're "curl -d" format is wrong. It's >> not semicolon separated: >> http://superuser.com/questions/149329/what-is-the- >> curl-command-line-syntax-to-do-a-post-request >> >> HTH

Re: [ANN] clean-blog @ modularity.org

2015-02-19 Thread danle...@gmail.com
I enjoy your blog. It's like my morning cup of British. It really takes the biscuit. :) Best, Dan On Wednesday, February 18, 2015 at 9:28:57 PM UTC-5, Malcolm Sparks wrote: > > I've added a blog-site template called 'clean-blog' to the collection at > http://modularity.org - documented here:

Generalisation of pre-conditions

2015-02-19 Thread Cecil Westerhof
I have two different functions for the same functionality. I would like to share the pre-conditions between them. The general function is: (defn test-lucky-numbers-general "Performance test of lucky numbers general" [fn desc nr] {:pre [(>= nr 1) (<= nr 7)]}

Side Effects and compiler optimzation

2015-02-19 Thread Ashish Negi
I tried to find old threads for my question but could not find any suitable answer. My question is that unlike haskell, which separates I/O side effect code from pure code, and hence can easily do other optimizations like auto-caching results, out of flow execution etc, what is the clojure way

core.async why 42 extra threads?

2015-02-19 Thread Robin Heggelund Hansen
>From the source of core.async, I see that it is started with a threadpool of *2 + 42. I can understand the number of processors * 2 part, erlang does the same thing. But Hitchicker's references aside, why add 42 to this? Won't that many threads do more harm than good, in terms of overhead rela

Using type to change the behaviour of a function

2015-02-19 Thread Cecil Westerhof
I have the following function: (defn lucky-numbers "Lucky numbers from 1 up-to upto-value. 1 <= upto-value <= 10.000.000 http://en.wikipedia.org/wiki/Lucky_number"; ; doc-string and pre-condition should match [upto] {:pre [(>= upto 1) (<= upto (*

Re: How to create jar for data.int-map

2015-02-19 Thread Cecil Westerhof
2015-02-19 11:58 GMT+01:00 Michael Griffiths : > Clojure and Clojure contrib libraries are uploaded to Sonatype when > released. e.g. > https://oss.sonatype.org/content/groups/public/org/clojure/data.int-map/ > > There should be both a jar with sources and jar without sources for each > released v

Re: How to create jar for data.int-map

2015-02-19 Thread Michael Griffiths
Clojure and Clojure contrib libraries are uploaded to Sonatype when released. e.g. https://oss.sonatype.org/content/groups/public/org/clojure/data.int-map/ There should be both a jar with sources and jar without sources for each released version of each lib. Michael -- You received this me

Re: ANN: Onyx Dashboard 0.5.2.1

2015-02-19 Thread Colin Yates
Thanks Mike On 18 February 2015 at 22:44, Michael Drogalis wrote: > Hi Colin, > > This is well supported within Onyx, and has seen recent progress > (http://yuppiechef.github.io/cqrs-server/) > The examples should give you a good indication if it's a fit for your > problem (https://github.com/Mic