Surprised by behaviour of `compile` vs positional constructor fns

2014-09-21 Thread Peter Taoussanis
Hi all! Ran into some behaviour today that I wasn't expecting and am wondering if someone could shed some light. Steps to reproduce (reproducible with at least Clojure 1.4.0 and 1.7.0-alpha2): 1. Setup a namespace with `(defrecord Foo [x])`. 2. Call cider's `cider-load-current-buffer` in Emacs.

Re: transducers and async operations

2014-09-21 Thread Wilker
Humm... actually, I was happy too soon... Ends up this following example doesn't work: (let [value-chan (fn [v] (let [c (chan 1)] ; simple helper to simulate an async operation that just returns the input (go (>! c v)

Re: transducers and async operations

2014-09-21 Thread Wilker
Ok, I think a got into a reasonable solution :) The code first: (defn -expand [v f] (if (satisfies? cljs.core.async.impl.protocols/ReadPort v) (take! v f) (f v))) (defn async [t f & args] (fn [f1] (fn ([] (f1)) ([result] (f1 result)) ([result input] (-exp

Re: transducers and async operations

2014-09-21 Thread Wilker
Hi, I did some progress here, I was able to manage to create a custom filter transducer that works seamlessly with regular values and channels and can be composed with other transducers: ; on JVM I did this using protocols, but in ClojureScript I could not make it work (some error when I tried to

Re: transducers and async operations

2014-09-21 Thread Wilker
On Sun, Sep 21, 2014 at 10:08 PM, Sean Corfield wrote: > Hi Sean, Sorry, I don't really understood your suggestion... But let me try to make myself more clear of what I'm trying to accomplish: First let me say that I have a more Javascript background than Java, and my issue is more into Clojure

Re: transducers and async operations

2014-09-21 Thread Sean Corfield
If you're putting data into a channel, why not just add the transducer to the channel creation so it is applied as you pull values off the channel? Sean On Sep 21, 2014, at 3:01 PM, Wilker wrote: > Hi guys, > > I'm playing with transducers here, and trying out stuff just for fun, there > is

Re: transducers and async operations

2014-09-21 Thread Wilker
More on my playing around here, I was trying to implement async versions for the transducers, for example: (defn filter-async [pred] (fn [f1] (fn ([] (f1)) ([result] (f1 result)) ([result input] (if (http://about.me/wilkerlucio/bio Woboinc Consultant +55 81 82556600

Re: transducers and async operations

2014-09-21 Thread Wilker
Because it's Node-JS environment, and that can be the same for any async Javascript, you never wanna call sync operations (like sync ajax) because they block everything... I was noticing that is a non-issue at all in Java world, since you can always read blocking into the predicate, for example: (

Re: transducers and async operations

2014-09-21 Thread Leon Grapenthin
Why would you want the the predicates and readdir to return channels? On Monday, September 22, 2014 12:14:27 AM UTC+2, Wilker wrote: > > Just an add, > > I was thinking if we could have something like a "deref" running during > the transducers, in order to enable value unwrapping (that way we cou

Re: transducers and async operations

2014-09-21 Thread Wilker
Just an add, I was thinking if we could have something like a "deref" running during the transducers, in order to enable value unwrapping (that way we could handle channels/values in same fashion). I understand that is complicated maybe because overhead, and also more tricky into JS world were you

transducers and async operations

2014-09-21 Thread Wilker
Hi guys, I'm playing with transducers here, and trying out stuff just for fun, there is something that I'm kind stuck on how to approach. I understand the great abstraction that transducers provide over don't carrying about the input source type, but I'm struggling to deal with async operations in

Rich Hickey's Transducers talk from Strange Loop

2014-09-21 Thread Mike Rodriguez
Thanks for putting it up so fast! -- 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 fr

Re: Recursive definition in core.logic

2014-09-21 Thread Tassilo Horn
Casper writes: > For me that leads to the question, how do we then define the relationship > 'descendant' (which would be the generalisation of child, grandchild etc)? > > (defn child [x y] > (parent y x)) Ok, so you have a `child' relation already, so this should be easy (but it's not teste

Re: emacs-cider company-mode no match found

2014-09-21 Thread Tassilo Horn
Xiangtao Zhou writes: Hi Joe, > i'm pretty sure, because I also want to have company working with repl. > both cider & cider-repl not working. Hm, strange, it works just fine for me since ages. And looking in my ~/.emacs, there's no special code for making it work. I currently use those MELP

Re: [ANN] Onyx: Distributed data processing in Clojure

2014-09-21 Thread Christopher Small
Beautiful :-) Thanks. Chris On Sun, Sep 21, 2014 at 9:36 AM, Mike Drogalis wrote: > Thanks Christopher! > > At the moment, elements of a workflow need to strictly be keywords. I'm > planning to allow for sets of keywords in the roots of the tree to enable > that expression. For now, you can do

Re: Use Require and Import

2014-09-21 Thread Lee Spector
> On Sep 21, 2014, at 12:31 PM, Robert Tweed > wrote: > The whole (ns) block is just boilerplate that you ignore until you need to > refer back to look something up, which is the only time it makes any > difference. You can't ignore the boilerplate while you're writing it, which is a pain th

Re: [ANN] om-bootstrap 0.2.6 released

2014-09-21 Thread Rostislav Svoboda
Thank you Daniel. IDidMount/did-mount works for me. BTW good om lifecycle explanation can be found here: http://josf.info/blog/2014/09/18/first-ompressions-a-conceptual-look-at-om/ On 18 September 2014 10:18, Daniel Kersten wrote: > > Forgot to add: IDidMount/did-mount only gets called after mou

Re: Use Require and Import

2014-09-21 Thread Robert Tweed
On 21/09/2014 14:31, Lee Spector wrote: I sort of agree with the bottom line here, but there are "non-throwaway" contexts in which (2) won't apply because you are only "use"ing your own namespaces, and in which the overall project is small enough that the chances of conflict in (1) are acceptab

Re: Recursive definition in core.logic

2014-09-21 Thread François Rey
I think this blog post should help: https://kotka.de/blog/2011/10/A_field_trip_into_logic_programming.html The site seems to have an invalid certificate so you may or may not want to proceed, but I just did and all is fine. On 21/09/14 17:07, Casper wrote:

Eager (cat) in transducers

2014-09-21 Thread Glen Mailer
While watching Rich's strangeloop talk, I noticed a slight oddity in the definition of mapcat. I brought this up briefly in the IRC channel yesterday and the general consensus seemed to be that this is awkward, but not easily solvable: The original lazy definition of (mapcat) uses (concat), and

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-21 Thread killme2...@gmail.com
I am glad it's helpful.I am using defun to write transform functions for instaparse in a DSL parser,it's really good at it.I am not sure if i can create a pull request to core.match. 发自我的 iPad > 在 2014年9月21日,下午5:13,Max Gonzih 写道: > > Amazing! Would love to have something like that in clojure.

Recursive definition in core.logic

2014-09-21 Thread Casper
I have been looking through core.logic tutorials and while I "get it" I haven't had the big epiphany yet. One thing that keeps nagging me is how to make a relation that isn't "fixed". An example is https://github.com/swannodette/logic-tutorial in which there is defined some relations such as pa

Re: Programming Clojure "in the large": libraries, frameworks, oh my

2014-09-21 Thread Henrik Eneroth
And just recently, we have Onyx as well: https://github.com/MichaelDrogalis/onyx On Friday, September 19, 2014 9:40:14 PM UTC+2, Mike Haney wrote: > > Just a note - juxt/jig isn't being maintained, and has been replaced by > juxt/modular. Modular is based on Stuart Sierra's component library, a

Re: Rich Hickey's Transducers talk from Strange Loop

2014-09-21 Thread Henrik Eneroth
I'm tempted to make a conference called "Rich Hickey talks about stuff", and it's just two days of Rich Hickey giving awesome presentations and telling us that we are still complecting stuff. On Saturday, September 20, 2014 1:22:50 PM UTC+2, Fergal Byrne wrote: > > Thanks Alex, right up there w

Re: Use Require and Import

2014-09-21 Thread Lee Spector
On Sep 21, 2014, at 5:11 AM, Robert Tweed wrote: > In short: use 'use' in the repl or any time you're generally feeling lazy. > Don't use it in non-throwaway code. > > Use automatically refers everything in a namespace. This is handy if you > don't want to type out the names, but it creates tw

Re: emacs-cider company-mode no match found

2014-09-21 Thread Xiangtao Zhou
hi Tassilo, i'm pretty sure, because I also want to have company working with repl. both cider & cider-repl not working. Joe On Sunday, September 21, 2014 3:59:59 PM UTC+8, Tassilo Horn wrote: > > Xiangtao Zhou > writes: > > Hi! > > > I have upgrade the latest emacs-cider, the document sugges

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-21 Thread Max Gonzih
Amazing! Would love to have something like that in clojure.core. On Sunday, September 14, 2014 8:47:28 AM UTC+2, dennis wrote: > > > Hi , i am pleased to introduce defun : > a beautiful macro to define clojure functions with pattern match. > > Some examples: >

Re: Use Require and Import

2014-09-21 Thread Robert Tweed
On 19/09/2014 16:46, Lee Spector wrote: On Sep 19, 2014, at 11:26 AM, John Gabriele wrote: Don't use `use`. :) Since the OP is new here I'll point out that that ":)" is probably a nod to the fact that there's a long history of controversy on the utility/evils of "use". Some (like me) think t

Re: emacs-cider company-mode no match found

2014-09-21 Thread Tassilo Horn
Xiangtao Zhou writes: Hi! > I have upgrade the latest emacs-cider, the document suggest me to use > company for auto completion, but it doesn't work, anyone know what > should I do. Just to be sure, you did M-x cider-jack-in RET in the Clojure project you are hacking in, right? Bye, Tassilo -