Re: [ANN] riddley: code-walking without caveats

2013-09-03 Thread Zach Tellman
Hey Konrad, you can maybe speak with more authority as to what tools.macro does and doesn't provide, but my reading of it is that it does expression walking to prevent bound variables from being incorrectly symbol-macroexpanded. This seems only important in the context of symbol macros, however; i

core.async and referential transparency

2013-09-03 Thread bertschi
Hi, recently I got interested core.async (also thanks to great blog post such as the ones by David Nolen) and wanted to understand better how it compares to other reactive libraries, in particular coming from the research on Functional Reactive Programming (FRP). Compared to FRP, core.async ap

Re: evaluation order in loading file/project (with leiningen)

2013-09-03 Thread Curtis Summers
If you're defining functions depending on yet-to-be-defined functions, you may need to use the "declare" macro. So, you may need to loop through your data with declare first, and then proceed with the definitions. http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/declare Curt

Re: core.async and referential transparency

2013-09-03 Thread Timothy Baldridge
What you are describing is a pub sub type system. This could be built on top of core.async, but it doesn't have to change the core library at all. But yes, you are mis-understanding the main use-case for a library like core.async. The library was created to allow for the building of systems that c

Re: core.async and referential transparency

2013-09-03 Thread David Nolen
On Tue, Sep 3, 2013 at 10:00 AM, bertschi wrote: > Whereas the first example receives all incremented values, the second one > receives potentially less since both consumers read from the very same > input channel! This also means that one can break working code, by > (accidently) attaching an add

Re: core.async and referential transparency

2013-09-03 Thread David Nolen
On Tue, Sep 3, 2013 at 10:00 AM, bertschi wrote: > Whereas the first example receives all incremented values, the second one > receives potentially less since both consumers read from the very same > input channel! This also means that one can break working code, by > (accidently) attaching an add

core.typed Blog posts

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi, Some new posts on core.typed: - Polymorphic HOFs - Using core.typed at the REPL Also, join #typed-clo

A macro for writing defn-like macros?

2013-09-03 Thread Mark
I find the vast majority of the time I'm tempted to write a macro (yeah, yeah, I know the first rule of macro club), is to defn-like things. Writing a defn-like macro to handle all the stuff defn does is pretty tough so I end up writing a barebones thing that doesn't support doc-string, doesn'

Re: core.async and referential transparency

2013-09-03 Thread bertschi
Hi, thanks for your remarks. @Timothy: Yes, looks like I mis-understand the main motivation for core.async or I'm just not used to see my programs as an assembly like sending data boxes around ;-) On Tuesday, September 3, 2013 4:20:19 PM UTC+2, David Nolen wrote: > > Which also creates a resou

Re: core.async and referential transparency

2013-09-03 Thread David Nolen
On Tue, Sep 3, 2013 at 10:47 AM, bertschi wrote: > As far as I know, Haskell has Chan data types in its concurrency > extensions, but I have never seen them in FRP. Maybe this means that FRP is > addressing a different problem. On the other hand, the Automaton Arrow can > be used to implement stat

Re: core.async and referential transparency

2013-09-03 Thread bertschi
Hi David, On Tuesday, September 3, 2013 5:28:13 PM UTC+2, David Nolen wrote: > > On Tue, Sep 3, 2013 at 10:47 AM, bertschi > > > wrote: > >> As far as I know, Haskell has Chan data types in its concurrency >> extensions, but I have never seen them in FRP. Maybe this means that FRP is >> addres

Re: A macro for writing defn-like macros?

2013-09-03 Thread Ben Wolfson
I've got something that helps with this stuff: https://github.com/bwo/macroparser/blob/master/src/macroparser/functions.clj On Tue, Sep 3, 2013 at 9:01 AM, Mark wrote: > I find the vast majority of the time I'm tempted to write a macro (yeah, > yeah, I know the first rule of macro club), is t

Re: A macro for writing defn-like macros?

2013-09-03 Thread Ben Wolfson
used, for example, here: https://github.com/bwo/monads/blob/master/src/monads/util.clj#L28-L43 and here: https://github.com/ReadyForZero/babbage/blob/1.1/src/babbage/graph.clj#L28-L79 On Tue, Sep 3, 2013 at 9:23 AM, Ben Wolfson wrote: > I've got something that helps with this stuff: > https://g

Re: A macro for writing defn-like macros?

2013-09-03 Thread Ben Mabey
On 9/3/13 10:01 AM, Mark wrote: I find the vast majority of the time I'm tempted to write a macro (yeah, yeah, I know the first rule of macro club), is to defn-like things. Writing a defn-like macro to handle all the stuff defn does is pretty tough so I end up writing a barebones thing that do

Re: Design Composition and Performance

2013-09-03 Thread Sam Aaron
On 3 Sep 2013, at 17:34, Tim Visher wrote: > What talk was this? http://www.infoq.com/presentations/Design-Composition-Performance Sam --- http://sam.aaron.name -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send emai

Re: A macro for writing defn-like macros?

2013-09-03 Thread Jim - FooBar();
I've been staring at this function for 20 minutes now (name-with-attributes)...I must be totally stupid but even though I 've understood what it does I can't figure out how to use it. Does anyone have an example usage? Let's suppose I want to define a DEFN macro that behaves exactly like defn..

Re: Design Composition and Performance

2013-09-03 Thread Stan Dyck
On 09/03/2013 09:05 AM, Sam Aaron wrote: Hey everyone, here's a picture of us (Meta-eX) doing most of the things Rich said we shouldn't in his recent talk: * pair programming * using a complex tmux setup * hacking in an extremely monstrous emacs setup (http://overtone.github.io/emacs-live) *

[ANN] lein typed - Check Clojure code with core.typed

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi, Announcing lein typed, a tool to use core.typed at the command line. https://github.com/frenchy64/lein-typed Thanks, Ambrose -- -- 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

Re: Emacs Clojure mode : No syntax highlighting for #_

2013-09-03 Thread Phil Hagelberg
On Wednesday, August 28, 2013 7:06:45 PM UTC-7, Joel Holdbrooks wrote: > It might be a bit involved to have *#_* and the subsequent form appear commented > through clojure-mode's syntax highlighting. However, it would also incorrectly express > the semantics of *#_* which, arguably, is counter to

[ANN] core.typed 0.2.2 - Loading performance

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi, Just pushed core.typed 0.2.2. It should be significantly less excruciating waiting for core.typed to initialise. There are also minor documentation/error fixes. [org.clojure/core.typed "0.2.2"] ...; for very recent releases:repositories {"sonatype-oss-public" "https://oss.sonatype.org/conten

Re: Emacs Clojure mode : No syntax highlighting for #_

2013-09-03 Thread Jozef Wagner
This is the convention I would like to see in an ideal clojure highlighter theme: ;; comments are highlighted so that they stand out. Comments are meant to be read, not forgotten. (comment ) form is for example code, so it is highlighted as a normal clojure code #_ is used for disabling parts

Re: core.async and referential transparency

2013-09-03 Thread Sean Corfield
Just an aside, Nils, have you take a look at Elm? It's a Haskell-like language, designed for FRP, compiles to JS, and deliberately avoids monads and arrows (at least in terminology) by having Signal and Automaton abstractions... http://elm-lang.org On Tue, Sep 3, 2013 at 9:12 AM, bertschi wrote:

Re: A macro for writing defn-like macros?

2013-09-03 Thread Jim - FooBar();
Yes! I eventually figured it out...thanks Konrad :) Jim On 03/09/13 20:49, Konrad Hinsen wrote: --On 3 septembre 2013 19:08:12 +0100 "Jim - FooBar();" wrote: understood what it does I can't figure out how to use it. Does anyone have an example usage? Let's suppose I want to define a DEFN m

Re: [ANN] riddley: code-walking without caveats

2013-09-03 Thread Zach Tellman
I see. This is honestly something I hadn't considered, but since Riddley actually uses the Clojure compiler internals to track locals, this would be as simple as a (when-not (contains? (riddley.compiler/locals) (first expr)) ...) guard in the macroexpansion. As Ben points out, using the compiler

Re: [ANN] lein typed - Check Clojure code with core.typed

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Released 0.2.0 which consolidates all commands to `lein typed check ...` on advice of technomancy. Thanks, Ambrose On Wed, Sep 4, 2013 at 2:18 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Hi, > > Announcing lein typed, a tool to use core.typed at the command line. > > h

Re: A macro for writing defn-like macros?

2013-09-03 Thread Alex Baranosky
https://github.com/clojure/tools.macro/blob/master/src/main/clojure/clojure/tools/macro.clj#L275?? On Tue, Sep 3, 2013 at 9:01 AM, Mark wrote: > I find the vast majority of the time I'm tempted to write a macro (yeah, > yeah, I know the first rule of macro club), is to defn-like things. > Writi

Re: [ANN] riddley: code-walking without caveats

2013-09-03 Thread Ben Wolfson
On Tue, Sep 3, 2013 at 12:41 PM, Konrad Hinsen < googlegro...@khinsen.fastmail.net> wrote: > > Not quite. It expands only terms that are evaluated, using a built-in > table of special forms, and it allows local macro definitions (macrolet). > But most importantly, it tracks local bindings Local

Re: A macro for writing defn-like macros?

2013-09-03 Thread Konrad Hinsen
--On 3 septembre 2013 19:08:12 +0100 "Jim - FooBar();" wrote: understood what it does I can't figure out how to use it. Does anyone have an example usage? Let's suppose I want to define a DEFN macro that behaves exactly like defn...how would that go? I'm struggling to find The general patter

Re: Emacs Clojure mode : No syntax highlighting for #_

2013-09-03 Thread Cedric Greevey
I vote for (comment ...) being highlighted like normal, except with some modification, such as italicized, smaller font, tinged towards gray or tinted some other way, or something, so you can immediately see that it's not the same as a nearby defn. On Tue, Sep 3, 2013 at 3:17 PM, Jozef Wagner w

ANN Meltdown, a fast message passing library for Clojure built on top of Reactor

2013-09-03 Thread Michael Klishin
On behalf of the ClojureWerkz [1] team, I'm happy to announce Meltdown, a fast message passing library that backs EEP [2] but is very useful on its own. Announcement blog post: http://blog.clojurewerkz.org/blog/2013/09/04/introducing-meltdown/ Meltdown on GitHub: https://github.com/clojurewerkz/m

[ANN] clj-leveldb, idiomatic LevelDB bindings from Factual

2013-09-03 Thread Zach Tellman
In the first of what I hope will be many annoucements, we're open sourcing a library we've found useful at Factual: https://github.com/Factual/clj-leveldb. This is just a simple wrapper around LevelDB, which is an in-process persistent k/v store from Google. If anyone has questions, I'm happy

Re: BigDecimal and ==, with a proposed fix

2013-09-03 Thread Korny Sietsma
It'd be great if this got fixed - we met an ugly bug yesterday due to this on our project. (Our system validates that the sum of two monetary fields A and B equals the sum of two monetary fields C and D. We parse the fields via Cheshire with conversion to bigdecimal turned on - but any fields wit

Re: [ANN] riddley: code-walking without caveats

2013-09-03 Thread Konrad Hinsen
--On 3 septembre 2013 02:08:23 -0700 Zach Tellman wrote: Hey Konrad, you can maybe speak with more authority as to what tools.macro does and doesn't provide, but my reading of it is that it does expression walking to prevent bound variables from being incorrectly symbol-macroexpanded.  This se

Re: BigDecimal and ==, with a proposed fix

2013-09-03 Thread Andy Fingerhut
Thanks for the experience report. I've copied it into the ticket's description along with a link to this discussion. If you have an account on JIRA, you can vote for the ticket. More votes might get the ticket some attention earlier than fewer votes. If you don't already have one, you can creat

Re: Clojure for the Brave and True, an online book for beginners

2013-09-03 Thread Greg
I think it could benefit from more posts on using Clojure with IDE/Editor ___. Perhaps outsource some of that with links to existing posts on the topic. I hesitate to recommend this to anyone because I can't recommend Emacs (even though it's my primary terminal editor). - Greg -- Please do not

hashing binary data

2013-09-03 Thread Brian Craft
I'm loading data files of about 1-2G, which are composed of a bunch of numeric data blocks. I need to store the data blocks w/o storing duplicates. They arrive as vectors of floats, and are stored as primitive byte arrays. I first tried memoizing the function that saves a block (returning an id

Re: hashing binary data

2013-09-03 Thread Softaddicts
Why not keep track of the hash of blocks already stored and discard duplicates blocks from memory asap ? I am talking here of keeping blocks as Clojure structures so the hash will be consistent between two identical blocks. Do you store them away as soon as you can ? Or are you trying to keep th

Re: hashing binary data

2013-09-03 Thread Mikera
On Wednesday, 4 September 2013 10:00:42 UTC+8, Brian Craft wrote: > I'm loading data files of about 1-2G, which are composed of a bunch of > numeric data blocks. I need to store the data blocks w/o storing > duplicates. They arrive as vectors of floats, and are stored as primitive > byte arrays

Re: Clojure for the Brave and True, an online book for beginners

2013-09-03 Thread Jason Lewis
+1 for outsourcing editor infos. Is this on Github? I might be inclined to open a pull request for Vim or LightTable. On Sep 3, 2013 8:42 PM, "Greg" wrote: > I think it could benefit from more posts on using Clojure with IDE/Editor > ___. > > Perhaps outsource some of that with links to existing

Re: hashing binary data

2013-09-03 Thread Brian Craft
On Tuesday, September 3, 2013 9:14:30 PM UTC-7, Mikera wrote: > > On Wednesday, 4 September 2013 10:00:42 UTC+8, Brian Craft wrote: > >> I'm loading data files of about 1-2G, which are composed of a bunch of >> numeric data blocks. I need to store the data blocks w/o storing >> duplicates. They

Re: hashing binary data

2013-09-03 Thread Mikera
On Wednesday, 4 September 2013 12:37:33 UTC+8, Brian Craft wrote: > > > > On Tuesday, September 3, 2013 9:14:30 PM UTC-7, Mikera wrote: >> >> On Wednesday, 4 September 2013 10:00:42 UTC+8, Brian Craft wrote: >> >>> I'm loading data files of about 1-2G, which are composed of a bunch of >>> numeri

Re: BigDecimal and ==, with a proposed fix

2013-09-03 Thread Mikera
On Friday, 2 August 2013 12:28:51 UTC+8, CGAT wrote: > My understanding of == is that it is intended to establish numerical > equivalence > across types. But I think that basic contract fails with BigDecimal. For > instance, > > (== 1M 1.0M) ; => false > > because the scale properties of

Re: BigDecimal and ==, with a proposed fix

2013-09-03 Thread Mikera
On Wednesday, 4 September 2013 13:19:16 UTC+8, Mikera wrote: > On Friday, 2 August 2013 12:28:51 UTC+8, CGAT wrote: > >> My understanding of == is that it is intended to establish numerical >> equivalence >> across types. But I think that basic contract fails with BigDecimal. >> For instance

Re: BigDecimal and ==, with a proposed fix

2013-09-03 Thread Andy Fingerhut
Mike, the equiv method that was shown was what Clojure does if it compares a BigDecimal value with any other numeric type, except if the BigDecimal value is compared with a Double. Between a BigDecimal and a Double it converts the BigDecimal to a Double before comparing. Check out Numbers.java in