Re: ANN: Emacs auto-complete plugin for slime users

2010-10-15 Thread Scott Jaderholm
Works for me in repl. I have too much slime/clojure customization code, not really sure what does what :) Maybe this: (defun slime-clojure-repl-setup () (when (string-equal "clojure" (slime-connection-name)) (message "Setting up repl for clojure") (when (slime-inferior-process) (s

Re: ANN: Emacs auto-complete plugin for slime users

2010-10-15 Thread Jarl Haggerty
Should autocomplete work in the swank repl? It works perfectly in a clj buffer but nothing happens in the repl. On Aug 19, 7:46 am, Phil Hagelberg wrote: > On Thu, Aug 19, 2010 at 6:21 AM, Steve Purcell wrote: > > I guess Phil's very busy, but if he can apply this patch, then the regular > > s

Re: Newbie : Java Interop question

2010-10-15 Thread Michael Ossareh
On Fri, Oct 15, 2010 at 09:32, oak wrote: > Hi All, > > This is how i see the package in package explorer. > IEssbase.class > (I) IEssbase > (C, s f) Home > (M, s) create(String) IEssbase > (M, c) Home() > (P, s f) JAPI_VERSION > > Out of interest what is this

Re: Newbie : Java Interop question

2010-10-15 Thread Randy Hudson
Nested classes require the syntax AClass$NestedClass -- this being the "real name" of the class in the JVM. Static members of classes are referenced as AClass/member -- essentially treating the class as a namespace of its static members. So this should do it: (IEssbase$Home/create IEssbase/JAPI_VE

Re: (ab)using STM for longish calculations, network I/O

2010-10-15 Thread Alyssa Kwan
On Oct 15, 7:57 pm, peter veentjer wrote: > On Oct 15, 2:51 pm, hobnob wrote: > > > > > > > Hi, > > > I'm just starting to get my head wrapped around STM just by reading > > about it so I can make a decision on whether to port a Java project to > > Clojure. > > > a) can STM transactions contain

Re: (ab)using STM for longish calculations, network I/O

2010-10-15 Thread peter veentjer
On Oct 15, 2:51 pm, hobnob wrote: > Hi, > > I'm just starting to get my head wrapped around STM just by reading > about it so I can make a decision on whether to port a Java project to > Clojure. > > a) can STM transactions contain calculations that take a 'long' time, > let's say computing the

Re: resultset-seq

2010-10-15 Thread Laurent PETIT
2010/10/15 Mark Engelberg > On Fri, Oct 15, 2010 at 1:49 AM, David Powell > wrote: > > I'm in favour of down-casing - at least by default. Some processing is > going to happen anyway, as column names might contain spaces, which wouldn't > > be allowed in keywords. > > > > -- > > Dave > > One of

Re: Is this bug in Google AppEngine, appengine-clj or Clojure itself?

2010-10-15 Thread gaz jones
i had a similar problem recently. the only way i could find around it was to create a class that extends the class with the problematic method in question and create a new method that delegates to the method you actually want to call. i would love to hear a better solution... On Fri, Oct 15, 2010

Clojure on Android - new REPL front end?

2010-10-15 Thread Mike Meyer
Has anyone taken a look at tying the exiting port of Clojure to Android (that runs a REPL on a socket) to the REPL front end to be found at: http://www.appbrain.com/app/repl/com.folone.replcore ? http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant,

Re: Newbie : Java Interop question

2010-10-15 Thread oak
Sorry i've tried that as well. The problem is that Home is not a method on IEssbase. That's the message i get back. On Oct 15, 1:08 pm, ".Bill Smith" wrote: > Try using  IEssbase/JAPI_VERSION instead (replace dot with slash). > > On Oct 15, 11:32 am, oak wrote: > > > > > Hi All, > > > This is ho

Re: Best practices for protocols

2010-10-15 Thread K.
> If your protocol functions generally look like : display that data on this > view, then why not leverage multimethods and double dispatch ? I think I choose a misleading example, sorry about that. I'm working mainly with one kind of data, but there a lot of functions. For instance one function

Is this bug in Google AppEngine, appengine-clj or Clojure itself?

2010-10-15 Thread Darren Clarke
I've been using Clojure 1.2 and appengine-clj for a project on AppEngine and two days ago it stopped working after the Google team released some newly refactored code to production. Short discussion of this problem on the AppEngine-Java discussion group is here: http://code.google.com/appengine/fo

Re: The vsClojure Project

2010-10-15 Thread Will Kennedy
Very cool! I've been working on something similar. Will check it out! On Oct 3, 4:49 pm, jmis wrote: > It's very encouraging to see others interested in the project.  I've > added the licensing information to the grammar file.  There's a few > other attributions I need to take care of before I ca

Re: Newbie : Java Interop question

2010-10-15 Thread .Bill Smith
Try using IEssbase/JAPI_VERSION instead (replace dot with slash). On Oct 15, 11:32 am, oak wrote: > Hi All, > > This is how i see the package in package explorer. > IEssbase.class >   (I) IEssbase >       (C, s f) Home >              (M, s) create(String) IEssbase >              (M, c) Home() >

Re: Best practices for protocols

2010-10-15 Thread Paul deGrandis
In this case I would most certainly use multimethods. This is the perfect use case for them. If you want your views themselves to have certain forms, you may consider applying protocols there. Paul On Oct 15, 8:57 am, Laurent PETIT wrote: > 2010/10/15 K. > > > > "Stop!". When I read this, my

Re: resultset-seq

2010-10-15 Thread Mark Engelberg
On Fri, Oct 15, 2010 at 1:49 AM, David Powell wrote: > I'm in favour of down-casing - at least by default.  Some processing is going > to happen anyway, as column names might contain spaces, which wouldn't > be allowed in keywords. > > -- > Dave One of the more significant nuisances in Clojure/J

Newbie : Java Interop question

2010-10-15 Thread oak
Hi All, This is how i see the package in package explorer. IEssbase.class (I) IEssbase (C, s f) Home (M, s) create(String) IEssbase (M, c) Home() (P, s f) JAPI_VERSION I can import like this in Clojure =>(import `(com.essbase.api.session IEssbase))` I can

Re: Newbie: Exceptions and map

2010-10-15 Thread Mark Nutter
Map returns a lazy seq (which I suspect you already knew). Try it with doall instead of do. The "do" only wraps the map expression, it doesn't actually realize the seq. On Fri, Oct 15, 2010 at 11:39 AM, bleibmoritztreu wrote: > Hi group, > > I'm playing around with Clojure for a few weeks now and

Re: when-first

2010-10-15 Thread Sunil S Nandihalli
sorry ... the expression should have been .. the expression should have been (when-first [x [1 2 3 4 5]] (+ x 1 2)) and it works fine... Thanks .. :) Sunil. On Fri, Oct 15, 2010 at 9:38 PM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Hello everybody, > The evaluation of > > (wh

Re: when-first

2010-10-15 Thread Baishampayan Ghose
> Hello everybody, >  The evaluation of > (when-first [[x y z] [1 2 3 4 5]] (+ x y z)) > is returning > nil > I was expecting it to return 6 .. > am I missing something ? when-first is a macro which will, in the above example get expanded to - (when (seq [1 2 3 4 5]) (let [[x y z] (first [1 2 3

when-first

2010-10-15 Thread Sunil S Nandihalli
Hello everybody, The evaluation of (when-first [[x y z] [1 2 3 4 5]] (+ x y z)) is returning nil I was expecting it to return 6 .. am I missing something ? Thanks, Sunil. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Best practices for protocols

2010-10-15 Thread Laurent PETIT
2010/10/15 K. > > "Stop!". When I read this, my mind cries "Alert! potential > java-in-clojure > > code here !". > > Sorry I didn't want to frighten you with the words "MVC" and "Clojure" > in the same sentence :-). > However, I think it's just the right approach to separate the > presentation fr

Re: Best practices for protocols

2010-10-15 Thread K.
> "Stop!". When I read this, my mind cries "Alert! potential java-in-clojure > code here !". Sorry I didn't want to frighten you with the words "MVC" and "Clojure" in the same sentence :-). However, I think it's just the right approach to separate the presentation from the logic. I may be wrong an

Newbie: Exceptions and map

2010-10-15 Thread bleibmoritztreu
Hi group, I'm playing around with Clojure for a few weeks now and quite like it. Today however I noticed one thing which puzzles me a lot, and maybe points at something very basic I've misunderstood, so I wanted to ask here: Why doesn't (do (map #(throw (Exception. %)) '("a")) true) throw any Exc

Re: (ab)using STM for longish calculations, network I/O

2010-10-15 Thread hobnob
Thanks Tim that with the readers and writers is what I figured. On Oct 16, 12:12 am, Timothy Baldridge wrote: > I can't answer most of these, but I'll take a crack at a) > > From my understanding of the clojure code, the answer to long running > transactions will depend on your application. If yo

Re: Best practices for protocols

2010-10-15 Thread Laurent PETIT
2010/10/15 K. > Hello, > > I'm a developping a Swing GUI in Clojure and follow the MVC patterns. > The view implements a protocol for displaying data, "Stop!". When I read this, my mind cries "Alert! potential java-in-clojure code here !". clojure promotes a generic approach to data management.

Re: Newbie: Multiple String Operations

2010-10-15 Thread Paul
Ooooh, lovely! P. On Oct 15, 3:31 pm, Meikel Brandmeyer wrote: > Hi, > > On 15 Okt., 16:25, Paul wrote: > > > (.replace (.replace (.replace (.replace ... > > > Is there a more succinct and 'clojurish' way to do this? > > (-> >   (.replace ) >   (.replace ) >   ... >   (.replace )) > > Sin

Re: Newbie: Multiple String Operations

2010-10-15 Thread Laurent PETIT
user=> (reduce (fn [s [old new]] (.replace s old new)) "abcd" [["a" "b"] ["b" "c"] ["c" "d"]])"" user=> 2010/10/15 Paul > Hi all, > > I need to perform string replacement a number of times and currently > achieve this using: > > (.replace (.replace (.replace (.replace ... > > Is there a m

Re: Newbie: Multiple String Operations

2010-10-15 Thread B Smith-Mannschott
On Fri, Oct 15, 2010 at 16:25, Paul wrote: > Hi all, > > I need to perform string replacement a number of times and currently > achieve this using: > > (.replace (.replace (.replace (.replace ... > > Is there a more succinct and 'clojurish' way to do this? > Instead of (.replace (.replace (.r

Re: Best practices for protocols

2010-10-15 Thread Shantanu Kumar
>From my experience, protocols are essentially contracts between various modules of the code base - the fewer they are (in number) the better my peace of mind! IMHO if you just need to pass around function implementations, consider using defrecord. (defrecord OrderProcessingView [fn1 fn2 fn3...])

Re: Newbie: Multiple String Operations

2010-10-15 Thread Meikel Brandmeyer
Hi, On 15 Okt., 16:25, Paul wrote: > (.replace (.replace (.replace (.replace ... > > Is there a more succinct and 'clojurish' way to do this? (-> (.replace ) (.replace ) ... (.replace )) Sincerely Meikel -- You received this message because you are subscribed to the Google Grou

Newbie: Multiple String Operations

2010-10-15 Thread Paul
Hi all, I need to perform string replacement a number of times and currently achieve this using: (.replace (.replace (.replace (.replace ... Is there a more succinct and 'clojurish' way to do this? Thanks, P. -- You received this message because you are subscribed to the Google Groups "Clo

Best practices for protocols

2010-10-15 Thread K.
Hello, I'm a developping a Swing GUI in Clojure and follow the MVC patterns. The view implements a protocol for displaying data, and another one to register Swing listeners. Callbacks registered with the second protocol only access the UI through the view protocol. Each of this protocol has ~50 f

Re: (ab)using STM for longish calculations, network I/O

2010-10-15 Thread Nicolas Oury
dosync is a way of ensuring whole stateful operation is done atomically. (ie as if everything was happening in one step.) That contradicts b). During a whole dosync, you can only see one state of the world. If you do not need atomicity, do multiple dosync. You should create another abstraction fo

Re: clojure clr and jmv - portability and compatibility?

2010-10-15 Thread Timothy Baldridge
>From what I've been seeing of both clojure and clojure-clr...they aren't very portable at all. Pure clojure code should be fine. But since clojure likes to use the underlying VM for almost everything it can, you'll have issues. FileStream in CLR may not be the same as FileStream in Java. As a CLR

Re: (ab)using STM for longish calculations, network I/O

2010-10-15 Thread Timothy Baldridge
I can't answer most of these, but I'll take a crack at a) >From my understanding of the clojure code, the answer to long running transactions will depend on your application. If you have one writer, and 100 readers, you'll be fine. The readers will read the old value while the writer is updating t

(ab)using STM for longish calculations, network I/O

2010-10-15 Thread hobnob
Hi, I'm just starting to get my head wrapped around STM just by reading about it so I can make a decision on whether to port a Java project to Clojure. a) can STM transactions contain calculations that take a 'long' time, let's say computing the cryptographic hash of a plaintext. I'd 'ensure' the

clojure clr and jmv - portability and compatibility?

2010-10-15 Thread urza urza
Hello, I am new to clojure, so sorry if this is a stupid question, but: How portable are clojure programs between clojure clr and clojure jvm? For example, can i use clojure contrib in clr? How about Enlive or other libraries? Can I write one clj program that will run both in jvm and clr? Or is

Re: Test-driven development in Clojure

2010-10-15 Thread Felix H. Dahlke
Ah, I see, thank you. Multimethods take a while getting used to I guess :) Definitely better for my problem than defprotocol though. On 14/10/10 22:13, Armando Blancas wrote: > Maybe something like this. Those calls polymorphic on the returrn > value of the anynimous function, so this is more pow

Re: Java Source Indentation

2010-10-15 Thread Stuart Halloway
It's all about priorities. At this point the goal is to write Clojure in Clojure, so the useful lifecycle of Java indentation fixes is hopefully modest. If you are looking to spend time on Clojure, there are many tickets that need patches. :-) https://www.assembla.com/spaces/clojure/tickets/cus

Re: Help to optimize palindrome search from input file

2010-10-15 Thread siddarth shankar
i could get it down to around 1.6/1.7 seconds s...@sid-:~$ time clojure dummy.clj woohoo palindrome: eve woohoo palindrome: ranynar real0m1.739s user0m2.088s sys 0m0.124s made a couple of changes - only call 'palindrome?' for substrings between identical characters(between

Re: Java Source Indentation

2010-10-15 Thread David Jacobs
I get that. However, "broken" can describe code on several different levels, not just on the level of compilation or execution. I would say that for a young aspiring language like Clojure, having readable, presentable source code is key, and that not having these things amounts to being broken,

Re: resultset-seq

2010-10-15 Thread David Powell
On Thu 14/10/10 20:58 , Mark Engelberg mark.engelb...@gmail.com sent: > Since no one chimed in with support or reasoning for resultset-seq's > current lower-casing behavior, can we discuss changing it to > case-maintaining behavior, or at least make it something you can set > with an optional flag

Re: Java Source Indentation

2010-10-15 Thread Laurent PETIT
2010/10/15 B Smith-Mannschott > On Fri, Oct 15, 2010 at 04:13, David Jacobs > wrote: > > I've just started learning Clojure and I'm excited about what I see. The > combination of power and sophistication in the language is refreshing, and > I've started to dive into the source code to understand