Re: Slime - Clojure Installation

2009-07-19 Thread Dimiter malkia Stanev
Here is my script for updating clojure on Mac/Linux - update-clojure.sh or on Windows (uses cygwin git) - update-clojure.bat git clone git://github.com/richhickey/clojure.git cd clojure git pull ant clean ant cd .. git clone git://github.com/richhickey/clojure-contrib.git cd clojure-contrib

Re: Examining performance on the JVM

2009-07-19 Thread Dimiter malkia Stanev
Great question! I've been wondering the same, and I've found great answers here. But here is how I was able to get some of the assembly (in normal JVM, not debug), but for small portions of code - for example this is how I was able to see the point-in-poly algorithm. Basically I put a tight

Re: clojure-mode install on Windows XP does not work, for me

2009-05-19 Thread Dimiter malkia Stanev
I have now the same problem, but under Mac OS X 10.5 Things used to work few days ago (if not yesterday) On May 18, 7:32 am, klang karstenl...@gmail.com wrote: First things first: swank doesn't load and slime can't connect to the *inferior-lisp* running clojure I am missing something

Re: clojure-mode install on Windows XP does not work, for me

2009-05-19 Thread Dimiter malkia Stanev
- Duser.dir=/Users/malkia/p/)) '(swank-clojure-java-path /System/Library/Frameworks/ JavaVM.framework/Versions/1.6.0/Home/bin/java)) It works :) On May 19, 9:38 pm, Dimiter \malkia\ Stanev mal...@gmail.com wrote: I have now the same problem, but under Mac OS X 10.5 Things used to work few

Re: Help with Type Hint

2009-05-14 Thread Dimiter malkia Stanev
This is the best I was able to come up with in Clojure: (defn byte-array-contains? [coll key] scans a byte array for a given value (let [c (int (count coll)) k (byte key)] (loop [i (int 0)] (if ( i c) (if (= k (aget coll i)) true (recur

Re: Stack Overflow problem with Maps

2009-04-27 Thread Dimiter malkia Stanev
Unless you provide some kind of isolated source code that reproduces the problem, I don't think it is going to be easy to help you out. But try adding (doall ..) to some your map calls and others. Even better, look at this excellent explanation why this might be happening by Cristophe Grand:

Re: Bit-level operations

2009-04-24 Thread Dimiter malkia Stanev
Or maybe just: (defn mo [op args] (reduce op args)) I believe that won't make clojure make a faster code, but I might be wrong. I think the macroexpansion is the right thing if you want speed, as it seems clojure could optimize well this: (+ a b) while it can't optimize this well (+ a b c)

Swing Java example to Clojure - Question about better translation

2009-04-23 Thread Dimiter malkia Stanev
Thanks, Dimiter malkia Stanev --~--~-~--~~~---~--~~ 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+unsubscr

Re: Bit-level operations

2009-04-23 Thread Dimiter malkia Stanev
You can make your own macro to do that: (defmacro mo [op args] (reduce (fn [a# b#] (cons op [a# b#])) args)) (mo + 1 2 3 4) (print expanded= (macroexpand '(mo + 1 2 3 4)) \n) ;expanded= (+ (+ (+ 1 2) 3) 4) On Apr 23, 5:57 pm, Kevin Van Horn kvanh...@ksvanhorn.com wrote: I'm writing an

Re: Bit-level operations

2009-04-23 Thread Dimiter malkia Stanev
Here's even more concise version: (defmacro mo [op args] (reduce (fn [ ab#] (cons op ab#)) args)) On Apr 23, 9:23 pm, Dimiter \malkia\ Stanev mal...@gmail.com wrote: You can make your own macro to do that: (defmacro mo [op args]   (reduce (fn [a# b#] (cons op [a# b#])) args)) (mo + 1

Re: cannot use swig native shared libraries

2009-04-22 Thread Dimiter malkia Stanev
I might be wrong, but shouldn't you compile the .c file to .o with -fpic, and then link with ld with -shared? maybe just adding -fpic to: gcc -fpic -shared ${JNI_CFLAGS} swig_test_wrap.c -o libswig_test.so might do it. On Apr 22, 6:41 am, Antonio, Fabio Di Narzo antonio.fa...@gmail.com

Re: Recursively delete files

2009-04-22 Thread Dimiter malkia Stanev
I think this might come from Common Lisp (or Scheme, not sure). In anycase CL also has unless which is exactly the opposite of when - e.g. it would do the else part of if. http://www.lispworks.com/documentation/HyperSpec/Body/m_when_.htm Basically some of the Common Lispers are saying that

Re: StackOverflowError Question

2009-04-21 Thread Dimiter malkia Stanev
msecs ((0.5 50.5)) user (time (main 1000)) ; Evaluation aborted. ;; Actually not stack overflow, but HEAP overflow (it took a while though) user Thanks, Dimiter malkia Stanev. On Apr 20, 10:01 pm, jleehurt jleeh...@gmail.com wrote: Hi David, Those two are not recursive, but they call

Re: StackOverflowError Question

2009-04-21 Thread Dimiter malkia Stanev
inputs outputs))) --- On Apr 21, 12:58 am, jleehurt jleeh...@gmail.com wrote: Hi Dimiter, Thank you! I'm still a bit confused as to why this was happening. Does lazy evaluation not work well with recursion? On Apr 20, 11:06 pm, Dimiter \malkia\ Stanev mal...@gmail.com wrote: I

Improving clojure.jar/clojure-contrib.jar compression (ClassLoader alternatives)

2009-04-17 Thread Dimiter malkia Stanev
I'm asking here question not directly related to Clojure, but related to the JVM: Is there any alternative (ClassLoader?) to store the .class files in a different compressed format?.NET can store lots of classes in one assembly? Is there something like that for JVM? For example right now

Re: Shouldn't doto be named just with

2009-03-07 Thread Dimiter malkia Stanev
Yes, that's a very good point. For example with in Common Lisp is used also when dealing with external resources (with-open-file, etc.). And also the point about other with- usages. On Mar 7, 10:31 am, Dan redalas...@gmail.com wrote: On Fri, Mar 6, 2009 at 7:51 PM, rzeze...@gmail.com

Re: pmap slower than map when reducing

2009-03-06 Thread Dimiter malkia Stanev
Hi guys, anyone has an insight into the problem I'm running into? On Mar 4, 2:27 am, Dimiter \malkia\ Stanev mal...@gmail.com wrote: Hi guys, In the example below, if map is replaced with pmap, it goes twice slower on my MBP (2 CPUs). I believe it's probably the (reduce + ...) causing

Re: What is Clojure NOT good for?

2009-03-06 Thread Dimiter malkia Stanev
Clojure is not good for: - Real time application development, due to the JVM being soft-real time. For example it can't be used for high-performance video pc/ console games, but it could be used for lots of turn-based games. Then again anything done with XNA on the XBOX could be done with

Re: pmap slower than map when reducing

2009-03-06 Thread Dimiter malkia Stanev
to the client of your library. Are you using the latest build? pmap now uses Java futures and they run in a cached thread pool. If so, try running the algorithm a few times and see if it speeds up as the thread pool winds up. On Fri, Mar 6, 2009 at 1:31 PM, Dimiter malkia Stanev mal

Shouldn't doto be named just with

2009-03-06 Thread Dimiter malkia Stanev
I've just started using doto, after seeing the celsius example on the Clojure page, but It brought back memories from Pascal days - http://csci.csusb.edu/dick/samples/pascal.syntax.html#with_statement It's probably nothing, but to me (with x (.Function1) (.Function2)) seems more readable than

pmap slower than map when reducing

2009-03-04 Thread Dimiter malkia Stanev
npol xp yp -0.5 -2.5))) (range 0 100) Thanks, Dimiter malkia Stanev --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: challenge: best fibo implementation under the new laziness?

2009-02-24 Thread Dimiter malkia Stanev
And this is by using java -server, not java -client, right? On Feb 23, 2:46 pm, Raffael Cavallaro raffaelcavall...@gmail.com wrote: On Feb 23, 2:51 pm, Stephen C. Gilardi squee...@mac.com wrote: The fibs implementation in clojure.contrib.lazy-seqs is not a function   that returns fib(n)

slime (swank-clojure) no longer working

2009-02-18 Thread Dimiter malkia Stanev
Hi guys, I've just updated to the latest (1289) version of clojure, and swank- clojure (slime) doesn't work anymore Here is what I'm getting from emacs: (add-classpath file:Users/malkia/p/swank-clojure/) (require 'swank.swank) (swank.swank/ignore-protocol-version 2009-02-14)

loop [#^Integer c 0] vs. loop [c (int 0)] and optimization question...

2009-02-13 Thread Dimiter malkia Stanev
with it. For example the same example in Python, Ruby or Perl runs at least for 200s (same with CLISP, haven't tried ECL or GCL). Thanks, Dimiter malkia Stanev. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: loop [#^Integer c 0] vs. loop [c (int 0)] and optimization question...

2009-02-13 Thread Dimiter malkia Stanev
On Feb 13, 5:35 am, Vincent Foley vfo...@gmail.com wrote: Dimiter, The latest revision of Clojure is r1278; are you using the Google code trunk? Vincent Thanks, Vincent! I kept wondering why I don't see any more versions, I was till on the sourceforge one.