Re: clojinc: a Clojure tutorial in the form of an extended REPL session

2011-09-08 Thread nchurch
You clone it from github (git clone URL listed at top) and run the code one form at a time in core.clj; or, just copy the code in core.clj from the code browser on github itself. On Sep 7, 10:16 pm, Vincent vincent@gmail.com wrote: How to use this ? -- You received this message because you

jsfiddle development app

2011-09-08 Thread daly
http://jsfiddle.net/g105b/Z4TFh/ It would be interesting to develop Clojure code this way Tim Daly -- 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

Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Dominikus
In Clojure 1.3, BigInts are said to be contagious across operations. When different types of numbers are used in a math operation, the result will be the larger or more general of the two types. For example, any integer operation involving a BigInt will result in a BigInt, [...].

Re: clojinc: a Clojure tutorial in the form of an extended REPL session

2011-09-08 Thread Lee Spector
On Sep 8, 2011, at 12:06 AM, Ambrose Bonnaire-Sergeant wrote: This is interesting, might I ask what in context are you teaching this? It's primarily for a genetic programming course I'm teaching at Hampshire College (https://moodle.hampshire.edu/course/view.php?id=1788). -Lee -- You

Re: Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Eric Lavigne
You have discovered a very recent change. The idea is to automatically switch to longs for performance when it is clear that overflow will not occur. https://github.com/clojure/clojure/commit/684fca15040e1ec8753429909b2d463e99d857e7 There are still some problems with this optimization,

Re: Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Dominikus
Thanks, Eric. My original problem was the factorial function, which breaks despite using BigInts: user= (defn fact [n] (if (= n 1N) 1N (* n (fact (- n 1N) #'user/fact user= (type (fact 1)) clojure.lang.BigInt user= (type (fact 20)) java.lang.Long user= (type (fact 21)) ArithmeticException

Re: suspending execution when displaying using inspect-tree

2011-09-08 Thread Meikel Brandmeyer (kotarak)
Hi, maybe not the easiest way, but it works for me: http://paste.pocoo.org/show/472348/ Sincerely Meikel -- 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

Re: suspending execution when displaying using inspect-tree

2011-09-08 Thread Meikel Brandmeyer (kotarak)
Ooops. To be used as: (wait-for (inspect-tree your-data-here)). -- 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

Re: Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Meikel Brandmeyer (kotarak)
Hi, Am Donnerstag, 8. September 2011 13:57:49 UTC+2 schrieb Dominikus: Upgrade casting in Clojure 1.2 is cool and simple. It's also in 1.3 cool and simple. user= (defn fact [n] (if (= n 1N) 1N (* n (fact (- n 1N) #'user/fact user= (fact 21) ArithmeticException integer overflow

Re: Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Meikel Brandmeyer (kotarak)
Even if you call the *correct* function recursively. *geez* user= (defn fact' [n] (if (= n 1) 1 (*' n (fact' (dec n) #'user/fact' user= (fact' 21) 5109094217170944N Sorry for the noise. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups

Re: Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Dominikus
Right, this feature is documented in http://dev.clojure.org/display/doc/Documentation+for+1.3+Numerics For me it feels somewhat strange to use primed operations to enforce upgrade casting and to write a special faculty function for that. I just discovered that (fact 21) breaks while (fact 21N)

Re: Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Meikel Brandmeyer (kotarak)
Hi, Am Donnerstag, 8. September 2011 14:21:09 UTC+2 schrieb Dominikus: Right, this feature is documented in http://dev.clojure.org/display/doc/Documentation+for+1.3+Numerics For me it feels somewhat strange to use primed operations to enforce upgrade casting and to write a special

Re: Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Dominikus
Thanks for the explanation, Meikel! I'll wait for the next release which hopefully fixes the bug. Cheers, Dominikus On Sep 8, 2:31 pm, Meikel Brandmeyer (kotarak) m...@kotka.de wrote: Hi, Am Donnerstag, 8. September 2011 14:21:09 UTC+2 schrieb Dominikus: Right, this feature is

Re: Contagious BigInts in 1.3? Why is (type (- 2 1N)) java.lang.Long?

2011-09-08 Thread Stuart Halloway
In Clojure 1.3, BigInts are said to be contagious across operations. When different types of numbers are used in a math operation, the result will be the larger or more general of the two types. For example, any integer operation involving a BigInt will result in a BigInt, [...].

Re: How To Empty A Tree or Returning The Skelton of A Tree Without Leaves

2011-09-08 Thread octopusgrabbus
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 Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email

Migration to 1.3 for mortals

2011-09-08 Thread Jan Rychter
How do we mere mortals (that develop and maintain large apps) migrate to 1.3? I thought I'd be able to at least estimate the effort involved for our application in about an hour today, but failed. In spite of searching, looking through various repos, reading the wiki and in general googling

Newbie question: How to add external clojure jars properly in Eclipse.

2011-09-08 Thread JosephLi
hi all, I have a bare bone Clojure project created in Eclipse with Counterclockwise plugin and am trying to (use clojure.java.jdbc). I tried adding the jar file downloaded from Maven repo to the project's build path but everytime it runs the (use) line from the repl it will give a

Re: How To Empty A Tree or Returning The Skelton of A Tree Without Leaves

2011-09-08 Thread Ivan Krechetov
Which exercises are those? Are they online somewhere? On Sep 7, 11:38 pm, octopusgrabbus octopusgrab...@gmail.com wrote: When I started learning Clojure, I did not want to be a casual user that shyed away from Clojure's native syntax, preferring to do as much as possible in Java. To that end,

Re: How To Empty A Tree or Returning The Skelton of A Tree Without Leaves

2011-09-08 Thread octopusgrabbus
http://www.cis.upenn.edu/~matuszek/cis554-2010/Assignments/clojure-01-exercises.html -- 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

Re: How To Empty A Tree or Returning The Skelton of A Tree Without Leaves

2011-09-08 Thread octopusgrabbus
Thanks. Something got out of whack when I copied it. -- 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 post.

Re: Thoughts on CUDA + Clojure

2011-09-08 Thread Milton Silva
Why not opencl? This way you would be able to run the code in any hardware and even a hybrid approach cpu+gpu(AMD and NVIDIA), you could even think about webcl (javascript to access the gpu) which I think has some form of GC. Besides, opencl code is very similar to CUDA code. Whatever you do,

Re: Thoughts on CUDA + Clojure

2011-09-08 Thread Jason Wolfe
I haven't looked at aparapi [1] in detail, but it seems interesting and potentially useful for your quest: [1] http://developer.amd.com/zones/java/aparapi/pages/default.aspx -Jason On Sep 8, 11:43 am, Timothy Baldridge tbaldri...@gmail.com wrote: I've been kicking around an idea for some time,

Re: Thoughts on CUDA + Clojure

2011-09-08 Thread Timothy Baldridge
Why not opencl? Yes if we were going for a very simple OpenCL in Clojure Syntax, the yes OpenCL is usable. However, last I checked, the OpenCL kernel language did not support virtual functions or dynamic memory allocation. That is only the CPU is allowed to allocate memory. This is something

Re: Thoughts on CUDA + Clojure

2011-09-08 Thread Michael Jaaka
Why not to translate to any lang? I though about translating clojure to php source code. It differs from jvm and crl (.net) approach that it is not translated to uni language to be run on one platform but translated to form/source understood by targeted hosting platform and ran on it. The

Re: Migration to 1.3 for mortals

2011-09-08 Thread Armando Blancas
There's this page: http://dev.clojure.org/display/doc/Clojure+Contrib Here's the main page for the new repos: https://github.com/clojure On Sep 7, 5:44 am, Jan Rychter jrych...@gmail.com wrote: How do we mere mortals (that develop and maintain large apps) migrate to 1.3? I thought I'd be

extend already refers to: #'clj-time.core/extend in namespace

2011-09-08 Thread Brad
I started using the clj-time library and found that it works great. Only issue I don't understand is this one about extend already refers to another version of extend. It seems that clj-time has a function called extend that conflicts with the same named function in clojure.core. The

Re: extend already refers to: #'clj-time.core/extend in namespace

2011-09-08 Thread Brad
Btw, I'm using clojure-1.2.0.jar clj-time-0.3.0.jar - Brad On Sep 8, 5:03 pm, Brad b...@beaconhill.com wrote: I started using the clj-time library and found that it works great. Only issue I don't understand is this one about extend already refers to another version of extend. It seems

What's wrong with my *print-dup* persistence?

2011-09-08 Thread Tassilo Horn
Hi all, I've just read Alan Malloy's excellent clojure persistence article at http://amalloy.hubpages.com/hub/Dont-use-XML-JSON-for-Clojure-only-persistence-messaging Then I wanted to add a feature for persisting and reloading clojure data that also contains vertices and edges of some java

Swarming experiment at Conj?

2011-09-08 Thread Brian Marick
TL;DR: I have an idea for an after-hours coding experiment at the Conj. Interested? I'm at ALE2011 in Berlin. Jason Ayers gave an interesting presentation. He works for Cincom, a maker of Smalltalk. They wondered what would happen if 8 people programmed together on the same problem (instead

Re: Migration to 1.3 for mortals

2011-09-08 Thread Sergey Didenko
Just my 2 cents: If you are ok with a quick dirty hack you can fix contrib libraries locally. -- 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 -

Re: Swarming experiment at Conj?

2011-09-08 Thread Phil Hagelberg
On Thu, Sep 8, 2011 at 2:36 PM, Brian Marick mar...@exampler.com wrote: I'm at ALE2011 in Berlin. Jason Ayers gave an interesting presentation. He works for Cincom, a maker of Smalltalk. They wondered what would happen if 8 people programmed together on the same problem (instead of one or

Re: Migration to 1.3 for mortals

2011-09-08 Thread Sean Corfield
On Wed, Sep 7, 2011 at 5:44 AM, Jan Rychter jrych...@gmail.com wrote: How do we mere mortals (that develop and maintain large apps) migrate to 1.3? It's a good question - and it's being discussed right now on the clojure-dev list because the biggest obstacle to folks moving to Clojure 1.3 is

Re: Migration to 1.3 for mortals

2011-09-08 Thread Luc Prefontaine
Hi, I'll take care of c.c.trace. Just need to register on clojure-dev, my CA should be in by tomorrow. Luc P. On Thu, 8 Sep 2011 16:49:42 -0700 Sean Corfield seancorfi...@gmail.com wrote: On Wed, Sep 7, 2011 at 5:44 AM, Jan Rychter jrych...@gmail.com wrote: How do we mere mortals (that

ClojureScript for Google Chrome webapps

2011-09-08 Thread Joop Kiefte
Has anyone used ClojureScript for Google Chrome webapps already? How would you structure your workflow/directories if you would do this? Joop Kiefte -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

How to view the doc of a ns in 1.3-beta3?

2011-09-08 Thread Robert Luo
When I use (doc clojure.test) It triggers a ClassNotFoundException. -- 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

Readd error???

2011-09-08 Thread jayvandal
I have installed cake accoring to the instructions. I then attempt ot run the sql and I get this information. I don't know where to look. Could anyone explain what the problem is??? Thanks in advance ===Microsoft Windows [Version 6.0.6002] Copyright (c)

Re: extend already refers to: #'clj-time.core/extend in namespace

2011-09-08 Thread Meikel Brandmeyer (kotarak)
Hi, the correct way to *change* to a namespace is in-ns. Calling ns will also refer to clojure.core. The first scenario happens because the namespace already exists and the ns tries to refer extend to #'clojure.core/extend which fails because #'clj-time.core/extend is already there. The second

Re: Swarming experiment at Conj?

2011-09-08 Thread daly
On Thu, 2011-09-08 at 23:36 +0200, Brian Marick wrote: TL;DR: I have an idea for an after-hours coding experiment at the Conj. Interested? I'm at ALE2011 in Berlin. Jason Ayers gave an interesting presentation. He works for Cincom, a maker of Smalltalk. They wondered what would happen if