Re: [ANN] Clojure 1.10 has been released!

2018-12-17 Thread Jozef Wagner
ander Kiel * >- *Ben Bader* >- Bruce Adams >- *Cezary Kosko* >- Erik Assum >- *Eugene Kostenko* >- Ghadi Shayban >- *Gijs Stuurman* >- Jozef Wagner >- > *Kwang Yul Seo * >- *Matthew Gilliard* >- Michał Marczyk >- Ni

Re: Immutable names of things?

2017-12-11 Thread Jozef Wagner
I think it's a great idea and it may even be a missing piece in the 'Grow, not Break' approach https://youtu.be/oyLBGkS5ICk?t=1946 , namely to the problem that good names are hard to come by. Suppose a library author wants to make a breaking change to some function. They change the doc-name of

Re: [ANN] Clojure 1.9.0 is now available!

2017-12-08 Thread Jozef Wagner
- *Adam Clements* >- Andy Fingerhut >- Brandon Bloom >- *Cameron Desautels* >- *Chad Taylor* >- Chris Houser >- *David Bürgin* >- *Eli Lindsey* >- *Gerrit Jansen Van Vuuren* >- Ghadi Shayban >- *Greg Leppert* >- *Jason Whi

Re: any? in clojure 1.9.0 alpha

2017-10-10 Thread Jozef Wagner
Clojure isn't for the most part a community effort therefore decisions about the language and it's core library are seldom made in the collaboration with the community. In my opinion, if you want your language change proposal to be considered, you have to justify and back it up by a strong real

Re: is reduce/reduced faster than loop/recur?

2016-04-29 Thread Jozef Wagner
There are many ways on how you can improve the performance of loop/recur, and most of them depends on the type of a thing you are iterating through. With reducers (and transducers), the iteration part is decoupled from the reduction part, so they offer a mechanism that chooses the optimal iteration

Re: Using metadata to specify how calls to a macro should be indented

2015-09-17 Thread Jozef Wagner
Dunaj uses metadata to guide IDEs and pretty printer regarding indentations, arg grouping, ... http://www.dunaj.org/metadata.html#_indentation http://www.dunaj.org/day10.html#_ide_support Jozef On Sunday, September 13, 2015 at 12:06:50 PM UTC+2, Artur Malabarba wrote: > > Hi everyone, > > > Ove

Re: Where should 'if-let-all' macro go?

2015-06-09 Thread Jozef Wagner
Dunaj has support for multiple bindings in if-let since version 0.5. http://www.dunaj.org/dunaj.flow.api.html#if_let Related design page that discusses possible approaches is at https://github.com/dunaj-project/dunaj/wiki/Conditionals Jozef On Tuesday, June 9, 2015 at 4:00:35 PM UTC+2, Lars An

Re: [ANN] Dunaj lite, a library-only version of Dunaj

2015-06-01 Thread Jozef Wagner
ols > * no changes to primitive types > > I've also started blogging at [3], where I plan to focus on Dunaj's > individual features and its usage in real world cases. > > Best, > Jozef Wagner > > [1] http://www.dunaj.org > [2] http://lite.dunaj.org > [3] ht

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-05-26 Thread Jozef Wagner
We were using http://wrapper.tanukisoftware.com/doc/english/download.jsp for deploying uberjars as a service under linux (AWS), and were quite satisfied with it. On Tue, May 26, 2015 at 3:15 PM, Shantanu Kumar wrote: > I'm doing some of those things at work (http-kit, > logback+slf4j+MDC+clojure

[ANN] Dunaj lite, a library-only version of Dunaj

2015-04-13 Thread Jozef Wagner
o focus on Dunaj's individual features and its usage in real world cases. Best, Jozef Wagner [1] http://www.dunaj.org [2] http://lite.dunaj.org [3] http://blog.wagjo.com -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-21 Thread Jozef Wagner
e! > > Thank you for putting yourself and your ideas out there in this way, and > for reminding us not to settle for what we have now, but to continually > push towards ever greater heights. > > Best, > James > > On Friday, March 20, 2015 at 6:35:37 AM UTC+1, Jozef Wagner

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-19 Thread Jozef Wagner
s experiments at the documentation section of Dunaj at http://www.dunaj.org/doc.html Best, Jozef Wagner On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: > > I'm happy to announce a project called Dunaj [1], which provides an > alternative core API for Clojure.

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-19 Thread Jozef Wagner
http://www.dunaj.org Best, Jozef On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: > > I'm happy to announce a project called Dunaj [1], which provides an > alternative core API for Clojure. Its main aim is to experimentally test > major additions to the lan

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-18 Thread Jozef Wagner
resources * Devise abstraction for composing resources into 'systems' You can read more about this experiment at http://www.dunaj.org Regards, Jozef On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: > > I'm happy to announce a project called Dunaj [

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-17 Thread Jozef Wagner
ing unpacked reduction... https://www.refheap.com/98510 Jozef On Wednesday, March 18, 2015 at 1:05:16 AM UTC+1, Herwig Hochleitner wrote: > > 2015-03-12 12:15 GMT+01:00 Jozef Wagner > >: > >> >> Experiment #5: Reducers First >> >> > Wow! There are some g

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-17 Thread Jozef Wagner
ble optimizations You can read more about this experiment at http://www.dunaj.org Regards, Jozef On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: > > I'm happy to announce a project called Dunaj [1], which provides an > alternative core API for Clojure. Its main aim is

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-16 Thread Jozef Wagner
http://www.dunaj.org Best, Jozef On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: > > I'm happy to announce a project called Dunaj [1], which provides an > alternative core API for Clojure. Its main aim is to experimentally test > major additions to the lan

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-12 Thread Jozef Wagner
that uses reducers by default - Enhance reducers to support straightforward conversion to lazy sequences - Provide full API support for transducers You can read more about this experiment at http://www.dunaj.org Best, Jozef On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: >

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-11 Thread Jozef Wagner
changes how compiler recognizes special symbols and makes them fully qualified. You can read more about this experiment at http://www.dunaj.org Jozef On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: > > I'm happy to announce a project called Dunaj [1], which

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-10 Thread Jozef Wagner
usual, you can read more about this experiment at http://www.dunaj.org Regards, Jozef On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: > > I'm happy to announce a project called Dunaj [1], which provides an > alternative core API for Clojure. Its main aim is to

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-07 Thread Jozef Wagner
t to write long emails here, you can read more about this experiment at http://www.dunaj.org . Best, Jozef On Thursday, March 5, 2015 at 10:33:53 PM UTC+1, Jozef Wagner wrote: > > I'm happy to announce a project called Dunaj [1], which provides an > alternative core API for Clo

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-07 Thread Jozef Wagner
IMO. > > On 6 March 2015 at 18:49, Jozef Wagner > > wrote: > >> Experiment #1 >> >> *Deconstructing Core API* >> >> While Clojure provides its functionalities in multiple namespaces (e.g. >> clojure.string, clojure.zip), the majority of it is

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-06 Thread Jozef Wagner
, but this list is handled by separate API presets that can be extended and customized. You can read more about this experiment at http://www.dunaj.org -- Jozef On Thu, Mar 5, 2015 at 10:33 PM, Jozef Wagner wrote: > I'm happy to announce a project called Dunaj [1], which pro

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-06 Thread Jozef Wagner
I'm planning to introduce experiments every other day, starting later today. On Fri, Mar 6, 2015 at 12:05 AM, Alex Baranosky < alexander.barano...@gmail.com> wrote: > Yeah, I'm excited to see some of the 10 write-ups. What's the ETA on the > first one? > > On Thu, Mar 5, 2015 at 6:02 PM, Alex Mil

[ANN] Dunaj project, an alternative core API for Clojure

2015-03-05 Thread Jozef Wagner
nts in a series of individual posts. Every part states the motivation behind the experiment, introduces changes and additions to the language and demonstrates its intended use. If you do not want to miss any of this, you may want to register for a mailing list at [1] or follow @dunajproject at Twi

Re: [ANN] Clojure 1.7.0-alpha5 now available

2015-01-29 Thread Jozef Wagner
Thank you very much Nicola! On Thu, Jan 29, 2015 at 7:24 PM, Nicola Mometto wrote: > > Jozef, I looked into this and opened a ticket with a proposed patch to > fix this issue: http://dev.clojure.org/jira/browse/CLJ-1650 > > Jozef Wagner writes: > > > With CLJ-979 appl

Re: [ANN] Clojure 1.7.0-alpha5 now available

2015-01-26 Thread Jozef Wagner
With CLJ-979 applied, lein may crash when doing :aot :all. This is caused when lein forces recompilation of already compiled classes. Not sure whether this should be considered a lein of clojure bug though. See https://github.com/wagjo/aotbug for contrived example. Jozef On Saturday, January 1

Re: Set equality bug?

2015-01-22 Thread Jozef Wagner
>> false > > >> user=> (= (float 1.5) (double 1.5)) > > >> true > > >> > > >> I.e. = (and ==) will return true when comparing floats with doubles > IFF > > >> the float's .doubleValue roundtrips to the same double it's

Re: Set equality bug?

2015-01-22 Thread Jozef Wagner
More on this behavior http://dev.clojure.org/jira/browse/CLJ-1036 On Thu, Jan 22, 2015 at 2:00 PM, Nicola Mometto wrote: > > Looking at the PHM impl, this looks like it's caused by (float 0.5) and > (double 0.5) hashing differently. > > user=> (= (float 0.5) (double 0.5)) > true > user=> (map ha

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
gt; > On Thu, Jan 1, 2015 at 11:31 AM, Jozef Wagner > wrote: > >> Implement a custom buffer type, or use mult. With mult, use tap/untap to >> control reading. Items sent to mult are dropped if there are no taps. >> >> Jozef >> >> On Mon, Dec 29, 2014

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

2015-01-06 Thread Jozef Wagner
AFAIK https://github.com/ztellman/aleph is the current best async IO library. Jozef On Tue, Jan 6, 2015 at 7:20 AM, Ricardo Gomez wrote: > There are, it'll just never happen. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this

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

2015-01-01 Thread Jozef Wagner
Implement a custom buffer type, or use mult. With mult, use tap/untap to control reading. Items sent to mult are dropped if there are no taps. Jozef On Mon, Dec 29, 2014 at 12:38 PM, Yehonathan Sharvit wrote: > Hello, > > > I would like to create a channel that will drop messages if no consumer

Re: how do you name your protocols?

2014-12-29 Thread Jozef Wagner
'expose' protocol methods directly, it's just a necessary > consequence of the component design, unless you can suggest an alternative > approach. > > On Sunday, 28 December 2014 16:54:30 UTC, Jozef Wagner wrote: >> >> I was not implying anything about what Rich have

Re: how do you name your protocols?

2014-12-28 Thread Jozef Wagner
of public APIs that expose > the underlying interfaces of the library to consumers. Saying that Rich is > saying protocols should "never ever" be part of the public API is both > misleading and false. > > On Sunday, December 28, 2014 2:50:06 AM UTC-5, Jozef Wagner w

Re: how do you name your protocols?

2014-12-27 Thread Jozef Wagner
;> Sent from my iPhone >> >> > On Dec 27, 2014, at 11:18 AM, Michael Klishin >> wrote: >> > >> >> On 27 December 2014 at 19:10:38, Jozef Wagner (jozef@gmail.com) >> wrote: >> >> clj-time seems to be naming protocols inconsistently. It use

Re: how do you name your protocols?

2014-12-27 Thread Jozef Wagner
clj-time seems to be naming protocols inconsistently. It uses ISomething, Something and SomethingProtocol naming. On Sat, Dec 27, 2014 at 4:20 PM, Matching Socks wrote: > In the interest of thoroughness, it should be noted here that a protocol > *named > "InTimeUnitProtocol" *appears in the Cha

Re: Weird performance issue with reduce

2014-11-17 Thread Jozef Wagner
I would look for unncessary object creation inside reduction function (use transients) and lazy seq realization (realize only what you really need). Calling reduce inside reduce (inside reduce...) may easily make the complexity of your code exponential. Consider caching of intermediate results if t

Re: Transducers: Why left to right rather than right to left?

2014-10-30 Thread Jozef Wagner
Well you can always read it at https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/Transducers.md :) On Thu, Oct 30, 2014 at 5:31 PM, Mars0i wrote: > Thanks Las. That's a verty helpful suggestion, though for me personally > it won't help. (I know that a lot of people like to

Re: Modelling in Clojure

2014-10-22 Thread Jozef Wagner
Not every ISeq is lazy. In this case the seq is not lazy but is backed by a mutable array, thus the mentioned behavior. Jozef On Wednesday, October 22, 2014 6:41:34 PM UTC+2, Fluid Dynamics wrote: > > On Wednesday, October 22, 2014 12:10:30 PM UTC-4, Ambrose > Bonnaire-Sergeant wrote: >> >> On

Re: Adding up numbers, quickly

2014-10-15 Thread Jozef Wagner
Slowdowns wrt math are caused mainly by boxing and range check, see this thread [1] [1] https://groups.google.com/d/msg/clojure/kcx5eKdMxcs/Wy4_IHrSEaMJ Jozef On Wednesday, October 15, 2014 9:53:40 PM UTC+2, Jony Hudson wrote: > > Hi all, > > another performance question ... this time about ar

Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-08 Thread Jozef Wagner
t; aleph/netty.clj#L109. Here the stream represents data coming off the >>> wire, and if the put onto the stream is not immediately successful, >>> backpressure is enabled until the put completes. No blocking required >>> anywhere. >>> >>> On Wed, Oct

Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-08 Thread Jozef Wagner
/netty.clj#L109. > Here the stream represents data coming off the wire, and if the put onto > the stream is not immediately successful, backpressure is enabled until the > put completes. No blocking required anywhere. > > On Wed, Oct 8, 2014 at 10:10 AM, Jozef Wagner > wro

Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-08 Thread Jozef Wagner
If you want to handle multiple TCP connections and async channels in one thread, you need a way how to block on both connections (wait for new input to arrive) and channels (wait for a free space in a buffer). Blocking only on connections will get you a busy loop if channels are full. If you cou

Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-08 Thread Jozef Wagner
One way how to handle this elegantly in Java is to add support for java.nio.channels.SelectableChannel in core.async buffer. That way you could select on any combination of core.async channels and io resources, waiting for core.async channels to free and resources to have data ready. Jozef On Wed

Re: Surprised by behaviour of `compile` vs positional constructor fns

2014-09-22 Thread Jozef Wagner
It looks like following not so well known bug http://dev.clojure.org/jira/browse/CLJ-979 On Mon, Sep 22, 2014 at 8:55 AM, Peter Taoussanis wrote: > Hi all! > > Ran into some behaviour today that I wasn't expecting and am wondering if > someone could shed some light. > > Steps to reproduce (reprod

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-11 Thread Jozef Wagner
FYI transients no longer enforce thread locality, and you may now call them from any thread [1]. More options for handling mutable state is not a bad thing (as Clojure is a practical language), though more discipline will be needed. Jozef [1] CLJ-1498 On Thu, Sep 11, 2014 at 9:41 AM, Arnout Roem

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-08 Thread Jozef Wagner
FYI the ticket about volatile is at http://dev.clojure.org/jira/browse/CLJ-1512 and the same question was raised there. On Mon, Sep 8, 2014 at 4:25 PM, Frantisek Sodomka wrote: > Hello, > I posted a question about volatiles on the github commit: > https://github.com/clojure/clojure/commit/6044097

Re: how do you name your protocols?

2014-09-06 Thread Jozef Wagner
Clojure API exposes types to the user (Agent, Ref, Var, ...), so it is benefical to see on the first glance whether the name is of a type or interface/protocol. If the API would be built solely on the protocols/interfaces, those prefixes would be of less use. Moreover, I think that names of types

Re: how do you name your protocols?

2014-09-05 Thread Jozef Wagner
I use IBlah (camel cased, prefixed with capital i) in both Clojure and ClojureScript. It looks better than PBlah and is consistent with how ClojureScript names its protocols. Jozef On Fri, Sep 5, 2014 at 11:52 AM, Dave Sann wrote: > I saw a comment on protocol naming here: > https://groups.goog

Re: Transducers are Coming

2014-08-14 Thread Jozef Wagner
This is not safe usage, as you are not calling the 'flushing' method or handle reduced objects. Correct use would be (def xform (comp (filter odd?) (map #(* % % (def strip-reduced [x] (if (reduced? x) @x x)) (let [r (xform conj)] (strip-reduced (r (strip-reduced (r #{1 2 3} 7) ;=> #{1 3 2

Re: What to use for serializing reference types?

2014-08-10 Thread Jozef Wagner
Assign a unique name to the prototype object. Serialize instances as map and put the reference to the prototype object under one of their keys. Something like {:prototype-components {:r10k {:resistance 10, :type :fixed, :unit :kΩ}} :components [{:name "resistor 1", :proto :r10k}, {:name "resistor

Re: Success Stories w/US Government Projects

2014-08-10 Thread Jozef Wagner
For the context, recent discussion about EPL Vs Government https://groups.google.com/forum/#!topic/clojure/jNEYM04TLiU Jozef On Sunday, August 10, 2014 1:19:48 PM UTC+2, Paul Butcher wrote: > > Out of interest, which aspect(s) of the EPL are your lawyers objecting to? > > -- > paul.butcher->msgC

Re: Can I compare ::logging from one namespace with ::logging from another?

2014-08-09 Thread Jozef Wagner
ct, but to give some examples: >> >> (ns example.core >> (:require [example.other :as other])) >> >> (= ::foo :example.core/foo) >> (= ::other/foo :example.other/foo) >> >> (not= :foo :example.core/foo) >> (not= :example.core/foo :example.othe

Re: Can I compare ::logging from one namespace with ::logging from another?

2014-08-09 Thread Jozef Wagner
Keep in mind that :: is just a syntax sugar that is processed by the reader, before the compiler kicks in. ::foo is a shorthand for :your.current.ns/foo. Its purpose is to make it easy to create keywords that do not clash with other ones. Keywords are equal (and identical) only when both of th

Re: Transducers are Coming

2014-08-06 Thread Jozef Wagner
Thank you for another great technique and concept!. I've been using reducers a lot lately and I've found that it is in some cases better (performance, fold support) to wrap local state in the intermediate result, rather than to keep it in an atom. See this *very* simplified example for compari

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Jozef Wagner
See this WIP branch https://github.com/clojure/clojure/tree/direct On Wednesday, August 6, 2014 12:54:32 PM UTC+2, Robin Heggelund Hansen wrote: > > Just read this blog post about Oxen ( > http://arrdem.com/2014/08/05/of_oxen,_carts_and_ordering/?utm_source=dlvr.it&utm_medium=twitter). > > In i

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Jozef Wagner
You can use record's positional constructor: user> (defrecord R [a]) user.R user> ((find-var (symbol "user/->R")) 5) #user.R{:a 5} JW On Wednesday, August 6, 2014 12:51:11 PM UTC+2, Ambrose Bonnaire-Sergeant wrote: > > Hi Colin, > > If you must call the Java constructor, you need reflection. >

Re: unexpected behavior of clojure.core/empty

2014-07-19 Thread Jozef Wagner
. Not sure why empty should be an exception. IMapEntry > only provides key, val, and java.util.Map.MapEntry, and probably if you're > modifying map entries, you don't mind losing that functionality. > > On Saturday, July 19, 2014 3:04:13 PM UTC-5, Jozef Wagner wrote: > >>

Re: unexpected behavior of clojure.core/empty

2014-07-19 Thread Jozef Wagner
While the c.l.MapEntry is a persistent vector, there is no such thing as an empty MapEntry persistent vector. Returning empty HAMT persistent vector instead is not a good solution, as 2 elements HAMT vector does not implement IMapEntry interface. One approach on how to solve this is in Zach's c

Re: Rxtx Serial Dependency issues with ARM processor

2014-07-18 Thread Jozef Wagner
Hi, AFAIK RXTX is obsolete, you may have more luck with JSSC [1]. Including it in your Clojure project is easy, just add [org.scream3r/jssc "2.8.0"] While it's not perfect, its pretty solid from my experience. There is a support for ARM, but I've been using it only in x86-64 Linux. [1] https://g

Re: non-lazy clojure?

2014-06-02 Thread Jozef Wagner
Reducers [1] provide eager variants of some core seq functions (map, filter, etc.). Note that they do not cache the result, so they recompute it every time you use their result. [1] http://clojure.org/reducers On Mon, Jun 2, 2014 at 10:32 PM, Lee Spector wrote: > > I've generally liked Clojure

Re: [ANN] JSON/CLJ/EDN comparison table

2014-06-01 Thread Jozef Wagner
e-offs. The comparison is fair. > > > On Saturday, May 31, 2014 3:45:24 PM UTC-7, Jozef Wagner wrote: >> >> Well the suggestion to consider JSON-LD was really out of place. Compared >> to JSON-LD, EDN belongs to the category of lightweight, schemaless and >> streaming fr

Re: [ANN] JSON/CLJ/EDN comparison table

2014-05-31 Thread Jozef Wagner
Well the suggestion to consider JSON-LD was really out of place. Compared to JSON-LD, EDN belongs to the category of lightweight, schemaless and streaming friendly data serialization formats. JSON-LD is closer to e.g. Turtle or RDF/XML. It serves a different purpose and has different goals than

Re: [ANN] JSON/CLJ/EDN comparison table

2014-05-31 Thread Jozef Wagner
hoo, etc. For > example, they provide JSON-LD examples of all the semi-structured data on > http://schema.org/docs/full.html along with a standard script tag for > including that data within HTML. > > http://www.w3.org/TR/json-ld/ > http://json-ld.org/ > > > On Friday, M

[ANN] JSON/CLJ/EDN comparison table

2014-05-30 Thread Jozef Wagner
I've put together a table comparing JSON, EDN and CLJ formats based on their specs [1]. Pull requests are welcome. Jozef [1] https://github.com/wagjo/serialization-formats -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Community Interest in a Clojure Application Config Library, using Zookeeper?

2014-05-20 Thread Jozef Wagner
FYI atoms backed by zookeeper are already provided in Avout library [1]. [1] https://github.com/liebke/avout Jozef On Tue, May 20, 2014 at 11:33 PM, Thomas Steffes wrote: > Hey folks, > > At Room Key we're using Apache Zookeeper and a home-grown clojure library > called drcfg for real-time ap

Re: recur code

2014-05-12 Thread Jozef Wagner
recur is a special form which is handled by the compiler. The relevant part of the compiler is at https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6213 same goes for fn and loop, which are recur targets. Jozef On Mon, May 12, 2014 at 1:33 PM, Catonano wrote: >

Re: Expected inconsistency between set and map w/ ArrayList?

2014-05-11 Thread Jozef Wagner
I'm the reporter of the mentioned ticket and I'm no longer inclined into fixing the hash. The real issue seems to lay in the fact that the = equality tries to work with host non-values. Whether the usefulness of such interoperability outweights the correctness of the =/hash is the issue which s

Re: Licensing program written in Clojure under GPL

2014-05-10 Thread Jozef Wagner
Do you want to distribute binaries (.class files) of the program B? If not, you may license your sources in any license you want. If yes, then it will be possible only if the library G has a linking exception in its license [1], as the clojure itself is EPL so it does not matter how the library A i

Re: [ANN] packthread 0.1.0

2014-05-03 Thread Jozef Wagner
Thanks for releasing this library. How does it compare to the synthread library [1] [2] ? Seems like both libraries have the same goal. Jozef [1] https://github.com/LonoCloud/synthread [2] http://www.infoq.com/presentations/Macros-Monads -- You received this message because you are subscribed

Re: every? expected behavior

2014-04-08 Thread Jozef Wagner
Regardles of the underlying implementation, why do you think false would be a better result for nil or empty collections? Can you give an example where current every? behavior causes problems? Jozef On Tue, Apr 8, 2014 at 8:08 AM, Jeff Mad wrote: > Hi, > I am new to Clojure, so please forgive

Re: Lazy sequence - how they work internally

2014-04-06 Thread Jozef Wagner
First have a look at delay (and clojure.lang.Delay) and try to understand it. LazySeq is just a delay with a fancy interface (supporting seq, first and rest). There is no recursion per se in the LazySeq object. What makes it harder to understand is the idiom of using lazy-seq together with cons and

Re: Basic string modification question

2014-04-03 Thread Jozef Wagner
nt a similar function in java ( > http://stackoverflow.com/questions/14642978/replace-part-of-a-string-between-indexes-in-java > ). > > Im also interested in your second comment and was wondering what you mean > by transient string? > > Thanks > > Andy > > > >

Re: Basic string modification question

2014-04-02 Thread Jozef Wagner
No. IMO this is not a common operation and should not be in core. If you need do it a lot, you should not use java string in the first place. What should be included in core is a transient string, with support for assoc!. Jozef On Wed, Apr 2, 2014 at 7:49 PM, Andy Smith wrote: > just a shame i

Re: Lazy evaluation

2014-04-01 Thread Jozef Wagner
Reducers should be given IMO a more attention, support and importance and I'm actually experimenting on a hypothesis that reducers can replace lazy seqs in most cases (excluding simple stuff, e.g. destructuring). Imagine a core API where functions like map, filter, rseq, range etc. are working

Re: Adding multiple entries in a vector with (something like) for.

2014-03-29 Thread Jozef Wagner
Jozef, > > Thank you. > > I was hoping for a syntax that I could use inside the structure (similarly > to the way that huccup supports embedded 'for' in HTML definitions). > > On Saturday, 29 March 2014 19:53:06 UTC+10:30, Jozef Wagner wrote: >> >> How abou

Re: Adding multiple entries in a vector with (something like) for.

2014-03-29 Thread Jozef Wagner
How about using 'into'? (into [:first :second] (for [x (range 1 5)] {:name (keyword (str "third-" x))})) Jozef On Sat, Mar 29, 2014 at 9:25 AM, Paul Schulz wrote: > Greetings, > I have a vector definition (containing maps), where a lot of them are very > similar. > eg. > [ :first >:seco

Re: updating the last member

2014-03-27 Thread Jozef Wagner
al meaning, so you could do: > > (update-in [1 2 ::last 1 ::last] ...) > > > On Thu, Mar 27, 2014 at 8:57 AM, Jozef Wagner wrote: > >> Calling count on vector is a constant time operation, so I think (dec >> (count v)) is an acceptable and even idiomatic in this case. Ma

Re: updating the last member

2014-03-27 Thread Jozef Wagner
Calling count on vector is a constant time operation, so I think (dec (count v)) is an acceptable and even idiomatic in this case. Make it a function if it is too verbose for you. (let [assoc-last #(assoc % (dec (count %)) %2) ] (update-in [1 [1 2 [1 2 3]]] [1 2] #(assoc-last % 5))) Jozef On Th

Re: Core async / how to work around "No more than 1024 pending puts are allowed on a single channel"

2014-03-27 Thread Jozef Wagner
If you cannot drop messages, just increase the size of a channel buffer (the argument to the chan function). If the channel buffer is full, puts are placed in a channels 'put buffer', which is limited to 1024 puts. Jozef On Thu, Mar 27, 2014 at 3:00 AM, Hanh Huynh Huu wrote: > Hi guys, > > I h

Re: Problems getting function metadata

2014-03-14 Thread Jozef Wagner
Metadata can be attached to many kinds of objects: functions, vars, collections, references, etc. Metadata added in defn is added to the global Var which is holding the newly created function. user=> (defn ^{:foo 42} my-fn []) #'user/my-fn user=> (:foo (meta #'my-fn)) ;; same as (:foo (meta (v

Re: XOR two arrays into a third on Clojure

2014-03-13 Thread Jozef Wagner
Note that looping with primitive int is faster than with long, and native array functions accepts/returns int instead of long for their index and length. It is very hard to eliminate boxing without dropping to java. In you example, calling bit-xor does 2 autoboxing (and 1 long to int cast as aset-

Re: How to use function "doubles" ?

2014-03-09 Thread Jozef Wagner
(double-array [1.2 2.2]) doubles just cast object into a double array, which fails if the object is not already one. It does not convert arbitrary array into array of doubles. doubles is used in few cases, when you need to pass array of doubles instead of just Object (or to get rid of reflection/t

Re: Clojure performance question

2014-03-03 Thread Jozef Wagner
the ISeq abstraction. Best, Jozef [1] http://clojure.org/lazy [2] https://www.assembla.com/spaces/clojure/wiki/Chunked_Seqs [3] http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html On Mon, Mar 3, 2014 at 5:35 PM, Mikera wrote: > On Monday, 3 March 2

Re: Clojure performance question

2014-03-03 Thread Jozef Wagner
On Mon, Mar 3, 2014 at 3:06 AM, Mikera wrote: > ISeq itself isn't too bad (it's just an interface, as above), but some of > the implementations are a bit expensive. > ISeq is inherently not suited for performance critical code, as next() requires creation of a new object. Even if JVM handles suc

Re: Clojure performance question

2014-03-01 Thread Jozef Wagner
>From my experience, you can get 1/1.2 performance (20% slower) with Clojure by following these steps: * Choose right clojure idioms That means to never use lazy seqs if you care for java-like performance. For fast looping, use reducers, for fast inserts, use transients. Postpone the data crea

Re: Clojure performance question

2014-03-01 Thread Jozef Wagner
Clojure math functions compile down to the same JVM 'instruction' as from java. See http://galdolber.tumblr.com/post/77153377251/clojure-intrinsics On Sat, Mar 1, 2014 at 1:23 PM, dennis zhuang wrote: > I think the remaining overhead of clojure sample code is that operators in > java such as '+

Re: Shutting down core.async executors threadpool

2014-02-24 Thread Jozef Wagner
All threads in default core.async threadpool should be daemon, so they should not block when JVM is about to exit. Maybe it is a tomcat issue. On Mon, Feb 24, 2014 at 7:06 PM, Jan Herich wrote: > Hi Folks, > > I developed an pedestal application which uses core.async for real-time > server push

Re: why not apply-macro

2014-02-24 Thread Jozef Wagner
Well the evil thing is that apply-macro evaluates arguments at compile time. Example where this won't work follows (defn foo [numbers] (apply-macro + numbers)) JW On Mon, Feb 24, 2014 at 10:27 AM, 刘家财 wrote: > I have one problem using Clojure > we all know there is a apply for a fn to prepe

Re: range-sum

2014-02-13 Thread Jozef Wagner
I would say that with good reducers, the reduce approach can eliminate seq creation and thus be at least a bit faster and less demanding for GC. On Thu, Feb 13, 2014 at 4:16 PM, Michał Marczyk wrote: > str is much faster with apply than with reduce; in fact, with reduce > it is O(n^2), whereas w

Re: Keyword equality check

2014-02-12 Thread Jozef Wagner
Interning table uses keyword's symbol as a key, and the symbols are compared by value. See https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java#L37 On Wed, Feb 12, 2014 at 5:23 PM, Arkadiusz Komarzewski < akomarzew...@gmail.com> wrote: > Hi, > > I wonder how is equali

core.async IOC state holds onto previous value?

2014-02-10 Thread Jozef Wagner
Hi, I'm trying to track down what holds onto an object (a vector) I've sent through mult. I got lost in the ioc_macros/take! and its AtomicReferenceArray state. I've sent the value through the mult and it got processed. aftewards, mult processing go block ( https://github.com/clojure/core.async/b

Re: map semantics

2014-02-09 Thread Jozef Wagner
There are many types and flavors of equality, and only handful of symbols. Symbol '=' in Clojure does not represent yours fundamental = comparison operator. = in Clojure compares for the actual value ignoring concrete types of collections and the internal representation of how the items are stored.

Re: map semantics

2014-02-08 Thread Jozef Wagner
iring the items to be sortable? > > Andy > > > On Sat, Feb 8, 2014 at 8:19 AM, Jozef Wagner > > wrote: > >> Every persistent collection in Clojure supports conversion to the >> sequence of items. This is clearly documented in the official docs and >

Re: map semantics

2014-02-08 Thread Jozef Wagner
I've forgot the most interesting part :) user> (= s1 s2) true user> (= (seq s1) (seq s2)) false JW On Sat, Feb 8, 2014 at 11:32 PM, Jozef Wagner wrote: > Yes. Behold a Murmur3 hash collision: > > user> (def n1 -2023261231) > #'user/n1 > user> (def n2 92

Re: map semantics

2014-02-08 Thread Jozef Wagner
But practically, I cannot think of any scenario where you will need a guarantee that two unordered non identical but value equivalent collections need to produce same ordered seq. JW On Sat, Feb 8, 2014 at 10:14 PM, Andy C wrote: > On Sat, Feb 8, 2014 at 1:46 PM, Jozef Wagner wrote: > >&

Re: map semantics

2014-02-08 Thread Jozef Wagner
By 'same' I've meant an identical :). Two collections equivalent by their values may easily have a different order of their items. This is because in unordered collections, their internal order (as any other implementation detail) must not be taken into account when comparing for value equivalence

Re: map semantics

2014-02-08 Thread Jozef Wagner
Every persistent collection in Clojure supports conversion to the sequence of items. This is clearly documented in the official docs and there is no surprise here. The order or items in the resulting sequence is dependent on the collection type. As the conversion to the sequence is a referentia

Re: Alternative ->> macro for threading sequences?

2014-02-06 Thread Jozef Wagner
I agree with Colin, the cognitive load is greater than benefits of such approach. BTW you can use comp to chain consecutive map transformation functions. (map (comp pacify wrangle) things) JW On Thu, Feb 6, 2014 at 3:40 PM, Korny Sietsma wrote: > Hi folks, > > I seem to regularly find myself w

Re: When should I use non-blocking >! / threads and blocking >!! / goroutines with clojure core.async

2014-01-31 Thread Jozef Wagner
t; > mauricio...@ciencias.unam.mx > wrote: > >> >> On Thu, Jan 30, 2014 at 12:48 PM, Jozef Wagner >> >> > wrote: >> >>> >>> go blocks, together with >!, >> threads and are not run in separate thread. There is no thread p

  1   2   3   >