ANN: Clojure Cookbook

2010-09-26 Thread David Sletten
Ladies and Gentlemen, I present for your viewing pleasure the Clojure Cookbook (beta :) ): http://www.gettingclojure.com/cookbook:clojure-cookbook Gregg Williams has set up a framework at Getting Clojure to gather material, primarily focused on newbies, on how to flatten the learning curve. Th

Re: Some code dramatically slower in Clojure 1.3 Alpha 1?

2010-09-26 Thread Btsai
I found that even without patching, most functions in clojure.contrib.math already correctly handle big nums in 1.3: Handles big nums in 1.3? absYes ceil Yes exact-integer-sqrt No expt No floor Yes gcdYes lcmY

Re: functions left over in the vm

2010-09-26 Thread Robert McIntyre
I generally use the ns macro to jump around my namespaces (like I use ls to change directories in the shell) , and use a convenience function I wrote called ns-nuke, which gets rid of all functions defined in that ns. Then I use reload, another convenience function, which just uses that namespace

Re: functions left over in the vm

2010-09-26 Thread Phil Hagelberg
On Sun, Sep 26, 2010 at 2:56 PM, Michael Ossareh wrote: > Situation: We've built a product, very rapidly thanks to being able to > produce stuff very quickly in clojure. However now that it is somewhat > settled I'm in the process of paring down the code, removing defunct fn's, > etc. It's actual

Re: An Emacs command to close the various balanced expressions in Clojure

2010-09-26 Thread Robert McIntyre
Thank you blais --- I also have troubles with paredit and this function will really help me out. keep up the good work, --Robert McIntyre On Sun, Sep 26, 2010 at 8:19 PM, Tassilo Horn wrote: > Hi, > > did you already try out paredit [1]?  That mode is absolutely fabulous > for programming any

Re: An Emacs command to close the various balanced expressions in Clojure

2010-09-26 Thread Tassilo Horn
Hi, did you already try out paredit [1]? That mode is absolutely fabulous for programming any lisp and provides much more than just closing parens. Give it a shot! Bye, Tassilo Footnotes: [1] http://mumble.net/~campbell/emacs/paredit.el -- You received this message because you are subscrib

Re: An Emacs command to close the various balanced expressions in Clojure

2010-09-26 Thread CuppoJava
I'm curious what you don't like about the automatic insertion scheme that you talked about. I'm using Parenedit with emacs and I'm quite happy with it. I think the scheme is quite simple... whenever you type '(', it inserts ')'. Similarly with '[' and '{'. -Patrick On Sep 26, 7:51 pm, blais wro

An Emacs command to close the various balanced expressions in Clojure

2010-09-26 Thread blais
Hi, Writing Clojure code tends to require a larger mix of "()", "[]" and "{}" characters than other LISPs I use. This sometimes makes it a bit tiring to write those balanced expressions. Writing balanced expressions has been addressed in editors mainly by providing the automated insertion of matc

Re: clojure-contrib 1.3.0-alpha1

2010-09-26 Thread André Thieme
Am 24.09.2010 17:09, schrieb Stuart Sierra: I have deployed release 1.3.0-alpha1 of clojure-contrib. This is the first public release of the modularized clojure-contrib. If you just want one big JAR file, download it from http://github.com/clojure/clojure-contrib/downloads If you want JARs for

Some programs require much more memory in Clojure 1.3 alpha1

2010-09-26 Thread Andy Fingerhut
While updating the benchmark programs I wrote for the shootout web site for 1.3 alpha1, I came across a program that required much more memory to complete in 1.3 than it did in 1.2. I boiled it down to a simpler program that has similar properties.

Re: Literal collection of numbers - prefer list or vector?

2010-09-26 Thread Steven E. Harris
David Sletten writes: > Umm, kind of...The single quote is a macro character not a real > macro. And I didn't say it was a macro. It's a macro character tied to a reader macro, and it participates in read-time macroexpansion. , | user> (quote (a 'b)) | (a (quote b)) ` [...] > The read

functions left over in the vm

2010-09-26 Thread Michael Ossareh
How are other people handling the process of reducing code in their projects? Situation: We've built a product, very rapidly thanks to being able to produce stuff very quickly in clojure. However now that it is somewhat settled I'm in the process of paring down the code, removing defunct fn's, etc

Re: Does 'lein repl' session give slow processing for you, too?

2010-09-26 Thread Tim Lopez
Possibly related -- I've noticed that lein repl on Mac / Linux seems to break type hinting. $ lein repl user=> (set! *warn-on-reflection* true) true user=> (defn foo [^String s] (.charAt s 1)) Reflection warning, NO_SOURCE_PATH:2 - call to charAt can't be resolved. $ java -cp `lein classpath` clo

VerifyError with symbol metadata, macros, and defrecord

2010-09-26 Thread Constantine Vetoshev
In Clojure 1.2, compiling the code below blows up with: error: java.lang.VerifyError: (class: t1/core/One, method: signature: ()V) Incompatible argument to function (core.clj:11) Something about this problem causes damage to the running Clojure process. Once the exception happens, changing the m

Re: Literal collection of numbers - prefer list or vector?

2010-09-26 Thread David Sletten
On Sep 26, 2010, at 10:42 AM, Steven E. Harris wrote: > ataggart writes: > >> Vectors also permit evaluation of the literal collection's elements: >> >> user=> [(+ 1 2) (+ 3 4)] >> [3 7] >> user=> '((+ 1 2) (+ 3 4)) >> ((+ 1 2) (+ 3 4)) > > That's a false distinction. You used `quote' rather

Re: Literal collection of numbers - prefer list or vector?

2010-09-26 Thread Steven E. Harris
ataggart writes: > Vectors also permit evaluation of the literal collection's elements: > > user=> [(+ 1 2) (+ 3 4)] > [3 7] > user=> '((+ 1 2) (+ 3 4)) > ((+ 1 2) (+ 3 4)) That's a false distinction. You used `quote' rather than `list'. Macroexpand your form to see: , | user> (quote ((+ 1

ANN: clojure-maven-plugin 1.3.4 released

2010-09-26 Thread Mark Derricutt
'lo all, I just released the clojure-maven-plugin 1.3.4 which should be hitting maven central in the next hour or so: I'd like to thank all those who've contributed patches for this release ( Alex Miller, Sam Umbach, Viktor Matic, Peter Schuller, Raoul Duke, Paudi Moriaty, and w...@glozer.net ( n

Re: Literal collection of numbers - prefer list or vector?

2010-09-26 Thread ataggart
Vectors also permit evaluation of the literal collection's elements: user=> [(+ 1 2) (+ 3 4)] [3 7] user=> '((+ 1 2) (+ 3 4)) ((+ 1 2) (+ 3 4)) On Sep 25, 6:43 am, Joop Kiefte wrote: > the vector form. in idiomatic clojure, lists are practically only used > for code and macro's. > > 2010/9/25 H

Base64, bytes, and Clojure 1.3

2010-09-26 Thread ataggart
A while back I wrote a Base64 encoder, and have been using it to play with the primitive enhancements in 1.3. After a bit of fiddling I was able to get it from around an order of magnitude slower than apache commons-codec down to about 5x slower. Taking Rich's exclamation that "clojure was meant