Re: Function called from macro loses record structure

2010-07-15 Thread Kyle Schaffrick
On Thu, 15 Jul 2010 23:08:27 -0700 (PDT) Quzanti wrote: > Kyle > > I think I understand what you are saying. > > So in practice you should prevent functions called from a macro from > evaluating the records (using quoting), so that the output is in a > form that looks like source code should? >

Re: Function called from macro loses record structure

2010-07-15 Thread Quzanti
Kyle I think I understand what you are saying. So in practice you should prevent functions called from a macro from evaluating the records (using quoting), so that the output is in a form that looks like source code should? So think it probably is my lack of intuition about macros that is the pr

Re: Typed Racket

2010-07-15 Thread Frederick Polgardy
A big part of it is that Clojure, being based on the JVM, has to deal with inheritance and polymorphism in the core type system. An algebraic type system like that of Haskell, OCaml, Scheme doesn't have to deal with inheritance. There is parametric polymorphism, but that's based on type classes,

Re: terracotta?

2010-07-15 Thread Alex Miller
Hi, I used to be a tech lead at Terracotta but I am now a full-time Clojure dev. I think it would be very interesting to explore the new Terracotta Toolkit product to provide a distributed store for Clojure data structures. I think it actually comes out in GA next week although it's been availab

Re: terracotta?

2010-07-15 Thread Paul Stadig
If anyone is interested, the latest version of my terracotta TIM is at http://github.com/pjstadig/tim-clojure-1.0.0 and it tries to be a Clojure 1.0.0 compatible TIM, which shows how its a bit out-of-date. I am very open to collaboration, and I would love pull requests, or any patches that anyone

Re: Clojure 1.2 Beta 1

2010-07-15 Thread nickikt
Sorry my answer was so short. I only remember that there was some kind of problem with master.git and clojure.git. So I thought I'll give you a tip and you will figure out the rest but your problem was bigger then I thought. On 15 Jul., 19:02, Jeffrey Schwab wrote: > On 7/15/10 10:15 AM, Adrian

Re: ANN lein-daemon, lein-test-out

2010-07-15 Thread nickikt
Oh nice, Lein-daemon will come in handy I wanted to do something that should work as a daemon but I had know Idea how that works. I'm glad for anything that helps :) On 16 Jul., 00:00, Allen Rohner wrote: > I'd like to announce two new lein plugins, lein daemon and lein test- > out. > > Lein-daem

Re: Typed Racket

2010-07-15 Thread ntu...@googlemail.com
On Jul 15, 8:16 pm, Tomi Neste wrote: > But I don't think it would be easy to make it work with Clojure, > given how polymorphic and dynamic the language is (IMHO Scheme is not too > far from ML when it comes to type systems). Please expand. - nt -- You received this message because you are su

ANN lein-daemon, lein-test-out

2010-07-15 Thread Allen Rohner
I'd like to announce two new lein plugins, lein daemon and lein test- out. Lein-daemon is a wrapper around the Apache Commons Daemon, for starting a clojure process as a daemon. Lein test-out is a plugin for running your tests and outputting the results to junit or TAP (using clojure.test.junit a

Re: ANN: Deview - Better test results

2010-07-15 Thread Brenton
> I might even go so far as to suggest > making it wrap the built-in test task using hooks; have you considered > that? lein-difftest now uses hooks to modify the behavior of "lein test". Huge improvement in the code - much simpler and no copying. > I'd rather wait on integrating it directly into

Re: Clojure noob: refactoring factorial code

2010-07-15 Thread Mike Meyer
On Thu, 15 Jul 2010 04:38:22 -0700 (PDT) Brisance wrote: > Here's a factorial function as found in the WikiBook "Learning > Clojure" : > > (defn factorial [n] > (defn fac [n acc] > (if (zero? n) >acc > (recur (- n 1) (* acc n

Re: Function called from macro loses record structure

2010-07-15 Thread Kyle Schaffrick
On Thu, 15 Jul 2010 08:10:55 -0700 (PDT) Quzanti wrote: > Hi > > Here is my sorry tale > > http://gist.github.com/477069 > > I am not sure if this could be my misunderstanding of macros or the ~ > idiom > > Anyway if you spell out a record structure to a macro then you keep > the Record infor

Re: Typed Racket

2010-07-15 Thread Nicolas Oury
On Thu, Jul 15, 2010 at 7:16 PM, Tomi Neste wrote: > www.ccs.neu.edu/*scheme*/pubs/popl08-thf.pdf Thanks for the link, I missed that. Looks very interesting. The filter one is more impressive, because it means that there is no cheating involve, that would not be first-class. But you're right C

Re: Typed Racket

2010-07-15 Thread Tomi Neste
On Thu, Jul 15, 2010 at 10:55 AM, Nicolas Oury wrote: > It's a hard problem. Most type-systems forbid the kind of program people > write in Clojure > > For example (if (keyword? x) using the fact that x is a keyword... > would not be typable in many languages. (Or there would be hundreds of >

Re: Clojure 1.2 Beta 1

2010-07-15 Thread Jeffrey Schwab
On 7/15/10 10:15 AM, Adrian Cuthbertson wrote: Apparently there's a problem with git clone http://... Should be git clone git://github.com/clojure/clojure.git Sorry for the noise. Thanks, I've been mistakenly working from git://github.com/richhickey/clojure.git ...which is apparently why

Re: Clojure 1.2 Beta 1

2010-07-15 Thread Jeffrey Schwab
On 7/15/10 9:24 AM, nickikt wrote: the new branch is called clojure not master Thanks, but I see no branch by that name. Do you mean 1.2.x? (And what's the corresponding branch for clojure-contrib?) -- You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: terracotta?

2010-07-15 Thread scx
Hi -- I'm noob to both Clojure and Terracotta but if you're willing to tolerate basic questions from me, I'd be very interested in helping out. On Jul 12, 3:36 am, peter veentjer wrote: > I don't think it every is going to scale. > > MVCC/TL2 based STM designs rely on a central clock, so if you

Re: Function called from macro loses record structure

2010-07-15 Thread Michał Marczyk
I think this is a consequence of the more general problem whereby records turn into maps when evaluated. There was a ticket for that on Assembla, not sure about its current status... Sincerely, Michał -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: leiningen seems broken on clojure 1.2 beta 1

2010-07-15 Thread Phil Hagelberg
On Wed, Jul 14, 2010 at 10:41 PM, Todd wrote: > I'm having difficulty getting leiningen to work w/ clojure 1.2... > > REPRO: > > 0. install leiningen and then upgrade it > > lein upgrade > > The script at ./lein will be upgraded to the latest stable version. > Do you want to continue [Y/n]? y Yes

Function called from macro loses record structure

2010-07-15 Thread Quzanti
Hi Here is my sorry tale http://gist.github.com/477069 I am not sure if this could be my misunderstanding of macros or the ~ idiom Anyway if you spell out a record structure to a macro then you keep the Record information, even you call a function which spells out the structure then the records

Re: Clojure 1.2 Beta 1

2010-07-15 Thread Adrian Cuthbertson
Apparently there's a problem with git clone http://... Should be git clone git://github.com/clojure/clojure.git Sorry for the noise. On Thu, Jul 15, 2010 at 3:57 PM, Adrian Cuthbertson wrote: > I'm trying... > git clone http://github.com/clojure/clojure.git > and getting the following error...

Re: Clojure 1.2 Beta 1

2010-07-15 Thread Adrian Cuthbertson
I'm trying... git clone http://github.com/clojure/clojure.git and getting the following error... Getting pack 9be7389ab68fea4a8309596c2916961599d2b06c which contains 833f9f368d2274766aa4699195b3fba3f9e4e8f0 error: Unable to get pack file http://github.com/clojure/clojure.git/objects/pack/pack-9be

Re: Clojure noob: refactoring factorial code

2010-07-15 Thread Frederick Polgardy
Well, no, I was merely demonstrating how to use loop/recur. -- Science answers questions; philosophy questions answers. On Jul 15, 2010, at 8:52 AM, Daniel Gagnon wrote: > There's no reason to recur at all: > > (defn factorial [n] (reduce * (range 1 (inc n > > On Thu, Jul 15, 2010 at 9:49

Re: Clojure noob: refactoring factorial code

2010-07-15 Thread Daniel Gagnon
There's no reason to recur at all: (defn factorial [n] (reduce * (range 1 (inc n On Thu, Jul 15, 2010 at 9:49 AM, Frederick Polgardy wrote: > You don't need to recur to another function, just recur to a loop: > > (defn factorial [n] > (loop [x n acc 1] >(if (zero? x) acc (recur (dec x)

Re: Clojure noob: refactoring factorial code

2010-07-15 Thread Frederick Polgardy
You don't need to recur to another function, just recur to a loop: (defn factorial [n] (loop [x n acc 1] (if (zero? x) acc (recur (dec x) (* acc x) (println (factorial 5)) -- Science answers questions; philosophy questions answers. On Jul 15, 2010, at 6:38 AM, Brisance wrote: > Here

Re: Clojure 1.2 Beta 1

2010-07-15 Thread Meikel Brandmeyer
Hi, On Jul 15, 3:24 pm, nickikt wrote: > the new branch is called clojure not master To be more precise: the new repo is under http://github.com/clojure Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Clojure 1.2 Beta 1

2010-07-15 Thread nickikt
the new branch is called clojure not master On Jul 15, 3:11 pm, Jeffrey Schwab wrote: > Is Clojure 1.2 Beta 1 built from the current clojure.git head on github? >   I don't see any 1.2 branches or tags, and the repl prints the following: > > Clojure 1.2.0-master-SNAPSHOT > > I also don't see any

Re: Clojure 1.2 Beta 1

2010-07-15 Thread Jeffrey Schwab
Is Clojure 1.2 Beta 1 built from the current clojure.git head on github? I don't see any 1.2 branches or tags, and the repl prints the following: Clojure 1.2.0-master-SNAPSHOT I also don't see any commits since 6/23; is that right? Thanks and congratulations, btw. :) On 7/14/10 11:35 AM, St

Re: Stepping, debugging in REPL

2010-07-15 Thread Meikel Brandmeyer
Hi, ha! Works better now. :) I gave it a quick try and it seems to work. I'll give it another ride in the next days. One more note: Avoid single segment namespaces. They cause classes to be generated without a package name in the Java default package. Sincerely Meikel -- You received this mess

Clojure noob: refactoring factorial code

2010-07-15 Thread Brisance
Here's a factorial function as found in the WikiBook "Learning Clojure" : (defn factorial [n] (defn fac [n acc] (if (zero? n) acc (recur (- n 1) (* acc n ; recursive call to fac, but reuses the stack; n will be (- n 1), and acc

Re: Stepping, debugging in REPL

2010-07-15 Thread Adam Schmideg
Thank you, Meikel, for trying it out and for your feedback. It seems there is more work ahead to be done. Jul 14, 11:17 am, Meikel Brandmeyer wrote: > Hi, > > On Jul 13, 10:24 am, Adam Schmideg wrote: > > > I just made this debugger.  It works but is still a bit rough around > > the edges.  I'd

Re: Clojure 1.2 Beta 1

2010-07-15 Thread Btsai
Congrats to Clojure on hitting this fantastic milestone :) Question: the release notes mentions a new clojure.string namespace. But I've had no luck finding it in the online API at http://richhickey.github.com/clojure/. Am I missing something? On Jul 14, 9:03 am, Stuart Halloway wrote: > Clojur

leiningen seems broken on clojure 1.2 beta 1

2010-07-15 Thread Todd
I'm having difficulty getting leiningen to work w/ clojure 1.2... REPRO: 0. install leiningen and then upgrade it lein upgrade The script at ./lein will be upgraded to the latest stable version. Do you want to continue [Y/n]? y Upgrading... % Total% Received % Xferd Average Speed Tim

Re: Evaluated or not -- unquote in syntax-quote/backquote

2010-07-15 Thread Yang Dong
Thank you very much! On Jul 14, 8:06 pm, Meikel Brandmeyer wrote: > Hi, > > On Jul 14, 4:30 am, Yang Dong wrote: > > > `body' on the 5th line is not evaluted when the macro got expanded, > > but the `mapcar' on the 2nd line is evaluated. > > No. Both are evaluated when the macro is expanded. bod

Re: Stepping, debugging in REPL

2010-07-15 Thread Adam Schmideg
Hi Meikel, thanks for your feedback. On Jul 14, 11:17 am, Meikel Brandmeyer wrote: > Hi, > > On Jul 13, 10:24 am, Adam Schmideg wrote: > > > I just made this debugger.  It works but is still a bit rough around > > the edges.  I'd be happy to hear your > > feedback.http://code.google.com/p/task

Re: faster flatten?

2010-07-15 Thread Cam
You're right about rest, I didn't see that rest should be preferred to next when consuming seqs in this style. I agree that flatten returning the empty list for some of the things that actually can be "seqed" is odd. I'm sure there's a good reason somewhere, but it's not to hard to change by just

Re: Clojure-based scientific paper!

2010-07-15 Thread jandot
Congratulations Boris. Nice to see clojure being used in bioinformatics :-) I might get in touch with you later about building a clojure library for bioinformatics... jan. On Jul 14, 7:56 am, bOR_ wrote: > Hi all, > > My first paper with results based on a clojure-build agent-based model > is in

Re: alter atom while iterating

2010-07-15 Thread ka
>(for [a (r 2), b (r 3)] [a b]) >; produces: > >( >[0 0] [0 1] >[0 2] [1 0] [1 1] [1 2]) Why does (r 2) get evaluated before the seq is needed ? => (def k (for [a (r 2), b (r 3)] [a b]) ) #'a/k - Thanks -- You received this message because you

Re: Building mixed clojure and java code

2010-07-15 Thread listas antoniogarrote
Hi all. I've uploaded a new version of lein-javac to clojars that should work with Clojure 1.2.0 Beta 1 and Leiningen 1.2.0-RC2. http://clojars.org/lein-javac Cheers! El 7/15/10 5:28 AM, Seth escribió: It appears that lein-javac is not compatible with Leiningen 1.2.0-RC2: % lein compile-ja

Re: ANN: Deview - Better test results

2010-07-15 Thread Hubert Iwaniuk
I've just pushed clansi to clojars http://clojars.org/clansi HTH, Hubert. On Jul 15, 2010, at 9:26 AM, Jeff Rose wrote: > On Jul 15, 6:27 am, Phil Hagelberg wrote: >> Yeah, a web display is certainly much richer. I'm totally an edge >> case, but when you're remote pairing it's pretty important

Re: Typed Racket

2010-07-15 Thread Nicolas Oury
It's a hard problem. Most type-systems forbid the kind of program people write in Clojure For example (if (keyword? x) using the fact that x is a keyword... would not be typable in many languages. (Or there would be hundreds of special cases) There is a category of type systems, that can hand

Re: ANN: Deview - Better test results

2010-07-15 Thread Jeff Rose
On Jul 15, 6:27 am, Phil Hagelberg wrote: > Yeah, a web display is certainly much richer. I'm totally an edge > case, but when you're remote pairing it's pretty important to keep > things in the shared context just so you can be sure you're looking at > the same thing. Another option is to use AN