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 $

time complexity for immutable priority queue?

2009-02-28 Thread zoglma...@gmail.com
After helping tutor some students earlier in the week on the subject of priority queues, I ended up implementing it in Clojure as a mutable data structure. It was straight forward, but curiosity struck and I implemented the priority queue as an immutable data structure. I'm pretty sure that 'ffirs

Re: Clojure + Terracotta = Yeah, Baby!

2009-02-28 Thread Nabib El-Rahman
Its a way to package integration details into a module. For example, if I want to cluster EHCache, I can drive through the code and figure out what data structure to share and subsequently lock on. All that work can be packaged into a module for terracotta, so that way people who just want to use

Re: Clojure + Terracotta = Yeah, Baby!

2009-02-28 Thread hank williams
> > > Writing a TIM is definitely the way to go, It's a place to hide the glue > until both Terracotta and Clojure catches up with each other. uhhh what is a TIM? Thanks Hank -- blog: whydoeseverythingsuck.com --~--~-~--~~~---~--~~ You received this m

Re: Clojure + Terracotta = Yeah, Baby!

2009-02-28 Thread Nabib El-Rahman
Hi guys, I work for Terracotta ( on the server side ) and find this work with Clojure + Terracotta very exciting. Writing a TIM is definitely the way to go, It's a place to hide the glue until both Terracotta and Clojure catches up with each other. If you have any questions feel free to post on o

Re: letfn - mutually recursive local functions

2009-02-28 Thread Chouser
On Sat, Feb 28, 2009 at 7:38 PM, Rich Hickey wrote: > > I've added letfn, which lets you define mutually recursive local > functions a la CL's labels. > > (defn ring [n] >  (letfn [(a [n] (if (zero? n) n (b (dec n >          (b [n] (if (zero? n) n (c (dec n >          (c [n] (if (zero? n)

Re: Opinions on -> macro? (was Re: Extensive use of let?)

2009-02-28 Thread Belfabius
First, I have to say thanks. I'm only a part-time Clojure user, and I didn't know of the -> macro until today. Second, I think the -> syntax leads to more readable code for precisely those situations where you're coding a sequence of actions. Finally, I've got a comment about what I think might

Re: Opinions on -> macro? (was Re: Extensive use of let?)

2009-02-28 Thread Laurent PETIT
2009/2/28 Stuart Sierra > > On Feb 27, 1:39 pm, "John D. Hume" wrote: > > As a Java/Ruby guy who is not used to reading inside out, I'm curious > > as to whether people who ARE accustomed to LISP find the -> macro > > distracting since it flops things around. Are there circumstances > > where yo

Re: Debugging Clojure with IntelliJ IDEA

2009-02-28 Thread CuppoJava
Oh I'm sorry, I was still accidentally running the previous version. Indentation works perfectly. Thank you very much for this plugin. Debugging support is so invaluable to me. May I ask how long you think the Surround-With feature will take? -Patrick PS: I found your profile on the IntelliJ t

Re: Debugging Clojure with IntelliJ IDEA

2009-02-28 Thread Ilya Sergey
Hello. What do you mean by "automatically indent"? If you press enter inside a Sexpr, vector or map, indentation will be ferformed automatically. Kind regards, Ilya On Mar 1, 1:37 am, CuppoJava wrote: > Wow it's incredible how fast your progressing on the plugin. It's > already a joy to use. T

letfn - mutually recursive local functions

2009-02-28 Thread Rich Hickey
I've added letfn, which lets you define mutually recursive local functions a la CL's labels. (defn ring [n] (letfn [(a [n] (if (zero? n) n (b (dec n (b [n] (if (zero? n) n (c (dec n (c [n] (if (zero? n) n (a (dec n] (c n))) (ring 1000) Note this is still s

Re: Debugging Clojure with IntelliJ IDEA

2009-02-28 Thread CuppoJava
Wow it's incredible how fast your progressing on the plugin. It's already a joy to use. Thank you very much. Is there a way to automatically indent when I press Enter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Denver/Boulder Clojure users

2009-02-28 Thread _ugly_2
I live in Boulder but have just started using Clojure. --~--~-~--~~~---~--~~ 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, se

Re: new Clojure article

2009-02-28 Thread _ugly_2
I'm in the process of learning Clojure so this article has already helped me quite a bit (about half done with it). Bookmarked. Thanks Mark for the work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: Observations about new lazy branch

2009-02-28 Thread Mark Engelberg
On Sat, Feb 28, 2009 at 6:09 AM, Rich Hickey wrote: > Clojure's fully-lazy now pretty much follows the "even" model > described by Wadler: > > How to add laziness to a strict language without even being odd: > > http://homepages.inf.ed.ac.uk/wadler/papers/lazyinstrict/lazyinstrict.ps OK, I just

Re: new Clojure article

2009-02-28 Thread Rayne
Thank you. Now I have something to link friends too when they ask about Clojure. Mark Volkmann wrote: > I've written an article on Clojure. See http://ociweb.com/jnb/jnbMar2009.html. > > The goal of this article is to provide a fairly comprehensive > introduction to the Clojure programming langua

Re: Observations about new lazy branch

2009-02-28 Thread Mark Engelberg
On Sat, Feb 28, 2009 at 6:09 AM, Rich Hickey wrote: > I think your fundamental hangup is on looking at (rest x) as a > calculation/effect triggered by a consumer. (rest x) is logically just > a slot lookup that obtains another seq. The laziness of that seq is > its constructor's problem. Right,

functional programming idiom

2009-02-28 Thread linh
hello, what's the common idiom in functional programming regarding checking the validity of arguments to functions. i think this is called defensive programming vs contract programming. for example: ;; this first version of foo checks the validity of arguments inside foo (defn foo [context arg]

Re: (rest ())

2009-02-28 Thread Mark Engelberg
As Rich explained in one post, in Lisp-like languages, there is a certain amount of intertwining between two views of a sequence which is a series of linked nodes. One way is to think about these nodes as just nodes with a first and rest. Another way is to think about each node as representing a

Early registration for International Lisp Conference (Cambridge, MA, 22-25 March 2009)

2009-02-28 Thread Stephen C. Gilardi
Rich will be presenting a "Clojure in Depth" tutorial session on Sunday, 22 March 2009 at the International Lisp Conference taking place at MIT in Cambridge, MA: http://www.international-lisp-conference.org/2009/tutorials#clojure It's scheduled in 3 parts for a total of 5 hours:

Debugging Clojure with IntelliJ IDEA

2009-02-28 Thread Ilya Sergey
Hello, all. Last build of "La Clojure" plugin for IntelliJ IDEA now supports debug for Clojure programs. It could be downloaded from http://plugins.intellij.net/plugin/?id=4050 Moreover, we've implemented completion for Java instance methods and implicitly imported classes. With best regards, Il

Re: Opinions on -> macro?

2009-02-28 Thread eyeris
You are wrong. Many writings use ,, as a place-holder for where -> is placing the argument. Take Meikel's example above: (foo (bar (baz (frobnicate a-thing)) bla)) Becomes (-> a-thing frobnicate baz (bar bla) foo) So bar is a function of more than one argument. Re-written with place- h

Re: Opinions on -> macro?

2009-02-28 Thread Meikel Brandmeyer
Hi, Am 28.02.2009 um 22:39 schrieb Joshua Fox: -> confuses me: Does it treat functions with multiple parameters different from functions with one parameter? Am I right that it can only be used with the latter? (-> a-thing fun-1 (fun-2) (fun-3 b-thing)) is turned into (fun-3 (fun-2 (fun-

Re: Opinions on -> macro?

2009-02-28 Thread Joshua Fox
-> confuses me: Does it treat functions with multiple parameters different from functions with one parameter? Am I right that it can only be used with the latter? Joshua --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Opinions on -> macro?

2009-02-28 Thread e
> Consistent syntax is nice, but not very useful if it gets in the way > of readability. Fortunately, Clojure has a consistent method for > designing arbitrary new syntax when needed. -> is not a "special > case". It's a well-documented macro intended to make some kinds of > expressions more readab

Re: Clojure + Terracotta = Yeah, Baby!

2009-02-28 Thread Luc Prefontaine
We think the same way. Our first implementation of an alternative to AtomicReference is straightforward, we will look at improving it if the need arises. It will be easier to do so when we get stats from Terracotta after running some benchmarks. There's much to do before getting there. Luc On S

Re: Clojure + Terracotta = Yeah, Baby!

2009-02-28 Thread Paul Stadig
In the Namespace case, it might be premature optimization to worry about AtomicReference being replaced. If there is a way to rewrite that code with, say, synchronized blocks, and it will work better with Terracotta, I think it would be worth doing. I don't think it would be normal usage to be upd

new Clojure article

2009-02-28 Thread Mark Volkmann
I've written an article on Clojure. See http://ociweb.com/jnb/jnbMar2009.html. The goal of this article is to provide a fairly comprehensive introduction to the Clojure programming language. A large number of features are covered, each in a fairly brief manner. Check out the hyperlinked table of

Re: The Application Context Pattern

2009-02-28 Thread Itay Maman
Hi, On Feb 28, 8:32 pm, CuppoJava wrote: > Hi Itay, > I'm a little confused about one aspect of the context pattern. > > If I understand this write, a listener is a function that takes an old > context, and returns a new context, BUT it also calls the appropriate > GUI functions (setText, setSiz

Re: Opinions on -> macro? (was Re: Extensive use of let?)

2009-02-28 Thread Stuart Sierra
On Feb 27, 1:39 pm, "John D. Hume" wrote: > As a Java/Ruby guy who is not used to reading inside out, I'm curious > as to whether people who ARE accustomed to LISP find the -> macro > distracting since it flops things around. Are there circumstances > where you prefer it? Definitely. When you'r

Re: The Application Context Pattern

2009-02-28 Thread CuppoJava
Hi Itay, I'm a little confused about one aspect of the context pattern. If I understand this write, a listener is a function that takes an old context, and returns a new context, BUT it also calls the appropriate GUI functions (setText, setSize) to ensure that the gui state is consistent with the

Re: dorun and map

2009-02-28 Thread Juergen Gmeiner
On 25 Feb., 15:02, Stuart Sierra wrote: > I often find I need to do this when the mapping function depends on a > dynamic context, like an open stream or an SQL connection. I'm not > using side effects in this case, but I have to make sure that the > sequence is completely realized before leaving

Re: Example JUnit 4.4 use with Clojure

2009-02-28 Thread Berlin Brown
On Feb 28, 12:05 pm, Berlin Brown wrote: > On Feb 28, 12:04 pm, BerlinBrown wrote: > > > If you want to use junit with clojure, this is what I ended up doing. > > Yes, I know there are many clojure test frameworks.  But if you are > > stuck with a junit mind, then here is an example approach.

Re: Example JUnit 4.4 use with Clojure

2009-02-28 Thread Berlin Brown
On Feb 28, 12:04 pm, BerlinBrown wrote: > If you want to use junit with clojure, this is what I ended up doing. > Yes, I know there are many clojure test frameworks.  But if you are > stuck with a junit mind, then here is an example approach. > > http://clojure.googlegroups.com/web/junit_exampl

Example JUnit 4.4 use with Clojure

2009-02-28 Thread BerlinBrown
If you want to use junit with clojure, this is what I ended up doing. Yes, I know there are many clojure test frameworks. But if you are stuck with a junit mind, then here is an example approach. http://clojure.googlegroups.com/web/junit_example_clojure.clj?gsc=rSQdQgsBq71IhmeUYhS87PjFY2mX

Re: Clojure + Terracotta = Yeah, Baby!

2009-02-28 Thread Luc Prefontaine
1) AtomicReference is used in several places. Instead of changing it, we think we can keep it when Clojure runs "locally" and provide an alternative when running in "shared" mode. AtomicReference is optimized to be efficient in a standalone JVM. We would like to keep it that way. Eventually Terra

Re: Synchronous watches

2009-02-28 Thread Rich Hickey
On Feb 28, 12:47 am, Mark Derricutt wrote: > Apologies for thread-hijackig but I thought I'd mention that one of the > problems I've had using Clojure under OSGi was fixed with a minor patch > (mentioned in my post > athttp://www.talios.com/clojure_running_successfully_under_osgi.htm) which >

Re: The Application Context Pattern

2009-02-28 Thread Itay Maman
On Feb 27, 5:38 pm, Marko Kocić wrote: > Interesting approach, nice explained. > > Does anyone have similar example using one of the cells > implementations? > What would be pros/cons between this and cells approach? I think that in general, when comparing powerful facilities (such as the Cont

Re: Waterfront 148 (was: Waterfront - The Clojure-based editor for Clojure)

2009-02-28 Thread Dan
On Sat, Feb 28, 2009 at 4:31 AM, Itay Maman wrote: > > Dan, Marko, > > I wonder whether you have the time to do a little experiment. The L&F > is set at line 182 of net/sourceforge/waterfront/ide/ui.clj. Could you > please try to see which L&F works on your machine or, otherwise, > understand why

StringSeq

2009-02-28 Thread David Powell
I noticed the other day that StringBuffers aren't seq-able. Would it make sense to allow StringSeq to work on any CharSequence implementation, not just Strings? -- Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: Observations about new lazy branch

2009-02-28 Thread Rich Hickey
On Feb 27, 2009, at 11:10 PM, Mark Engelberg wrote: > > I just finished porting my combinatorics code to the new lazy > constructs, and I discovered some subtleties to using lazy-seq that > were not at first apparent. > > To begin with, consider the two versions of map: > The old way: > > (defn

Re: Contributing

2009-02-28 Thread Joshua Foster
Thanks. Joshua On Feb 28, 2009, at 8:16 AM, Rich Hickey wrote: > > On Feb 27, 2009, at 10:59 PM, Joshua wrote: > >> >> I have started looking into Issue 34 and I have some questions. >> >> Link: >> http://code.google.com/p/clojure/issues/detail?id=34&colspec=ID%20Type%20Status%20Priority%20Repo

Re: Contributing

2009-02-28 Thread Rich Hickey
On Feb 27, 2009, at 10:59 PM, Joshua wrote: > > I have started looking into Issue 34 and I have some questions. > > Link: > http://code.google.com/p/clojure/issues/detail?id=34&colspec=ID%20Type%20Status%20Priority%20Reporter%20Owner%20Summary > > Is the desired syntax to match the CL version? >

Re: Clojure + Terracotta = Yeah, Baby!

2009-02-28 Thread Paul Stadig
My approach was just to share what few refs I wanted, but another approach (like Luc's) is to share everything. The obvious advantage being that you can set! the root binding of vars (like function definitions). The goal with Terracotta is to make things as transparent as possible, so I don't thin

Re: Opinions on -> macro?

2009-02-28 Thread Jarkko Oranen
e wrote: > I think it's simpler just to have a consistent syntax, personally. > Otherwise, why not python or haskell style syntax for the language? because > code is data. So now there's a special case where the data is backwards. Consistent syntax is nice, but not very useful if it gets in th

Re: doc suggestion for future function

2009-02-28 Thread bOR_
Hmm. This is becoming something of a puzzle. A simple noncode version of the model I am using is this (loop (increase year with 1) (break and create bidirectional links between refs) ) The break and create step represents a contact network between humans, where each human is basically a str

Re: The Application Context Pattern

2009-02-28 Thread Itay Maman
On Feb 28, 3:26 am, samppi wrote: > It looks really nice. I have a question about those observers, though-- > every time that a context-processing function is called, every > observer is called one by one, no matter what the context-processing > function was. This seems somewhat inefficient, mo

Re: (rest ())

2009-02-28 Thread Meikel Brandmeyer
Hi, Am 28.02.2009 um 04:14 schrieb Mark Engelberg: I expect: (rest [1]) -> () (rest []) -> nil Just as (first []) yields nil, so should (rest []), IMO. The definition of rest, is that it returns a collection of items of the rest of the given seqable thing. first is a different case. It take

Re: doc suggestion for future function

2009-02-28 Thread Christophe Grand
bOR_ a écrit : > can I call something like (apply await myvectorofrefs) if I have a > bunch of futures running and I want to wait for them to finish before > I go on with the next step in the model? > No you can't use await. The simplest way to await for a future is to deref it: @fut blocks u

Re: Waterfront 148 (was: Waterfront - The Clojure-based editor for Clojure)

2009-02-28 Thread Itay Maman
Dan, Marko, I wonder whether you have the time to do a little experiment. The L&F is set at line 182 of net/sourceforge/waterfront/ide/ui.clj. Could you please try to see which L&F works on your machine or, otherwise, understand why an exception is thrown there? Thanks, -Itay On Feb 28, 12:58 

Re: Observations about new lazy branch

2009-02-28 Thread Christophe Grand
Mark Engelberg a écrit : > Let's imagine that you are using map on a collection for which it is > very computation intensive to generate the rest, but trivial to > generate the first. > I don't think that's that simple: it depends on what is in the cons. For example, if the input seq is the r

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-28 Thread Itay Maman
On Feb 28, 1:57 am, zoltar wrote: > On Feb 25, 6:02 pm, "Stephen C. Gilardi" wrote: > > > > > - When using waterfront on Mac OS X, it appears that the control   > > characters intended to trigger menu selections (e.g. ^E) are being   > > intercepted before they reach the menus. In the specific

Re: doc suggestion for future function

2009-02-28 Thread bOR_
Related to the (future function. (there is a bit of a lack of documentation on it, but I guess I can derive more from the example in http://clojure.org/refs,) can I call something like (apply await myvectorofrefs) if I have a bunch of futures running and I want to wait for them to finish before I