Re: Static type guy trying to convert

2009-03-12 Thread Korny Sietsma
On Thu, Mar 12, 2009 at 11:26 AM, Jon Harrop j...@ffconsultancy.com wrote: IME, the trouble can be well worth it. I once wasted two weeks trying to track down bugs in a thousand lines of code using unit tests and never managed it. When I finally caved in and tried to leverage the static type

Speed issues vs. Python

2009-03-12 Thread tristan
Hi guys, I'm loving Clojure, but i'm having a lot of trouble writing programs in it that run as fast as my python equivalents. One example is code i've written for projecteuler.net problem 87 (for those who don't want to see any solutions don't click the links below :)) my python version

ANN: A pretty printer for Clojure

2009-03-12 Thread Tom Faulhaber
I have now released the first version of my pretty printer as part of my cl-format library. It is released under the EPL. The pretty printer has two functions that you probably care about: (pprint obj) will pretty print the given object, and (pp) at the REPL will pretty print the last result

Java equivalent to Python's Imaging Library (PIL)

2009-03-12 Thread Mark Engelberg
Can anyone point me to a PIL-like library that will work from Clojure? Thanks. --~--~-~--~~~---~--~~ 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

Re: Debugging support for clojure?

2009-03-12 Thread Tassilo Horn
Jerry K jerryk...@gmail.com writes: Hi Jerry, Also, I've not looked at any of the math code in clojure contrib, but expressed as such, I wouldn't expect the idiom (mod (expt n exp) m) to be at all fast for reasons largely independent of the numeric implementation underneath. Yes, you're

Re: Static type guy trying to convert

2009-03-12 Thread ntu...@googlemail.com
On Mar 12, 3:22 am, Mark Engelberg mark.engelb...@gmail.com wrote: I know of someone who tracked all his bugs in a year of coding in both Scheme (dynamic) and ML (static).  He said that there was no real difference.  The kind of bugs that are caught by static type systems are also quickly

Re: Clojure plugin for IntelliJ IDEA published

2009-03-12 Thread AlamedaMike
So, we're going to implement it in near-term future. Thanks Ilya! I (and I'm sure others) will look forward to it. It seems to be a good tactics to compile all files with namespaces labeled by :gen-class to the same output path as vanilla java classes before compiling Java part (to allow the

Re: Java equivalent to Python's Imaging Library (PIL)

2009-03-12 Thread Korny Sietsma
I'm interested too - got some ruby stuff using rmagick I'd like to rewrite - there's jmagick but it sounds like a pain to get it working on osx, and there's a library that wraps imagemagick command-line, but something native that supports: - 48 bits-per-pixel images - colour profiles - digital

Re: Debugging support for clojure?

2009-03-12 Thread Jason Wolfe
On Mar 11, 2009, at 11:04 AM, Jerry K wrote: Also, I've not looked at any of the math code in clojure contrib, but expressed as such, I wouldn't expect the idiom (mod (expt n exp) m) to be at all fast for reasons largely independent of the numeric implementation underneath. Computing the

Bytecode optimization

2009-03-12 Thread Joshua Fox
I was just reading thishttp://developer.amd.com/documentation/Articles/pages/01302008_jvm.aspx and wondering: Does Clojure's pure-functional design enhance VM-level bytecode optimization by simplifying escape analysis? Joshua --~--~-~--~~~---~--~~ You received

Re: On the importance of recognizing and using maps

2009-03-12 Thread Konrad Hinsen
On 11.03.2009, at 23:34, Chouser wrote: Interacting directly with a class dict feels a little dirty, because you could be circumventing the API provided by the class methods, making it easy to get the object into a bad state. Clojure's maps being immutable reduces the amount of trouble you

Re: Speed issues vs. Python

2009-03-12 Thread bOR_
Setting that one (set! *warn-on-reflection* true) Helped a lot in my simulation model to find out where clojure/java were having trouble. It pointed out that one of my main functions was causing trouble, and could do with a bit of typehinting. (defn #^Short find-all-epi turns the rx and

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread Rich Hickey
On Mar 12, 2009, at 3:05 AM, Tom Faulhaber wrote: I have now released the first version of my pretty printer as part of my cl-format library. It is released under the EPL. The pretty printer has two functions that you probably care about: (pprint obj) will pretty print the given object,

Re: New mod code is broken

2009-03-12 Thread bOR_
Mod seems to have broken again (mod 9 -3) gives -3 (map #(mod % 3) (range -10 10)) (2 3 1 2 3 1 2 3 1 2 0 1 2 0 1 2 0 1 2 0) svn 1372. Chouser wrote: On Sat, Feb 14, 2009 at 12:45 AM, Stephen C. Gilardi squee...@mac.com wrote: The new mod isn't working properly though:

Re: Debugging support for clojure?

2009-03-12 Thread Konrad Hinsen
On Mar 11, 2009, at 19:04, Jerry K wrote: I had thought a while back about digging into building some math code for clojure contrib for applications like algebra and number theory, since Clojure's Lispyness makes it well suited for that, but wasn't sure anybody else was especially

Re: On the importance of recognizing and using maps

2009-03-12 Thread Jeff Rose
Konrad Hinsen wrote: On 11.03.2009, at 23:34, Chouser wrote: Interacting directly with a class dict feels a little dirty, because you could be circumventing the API provided by the class methods, making it easy to get the object into a bad state. Clojure's maps being immutable reduces the

Re: On the importance of recognizing and using maps

2009-03-12 Thread Konrad Hinsen
On Mar 12, 2009, at 10:59, Jeff Rose wrote: My main conclusion is that Clojure's system is a lot more flexible but also a lot more fragile. Any function can modify data of any type (as defined by metadata), even without being aware of this. Modifying type tags without being aware of it?

Re: New mod code is broken

2009-03-12 Thread Frantisek Sodomka
Latest SVN r1327 works ok: user= (mod 9 -3) 0 user= (map #(mod % 3) (range -10 10)) (2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0) Test-clojure runs ok too. Frantisek On Mar 12, 10:30 am, bOR_ boris.sch...@gmail.com wrote: Mod seems to have broken again (mod 9 -3)  gives -3 (map #(mod % 3)

Re: New mod code is broken

2009-03-12 Thread bOR_
Hmm. might be mixing two versions of clojure on my system than. Thanks for correcting me! On Mar 12, 11:47 am, Frantisek Sodomka fsodo...@gmail.com wrote: Latest SVN r1327 works ok: user= (mod 9 -3) 0 user= (map #(mod % 3) (range -10 10)) (2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0)

Re: Accuracy of *file*

2009-03-12 Thread Paul Stadig
I wrote these a while ago, and I'm not sure if they're still useful or not, but I'll just send them along without any guarantee. I have used them like (__FILE__) and (__DIR__) when I wanted to get access to things relative to the current file. (defmacro __FILE__ [] `(if *file* (let [f#

Re: Static type guy trying to convert

2009-03-12 Thread Jon Harrop
On Thursday 12 March 2009 06:38:48 Korny Sietsma wrote: But maybe you use unit tests some other way? How do you use unit tests to track down bugs? I mean: I had unit tests for each function but they were not identifying the bug so I kept augmenting them with more tests in the hope that I

Re: Java equivalent to Python's Imaging Library (PIL)

2009-03-12 Thread Albert Cardona
Mark Engelberg wrote: Can anyone point me to a PIL-like library that will work from Clojure? Hi Mark, We use clojure to handle the java-only ImageJ application and library. It's not what you'd call an industrial-strength library, but rather a dedicated practical application for scientific

Re: What is Clojure NOT good for?

2009-03-12 Thread Jason Warner
This is almost exactly my experience in PHX at our user groups. Unfortunately I am also trying to hire people and I find the people here have no interest in learning something new because they already know java (at least the ones I've seen on interviews). On Mar 11, 11:22 am, Howard Lewis Ship

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread Jeffrey Straszheim
Awesome! I expect I'll be trying it out tonight. Oh, and I hope this goes into contrib -- it'll keep my classpath shorter. On Thu, Mar 12, 2009 at 2:05 AM, Tom Faulhaber tomfaulha...@gmail.comwrote: I have now released the first version of my pretty printer as part of my cl-format library.

New version of clojure.contrib.types

2009-03-12 Thread Konrad Hinsen
After a lot of experimentation with types and interfaces, I have somewhat redesigned clojure.contrib.types. The new version contains some breaking changes, but the changes are minor. There are now two different ways to define types, one of them being algebraic data types, which are now

Re: android app development with clojure

2009-03-12 Thread rob
Ok, duh, somehow didn't catch that this link was the code I was wondering about: http://github.com/remvee/clojure/tree/master/ Also, this is interesting: http://translate.google.com/translate?sl=autotl=enu=http%3A%2F%2Fblog.remvee.net%2F2009%2F01%2F18%2FsetText_tv_Hello_Android_from_Clojure

Re: Java equivalent to Python's Imaging Library (PIL)

2009-03-12 Thread Albert Cardona
Hi Michael, This looks really interesting. One thing I noticed, though, is that the page links to clojure.sourceforge.net as the Clojure web site. Although that does redirect to the correct place (clojure.org) it could give people the false impression that Clojure is still hosted on

New clojure.contrib.stream-utils

2009-03-12 Thread Konrad Hinsen
I just checked in an almost complete reimplementation of clojure.contrib.stream-utils. It is now centered around an interface for data streams that consists of the single multimethod stream-next. It takes a stream state as its argument and returns the next value of the stream as well as

Re: What is Clojure NOT good for?

2009-03-12 Thread Colin Walters
On Mar 11, 11:11 pm, e evier...@gmail.com wrote: On Wed, Mar 11, 2009 at 6:28 PM, Stuart Sierra the.stuart.sie...@gmail.comwrote: Ok, here's a real one: if you need to use a lot of C/C++ libraries, for which there are no Java replacements, Clojure won't be much fun, because C/C++

Re: Speed issues vs. Python

2009-03-12 Thread Sergio
You should profile your code. A cousin of mine was solving a problem from programmingchallenges.com in C++. I wrote a solution in Clojure. At the beginning, my version was astronomically slower. After profiling, I reduced it to about 2x slower. After modifying it to use Java arrays, it actually

Re: Clojure plugin for IntelliJ IDEA published

2009-03-12 Thread CuppoJava
Hi Ilya, I'm just wondering if it's possible for you to release a quick version update with the latest changes incorporated. I'm interested in the fixes to the namespace-qualified keywords, and the keyword indentation rules specifically. Thanks a lot -Patrick

Re: On the importance of recognizing and using maps

2009-03-12 Thread Jeff Rose
Konrad Hinsen wrote: On Mar 12, 2009, at 10:59, Jeff Rose wrote: My main conclusion is that Clojure's system is a lot more flexible but also a lot more fragile. Any function can modify data of any type (as defined by metadata), even without being aware of this. Modifying type tags without

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread David Nolen
Amazing stuff. In particular this finally makes debugging macros sane. For those of you that are using swank-clojure you only need to make minor modifications to swank-clojure to pretty-print your macro expansions to the macro expansion buffer. Even better you can move the cursor to subform

Re: Clojure plugin for IntelliJ IDEA published

2009-03-12 Thread Ilya Sergey
Hi Patrick. I'd recommend to you to build plugin by yourself. It's very, very simple. Just check-out it from following svn root: http://svn.jetbrains.org/idea/Trunk/clojure-plugin After that change clojure.properties file to make two variables point to your $JAVA_HOME and IDEA installation

Re: Bug in set?

2009-03-12 Thread Kyle Schaffrick
On Wed, 11 Mar 2009 21:51:51 -0700 (PDT) Raffael Cavallaro raffaelcavall...@gmail.com wrote: On Mar 11, 11:43 pm, Stephen C. Gilardi squee...@mac.com wrote: Here are the expressions and results in a simplified notation: #{a b c} - #{a b} = #{c} #{a b} - #{a b c} = #{} ok, so I was

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread Konrad Hinsen
On Mar 12, 2009, at 8:05, Tom Faulhaber wrote: I have now released the first version of my pretty printer as part of my cl-format library. It is released under the EPL. From what I have seen in my first tests, this is likely to become an essential part of my Clojure environment. Thanks!

Re: Java equivalent to Python's Imaging Library (PIL)

2009-03-12 Thread Michael Wood
Hi Albert On Thu, Mar 12, 2009 at 4:06 PM, Albert Cardona sapri...@gmail.com wrote: Hi Michael, [...] Because ImageJ's ij.jar became a library long after being just an application. There is no concept of MVC, and thus GUI classes are mixed with processing and controller constructs. What's

Re: Java equivalent to Python's Imaging Library (PIL)

2009-03-12 Thread Michael Wood
Hi Albert On Thu, Mar 12, 2009 at 4:06 PM, Albert Cardona sapri...@gmail.com wrote: Hi Michael, [...] Because ImageJ's ij.jar became a library long after being just an application. There is no concept of MVC, and thus GUI classes are mixed with processing and controller constructs. What's

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread Tom Faulhaber
Rich, I would be happy to make it a contribution (it's the least I can do!). I've had a CA sitting on my desk unread and unsigned for about 3 weeks. It is now read, signed, and in an envelope. I'll send it off this morning. Everyone, Thanks for the kind words. I'm glad you like it. David's

Re: Bug in set?

2009-03-12 Thread Raffael Cavallaro
On Mar 12, 11:28 am, Kyle Schaffrick k...@raidi.us wrote: clojure.set/difference implements the relative complement operation. I don't see a symmetric difference operation in clojure.set, but it might be useful: exactly; I was naively thinking of symmetric difference since this is the

Re: What profilers are you using?

2009-03-12 Thread Scott Jaderholm
On Sat, Feb 7, 2009 at 8:16 AM, David Powell djpow...@djpowell.net wrote: Newer versions of JDK 1.6, eg Update 11, have an application called 'jvisualvm' in the bin directory. It lets you attach to any running Java process and it has a profiler that you can switch on at runtime. If you're

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread Tom Faulhaber
Expanding on David's earlier example of pretty printing, we can set the dispatch to *code-dispatch* and bind *print-suppress-namespaces* to true and get the following (apologies for google messing up my formatting): (do (defmacro dft2 [tree] (seq (concat (list '=dft2) (list '*cont*) (list

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread Tom Faulhaber
Are you planning to include scripts at some point that support pretty printing a source file? For example, I'd like to do this from a terminal window: $ cljpp foo.clj foo2.clj Mark, Yeah, I've thought about that and the simple version is very straight- forward and I'm planning to do that

Re: Static type guy trying to convert

2009-03-12 Thread Raoul Duke
The Erlang world has a tool called Dialyzer w00t. i've always very much liked that approach, and wish it were available for other dynamic languages (maybe qi-lang is somewhat similar). it seems to offer everybody whatever options they want, so we can all get along. sorta in the vein of gradual

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread David Nolen
So that people can copy and paste the change in basic.clj (defn- apply-macro-expander [expander string] (binding [*print-suppress-namespaces* true] (let [astr (with-out-str (with-pprint-dispatch *code-dispatch* (pprint (expander (read-from-string string)] (subs astr 0 (dec

Generic maths (was: Debugging support for clojure?)

2009-03-12 Thread Konrad Hinsen
On Mar 12, 2009, at 10:54, Konrad Hinsen wrote: Building a math environment is one of my long-term goals in working with Clojure, and my recent experiments with types and interfaces are partly motivated by this. What I have in mind is an infrastructure consisting of a few well-designed

Re: Bytecode optimization

2009-03-12 Thread Stuart Sierra
On Mar 12, 4:46 am, Joshua Fox joshuat...@gmail.com wrote: wondering: Does Clojure's pure-functional design enhance VM-level bytecode optimization by simplifying escape analysis? Functional design doesn't necessarily make bytecode easy to optimize. But Rich Hickey works hard on making Clojure

Re: version of - short-circuiting on nil

2009-03-12 Thread Stuart Sierra
On Mar 9, 8:12 pm, Laurent PETIT laurent.pe...@gmail.com wrote: When interacting with java code, and maybe in other pure clojure situations as well (but I have not encountered the case myself), I was faced with writing boiler plate code to check whether the return values of a chain of calls

Performance conundrum - my primes function should really be faster.

2009-03-12 Thread levand
So, I'm doing the whole Euler thing, and I'm writing a function for finding primes using wheel factorization in combination with the Sieve of Eratosthenes. The algorithm is correct, but very slow. I've managed to isolate the part that's having unexpectedly bad performance. I just can't see why

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread David Nolen
I suppose the following is more idiomatic: (defn- apply-macro-expander [expander string] (let [astr (with-out-str (binding [*print-suppress-namespaces* true] (with-pprint-dispatch *code-dispatch* (pprint (expander (read-from-string string))] (subs astr 0 (dec (count

Re: Accuracy of *file*

2009-03-12 Thread Paul Stadig
On Thu, Mar 12, 2009 at 12:50 PM, Phil Hagelberg p...@hagelb.org wrote: Paul Stadig p...@stadig.name writes: I wrote these a while ago, and I'm not sure if they're still useful or not, but I'll just send them along without any guarantee. I have used them like (__FILE__) and (__DIR__) when

Re: suggestion for resultset-seq and duplicate column names

2009-03-12 Thread Ron Lusk
Works for me: I just overwrote my copy of resultset-seq with one that uses getColumnLabel, and I am now getting the results I expected from complex queries (in Interbase, at least). On Feb 23, 9:33 am, Rich Hickey richhic...@gmail.com wrote: Sounds good to me - any drawbacks to this? Does it

Re: Clojure plugin for IntelliJ IDEA published

2009-03-12 Thread CuppoJava
Ah thank you for those instructions. That's very helpful. -Patrick --~--~-~--~~~---~--~~ 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

Re: Bytecode optimization

2009-03-12 Thread Mark Addleman
On Mar 12, 10:56 am, Stuart Sierra the.stuart.sie...@gmail.com wrote: On Mar 12, 4:46 am, Joshua Fox joshuat...@gmail.com wrote: wondering: Does Clojure's pure-functional design enhance VM-level bytecode optimization by simplifying escape analysis? Functional design doesn't necessarily

Re: Bug in set?

2009-03-12 Thread Jason Wolfe
Also, union/difference/intersection/symmetric-diff are binary. Would there be any interest in a patch to make them n-ary? Union, difference, and intersection are all variadic as of a month or so ago. Are you on the latest SVN? -Jason --~--~-~--~~~---~--~~

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread David Nolen
Works great. On Thu, Mar 12, 2009 at 3:30 PM, Tom Faulhaber tomfaulha...@gmail.comwrote: Write can produce pretty output directly to a string and without the trailing newline, making this a little shorter: (defn- apply-macro-expander [expander string] (binding

Re: Performance conundrum - my primes function should really be faster.

2009-03-12 Thread Luke VanderHart
Ok, sorry for posting this. I figured it out myself. Turns out that my eratosthenes function took much, much longer on primes and near-primes than it does on the average number. And, of course, the numbers that pass through the wheel factorization filter are just that. So the good news is that

VimClojure 2

2009-03-12 Thread Mark Volkmann
The README.txt file doesn't describe the files that need to be copied to ~/.vim. I'm getting errors starting Vim now. I suspect it's because I haven't copied all the necessary files to my ~/.vim directory. Which files do I need to copy? -- R. Mark Volkmann Object Computing, Inc.

Re: VimClojure 2

2009-03-12 Thread Mark Volkmann
On Mar 12, 3:21 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: The README.txt file doesn't describe the files that need to be copied to ~/.vim. I'm getting errors starting Vim now. I suspect it's because I haven't copied all the necessary files to my ~/.vim directory. Which files do I

Re: VimClojure 2

2009-03-12 Thread Meikel Brandmeyer
Hi, Am 12.03.2009 um 21:30 schrieb Mark Volkmann: On Mar 12, 3:21 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: The README.txt file doesn't describe the files that need to be copied to ~/.vim. I'm getting errors starting Vim now. I suspect it's because I haven't copied all the

Re: VimClojure 2

2009-03-12 Thread Mark Volkmann
On Thu, Mar 12, 2009 at 3:37 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 12.03.2009 um 21:30 schrieb Mark Volkmann: On Mar 12, 3:21 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: The README.txt file doesn't describe the files that need to be copied to ~/.vim. I'm getting errors

08 and 09 are invalid numbers, but 01 through 07 are fine?

2009-03-12 Thread levand
Seems like there's a bug here. All the digits less than 8 work. If leading zeros aren't allowed, at least the behavior ought to be consistent. (def n 01) #'user/n ... (def n 07) #'user/n BUT (def n 08) clojure.lang.LispReader$ReaderException: java.lang.NumberFormatException: Invalid number:

Re: 08 and 09 are invalid numbers, but 01 through 07 are fine?

2009-03-12 Thread Jeffrey Straszheim
In Java, numbers prefixed with a 0 are treated as octal. It should not surprise us, then, that 08 and 09 blow up. On Thu, Mar 12, 2009 at 4:08 PM, levand luke.vanderh...@gmail.com wrote: Seems like there's a bug here. All the digits less than 8 work. If leading zeros aren't allowed, at least

Re: 08 and 09 are invalid numbers, but 01 through 07 are fine?

2009-03-12 Thread Meikel Brandmeyer
Hi, Am 12.03.2009 um 22:08 schrieb levand: Seems like there's a bug here. All the digits less than 8 work. If leading zeros aren't allowed, at least the behavior ought to be consistent. Leading zeros indicate octal, which has no digits like 8 or 9... In so far it's not a bug nor is it

Re: 08 and 09 are invalid numbers, but 01 through 07 are fine?

2009-03-12 Thread Shawn Hoover
On Thu, Mar 12, 2009 at 5:13 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 12.03.2009 um 22:08 schrieb levand: Seems like there's a bug here. All the digits less than 8 work. If leading zeros aren't allowed, at least the behavior ought to be consistent. Leading zeros indicate

Re: Bytecode optimization

2009-03-12 Thread Howard Lewis Ship
I have to wonder a bit about the ability to optimize. Everything boils down to one of the seven or so basic forms. That's a lot of function calls to do even small things, like adding numbers. You might think that simple math would be optimized and inlined, but it isn't: Clojure user= (doc +)

Re: design patterns for event driven applications

2009-03-12 Thread Anatoly Yakovenko
basically i am dealing with a 3rd party library, (interactive brokers tws api), that takes an interface with lots of different methods that it calls when an event occurs. like received market data, received order, etc... It provides another interface that basically generates these events. Some

Re: Bytecode optimization

2009-03-12 Thread Jarkko Oranen
On Mar 12, 11:15 pm, Howard Lewis Ship hls...@gmail.com wrote: I have to wonder a bit about the ability to optimize.  Everything boils down to one of the seven or so basic forms.  That's a lot of function calls to do even small things, like adding numbers. You might think that simple math

Re: VimClojure 2

2009-03-12 Thread Attila Babo
On Thu, Mar 12, 2009 at 9:30 PM, Mark Volkmann r.mark.volkm...@gmail.com wrote: cp -r {autoload,bin,doc,ftdetect,ftplugin,indent,syntax} ~/.vim You don't need the content of bin folder under ~/.vim --~--~-~--~~~---~--~~ You received this message because you are

Re: version of - short-circuiting on nil

2009-03-12 Thread Laurent PETIT
Oh, I should have search through the ml first ... I see that we came to almost exactly the same code ;-) So it seems that finally, there are more than persons named Stuart that would like to see this function somewhere in clojure or clojure-contrib. I have the following questions : *

Miller-Rabin pseudo-primality test (was: Debugging support for clojure?)

2009-03-12 Thread Tassilo Horn
Mark Engelberg mark.engelb...@gmail.com writes: Hi Mark, For number theory you often need things like    (mod (expt n exp) m) Yes, and to make things like this fast, the trick is to perform the mod at each multiplication step, rather than waiting until the end. So now I added this

Re: version of - short-circuiting on nil

2009-03-12 Thread Stephen C. Gilardi
On Mar 12, 2009, at 5:45 PM, Laurent PETIT wrote: * Concerning the name to give to this function : maybe -? instead of ?-, if you think we can live with this violation to the predicate convention ? I like these: .?. -? They fit with the criteria that Rich laid down in

Re: VimClojure 2

2009-03-12 Thread Mark Feeney
I've had this one. For me it was failure to have vimclojure.jar in the classpath of the nailgun server. Here's how I start the server on Windows: @echo off set VIMCLOJURE_JAR=c:\vim\vimfiles\vimclojure.jar set CLOJURE_JAR=c:\java\clojure-read-only\clojure.jar set

Re: VimClojure 2.0.0 released (merged with Gorilla)

2009-03-12 Thread Meikel Brandmeyer
Dear vimming Clojurians, unfortunately there was a typo in the documentation. It should read: let clj_want_gorilla = 1 Without a 's'. I'm sorry for the inconvenience. Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature

Re: Bytecode optimization

2009-03-12 Thread Howard Lewis Ship
Well, at some point I'll open up the code and check. Though I'll be overly tempted to write some comments, fix the indentation and write some tests if I do! On Thu, Mar 12, 2009 at 2:36 PM, Jarkko Oranen chous...@gmail.com wrote: On Mar 12, 11:15 pm, Howard Lewis Ship hls...@gmail.com wrote:

Re: VimClojure 2.0.0 released (merged with Gorilla)

2009-03-12 Thread Meikel Brandmeyer
Hi, Am 11.03.2009 um 01:20 schrieb Jeff Rose: Awesome! This is really sweet. I've got it up and running, and this is really getting good now. I've got a couple quick questions: * Is there a smart way to install it? I've been copying each .vim file into its place inside my $HOME/.vim

Re: Bug in set?

2009-03-12 Thread Kyle Schaffrick
On Thu, 12 Mar 2009 12:45:00 -0700 (PDT) Jason Wolfe jawo...@berkeley.edu wrote: Also, union/difference/intersection/symmetric-diff are binary. Would there be any interest in a patch to make them n-ary? Union, difference, and intersection are all variadic as of a month or so ago. Are

Re: VimClojure 2.0.0 released (merged with Gorilla)

2009-03-12 Thread Kyle Schaffrick
On Wed, 11 Mar 2009 00:36:39 +0100 Meikel Brandmeyer m...@kotka.de wrote: Dear vimming Clojurians, I'm proud to announce VimClojure 2.0! Working fantastic here, thanks for this. I just cannot get comfortable in Emacs. I really did try :) More information on the installation can be

Re: Bug in set?

2009-03-12 Thread Jason Wolfe
On Mar 12, 2009, at 3:34 PM, Kyle Schaffrick wrote: On Thu, 12 Mar 2009 12:45:00 -0700 (PDT) Jason Wolfe jawo...@berkeley.edu wrote: Also, union/difference/intersection/symmetric-diff are binary. Would there be any interest in a patch to make them n-ary? Union, difference, and

Re: VimClojure 2

2009-03-12 Thread Kyle Schaffrick
On Thu, 12 Mar 2009 13:30:51 -0700 (PDT) Mark Volkmann r.mark.volkm...@gmail.com wrote: On Mar 12, 3:21 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: The README.txt file doesn't describe the files that need to be copied to ~/.vim. I'm getting errors starting Vim now. I suspect it's

Re: Bug in set?

2009-03-12 Thread Kyle Schaffrick
On Thu, 12 Mar 2009 15:50:16 -0700 Jason Wolfe jawo...@berkeley.edu wrote: On Mar 12, 2009, at 3:34 PM, Kyle Schaffrick wrote: On Thu, 12 Mar 2009 12:45:00 -0700 (PDT) Jason Wolfe jawo...@berkeley.edu wrote: Also, union/difference/intersection/symmetric-diff are binary. Would there

Re: Bug in set?

2009-03-12 Thread Jason Wolfe
union does an implicit distinct operation, as it returns a set. I didn't think Clojure had multisets, unless we've had another Rich's Time Machine moment :) Nope, it doesn't have multisets ... I somehow read that as apply concat rather than apply union ... maybe I need some more sleep

Re: version of - short-circuiting on nil

2009-03-12 Thread Mark Volkmann
On Thu, Mar 12, 2009 at 5:04 PM, Stephen C. Gilardi squee...@mac.com wrote: On Mar 12, 2009, at 5:45 PM, Laurent PETIT wrote: * Concerning the name to give to this function : maybe -? instead of ?-, if you think we can live with this violation to the predicate convention ? I like these:  

Re: What profilers are you using?

2009-03-12 Thread Sergio
I don't have trouble connecting from Emacs. I just added (setq swank-clojure-extra-vm-args (list - Dcom.sun.management.jmxremote=true ) to my clojure swank configuration. On Mar 12, 10:47 am, Scott Jaderholm jaderh...@gmail.com wrote: On Sat, Feb 7, 2009 at 8:16 AM, David Powell

Re: Miller-Rabin pseudo-primality test (was: Debugging support for clojure?)

2009-03-12 Thread Jerry K
On Mar 12, 2:45 pm, Tassilo Horn tass...@member.fsf.org wrote: Mark Engelberg mark.engelb...@gmail.com writes: Hi Mark, For number theory you often need things like    (mod (expt n exp) m) Yes, and to make things like this fast, the trick is to perform the mod at each multiplication

Re: version of - short-circuiting on nil

2009-03-12 Thread Stephen C. Gilardi
On Mar 12, 2009, at 9:45 PM, Mark Volkmann wrote: On Thu, Mar 12, 2009 at 5:04 PM, Stephen C. Gilardi squee...@mac.com wrote: I like these: .?. -? Given a choice between the two, I'd choose -? The proposal was for naming nil-safe versions of the existing .. and -

Re: VimClojure 2.0.0 released (merged with Gorilla)

2009-03-12 Thread rzeze...@gmail.com
Meikel, found a few more things that might need fixing. 1) In the preview window it says Use \p to close this buffer!, but I have m LocalLeader mapped to ,. I'm guessing maybe you hardcoded this by accident? 2) When doing a macroexpand (me or m1), the cursor is moved into the REPL buffer. Is