Re: ANN: Om 0.8.0-alpha1, Reference Cursors!

2014-10-18 Thread Jonas Enlund
Hi Interesting work as usual! One quick question: What is the difference between (let [xs (om/observe owner (items))] ...) as seen in the sub-view component versus the one in main-view which doesn't use `om/observe`: (let [xs (items)] ...) /Jonas On Saturday, October

lein.bat self-install has been broken for a month

2014-10-18 Thread Matching Socks
Last week, I ran into Leiningen issue 1702, "lein self-install/upgrade/downgrade is broken in lein.bat (2.5.0)"[1]. Here's how it happened: I emailed a Windows user a pointer to leiningen.org. I got an email back saying -- doesn't work. We worked around it by editing lein.bat in Notepad an

Re: Modelling in Clojure

2014-10-18 Thread Brandon Bloom
> > I don't know who is the outlier. The point is that Scala, for instance, > has explicit support to hide the distinction between accessing a value > and computing a value. The point is to support the uniform access > principle. > > http://en.wikipedia.org/wiki/Uniform_access_principle > In

Re: Modelling in Clojure

2014-10-18 Thread James Reeves
On 18 October 2014 21:02, Mark Engelberg wrote: > I think all of James' points about the proven value of structuring an > application primarily around data rather than a complex API are right on > point. It is one of the things I love about the Clojure philosophy. > > But there's nothing about t

Re: ANN: Om 0.8.0-alpha1, Reference Cursors!

2014-10-18 Thread Ahmad Hammad
Brilliant! Looking forward to digging into it. P.S I was wondering when that Advanced tutorial was going to be written, looks like its up! Don't know how you find the time but glad that you do! On Saturday, October 18, 2014 5:53:57 PM UTC+2, David Nolen wrote: > > I'm happy to announce the rel

Re: Modelling in Clojure

2014-10-18 Thread Nahuel Greco
Maybe we need some sort of lazy map where: (def m (assoc-computed {:first-name "Robert" :last-name "Plankton"} :full-name #(str (:first-name %) " " (:last-name % ;; will call the function to compute the value and will memoize it: (:full-name m) ;; now the memoized val

Re: Dynamically generate jar from clojure

2014-10-18 Thread Denis Fuenzalida
Hi Arkadiusz, You're right: you should leverage on the existing functionality from Leiningen itself as much as possible. I think you'd want to follow an approach like this: - Create your Clojure-based web application, include Leiningen itself as a runtime dependency - Generate a project skelet

Re: book for a beginner with some exercises

2014-10-18 Thread Eric Normand
Hi there, If you're looking for books, I don't know of any. But my Intro to Clojure videos have lots of exercises and start from the beginning. http://www.purelyfunctional.tv/intro-to-clojure In terms of exercises, I cut my Clojure teeth on Project Euler. https://projecteuler.net/ Once you sol

Re: Calling empty on a map entry

2014-10-18 Thread Mark Engelberg
See this thread: https://groups.google.com/forum/#!searchin/clojure/unexpected$20behavior$20of$20clojure.core$2Fempty/clojure/z4GiyxvFEqg/zxwTklPa2mEJ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: Modelling in Clojure

2014-10-18 Thread Mark Engelberg
I think all of James' points about the proven value of structuring an application primarily around data rather than a complex API are right on point. It is one of the things I love about the Clojure philosophy. But there's nothing about the value of data-driven development that requires data look

Calling empty on a map entry

2014-10-18 Thread Alex Engelberg
(def map-entry (first {1 2})) (empty map-entry) => nil Up until now my understanding was that map entries are completely interchangeable with vectors, in that you can conj and assoc just like vectors, and you can even call them like functions. I figured that calling empty on a map entry would r

Re: [PSA] Clojars scp disabled until further notice

2014-10-18 Thread tcrayford
Phil, I've used scp uploads in the past. They're much easier when e.g. you wanna upload a java library you've forked. Without scp uploads (or an easy copy/paste curl alternative), you have to go through getting the project to build with lein by itself. It's not *too* difficult to get a maven ba

Re: behaviour of map

2014-10-18 Thread Jonathan Winandy
On Seq, no, but you can use a transducer to make it read-ahead. Eg : https://gist.github.com/cgrand/c8fa256c9ed8331f9cf1 from Christophe Grand. On Oct 18, 2014 8:18 PM, "shahrdad shadab" wrote: > Thanks a lot for your explanation, the thing that confuses me was the same > function used with "r

Re: behaviour of map

2014-10-18 Thread shahrdad shadab
Thanks a lot for your explanation, the thing that confuses me was the same function used with "repeatedly" only prints once: (first (repeatedly 4 #(do (println "executed!") (inc 1 I guess because Clojure does not read-ahead in this scenario. Am I right? On Sat, Oct 18, 2014 at 1:41 PM, Jonat

Re: behaviour of map

2014-10-18 Thread Jonathan Winandy
You can try in you repl with (take 1 (map (fn [_] (println "executed")) (vec (range 100 (take 32 (map (fn [_] (println "executed")) (vec (range 100 (take 33 (map (fn [_] (println "executed")) (vec (range 100 you will observe the 32 sized chunks. On Sat, Oct 18, 2014 at 7:36 PM,

Re: behaviour of map

2014-10-18 Thread James Reeves
Some lazy lists are chunked for efficiency, which means Clojure will read-ahead and evaluate a number of elements in advance. Often the outputs from the various list handling functions are chunked (e.g. map, range, etc.), while creating a seq explicitly with lazy-seq will not be chunked. - James

behaviour of map

2014-10-18 Thread shahrdad shadab
Greeting everyone, It might be stupid question but I expect (first (map (fn [_] (println "executed")) [1 2 3 4])) prints only once (realizing only first element in lazy seq returned by map) but it prints four times. Can some one shed a light why? Thanks in advance Best regards Shahrdda --

Re: Modelling in Clojure

2014-10-18 Thread Luc Préfontaine
+1. Two years ago we went all data driven here. We stripped the code size and complexity by a huge factor. All data encapsulation code was sent to the trash can. Our processing is driven by data more than by code. We ended up with a significant increase in generic code not linked to the busines

Re: [ClojureScript] ANN: Om 0.8.0-alpha1, Reference Cursors!

2014-10-18 Thread Daniel Kersten
Fantastic work, David! Thank you for all your hard work on Om! This is definitely an exciting release and I look forward to playing with it over the coming days. I'll be sure to report back on my experience with it. On 18 October 2014 16:53, David Nolen wrote: > I'm happy to announce the releas

Re: Modelling in Clojure

2014-10-18 Thread Chris Ford
James might be too modest to mention this as an exemplar as he's the maintainer, but for me, Ring is a great example of the success of data-as-API. HTTP requests are represented as a nested map with well-known keys, and middleware works with these fields or ev

ANN: Om 0.8.0-alpha1, Reference Cursors!

2014-10-18 Thread David Nolen
I'm happy to announce the release of Om 0.8.0-alpha1. This release includes the single biggest conceptual enhancement since its initial release - Reference Cursors. As we begin to build larger and larger applications with Om, we often run afoul of the need to organize our application around a hier

Re: Modelling in Clojure

2014-10-18 Thread James Reeves
On 18 October 2014 08:28, Mark Engelberg wrote: > Yeah, it's hard to deny the convenience of Clojure's keyword lookups and > standard assoc mechanism for getting and setting stored values, but I think > Bertrand Meyer's Uniform Access Principle reflects some pretty deep > thinking about the kinds

Re: Modelling in Clojure

2014-10-18 Thread Tom Oram
While this discussing has taken a slight tangent from my original question, it's been a very interesting read. Thanks for all your thoughts everyone. You guys rock! On 18 October 2014 08:28, Mark Engelberg wrote: > Yeah, it's hard to deny the convenience of Clojure's keyword lookups and > standa

Re: agent validation fails in STM

2014-10-18 Thread Linus Ericsson
You are right! If, say, a file write, fails the data would reside only in your memory refs. One way to make sure the two thing are always in sync is to be able to rollback the in-memory state (and replaying all subsequent actions) by holding on to the old version until the agent could be derefed

[UPDATE] Spring/Clojure integration / Clojure functions via JMX

2014-10-18 Thread henrik42
Hi folks, I added code that lets you call your clojure functions via JMX operations. https://github.com/henrik42/spring-break#jmxmbeans Cheers Henrik -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: Modelling in Clojure

2014-10-18 Thread Mark Engelberg
Yeah, it's hard to deny the convenience of Clojure's keyword lookups and standard assoc mechanism for getting and setting stored values, but I think Bertrand Meyer's Uniform Access Principle reflects some pretty deep thinking about the kinds of complications that arise in maintaining large programs