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 ANSI color codes to markup the text and
display it in the terminal.  This little library from the Amsterdam
Clojurians will provide all of the styles you use in the demo (colors,
bold, underline, and highlighted background color):

http://github.com/ams-clj/clansi

-Jeff

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 handle this kind of thing:
Dependant Types.
(But I am a bit biased, I am a researcher in Dependant Types)

With this kind of type systems, you can formalize something like
"(keyword? x) = true => x : keyword"

But they are still research projects, and most of them needs a lot of type
annotations.
(Agda is nice, if yo want to try it, though)

It is not very hard to have a type-checker for a sub-cases of correct
programs in Clojure.
(Something like ML + protocols, for example)

If other people want to do something, I would happily get involved.

But most programs won't be typable except with a very clever type-checker
(more clever than the state of the art).

At least, it could be helpful in simple code, to put annotations.

Best,

Nicolas.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

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 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 ANSI color codes to markup the text and
> display it in the terminal.  This little library from the Amsterdam
> Clojurians will provide all of the styles you use in the demo (colors,
> bold, underline, and highlighted background color):
> 
> http://github.com/ams-clj/clansi
> 
> -Jeff

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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-java
[...]
Exception in thread "main" java.lang.Exception: Unable to resolve
symbol: make-path in this context (compile_java.clj:10)

On Jul 14, 9:19 am, Moritz Ulrich
wrote:
   

There is lein-javac which integrates javac into the leiningen
build-flow:http://github.com/antoniogarrote/lein-javac





On Wed, Jul 14, 2010 at 3:16 PM, Martin DeMello  wrote:
 

On Wed, Jul 14, 2010 at 6:45 PM, Martin DeMello  wrote:
   

What are people using to build mixed clojure/java code? Currently just
using lein {uber,}jar to build and distribute.
 
 

Hit send too soon - I meant to say, currently my project is just
clojure, and lein works very nicely to package it. If I wanted to
include some java sources, what would the easiest way to build the
combined project be?
   
 

martin
   
 

--
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
   

--
Moritz Ulrich
Programmer, Student, Almost normal Guy

http://www.google.com/profiles/ulrich.moritz
 
   


--
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 press! If you have academic access to the journal, you can peek
> at it here:http://dx.doi.org/10.1016/j.epidem.2010.05.003, but
> otherwise it is also available on mendeley:  
> http://www.mendeley.com/profiles/boris-schmid/
>
> A very old and experimental version of the code is still in the files
> directory of the newsgroup (eden.clj), but I'll make some time to
> clean up the current version and drop it in the files directory as
> well.
>
> Several other papers using clojure are in the works as well, and by
> now I'm making heavy use of Incanter for visualization. Thanks for
> making these wonderful tools! The paper quoted above still uses
> xmgrace and inkscape.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 using seqable? from
contrib. That makes flatten handle anything. After benchmarking it
though, it seems like its muuuch slower; so slow that I got bored of
waiting after 5 minutes. Seems like a punt though :/


On Jul 14, 3:55 pm, Steve Miner  wrote:
> On Jul 14, 2010, at 2:40 PM, Cam wrote:
>
> > I definitely like this version a little better. If you change the else
> > of the if to be just (list), it returns the empty list just as core/
> > flatten does. Mind if I update the ticket with this patch?
>
> It's all yours.  Really, just a slight change from your code anyway.
>
> I wonder about the call to next.  I'm thinking it should be rest instead.  
> (Seehttp://clojure.org/lazy)
>
> I definitely don't like the way (flatten 10)  and (flatten {:a 1 :b 2}) 
> return the empty list (in 1.2 beta).  I think these are accidents, and I 
> worry that they will obscure higher-level bugs.
>
> My preference is to return the arg if it's not sequential? as I believe it 
> will provide a more useful result at no extra cost.  In that case, the 
> argument to flatten was probably a mistake, and it's better if the value 
> shows up somewhere rather than being mysteriously swallowed.  On the other 
> hand, it might make sense to return (list arg) on the theory that flatten 
> should always return a seq.  I could live with that.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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/taskberry/wiki/Stepl
>
> While the whole idea sounds nice, I have trouble getting it to work.
> It seems it can only "debug" correct code. Code throwing an exception
> is not handled.
Half-fixed.  You can debug (+ x (/ y 0)), the exception will be
handled.  Explicit try-catch blocks are not handled yet, though.
>
> When getting in the debug prompt, I can't do nothing but printing the
> usage message. Choosing eg. back or in as commands throws a NPE.
It did throw an exception in some corner cases, but I couldn't
reproduce NPE in all cases.  Anyway, I fixed that part, too.  It also
highlights the currently executing code now.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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. body evaluates to
> whatever is bound to the argument.
>
> (our-let [...] (this) (is the) (body))
>
> In this case body evaluates to "((this) (is the) (body))" which is
> inserted into the macro expansion. (Note: since we use unquote-splice
> aka. ~@ instead of plain unquote aka. ~ the outer list is spliced away
> in the expansion)
>
> Hope this helps.
>
> 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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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   TimeTime Time 
 Current
 Dload  Upload   Total   SpentLeft 
 Speed
100  4061  100  40610 0  10731  0 --:--:-- --:--:-- --:--:-- 
17504


Downloading Leiningen now...
  % Total% Received % Xferd  Average Speed   TimeTime Time 
 Current
 Dload  Upload   Total   SpentLeft 
 Speed
100 8076k  100 8076k0 0  1093k  0  0:00:07  0:00:07 --:--:-- 
1271k


Now running Leiningen 1.1.0 on Java 1.6.0_20 Java HotSpot(TM) 64-Bit 
Server VM



1. create a new app
 lein new test02

1.a verify

cat project.clj

(defproject test02 "1.0.0-SNAPSHOT"
  :description "FIXME: write"
  :dependencies [[org.clojure/clojure "1.1.0"]
 [org.clojure/clojure-contrib "1.1.0"]])


2. make sure lein works there
 cd test02
 lein help

3. ok, targets listed, now upgrade to clojure 1.2 beta 1
 cat project.clj

(defproject test02 "1.0.0-SNAPSHOT"
  :description "FIXME: write"
  :dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
 [org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]])

lein deps
 [copy] Copying 2 files to 
/Users/todd/Documents/projects/clojure/lein-test/test02/lib


4. now try running help again...

lein help

WARNING: reader macro ^ is deprecated; use meta instead
Exception in thread "main" java.lang.RuntimeException: 
java.lang.ClassCastException: clojure.lang.Cons cannot be cast to 
clojure.lang.Named (help.clj:5)

at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:2780)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:302)
at clojure.lang.Compiler.eval(Compiler.java:4647)
at clojure.lang.Compiler.load(Compiler.java:4972)
at clojure.lang.RT.loadResourceScript(RT.java:330)
at clojure.lang.RT.loadResourceScript(RT.java:321)
at clojure.lang.RT.load(RT.java:399)
at clojure.lang.RT.load(RT.java:371)
at clojure.core$load__6449$fn__6458.invoke(core.clj:4171)
at clojure.core$load__6449.doInvoke(core.clj:4170)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at clojure.core$load_one__6379.invoke(core.clj:4007)
at clojure.core$load_lib__6400.doInvoke(core.clj:4044)
at clojure.lang.RestFn.applyTo(RestFn.java:147)
at clojure.core$apply__4370.invoke(core.clj:438)
at clojure.core$load_libs__6417.doInvoke(core.clj:4070)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply__4370.invoke(core.clj:438)
at clojure.core$require__6440.doInvoke(core.clj:4138)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at leiningen.core$resolve_task__38.invoke(core.clj:65)
at leiningen.core$_main__46$fn__49.invoke(core.clj:81)
at leiningen.core$_main__46.doInvoke(core.clj:78)
at clojure.lang.RestFn.invoke(RestFn.java:413)
at user$eval__55.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:4642)
at clojure.core$eval__5236.invoke(core.clj:2017)
at clojure.main$eval_opt__7411.invoke(main.clj:227)
at clojure.main$initialize__7418.invoke(main.clj:246)
at clojure.main$null_opt__7446.invoke(main.clj:271)
at clojure.main$main__7466.doInvoke(main.clj:346)
at clojure.lang.RestFn.invoke(RestFn.java:426)
at clojure.lang.Var.invoke(Var.java:363)
at clojure.lang.AFn.applyToHelper(AFn.java:175)
at clojure.lang.Var.applyTo(Var.java:476)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: 
clojure.lang.Cons cannot be cast to clojure.lang.Named

at clojure.lang.LazySeq.sval(LazySeq.java:47)
at clojure.lang.LazySeq.seq(LazySeq.java:63)
at clojure.lang.Cons.next(Cons.java:37)
at clojure.lang.PersistentHashSet.create(PersistentHashSet.java:41)
at clojure.core$hash_set__4294.doInvoke(core.clj:285)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply__4370.invoke(core.clj:436)
at clojure.core$set__5556.invoke(core.clj:2636)
at clojure.lang.AFn.applyToHelper(AFn.java:173)
at clojure.lang.AFn.applyTo(AFn.java:164)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:2775)
... 35 more
Caused by: java.lang.ClassCastException: clojure.lang.Cons cannot be 
cast to clojure.lang.Named

at clojure.core$name__4748.invoke(core.clj:1053)
at leiningen.help$fn__67.invoke(help.clj:5)
at clojure.core$filter__5084$fn__5086.invoke(core.clj:1804)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
... 45 more

-Todd

--
You received this messa

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:
> Clojure 1.2 Beta 1 is now available, along with a corresponding Clojure 
> Contrib, at:
>
>        http://clojure.org/downloads
>
> It contains significant new features, as well as many bug fixes and small 
> enhancements. A larger number of contributors than ever before have pitched 
> in. You can see an overview of the changes in the changes file at:
>
>        http://github.com/clojure/clojure/blob/1.2.x/changes.txt
>
> For maven/leiningen users, your settings to get the beta from 
> build.clojure.org/releases are:
>
>          :dependencies [[org.clojure/clojure "1.2.0-beta1"]
>                                       [org.clojure/clojure-contrib 
> "1.2.0-beta1"]
>
> To everyone who has contributed to 1.2, many thanks!
>
> Stu

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 be happy to hear your 
> > feedback.http://code.google.com/p/taskberry/wiki/Stepl
>
> While the whole idea sounds nice, I have trouble getting it to work.
> It seems it can only "debug" correct code. Code throwing an exception
> is not handled.
I added some error handling, unexpected exceptions can be debugged
now, like (+ 1 (/ x 0))

>
> When getting in the debug prompt, I can't do nothing but printing the
> usage message. Choosing eg. back or in as commands throws a NPE.
I couldn't reproduce this one.  I fixed some exceptions thrown by
commands, though.
>
> 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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 will be (* acc n)
  (fac n 1))

Question: how would I go about writing idiomatic Clojure to return
factorials of n, for large values of n. e.g. 1e6 or more? Preferably
without having to create another function.

Thanks in advance for any insight.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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, Stuart Halloway wrote:

Just pushed, sorry.


Awesome! Looks great.

What branch/tag of clojure-contrib is the clojure-contrib-1.2.0-
beta1.zip download built from? I don't see it under branches, and
master builds clojure-contrib-1.2.0-SNAPSHOT.jar.

Thanks.

On Jul 14, 10:03 am, Stuart Halloway
wrote:

Clojure 1.2 Beta 1 is now available, along with a corresponding Clojure 
Contrib, at:

http://clojure.org/downloads

It contains significant new features, as well as many bug fixes and small 
enhancements. A larger number of contributors than ever before have pitched in. 
You can see an overview of the changes in the changes file at:

http://github.com/clojure/clojure/blob/1.2.x/changes.txt

For maven/leiningen users, your settings to get the beta from 
build.clojure.org/releases are:

  :dependencies [[org.clojure/clojure "1.2.0-beta1"]
   [org.clojure/clojure-contrib 
"1.2.0-beta1"]

To everyone who has contributed to 1.2, many thanks!

Stu


--
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en





--
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 commits since 6/23; is that right?
>
> Thanks and congratulations, btw. :)
>
> On 7/14/10 11:35 AM, Stuart Halloway wrote:
>
> > Just pushed, sorry.
>
> >> Awesome! Looks great.
>
> >> What branch/tag of clojure-contrib is the clojure-contrib-1.2.0-
> >> beta1.zip download built from? I don't see it under branches, and
> >> master builds clojure-contrib-1.2.0-SNAPSHOT.jar.
>
> >> Thanks.
>
> >> On Jul 14, 10:03 am, Stuart Halloway
> >> wrote:
> >>> Clojure 1.2 Beta 1 is now available, along with a corresponding Clojure 
> >>> Contrib, at:
>
> >>>        http://clojure.org/downloads
>
> >>> It contains significant new features, as well as many bug fixes and small 
> >>> enhancements. A larger number of contributors than ever before have 
> >>> pitched in. You can see an overview of the changes in the changes file at:
>
> >>>        http://github.com/clojure/clojure/blob/1.2.x/changes.txt
>
> >>> For maven/leiningen users, your settings to get the beta from 
> >>> build.clojure.org/releases are:
>
> >>>           :dependencies [[org.clojure/clojure "1.2.0-beta1"]
> >>>                                        [org.clojure/clojure-contrib 
> >>> "1.2.0-beta1"]
>
> >>> To everyone who has contributed to 1.2, many thanks!
>
> >>> Stu
>
> >> --
> >> 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 to
> >> clojure+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/clojure?hl=en

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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'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 will be (* acc n)
>  (fac n 1))
> 
> Question: how would I go about writing idiomatic Clojure to return
> factorials of n, for large values of n. e.g. 1e6 or more? Preferably
> without having to create another function.
> 
> Thanks in advance for any insight.
> 
> -- 
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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) (* acc x)
>
> (println (factorial 5))
>
> --
> Science answers questions; philosophy questions answers.
>
> On Jul 15, 2010, at 6:38 AM, 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 ; recursive call to fac, but reuses
> > the stack; n will be (- n 1), and acc will be (* acc n)
> >  (fac n 1))
> >
> > Question: how would I go about writing idiomatic Clojure to return
> > factorials of n, for large values of n. e.g. 1e6 or more? Preferably
> > without having to create another function.
> >
> > Thanks in advance for any insight.
> >
> > --
> > 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 to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

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 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) (* acc x)
> 
> (println (factorial 5))
> 
> --
> Science answers questions; philosophy questions answers.
> 
> On Jul 15, 2010, at 6:38 AM, 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 ; recursive call to fac, but reuses
> > the stack; n will be (- n 1), and acc will be (* acc n)
> >  (fac n 1))
> >
> > Question: how would I go about writing idiomatic Clojure to return
> > factorials of n, for large values of n. e.g. 1e6 or more? Preferably
> > without having to create another function.
> >
> > Thanks in advance for any insight.
> >
> > --
> > 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 to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> 
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> 
> 
> -- 
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

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-9be7389ab68fea4a8309596c2916961599d2b06c.pack
transfer closed with 2113048 bytes remaining to read
error: Unable to find 833f9f368d2274766aa4699195b3fba3f9e4e8f0 under
http://github.com/clojure/clojure.git
Cannot obtain needed object 833f9f368d2274766aa4699195b3fba3f9e4e8f0
while processing commit d184ed95817c5ddfd5874ea75e83e0df7e753c24.
fatal: Fetch failed.

Any ideas?


On Thu, Jul 15, 2010 at 3:42 PM, Meikel Brandmeyer  wrote:
> 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 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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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...
>
> Getting pack 9be7389ab68fea4a8309596c2916961599d2b06c
>  which contains 833f9f368d2274766aa4699195b3fba3f9e4e8f0
> error: Unable to get pack file
> http://github.com/clojure/clojure.git/objects/pack/pack-9be7389ab68fea4a8309596c2916961599d2b06c.pack
> transfer closed with 2113048 bytes remaining to read
> error: Unable to find 833f9f368d2274766aa4699195b3fba3f9e4e8f0 under
> http://github.com/clojure/clojure.git
> Cannot obtain needed object 833f9f368d2274766aa4699195b3fba3f9e4e8f0
> while processing commit d184ed95817c5ddfd5874ea75e83e0df7e753c24.
> fatal: Fetch failed.
>
> Any ideas?
>
>
> On Thu, Jul 15, 2010 at 3:42 PM, Meikel Brandmeyer  wrote:
>> 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 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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 get turned into PersistentArrayMaps?

I first discovered this behaviour on an early July build, but it is
the same in the 1.2 Beta

Any clues?

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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, it looks like Leiningen 1.1.0 has a bug where it prefers the
project's version of Clojure to its own version even for Leiningen's
JVM. This was fixed several months ago though, so if you use 1.2.0-RC2
you should be fine.

-Phil

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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.
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 can
> update the clock in 0.1 ms on all machines, the maximum throughput is
> 1/0.0001 = 10.000 transactions/second... no matter how many machines
> you throw at it. Even on a single machine the central clock can cause
> scalability problems (10/20M transactions/second and this will degrade
> when you throw more cores at it).
>
> This is one of the reasons I dropped the TL2 approach for Multiverse
> and switched over to the SkySTM model (with some magic of my own) that
> doesn't relied as much on a central mechanism.
>
> On Jul 11, 6:50 pm, scx  wrote:
>
>
>
> > hi --
>
> > i've seen paul standig's work with clojure +terracotta.  wondering if
> > anyone has continued his work?

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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" 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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 I didn't see any commits since June.

--
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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
> special cases)
>

Actually the previous example typechecks just fine with Typed Racket. Same
with something like

(apply + (filter number? '(1 foo "bar" 2)))

Exactly these kind of cases make Typed Rackets occurrence typing system
interesting ( www.ccs.neu.edu/*scheme*/pubs/popl08-thf.pdf for more
details). 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).


-- 
tomppa

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

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 Clojure is more dynamically used than Scheme.
But the Java interop orientation makes it more accessible to an interesting
type system than, say, Ruby, IMHO.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

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 information, even you call a function which spells out the
> structure then the records get turned into PersistentArrayMaps?
> 
> I first discovered this behaviour on an early July build, but it is
> the same in the 1.2 Beta
> 
> Any clues?
> 

I think I see the problem.

In the first case, the ~ (unquote) is causing the result of evaluating
the (company-fn) (which is a record) to be inserted at macro expansion
time. Since defrecord's implement IPersistentMap, it appears to get
converted to literal maps in the result of the macro expansion. Then,
when you *evaluate* the result of the macro expansion, the literal map
evaluates to itself and gets returned as a plain old map.

In the direct case (explicit-var), you're not inserting a record into
the macro expansion, but rather a form for constructing one, because
it's not unquoted. Then, when that is evaluated *after* macro expansion
time, it constructs the record instance. The key insight is that
(Company. ...) is not actually a "literal" record, it's a call to a
constructor, which like all function calls, is a list.

In essence, var-from-fn constructs the record (which is converted to a
map literal) at *macro expansion* time, while the second one constructs
the record at *evaluation* time. If you force evaluation of the
(Company. ... ) form at expansion time by unquoting it in explicit-var,
I imagine they will both return regular old maps via the same quirky
conversion behavior.

What I don't know is, is it meaningful for a macro to expand to
something that contains stuff that couldn't ever appear in the output
of the reader, like instances of user-defined types, or even Java
objects for that matter? What is the expected behavior here?

To me it seems like that the behavior it exhibits here is an
implementation artifact.

-Kyle

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 ; recursive call to fac, but reuses
> the stack; n will be (- n 1), and acc will be (* acc n)
>   (fac n 1))
> 
> Question: how would I go about writing idiomatic Clojure to return
> factorials of n, for large values of n. e.g. 1e6 or more? Preferably
> without having to create another function.

Well, an idiomatic refactoring of the above might be:

(defn factorial [n]
  (reduce * (range 1 (inc n)))

However, that won't be able to calculate 100! on my hardware, as
that has over five and a half billion digits, and I only have 4Gig of
ram. If you actually want to see the value - well, that's a lot of
paper. Or phosphor, or whatever. If you'll settle for an seeing an
approximation, this works:

(defn fact-approx
  "Approximate factorial values as strings representing floats. We output
   strings since we can build the string for output values to large to be 
   represented in floats. Works for n less than 10 billion."

  [n] (apply (fn [val exp]
   (let [valstr (str val)]
 (str (subs valstr 0 (min 6 (count valstr))) "E" exp)))
 (let [x (+ n n 1) ex 0.0]
   (if (> x 1)
 (let [t 
   (/ (- (+ (Math/log (* 2.0 Math/PI))
(* (Math/log (/ x 2.0)) x))
 x
 (/ (- 1.0 (/ 7.0 (* 30.0 x x))) (* 6.0 x)))
  2.0
  (Math/log 10))
   ex (int t)]
   [(Math/pow 10 (- t ex)), ex] )
 [x, 0]

It's not clear you'd call it idiomatic; I haven't seen enough
hard-core mathematical calculations to have a feel for what would be
considered idiomatic.

If you really need to work with accurate values of n! for these values
of n (and have the hardware to deal with them), googling for "fast
factorial" turns up some Java objects that might be of interest.

   http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 Leiningen itself until
> it's seen some more widespread use as a plugin, but it is definitely
> not off the table for the future.

It may be better to keep this as a plugin since it is more tightly
coupled to clojure.test. Leiningen is test package agnostic. As other
test frameworks emerge, different plugins can be created to use and
improve upon them.

> Another option is to use ANSI color codes to markup the text and
> display it in the terminal.

I have added some coloring (using clansi) to make the important bits
stand out. I am not sure that this is an improvement.

Thanks for the input.

Brenton



-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 and
clojure.test.tap).

You can find them at http://github.com/arohner/lein-daemon , and
http://github.com/arohner/lein-test-out , and clojars.

Allen

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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-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 and
> clojure.test.tap).
>
> You can find them athttp://github.com/arohner/lein-daemon, 
> andhttp://github.com/arohner/lein-test-out, and clojars.
>
> Allen

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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 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 I didn't see any commits since June.

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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


Paul

http://paul.stadig.name/ (blog)
703-634-9339 (mobile)
pjstadig (twitter)
p...@stadig.name (jabber)

On Thu, Jul 15, 2010 at 12:35 PM, scx  wrote:

> 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 can
> > update the clock in 0.1 ms on all machines, the maximum throughput is
> > 1/0.0001 = 10.000 transactions/second... no matter how many machines
> > you throw at it. Even on a single machine the central clock can cause
> > scalability problems (10/20M transactions/second and this will degrade
> > when you throw more cores at it).
> >
> > This is one of the reasons I dropped the TL2 approach for Multiverse
> > and switched over to the SkySTM model (with some magic of my own) that
> > doesn't relied as much on a central mechanism.
> >
> > On Jul 11, 6:50 pm, scx  wrote:
> >
> >
> >
> > > hi --
> >
> > > i've seen paul standig's work with clojure +terracotta.  wondering if
> > > anyone has continued his work?
>
> --
> 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

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 available to try for a while.  If only I had 47
hours per day I would be all over giving it a try.  If someone is
banging on it and needs help, I'm happy to connect you to the right
people or give you some pointers.

Also, Sergio is doing some awesome work with Terrastore and I'd highly
recommend giving it a shot if it fits your needs!

I'd really like to hear some detailed use cases for what you want out
of Clojure/Terracotta integration. Is it shared Clojure data? Locking?
Coordination? Caching? Remote code execution?

Alex



On Jul 15, 7:51 pm, Paul Stadig  wrote:
> If anyone is interested, the latest version of my terracotta TIM is 
> athttp://github.com/pjstadig/tim-clojure-1.0.0and 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 sends.
>
> Paul
> http://paul.stadig.name/(blog)
> 703-634-9339 (mobile)
> pjstadig (twitter)
> p...@stadig.name (jabber)
>
>
>
> On Thu, Jul 15, 2010 at 12:35 PM, scx  wrote:
> > 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 can
> > > update the clock in 0.1 ms on all machines, the maximum throughput is
> > > 1/0.0001 = 10.000 transactions/second... no matter how many machines
> > > you throw at it. Even on a single machine the central clock can cause
> > > scalability problems (10/20M transactions/second and this will degrade
> > > when you throw more cores at it).
>
> > > This is one of the reasons I dropped the TL2 approach for Multiverse
> > > and switched over to the SkySTM model (with some magic of my own) that
> > > doesn't relied as much on a central mechanism.
>
> > > On Jul 11, 6:50 pm, scx  wrote:
>
> > > > hi --
>
> > > > i've seen paul standig's work with clojure +terracotta.  wondering if
> > > > anyone has continued his work?
>
> > --
> > 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 to
> > clojure+unsubscr...@googlegroups.com > >
> > For more options, visit this group at
> >http://groups.google.com/group/clojure?hl=en

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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, not 
inheritance.

-Fred

--
Science answers questions; philosophy questions answers.

On Jul 15, 2010, at 5:23 PM, ntu...@googlemail.com wrote:

> 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 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 to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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
problem here?

> What I don't know is, is it meaningful for a macro to expand to
> something that contains stuff that couldn't ever appear in the output
> of the reader, like instances of user-defined types, or even Java
> objects for that matter? What is the expected behavior 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 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


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

Precisely; I think my first instinct would be that macros should
probably only expand to forms that look like regular Clojure source.

However there are situations where it is appropriate and indeed very
useful to unquote function calls in a macro. For example you may wish to
call some regular function that returns a data structure which you then
insert into the macro expansion. Personally I find this is actually
a very useful technique for writing macros: write a regular, private
function that does the "hard work" of transforming the source code data
structures without having to worry about macros' "abnormal" evaluation
rules, and then call that function from a much simpler macro, inserting
the result in the macro expansion using unquote.

However, I would think any data structure returned from a function used
in this way would still need to be something that can be interpreted as
Clojure source code: lists, vectors, maps, and sets containing symbols,
keywords, and so on. Any sort of user defined objects or Java objects,
*as far as I can tell*, don't make any sense in the result of a macro
expansion, but that is why I wrote this part:

> > What I don't know is, is it meaningful for a macro to expand to
> > something that contains stuff that couldn't ever appear in the
> > output of the reader, like instances of user-defined types, or even
> > Java objects for that matter? What is the expected behavior here?
> >

This was actually sort of an open question to the Clojure experts on the
mailing list, since I'm not actually sure about the answer. Should
this be done at all? Is it always an error (or at least bad style), or
should/could it be a meaningful operation in some cases? As I said, I
don't see any useful reason to do this, but maybe I just can't think of
one. I'd be interested to know what others think.

-Kyle

-- 
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 to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en