Re: leveraging Clojure STM in other JVM languages?

2009-06-23 Thread MattH
I'm calling the clojure.lang.Ref and LockingTransaction classes directly from Java (as suggested by Rich above). Yes, as Daniel says you to need to segregate side effects from the code that runs in a transaction. I'm using some lightweight wrappers around Ref and LockingTransaction to store a que

Re: Abstract data types in functional languages

2009-04-25 Thread MattH
It's worth considering how *nested* accessors would work in the context of immutability. The nested maps approach works really nicely, due in part to functions like assoc-in: ; From Mark Volkmann's tutorial (assoc-in person [:employer :address :city] "Clayton") What would the above update look

Re: VimClojure 2.0.0 released (merged with Gorilla)

2009-03-13 Thread MattH
Thanks Meikel, this is really useful! I noticed that the and key bindings used for the history navigation work fine in MacVim.app, but not from the terminal in OS X. So for any VimClojurians on OS X with the same problem, suggested workarounds: - use MacVim.app, or - add alternative mappings i

Re: Gorilla issue with recent builds?

2009-02-28 Thread MattH
> Environment: ... contrib r1312 ... Sorry, that should be clojure-contrib r545 (the latest revision) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goo

Re: Gorilla issue with recent builds?

2009-02-28 Thread MattH
I had the same problem with the Vim Repl, but rebuilding Gorilla fixed the problem. Build instructions are in the README, but to paraphase: $ cd /path/to/gorilla-1.1.1 $ vi local.properties $ cat local.properties clojure.jar=/path/to/clojure.jar clojure-contrib.jar=/path/to/clojure-contrib.jar $

Re: Directed Graphs for Contrib

2009-02-22 Thread MattH
+1! That'd be really useful. --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send email to clojure+unsub

Re: IntelliJ Plugin -- Wonderful News!

2009-02-15 Thread MattH
For those looking to get this working on Mac OS X, this worked for me: (Tested using revision 22594, IDEA 8.1, 32-bit Macintel with Java 1.5 and Mac OS X 10.5.6) - $ mkdir ~/clojure-build-dir - $ cd ~/clojure-build-dir - $ mkdir ~/clojure-build-dir/fake-idea-home - $ cd ~/clojure-build-dir/fake-

Re: A pipe macro for left-to-right coll streams

2009-02-12 Thread MattH
+1 for pipe and let-> as above, with the non-seq => (non-seq local) translation. --~--~-~--~~~---~--~~ 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 To unsubs

Re: How to build tree with nodes that 'point' to each other?

2009-02-12 Thread MattH
You might want to check out zippers, which give you the ability to navigate and 'edit' a tree structure, but using immutable data structures. There are some good explanations on this thread: http://groups.google.com/group/clojure/browse_thread/thread/d8871da625420b71/1bce7c6d9def2031 --~--~--

Re: A pipe macro for left-to-right coll streams

2009-02-12 Thread MattH
"Plus a macro makes for shorter syntax, which is part of its purpose." Yeah the shorter syntax becomes even more apparent when you're piping/ threading through one-arg functions where it also saves on parenthesis, as the "->" and "pipe" macros expand to a list if necessary. E.g. this code in a c

Re: A pipe macro for left-to-right coll streams

2009-02-10 Thread MattH
The pipe macro is definitely not a new idea btw. It's taken from a thread posted on another lisp group. Someone posted a silly inflammatory attack on lisp, contrasting unix: "cat a b c | grep xyz | sort | uniq" to how they'd imagine it in lisp: "(uniq (sort (grep xyz (cat a b c" A poster c

A pipe macro for left-to-right coll streams

2009-02-08 Thread MattH
Hi, I want to suggest a "pipe" macro for dealing with collection streams, as a one-line variation on the built in "->" macro. Instead of writing a nested stream like this: ; "Take the first 3 elements of the odd numbers in the range 1 to 20" (take 3 (filter odd? (range 1 20))) you can write