Re: Performance tips for Clojure

2009-03-12 Thread Chouser
On Fri, Mar 13, 2009 at 2:18 AM, Sergio wrote: > > There are a couple of obvious ones, but also some others that I > haven't seen documented (like, map is much faster on lists than on > vectors since rest is O(1) for lists). You're right that 'rest' is O(1) for lists, but it's O(1) for vectors a

Re: r994 UTF8 addition broke latin-1 characters (ISO-8859-1) - WAS: Re: Unicode, accented characters

2009-03-12 Thread max3000
Any news on this item? Does what I'm saying make sense? I understand most people who use clojure are probably English-speaking and couldn't care less about internationalization, but this has to be addressed if clojure is to get any semblance of semi-mainstream adoption. In fact, one of the reason

Performance tips for Clojure

2009-03-12 Thread Sergio
Hi! I have been programming in clojure for a few months now. I really like the language. Something that I have noted is that it is very easy to write slow Clojure code. After doing some programming and spending time optimizing things, I decided to write on my blog some points on how to write effic

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.

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 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 -> functions. (->

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 wrote: > Mark Engelberg 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 unti

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 wrote: > On Sat, Feb 7, 2009 at 8:16 AM, David Powell wrote: > > > Newer versions of

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 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: 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 mor

Re: Bug in set?

2009-03-12 Thread Kyle Schaffrick
On Thu, 12 Mar 2009 15:50:16 -0700 Jason Wolfe wrote: > > On Mar 12, 2009, at 3:34 PM, Kyle Schaffrick wrote: > > > > > On Thu, 12 Mar 2009 12:45:00 -0700 (PDT) > > Jason Wolfe wrote: > >>> Also, union/difference/intersection/symmetric-diff are binary. > >>> Would there be any interest in a pa

Re: VimClojure 2

2009-03-12 Thread Kyle Schaffrick
On Thu, 12 Mar 2009 13:30:51 -0700 (PDT) Mark Volkmann wrote: > > On Mar 12, 3:21 pm, Mark Volkmann 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

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 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 a

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 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 > found in

Re: Bug in set?

2009-03-12 Thread Kyle Schaffrick
On Thu, 12 Mar 2009 12:45:00 -0700 (PDT) Jason Wolfe 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 you on the la

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 di

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 wrote: > > > On Mar 12, 11:15 pm, Howard Lewis Ship wrote: >> I have to wonder a bit about

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: 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 CONTRIB_JAR=c:\java\clojure-con

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 i

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

2009-03-12 Thread Tassilo Horn
Mark Engelberg 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 suggestion and the tes

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 : * Concern

Re: VimClojure 2

2009-03-12 Thread Attila Babo
On Thu, Mar 12, 2009 at 9:30 PM, Mark Volkmann 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 subscribed to the Google G

Re: Bytecode optimization

2009-03-12 Thread Jarkko Oranen
On Mar 12, 11:15 pm, Howard Lewis Ship 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 would be optimi

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 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: "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 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 octal,

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 incons

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 wrote: > > 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 t

"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: 0

Re: VimClojure 2

2009-03-12 Thread Mark Volkmann
On Thu, Mar 12, 2009 at 3:37 PM, Meikel Brandmeyer wrote: > Hi, > > Am 12.03.2009 um 21:30 schrieb Mark Volkmann: > >> On Mar 12, 3:21 pm, Mark Volkmann 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 susp

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 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 direc

Re: VimClojure 2

2009-03-12 Thread Mark Volkmann
On Mar 12, 3:21 pm, Mark Volkmann 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 need to copy? Here is th

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: 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 I

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 wrote: > > 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 [*print-suppress-namespaces* true] >(wit

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 Tom Faulhaber
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 [*print-suppress-namespaces* true] (with-pprint-dispatch *code-dispatch* (write (expander (read-from-string strin

Re: Bytecode optimization

2009-03-12 Thread Mark Addleman
On Mar 12, 10:56 am, Stuart Sierra wrote: > On Mar 12, 4:46 am, Joshua Fox 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 Ri

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 t

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 wrote: > Sounds good to me - any drawbacks to this? Does it require that the > col

Re: Accuracy of *file*

2009-03-12 Thread Paul Stadig
On Thu, Mar 12, 2009 at 12:50 PM, Phil Hagelberg wrote: > > Paul Stadig 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 I wanted to get access

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 astr

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 t

Re: version of -> short-circuiting on nil

2009-03-12 Thread Stuart Sierra
On Mar 9, 8:12 pm, Laurent PETIT 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 to successive instanc

Re: Bytecode optimization

2009-03-12 Thread Stuart Sierra
On Mar 12, 4:46 am, Joshua Fox 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 generate bytecode t

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 in

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 (cou

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 gradu

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

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 t

Re: ANN: A pretty printer for Clojure

2009-03-12 Thread Mark Volkmann
On Thu, Mar 12, 2009 at 2: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 giv

Re: Accuracy of *file*

2009-03-12 Thread Phil Hagelberg
Paul Stadig 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 I wanted to get access to > things relative to the current file. > > (defmacro __FILE__

Re: What profilers are you using?

2009-03-12 Thread Scott Jaderholm
On Sat, Feb 7, 2009 at 8:16 AM, David Powell 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 starting Clojure fr

Re: Bug in set?

2009-03-12 Thread Raffael Cavallaro
On Mar 12, 11:28 am, Kyle Schaffrick 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 ordinary en

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 use

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 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 worse, most

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 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 worse, most

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: Bug in set?

2009-03-12 Thread Kyle Schaffrick
On Wed, 11 Mar 2009 21:51:51 -0700 (PDT) Raffael Cavallaro wrote: > On Mar 11, 11:43 pm, "Stephen C. Gilardi" 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 misunderstanding how dif

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 direc

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 macros

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

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: 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 b

Re: What is Clojure NOT good for?

2009-03-12 Thread Colin Walters
On Mar 11, 11:11 pm, e wrote: > On Wed, Mar 11, 2009 at 6:28 PM, Stuart Sierra > wrote: > > > > > 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++ interop with Java is not fun.  You'll pr

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 th

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

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=auto&tl=en&u=http%3A%2F%2Fblog.remvee.net%2F2009%2F01%2F18%2FsetText_tv_Hello_Android_from_Clojure

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 defi

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 wrote: > > I have now "released" the first version of my pretty printer as part > of my cl-format library. It is released unde

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

2009-03-12 Thread Michael Wood
Hi Albert On Thu, Mar 12, 2009 at 2:01 PM, Albert Cardona wrote: > > 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 industri

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: 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 i

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# (C

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 wo

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 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) > > Test-clojure run

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_ wrote: > Mod seems to have broken again > > (mod 9 -3)  gives -3 > > (map #(mod % 3) (range -10 10)) >

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 o

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 re

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 interes

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 wrote: > > > > The new mod isn't working properly though: > > > >Testing clojur

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

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 stri

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 y

Bytecode optimization

2009-03-12 Thread Joshua Fox
I was just reading this and wondering: Does Clojure's pure-functional design enhance VM-level bytecode optimization by simplifying escape analysis? Joshua --~--~-~--~~~---~--~~ You received th

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. > > Compu

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 cam

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 t

Re: Static type guy trying to convert

2009-03-12 Thread ntu...@googlemail.com
On Mar 12, 3:22 am, Mark Engelberg 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 identified upon an initi

Re: Debugging support for clojure?

2009-03-12 Thread Tassilo Horn
Jerry K 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 right. And afte

Re: Debugging support for clojure?

2009-03-12 Thread Tassilo Horn
Mark Engelberg writes: Hi Mark, > On Wed, Mar 11, 2009 at 12:21 AM, Tassilo Horn wrote: > >> Investigated it a bit more (doing the algorithm step by step in the >> repl) and now I know what's the culprit:  The `expt' function from >> the math contrib library is dead slow. > > Dead slow? Compa

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 unsubs

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 o