Re: How to create a core.async channel that will drop messages if no consumer is currently reading from the channel?

2015-01-07 Thread Jozef Wagner
>From my understanding of how core.async is implemented, if channel has a buffer, every message goes through it, regardless of whether there are takes waiting or not. This is due to transducers that are applied only on buffer items. None messages would thus pass through with a 0 size dropping b

Re: camelize-dasherize - reinventing the wheel?

2015-01-07 Thread Noam Ben-Ari
@Thomas Unfortunately, clojure.walk is not StackOverflowError-safe. Same goes for tree-seq (uses walk). The only safe solution I found so far are zippers. Regarding memoization, yes I agree it will help if converting the same maps frequently, however at scale, with many users hitting the same A

Re: camelize-dasherize - reinventing the wheel?

2015-01-07 Thread Andrey Antukh
Hello 2015-01-07 10:11 GMT+01:00 Noam Ben-Ari : > @Thomas > > Unfortunately, clojure.walk is not StackOverflowError-safe. Same goes for > tree-seq (uses walk). The only safe solution I found so far are zippers. > > Regarding memoization, yes I agree it will help if converting the same > maps freq

Re: camelize-dasherize - reinventing the wheel?

2015-01-07 Thread Noam Ben-Ari
You are right. If it is only applied to keys, like in Thomas's example, it can be very helpful. On Wednesday, January 7, 2015 11:21:39 AM UTC+2, Andrey Antukh wrote: > > Hello > > 2015-01-07 10:11 GMT+01:00 Noam Ben-Ari >: > >> @Thomas >> >> Unfortunately, clojure.walk is not StackOverflowError-s

Re: camelize-dasherize - reinventing the wheel?

2015-01-07 Thread Noam Ben-Ari
Cool! I'm glad you found it useful :-) On Wednesday, January 7, 2015 2:12:35 AM UTC+2, Andrey Antukh wrote: > > Hi! > > 2015-01-06 20:25 GMT+01:00 Noam Ben-Ari >: > >> Hi, >> >> I've written a small library (1 ns, 100 lines) to transform nested maps >> from "dash-case" keys to "camelCase" keys an

Re: How to create a core.async channel that will drop messages if no consumer is currently reading from the channel?

2015-01-07 Thread Yehonathan Sharvit
Anyway, I was able to implement only one oof your suggested solutions. The tap/untsp one. I was unable to implement a buffer of size 0. I have tried, this: (deftype NoBuffer [state]   impl/UnblockingBuffer   impl/Buffer   (full? [this] false)   (remove! [this])   (add!* [this

Re: Extend causes error in servlet container?

2015-01-07 Thread peter . denhaan
Those are some very comprehensive responses indeed; thanks Michael. It makes sense now. I'll keep an eye on lein-ring and clojure upgrades and in the mean time work around it. Ghadi, you are of course right; thanks. I was playing around with extend so two types could share an implementation wit

[ANN] Sparkling, a Clojure-API to Apache Spark.

2015-01-07 Thread chris_betz
Hi, we just released Sparkling (https://gorillalabs.github.io/sparkling/), our take on an API to Apache Spark. With an eye on speed for very large amounts of data we improved clj-spark and flambo to get us the speed we need for our production environment. See https://gorillalabs.github.io/

[ANN] lentic 0.6: Multiple syntactic views over Emacs buffers

2015-01-07 Thread Phillip Lord
Lentic.el 0.6 is now available. Lentic is an Emacs mode which supports multiple views over the same text. This can be used for a form of literate programming. It has specific support for Clojure which it can combine with either LaTeX, Asciidoc or Org-Mode. Two lentic buffers, by default, the two

Simplifying JS dependencies in ClojureScript

2015-01-07 Thread David Nolen
I believe the solution to this problem has been sitting right under our noses for some time. I've written up my thoughts here: http://dev.clojure.org/jira/browse/CLJS-965 Feedback & patch welcome :) David -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Potential bug in trampoline

2015-01-07 Thread Hongseok Yang
Hi, While trying to use trampoline to optimise tail recursion in my Clojure project, I came across some strange behaviour of the trampoline function. => (defn f [g] (fn [k & args] #(k (apply g args ... => (trampoline (f list) println 1 2 3) (# 1 2 3) nil => (((f list) println 1 2 3)) (1 2 3)

Re: Potential bug in trampoline

2015-01-07 Thread Nicola Mometto
This looks like a serious bug in PersistentList, it has nothing to do with trampoline. Here's a minimal case: user=> ((fn [& args] (apply (fn [a & b] (apply list b)) args)) 1 2 3) (1 2 3) Hongseok Yang writes: > Hi, > > While trying to use trampoline to optimise tail recursion in my Clojure >

Prefer non-daemon threads in clojure.core.async/thread?

2015-01-07 Thread Erik Price
Howdy, I see that the ThreadFactory used by clojure.core.async/thread‘s Executor accepts a daemon parameter, to specify whether the threads are daemon or not. But from reading the source, I don’t see any obvious way to specify this for individual calls to clojure.core.async/thread. Is it possible?

Re: Potential bug in trampoline

2015-01-07 Thread Nicola Mometto
I created http://dev.clojure.org/jira/browse/CLJ-1633 with a patch implementing the proposed fix in the stackoverflow answer by the user " d.j.sheldrick". Hongseok Yang writes: > Hi, > > While trying to use trampoline to optimise tail recursion in my Clojure > project, I came across some strange

Re: A (foolish) plan to re-invent IO on top of core.async

2015-01-07 Thread Paul deGrandis
There was another discussion on this list regarding async IO and web servers. It may be rather informative to you: https://groups.google.com/d/msg/clojure/rKqT13Ofy4k/H9xvkZA9Yy4J To my knowledge, Pedestal is the only web library that let's you go async all the way down to the wire (potentiall

Re: Simplifying JS dependencies in ClojureScript

2015-01-07 Thread Ivan L
Sounds like this would work great for the majority where the lib is only js, but what about edge cases where a lib depends on a relative pathed resource like an image or css file? Bootstrap comes to mind. -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-07 Thread Allen Rohner
On Wednesday, December 31, 2014 8:48:27 AM UTC-6, Jonathon McKitrick wrote: > > I use TDD and mocking/stubbing (conjure) to test each layer of my code. > The problem is when I change the function signature and the tests do not > break, because the mocks/stubs do not know when their argument li

maya - A DSL for math and numerical stuff

2015-01-07 Thread Divyansh Prakash
maya - A DSL for math and numerical stuff. https://gist.github.com/divs1210/b4fcbd48d7697dfd8850#file-maya -- 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

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-07 Thread Sean Corfield
On Jan 7, 2015, at 10:21 AM, Allen Rohner wrote: > As a design rule, I prefer making I/O fns (things that hit the DB or a REST > API), 'dumb', and perform all logic/processing in fns that just receive plain > data, and return plain data. I’m curious: do you have wrapper functions for the DB rea

maya - A DSL for math and numerical stuff

2015-01-07 Thread Ivan L
Lovely. It also seems like a stones throw away to a succint let macro. -- 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 wi