Re: Enhanced Primitive Support

2010-06-21 Thread Richard Newman
user=> (defn fac [n] (loop [n n r 1] (if (= n 1) r (recur (dec' n) (*' r n) NO_SOURCE_FILE:5 recur arg for primitive local: r is not matching primitive, had: Object, needed: long Auto-boxing loop arg: r #'user/fac user=> (fac 40) 8159152832478977343456112695961158942720N Might I sugg

Re: compiling clojure for a servlet container (tomcat)

2010-06-21 Thread Adrian Cuthbertson
> You can use Compojure to build webapp in more convenient way. I should elaborate on my previous post. It was intended not to recommend the clojure way of building web apps (there's plenty of info regarding that - compojure, ring, clout, hiccup, conjure, etc), but rather as a specific, detailed e

Re: Enhanced Primitive Support

2010-06-21 Thread Mark Engelberg
The new uber-loop is fantastic. So I guess the main point still to be finalized is whether the default arithmetic ops will auto-promote or error when long addition overflows. Playing around with the latest equals branch: user=> (def n 9223372036854775810) #'user/n user=> (* (/ n 3) 3) 922337203

Re: Transform columnar data into a tree?

2010-06-21 Thread David Nolen
Is it really necessary to have the keys :data and :children? If not: (reduce (fn [r x] (assoc-in r x {})) {} (partition 3 '(A1 B1 C1 A1 B1 C2 A1 B2 C3 A1 B2 C4 A2 B3 C5 A2 B3 C6 A2 B4 C7 A2 B4 C8))) {A2 {B4 {C8 {}, C7 {}}, B3 {C6 {}, C5 {}}}, A1 {B2 {C4 {}, C3 {}}, B1 {C2 {}, C1 { Works out

Transform columnar data into a tree?

2010-06-21 Thread Base
Hi all - This seems like it should be easy, but for some reason i have thought myself into a box on this and now am stuck. I have a data set of rows/ columns that has some hierarchical data in it: COLUMN A B C A1 B1 C1 A1 B1 C2 A1 B

Re: Batch file wrappers on Windows

2010-06-21 Thread Rick Moynihan
On 21 June 2010 18:42, Paul Moore wrote: > 3. Using a bat file to start a GUI application from Explorer causes an > unnecessary and ugly console window to appear. You should use "javaw" instead of "java" to start the JVM without the console window appearing. This should ship with both the JRE an

Re: Batch file wrappers on Windows

2010-06-21 Thread Russ Olsen
Paul, One way would be to use the cljw.exe that comes with dejour. This is a windows executable that runs clojure without creating that annoying extra window. I haven't really looked into making dejour work with Leiningen yet, so that may be a problem for you. You can find the dejour project on

Re: Batch file wrappers on Windows

2010-06-21 Thread Kevin Kelley
On Mon, 21 Jun 2010 12:42:47 -0500, Paul Moore wrote: The common way of running Java applications (and hence Clojure code) on Windows seems to be to use a batch file wrapper (for example, lein.bat for Leiningen). It seems to me that there are a number of issues with this: [...] Before I spend t

Submission to Duke's Choice Award

2010-06-21 Thread Howard Lewis Ship
Has anyone put together a submission for Clojure to Duke's Choice? http://www.oracle.com/dm/10q4cif/em050238/em050238_duke_choice_awards_welcome_new.html We just need to capture what makes Clojure special in 500 words. -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry

Re: Name change proposal for "extend-protocol"

2010-06-21 Thread Stuart Halloway
Hi Travis, The choice of "extend" follows from this reasoning: (1) Create a protocol. At this point there are no implementations. Protocol functions will fail regardless of arguments passed. (2) Extend the protocol to a String. The protocol has been *extended* to work with one type, Strings.

Name change proposal for "extend-protocol"

2010-06-21 Thread Travis Hoffman
I notice that there is a "satisfies?" method to determine if something satisfies a protocol. Also, I see that "extend-protocol" doesn't actually let one create a protocol which is an extension of another protocol. Rather, "extend-protocol" really means "implements", in the Java sense. When I first

Re: Enhanced Primitive Support

2010-06-21 Thread Daniel
user=> (set! *warn-on-reflection* true) true user=> (defn fac [n] (loop [n n r 1] (if (= n 1) r (recur (dec' n) (*' r n) NO_SOURCE_FILE:5 recur arg for primitive local: r is not matching primitive, had: Object, needed: long Auto-boxing loop arg: r #'user/fac user=> (fac 40) 81591528324789773434

Re: Enhanced Primitive Support

2010-06-21 Thread Daniel
If this is half the genius it sounds like then bravo! :D On Jun 21, 9:52 am, Rich Hickey wrote: > I've added the speculative analysis required to detect when recur   > arguments fail to match the type of primitive loop locals, and   > recompile the loop with those loop args boxed. When *warn-on-

Batch file wrappers on Windows

2010-06-21 Thread Paul Moore
The common way of running Java applications (and hence Clojure code) on Windows seems to be to use a batch file wrapper (for example, lein.bat for Leiningen). It seems to me that there are a number of issues with this: 1. Batch files don't nest well - if I want to call lein.bat from within another

Re: Records forget they are records

2010-06-21 Thread Michał Marczyk
On 21 June 2010 08:18, Erik Söhnel wrote: > Feel free to ask or drop into #clojure if you're having more > questions. Actually he did that, this thread was started somewhere in the middle of a #clojure chat. A solution was reached eventually. :-) http://clojure-log.n01se.net/date/2010-06-19.html

Re: Enhanced Primitive Support

2010-06-21 Thread Michał Marczyk
On 21 June 2010 16:52, Rich Hickey wrote: > I've added the speculative analysis required to detect when recur arguments > fail to match the type of primitive loop locals, and recompile the loop with > those loop args boxed. When *warn-on-reflection* is true it will issue a > report that this is ha

Re: Calx, a wrapper for OpenCL

2010-06-21 Thread Zach Tellman
I'm using JavaCL as the underlying library, which uses JNA rather than JNI. My understanding of the distinction (which is not perfect) is that JNA relies on bindings generated at runtime, rather than the static per-platform binaries used in JNI. As a result, you only need a jar file. I believe J

Re: Enhanced Primitive Support

2010-06-21 Thread David Nolen
On Mon, Jun 21, 2010 at 10:52 AM, Rich Hickey wrote: > I've added the speculative analysis required to detect when recur arguments > fail to match the type of primitive loop locals, and recompile the loop with > those loop args boxed. When *warn-on-reflection* is true it will issue a > report tha

Re: Calx, a wrapper for OpenCL

2010-06-21 Thread MarkSwanson
> available athttp://github.com/ztellman/calx. Nice! -- 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 Note that posts from new members are moderated - please be patient with your first pos

Re: Enhanced Primitive Support

2010-06-21 Thread ka
> My favorite option of those proposed is: > +, *, -, inc, dec auto-promote. > loop/recur is changed so that primitive bindings are boxed. > +',*',-',inc',dec' give error upon overflow. > A new construct, loop', is introduced that doesn't box primitives and > enforces recur with primitive upon pena

Re: Enhanced Primitive Support

2010-06-21 Thread Heinz N. Gies
On Jun 21, 2010, at 16:52 , Rich Hickey wrote: > I've added the speculative analysis required to detect when recur arguments > fail to match the type of primitive loop locals, and recompile the loop with > those loop args boxed. When *warn-on-reflection* is true it will issue a > report that t

Re: Enhanced Primitive Support

2010-06-21 Thread Rich Hickey
On Jun 20, 2010, at 12:57 PM, Luke VanderHart wrote: I've been reading this thread, and there's good arguments being made both ways - I've just been reading with interest. But after seeing the factorial function that won't compile without hints/casts, I feel I have to speak up. I wrote a book

Re: [ANN] Calx, a wrapper for OpenCL

2010-06-21 Thread David Nolen
On Mon, Jun 21, 2010 at 2:04 AM, Zach Tellman wrote: > Wrappers for OpenCL have been discussed a few times on this list, so > hopefully a few of you will be interested to hear that one is > available at http://github.com/ztellman/calx. > > In my opinion, the C-variant language used by OpenCL does

Re: Rich Hickey Video - unit conversion language

2010-06-21 Thread Timothy Baldridge
BTW...his documentation is just awesome...read the section on "Superman is a slacker" for a good laugh. Timothy > On Mon, Jun 21, 2010 at 6:46 AM, Julian wrote: >> Rich Hickey made reference in one of his videos to a language that >> could convert between all different kinds of units and dimensi

Re: Rich Hickey Video - unit conversion language

2010-06-21 Thread Timothy Baldridge
On Mon, Jun 21, 2010 at 6:46 AM, Julian wrote: > Rich Hickey made reference in one of his videos to a language that > could convert between all different kinds of units and dimensions. > Does anybody recall what that was? google is thy friend: http://www.google.com/search?sourceid=chrome&ie=UTF

Re: Rich Hickey Video - unit conversion language

2010-06-21 Thread Jon Seltzer
The language was Frink. On Jun 21, 4:46 am, Julian wrote: > Rich Hickey made reference in one of his videos to a language that > could convert between all different kinds of units and dimensions. > Does anybody recall what that was? -- You received this message because you are subscribed to the

Re: Enhanced Primitive Support

2010-06-21 Thread Meikel Brandmeyer
Hi, On Jun 21, 4:04 pm, Lee Spector wrote: > I guess this a somewhat unrelated newbie question: aren't there often cases > like this where one wants to temporarily rebind something, but across all > children threads? Is there some straightforward way to do this that I've > missed? See: http

Re: [ANN] Calx, a wrapper for OpenCL

2010-06-21 Thread Wilson MacGyver
I noticed you are importing com.nativelibs4java.opencl in src/clax/data.clj, looking at your project.clj I see a dep on clax/javacl is that where you are pulling the native lib for OpenCL? Can you explain a bit on your approach of getting this to work on various platforms? Esp on OSX and Linux. T

Re: Leiningen on windows

2010-06-21 Thread Shantanu Kumar
That blog-post is by me. I have only tried Lein on XP, but theoretically it should work on Vista too. The Leiningen 1.1.0 JAR bundles Clojure 1.1.0 compiled classes inside. You can mention the version of Clojure in the project.clj file for your project. As of now Clojure 1.1.0 is the stable version

Re: Rich Hickey Video - unit conversion language

2010-06-21 Thread Tim Daly
Frink. Julian wrote: Rich Hickey made reference in one of his videos to a language that could convert between all different kinds of units and dimensions. Does anybody recall what that was? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Rich Hickey Video - unit conversion language

2010-06-21 Thread Julian
Rich Hickey made reference in one of his videos to a language that could convert between all different kinds of units and dimensions. Does anybody recall what that was? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Records forget they are records

2010-06-21 Thread Erik Söhnel
Hi, see http://paste.pocoo.org/show/227866/ You just have to write your macro so that it expands into multiple defs. Remember, macros work at compile time, so they are not the same as eval. And from your code, I could not see your intentions, your prepare-2 macro seems somehow wrong to me. Maybe

Re: Enhanced Primitive Support

2010-06-21 Thread Lee Spector
On Jun 21, 2010, at 8:23 AM, Heinz N. Gies wrote: > it would be more or less trivial to make a macro that switches between non > promoting + primitive loop and promoting and boxed loop: > > (defmacro fast [body] > `(let [+# +, *# *, -# -, loop# loop ...] > (binding [+ +', * *', - -', loop

Clojure Futures Docs and Functionality

2010-06-21 Thread Ryan Senior
I figured before I added a ticket, I'd post here. I was using the functions for Futures in Clojure and found for all of the future functions (like future, future-done?, future-cancel etc) it was nicely abstracted and there was no need to know exactly what kind of object was passed into or returned

maturity and usefulness: clj-haml vs haml-macro

2010-06-21 Thread Julian
I'm about to start a new project using haml in clojure and I wanted to know at the present time (Jun 2010) - is clj-haml or haml-macro more mature? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

ANN: Dejour

2010-06-21 Thread Russ Olsen
Folks, I've pushed out a new version (1.1.0b) of dejour this weekend. Dejour provides an easy, works out of the box experience for the Clojure programming language. Dejour fills in some things that are missing from Clojure: It includes clojure, clojure-contrib and jline, along with the scripts t

Re: Enhanced Primitive Support

2010-06-21 Thread Nicolas Oury
On Mon, Jun 21, 2010 at 12:40 PM, Tim Daly wrote: > This debate happened many years ago for common lisp. > > The flag *use-primitive-as-default* is a big help for optimization. Most >> of the performance hits of boxing do not show in profiling. >> (It slows down a lot of functions, by memory acc

Re: Need help getting Snow Leopard, Aquamacs, Clojure, and Slime to work

2010-06-21 Thread Joost
On Jun 21, 3:07 pm, Joost wrote: > For core swank-clojure (without the elisp parts), you start a swank > server somewhere (using leiningen or some other script) and connect to > that using slime-connect. This means you don't need to install swank- > clojure in your clojure project, and can use g

Re: Need help getting Snow Leopard, Aquamacs, Clojure, and Slime to work

2010-06-21 Thread Joost
On Jun 20, 8:03 am, Larry Travis wrote: > So far so good. But then when I open a new file, say /foo.clj/ (and > indeed am presented with a buffer in clojure mode), and do /M-x slime/, > I get the error message "Symbol's function definition is void: > define-slime-contrib".  As I understand things,

Leiningen on windows

2010-06-21 Thread Emeka
Hello All, I need the following; The clojure version to be used, The best way to configure Leiningen on Vista, Examples I am currently try out instructions on this site http://charsequence.blogspot.com/2010/06/setup-leiningen-on-windows.html Regards, Emeka -- You received this message beca

Re: compiling clojure for a servlet container (tomcat)

2010-06-21 Thread Alex Ott
Hello AC> Notes; AC> - to update, simply copy new app clj file/s to WEB-INF/classes and AC> reload the context. AC> - Borrow http://github.com/weavejester/hiccup for some cool html AC> generation stuff. AC> - you should be able to adapt the above (namespace requiring) to your AC> other jav

Re: Enhanced Primitive Support

2010-06-21 Thread Konrad Hinsen
On 21.06.2010, at 02:19, Mark Engelberg wrote: > The arguments seem to be winding down, so I thought this would be a > good time to summarize my thoughts. > > My favorite option of those proposed is: > +, *, -, inc, dec auto-promote. > loop/recur is changed so that primitive bindings are boxed. >

Re: Enhanced Primitive Support

2010-06-21 Thread Heinz N. Gies
On Jun 21, 2010, at 13:40 , Tim Daly wrote: > This debate happened many years ago for common lisp. ... > Rich explicitly said he did not want this solution. > > Tim Daly it would be more or less trivial to make a macro that switches between non promoting + primitive loop and promoting and box

Re: Enhanced Primitive Support

2010-06-21 Thread Tim Daly
This debate happened many years ago for common lisp. The flag *use-primitive-as-default* is a big help for optimization. Most of the performance hits of boxing do not show in profiling. (It slows down a lot of functions, by memory access and - more importantly - filling the cache with garbage,

Re: Enhanced Primitive Support

2010-06-21 Thread Mark Engelberg
On Mon, Jun 21, 2010 at 12:32 AM, Nicolas Oury wrote: > That's not true. primitive loop is one of the key of the java-like > performance of clojure, once there are a few annotations. Right, the key words here are "once there are a few annotations". Those who aren't making those annotations will s

Re: Need help getting Snow Leopard, Aquamacs, Clojure, and Slime to work

2010-06-21 Thread patrik karlin
Hello theres a wherry "spartan" screencast on vimeo that install all this with regular emacs http://vimeo.com/11844368 2010/6/20 Larry Travis : > To save my life, I can't get Snow Leopard, Aquamacs, Clojure, and Slime to > work.  I have installed Aquamacs 2.0, then ELPA, then the packages > clojur

Re: Enhanced Primitive Support

2010-06-21 Thread Nicolas Oury
On Mon, Jun 21, 2010 at 9:06 AM, Nicolas Oury wrote: > - Default for the the non-labeled operator is boxed. It removes the problem > for loop/recur, and gives back the problems are they are now. oups. Not really awake. Monday morning :( I meant: - Default for the the non-labeled operator is bo

Re: Enhanced Primitive Support

2010-06-21 Thread Nicolas Oury
On Mon, Jun 21, 2010 at 1:19 AM, Mark Engelberg wrote: > The arguments seem to be winding down, so I thought this would be a > good time to summarize my thoughts. > I will do that too. The two sides of the arguments have both good points and won't change their position. So, my proposal: - a diffe

Re: Enhanced Primitive Support

2010-06-21 Thread Nicolas Oury
That's not true. primitive loop is one of the key of the java-like performance of clojure, once there are a few annotations. On Mon, Jun 21, 2010 at 1:19 AM, Mark Engelberg wrote: > [Note that > changing loop to auto-boxing behavior shouldn't hurt performance > because currently, almost all numbe