Re: Clojure glosary

2016-02-19 Thread Juvenn Woo
Hi Tianxiang, there is Clojure cheatsheet that may be helpful to you: http://jafingerhut.github.io/cheatsheet/grimoire/cheatsheet-tiptip-cdocs-summary.html Best, -- Juvenn Woo Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Saturday, 20 February 2016 at 10:39 AM, Tianxiang Xiong

Re: 'cljsbuild' not a task

2015-07-20 Thread Juvenn Woo
Hi Bernie, please have a look at project.clj, where you might be missing plugin lein-cljsbuild https://github.com/emezeske/lein-cljsbuild -- Juvenn Woo Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, 20 July, 2015 at 12:12 pm, Bernie Baillargeon wrote: I followed

Re: Advice on introducing a Java dev to Clojure

2015-07-11 Thread Juvenn Woo
Hi Johanna, I don’t know if it'll work for your team, but I find Shaun Le Bron's Interactive guide to Tetris in ClojureScript” the most succinct and beautiful way of showing power of Clojure and ClojureScript. https://github.com/shaunlebron/t3tr0s-slides Have fun! -- Juvenn Woo Sent

Re: Advice on introducing a Java dev to Clojure

2015-07-11 Thread Juvenn Woo
Hi Johanna, I don’t know if it'll work for your team, but I find Shaun Le Bron's Interactive guide to Tetris in ClojureScript” the most succinct and beautiful way of showing power of Clojure and ClojureScript. https://github.com/shaunlebron/t3tr0s-slides Have fun! -- Juvenn Woo Sent

Re: Weird behaviour in re-matches ?

2015-06-16 Thread Juvenn Woo
On Tuesday, 16 June, 2015 at 5:19 pm, Jeroen van Dijk wrote: I came accross this weird case below with re-matches (in clojure 1.6). For some reason the pattern matches, once just once, only after a parse exception. This pattern repeats with every follow up parse exception. Is this a

Re: What is a real example of the Observer pattern?

2015-05-07 Thread Juvenn Woo
Hi Larry, As far as I know, the core part of Om is implemented in Observer Pattern, see: https://github.com/omcljs/om/blob/master/src/om/core.cljs#L1164 which observes app state, and triggers DOM renders as that changes. Best, -- Juvenn Woo Sent with Sparrow (http://www.sparrowmailapp.com

Re: How to to watch changed files and run tests again automatic

2015-04-09 Thread Juvenn Woo
Hi Denis, there's lein-auto plugin can do that. — Sent from Mailbox On Thu, Apr 9, 2015 at 9:55 PM, Denis L sad.ho...@gmail.com wrote: I use Rspec/Guard to watch changed files and automatic run test for for Ruby/Rails application. How can I repeat similar scenario for Clojure-app? --

Re: anybody here who use emacs to edit closure? is emacs lisp a good starting point to learn closure?

2015-04-03 Thread Juvenn Woo
Agree with Andy. As a starter, it is better and faster to learn Clojure alone. After you grasped one, the other lisps will be easy to follow. Emacs has been the de facto goto choice for most here, it is highly recommended to invest into it. Other than that, there're vim fireplace, as well as

Re: how do you re-load a clojure library?

2015-03-30 Thread Juvenn Woo
. So you can just find and delete them over there. The next time you run a lein task, it will re-download it. Best, -- Juvenn Woo Sent with Sparrow http://www.sparrowmailapp.com/?sig On Sunday, 29 March, 2015 at 7:43 pm, Dan Campbell wrote: If you wanted to sort of 'clean out' a clojar

Re: how do you re-load a clojure library?

2015-03-29 Thread Juvenn Woo
Hi Dan, All jars files are kept at `~/.m2/repositories` on *nix, as far as I know. So you can just find and delete them over there. The next time you run a lein task, it will re-download it. Best, -- Juvenn Woo Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Sunday, 29 March

Re: test.check :autotest ?

2015-03-28 Thread Juvenn Woo
In addition to lein-autotest plugin, there's also lein-auto that'll continuously reload your code and run your test. Generally, you'll find plentiful other plugins on leiningen's plugin wiki of GitHub: https://github.com/technomancy/leiningen/wiki/Plugins Best, — Sent from Mailbox On

Re: Some guidance on how to write good property tests with test.check?

2015-03-28 Thread Juvenn Woo
Hi John, since it's a simple predicate, we can test what cases will result true, and what false. E.g. : (is (false (valid-vector? [])) (is (false (valid-vector? [:a])) (is (false (valid-vector? [1])) (is (true (valid-vector? [:a 1])) Practically, I do feel it's a bit unnecessary to use

Re: Extend java class to participate in sequence operations

2015-03-18 Thread Juvenn Woo
So in Clojure, I'd have: (defrecord MyNode [^Node node] clojure.lang. ISeq (seq [this] …)) Thanks Mikera! An enlightenment to me! — Sent from Mailbox On Wed, Mar 18, 2015 at 2:11 PM, Mikera mike.r.anderson...@gmail.com wrote: In that case, I would suggest writing a

Extend java class to participate in sequence operations

2015-03-17 Thread Juvenn Woo
Dear all, Given a node type from singly linked list: class Node { int val; Node next; } How do I extend it so `(seq node)` will return a sequence of values? And generally first, rest, and next will work on node too. While in Java, we could define the class to implement

Re: Extend java class to participate in sequence operations

2015-03-17 Thread Juvenn Woo
Thanks Niels, but what if a java class is not available for rewrite? Say, it is from an external library. — Sent from Mailbox On Tue, Mar 17, 2015 at 10:01 PM, Niels van Klaveren niels.vanklave...@gmail.com wrote: If a java class implements Iterable, it automatically supports seq. On

Re: Newify java class dynamically

2015-03-10 Thread Juvenn Woo
Good to know thee, thank you T T! — Sent from Mailbox On Mon, Mar 9, 2015 at 11:21 PM, Tassilo Horn t...@gnu.org wrote: Juvenn Woo mach...@gmail.com writes: I am writing a function that'll take a java class name as an arg, wherein I'll make instance of the class. Several approaches did I

Newify java class dynamically

2015-03-09 Thread Juvenn Woo
Hi all, I am writing a function that'll take a java class name as an arg, wherein I'll make instance of the class. Several approaches did I try: (let [klass Integer] (new klass 42)) ; this raises exception unable to resolve symbol: klass (let [klass Integer] (.new klass 42)) ; raises

Re: Better update function

2014-12-22 Thread Juvenn Woo
Dear Steve, I’m new in clojure as well, but if we try to break up your one function into two, we’d have the following: (defn update1 Given a two-level nested vector of maps, two keys for each map, and an update function. Apply the function in the inner map, and returns nested structure.