Re: every? expected behavior

2014-04-09 Thread Simon Brooke
On Tuesday, 8 April 2014 07:08:56 UTC+1, Jeff Mad wrote: Hi, I am new to Clojure, so please forgive me if this does not make sense. I was surprised to find out in the REPL that every? returns true if you pass in an empty or nil collection. user= (every? #(= 77 %) nil) true user=

Re: true lightweight threads on clojurescript?

2014-04-09 Thread t x
I believe https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7 suffices. However, it's currently Firefox only and no Chrome. On Tue, Apr 8, 2014 at 8:51 PM, Timothy Baldridge tbaldri...@gmail.com wrote: What is going to fulfill a promise? How will you know when a

Re: rant / cljs in cljs ? :-)

2014-04-09 Thread t x
I recently started using livejs. It's fucking awesome. basically livejs + lein cljsbuild auto (without cljx) + optimizations :none = * I edit code in emacs. * I hit C-x C-s * I see compiling window flyby in milliseconds. * I see browser reload. This is happiness. :-) On Sat, Apr 5, 2014 at

Re: true lightweight threads on clojurescript?

2014-04-09 Thread Moritz Ulrich
What on this page would solve your problem? I just see Generators/Iterators, Array Comprehensions, lexical let and destructuring assignment. On Wed, Apr 9, 2014 at 9:39 AM, t x txrev...@gmail.com wrote: I believe https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.7

Re: Real World Example

2014-04-09 Thread Colin Yates
Hello back! We are using Clojure on the JVM as the implementation language for a platform that will underpin our applications for the next decade. It is relatively new and so far we have implemented the analysis module which is essentially a generic charting engine. So far we have 5547

Re: Real World Example

2014-04-09 Thread Colin Yates
Gah - 5547 production, 2600 of tests. A lot of that discrepancy is down to the very extensive documentation that https://github.com/gdeer81/marginalia allows you to write. Please forgive any other mistakes, working on less than an hours sleep due to my lovely kids. On Wednesday, 9 April 2014

[ANN] friendui 0.2.0 released

2014-04-09 Thread Sven Richter
Hi, I just released friendui into the wild: https://github.com/sveri/friend-ui/. Friendui is a wrapper around cemericks friend and datomic. This is the first time I am contributing something to the clojure community, mainly because I just started using clojure some months ago. If someone

Re: Real World Example

2014-04-09 Thread Aditya Athalye
Welcome, Anthony. I'm not aware of complete applications that fit your requirement, however I think you'll find value in the newly-minted Clojure Cookbook http://clojure-cookbook.com/ ... many, many examples of real-world problems, across domains, solved by Clojure practitioners. All the

Re: How do I update a record in a vector, matching certain criteria?

2014-04-09 Thread Ivan Schuetz
Hi, thanks a lot! I ended putting the question in StackOverflow, yesterday, and also got this answer. It would have took a while until I came up with this. But now I understand. For my concrete case I needed to update the record with all fields passed in a map. So I did: (commute items

Re: Real World Example

2014-04-09 Thread Fergal Byrne
Hi Anthony, I'm building a fairly large real-world system called Clortex [1], which is a rewrite of the Numenta Platform for Intelligent Computing (NuPIC) [2]. As it's a greenfield project, I've chosen to use Clojure components all the way through instead of fitting in with Java-based or

ANN Langohr 2.9.0 is released

2014-04-09 Thread Michael Klishin
Langohr [1] is a small, feature complete Clojure client for RabbitMQ. Release notes: http://blog.clojurewerkz.org/blog/2014/04/09/langohr-2-dot-9-0-is-released/ 1. http://clojurerabbitmq.info -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- You received this

Re: Real World Example

2014-04-09 Thread Colin Yates
Hi Fergal, Thanks for those links. I started using protocols and defrecords but I (maybe mistakenly) got the impression that they were frowned upon. As it turns out, maps (typically with a :type key) and multi methods go a long long way, but I still end up with fairly deep nesting of maps.

Re: true lightweight threads on clojurescript?

2014-04-09 Thread t x
For the purposes of building a webos: Having yield + co-routines gives me cooperative multi-threading -- which is basically all I need. The main difference between co-routines and go-routines. Is that for (go ... ) blocks, the ! and ! must be lexically embedded within the block; whereas with

Re: true lightweight threads on clojurescript?

2014-04-09 Thread Timothy Baldridge
One can build go like things on top of generators, however this doesn't solve your problem, as these generators (pointed to in your link) cannot yield through more than a single function. They have the same semantics as yield in python or C# (or go in Clojure). That is to say every function in the

Re: true lightweight threads on clojurescript?

2014-04-09 Thread Timothy Baldridge
I'd also caution against attempting to use ! and ! deep inside a call chain. Send and receive are side-effects. Any function that contains them is impure. Keep IO at the edges, and your whole system will be much easier to test. Timothy On Wed, Apr 9, 2014 at 6:07 AM, t x txrev...@gmail.com

Re: Real World Example

2014-04-09 Thread Fergal Byrne
Hi Colin, Cheers. I had exactly the same problem, so I've been trying out a few other ideas. One is to use datalog (or cascalog etc) and represent objects with entities and relationships between objects with refs (for datalog). I have some enormous data structures (2-300m synapses per layer, for

Re: Real World Example

2014-04-09 Thread Colin Yates
lein-midje-doc really does look excellent. I went with marginalia but if that had been around at the time I would have jumped on it without a doubt. On Wednesday, 9 April 2014 13:20:51 UTC+1, Fergal Byrne wrote: Hi Colin, Cheers. I had exactly the same problem, so I've been trying out a few

Re: Real World Example

2014-04-09 Thread Fergal Byrne
I'm using both: Marginalia for straight docstrings in the source code [1], lein-midje-doc for TDD in a literate style [2]. Some of the components I wanted to discuss with others, for example a new design for a Scalar Encoder [3] (I found and fixed a bug in the algorithm using this approach). [1]

Re: true lightweight threads on clojurescript?

2014-04-09 Thread t x
Regarding yield: Understood, thanks for clarifying my misunderstandings! -- 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

Om and core.async: Necessary together?

2014-04-09 Thread Kendall Buchanan
Hi, I have a question about Om's Basic Tutorial, and perhaps core.async's role generally: The example given in the section, Intercomponent Communication, uses core.async for communication between two components. Is this necessary? Or, is it demonstration? It seems in testing that I can even

Re: Om and core.async: Necessary together?

2014-04-09 Thread David Nolen
It's mostly for demonstration purposes, but I think it will be a common pattern when more complex coordination is required. I think components should probably communicate via callbacks and applications can glue things together with core.async if it's beneficial. David On Wed, Apr 9, 2014 at

Quotient *and* Remainder

2014-04-09 Thread Anthony Ortiz
Hello everyone, I am able to get the quotient or remainder by doing the following : (quot 22 7) - 3 (rem 22 7) - 1 Is there a way to get back both the quotient and the remainder in one calculation rather than performing two separate calculations? And I don't mean writing a function that does

Re: Quotient *and* Remainder

2014-04-09 Thread Ben Wolfson
Many languages expose a quotrem or divmod function that returns both at once, since they can both be calculated at once. On Wed, Apr 9, 2014 at 10:05 AM, Sam Ritchie sritchi...@gmail.com wrote: So you DON'T mean: (juxt quot rem) ? Anthony Ortiz anthonypa...@gmail.com April 9, 2014

Re: Quotient *and* Remainder

2014-04-09 Thread Anthony Ortiz
No because that's simply calling what is essentially the same function twice. Internally the quotient and remainder functions are the same, the only difference is which part of the result they return. If I call the quotient function and then I call the remainder function then I am performing

Re: Quotient *and* Remainder

2014-04-09 Thread James Reeves
AFAIK, the JVM doesn't have a bytecode instruction for this, and therefore there's no mechanism to do this in Clojure except by using quot and rem separately. - James On 9 April 2014 18:11, Anthony Ortiz anthonypa...@gmail.com wrote: No because that's simply calling what is essentially the

Re: Quotient *and* Remainder

2014-04-09 Thread Anthony Ortiz
Ah yes of course... the same applies to the CLR. On Wednesday, April 9, 2014 1:46:37 PM UTC-4, James Reeves wrote: AFAIK, the JVM doesn't have a bytecode instruction for this, and therefore there's no mechanism to do this in Clojure except by using quot and rem separately. - James On

Questions regarding Map vs Record and usage

2014-04-09 Thread Anthony Ortiz
I see that there are several ways of instantiating a record : (-Book Lord of the Rings, Tolkien) (Book. Lord of the Rings, Tolkien) #user.Book{:title Lord of the Rings, :author Tolkien} Questions : 1) The second version is referred to as the original version so I'm wondering which is the

Re: Real World Example

2014-04-09 Thread Sean Corfield
And for comparison at World Singles: Clojure source 101 files 17952 total loc, 1321 fns, 666 of which are private, 203 vars, 8 macros, 29 atoms Clojure tests 43 files 3790 total loc Clojure WebDriver tests 14 files 560 total loc (includes comments / whitespace etc - this is just the

Re: Questions regarding Map vs Record and usage

2014-04-09 Thread A. Webb
You can refer-in the first (factory function) to another namespace; for the second you'd have to import the class. I prefer the first. The third is special syntax for the reader. As to the last question, I don't know, but it allows you to define your own. For example, (defrecord Book

Re: every? expected behavior

2014-04-09 Thread Sean Corfield
On Apr 9, 2014, at 12:11 AM, Simon Brooke still...@googlemail.com wrote: Clojure is a bit muddled about nil. Nil, generally speaking, is the empty list - which is why (every? #(= 77 %) nil) is true. But in Clojure, it's not true that (= nil ()). There's no point in saying this is a mistake.

Re: Questions regarding Map vs Record and usage

2014-04-09 Thread Ben Mabey
On 4/9/14, 12:51 PM, Anthony Ortiz wrote: I see that there are several ways of instantiating a record : (-Book Lord of the Rings, Tolkien) (Book. Lord of the Rings, Tolkien) #user.Book{:title Lord of the Rings, :author Tolkien} You missed one: (map-Book {:title Lord of the Rings, :author

Logo usage

2014-04-09 Thread Plínio Balduino
Hi there Is there any restriction about the usage of Clojure logo in magazines, books and printed materials? Thank you Plinio Balduino -- 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

Re: Logo usage

2014-04-09 Thread Tim Visher
On Wed, Apr 9, 2014 at 4:06 PM, Plínio Balduino pbaldu...@gmail.com wrote: Hi there Is there any restriction about the usage of Clojure logo in magazines, books and printed materials? Yes. You must get permission from Tom Hickey, I believe, who listens on this list (or at least used to).

Re: Questions regarding Map vs Record and usage

2014-04-09 Thread Greg D
FWIW, I use: - (-Book Lord of the Rings, Tolkien) - when I define the record instance with the default fields, and the number of default fields is a small number - (map-Book {:title The Fellowship of the Ring, :author Tolkien, :series

Re: Any experience with Cognitect?

2014-04-09 Thread Mike Haney
Thanks for the feedback. Resume updated - check Cover letter written - check Email sent - check Ego intact - pending -- 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

Re: Any experience with Cognitect?

2014-04-09 Thread Tim Visher
 On Wed, Apr 9, 2014 at 4:47 PM, Mike Haney txmikes...@gmail.com wrote: Thanks for the feedback. Resume updated - check Cover letter written - check Email sent - check Ego intact - pending -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Meta-eX - The Music of Code

2014-04-09 Thread Samuel Aaron
For those that enjoyed the interview and are interested in how we sound this month, we just pushed out a new track, lovingly live coded in Clojure: https://soundcloud.com/meta-ex/spiked-with-recursive-dreams Sam --- http://sam.aaron.name On 2 Apr 2014, at 21:33, Samuel Aaron

Re: Om and core.async: Necessary together?

2014-04-09 Thread Brendan Stromberger
How can one build up the intuition to know, in what situation, whether it would be more beneficial to use callbacks or channels? Are there 'rules-of-thumb' that I could follow until that intuition is established? On Wednesday, April 9, 2014 8:40:19 AM UTC-7, David Nolen wrote: It's mostly for

Re: Om and core.async: Necessary together?

2014-04-09 Thread David Nolen
Reusable components - use callbacks Application components (non-reusable or less re-usable) - use channels David On Wed, Apr 9, 2014 at 7:53 PM, Brendan Stromberger brendanstromber...@gmail.com wrote: How can one build up the intuition to know, in what situation, whether it would be more

Re: Om and core.async: Necessary together?

2014-04-09 Thread David Nolen
Also don't use a channel unless you actually need complex coordination. I would always default to a callback first. David On Wed, Apr 9, 2014 at 7:56 PM, David Nolen dnolen.li...@gmail.com wrote: Reusable components - use callbacks Application components (non-reusable or less re-usable) -

Re: Logo usage

2014-04-09 Thread Plínio Balduino
Thank you On Wed, Apr 9, 2014 at 5:16 PM, Tim Visher tim.vis...@gmail.com wrote: On Wed, Apr 9, 2014 at 4:06 PM, Plínio Balduino pbaldu...@gmail.comwrote: Hi there Is there any restriction about the usage of Clojure logo in magazines, books and printed materials? Yes. You must get

Re: Meta-eX - The Music of Code

2014-04-09 Thread Earl Jenkins
Good stuff, all the hard work you've done in the field of live coding, yet no mention of Meta-ex nor clojure in the Computer Music Journal which has a whole issue dedicated to this subject ;( of course this is just from me scanning the issue. keep up the inspiring work I'll soon brush up on my

Re: Om and core.async: Necessary together?

2014-04-09 Thread Mike Haney
David, This seems to be a different take on things than you proposed in your series of CSP articles last summer. I'm not saying that is a bad thing - if an idea doesn't pan out, it needs to be scrapped (and most of us cling to bad ideas longer than we should). I'm just curious why the change

Re: Om and core.async: Necessary together?

2014-04-09 Thread David Nolen
I would probably still do an async autocompleter component with channels where it seems useful *internally*. I just wouldn't expose channels as an interface to users of this component. I think most of points from my CSP posts still hold even with React/Om. David On Wed, Apr 9, 2014 at 11:57 PM,