Re: Bug: recur won't work in tail position within cond

2008-12-05 Thread Ralf Bensmann
In Clojure the extra () around case and expr are skipped if no function call is made. Have a look at clojure.org/api -Ralf On Thu, Dec 4, 2008 at 5:54 AM, harrison clarke <[EMAIL PROTECTED]> wrote: > did cond change syntax? > > last i checked, it was > > (cond (case) (expr) > > (case) (e

PATCH: add overloaded (reader) and (writer) to clojure.contrib.duck-stream

2008-12-05 Thread walterc
i've added overloaded versions of reader and writer to clojure.contrib.duck-stream. they can now take an additional string argument named "encoding" so content can be read or written with the specified encoding instead of default encoding. the semantics of the original functions have not changed

Re: Improved Maven Build

2008-12-05 Thread ivant
I remember reading somewhere[1], that we can actually run ant from maven. It just occurred to me, that we can build the pom with groupId, artifactId and version, which actually uses ant for the build. This way the builds will be identical and we'll only have to update the version in the pom. I

clojure-contrib build fails; ant does not like "path" element for jar

2008-12-05 Thread Juergen Gmeiner
Maverick:~/site/clojure/clojure-contrib gj$ ant -Dclojure.jar=../ clojure/clojure.jar Buildfile: build.xml - boring stuff snipped jar: BUILD FAILED /Users/gj/site/clojure/clojure-contrib/build.xml:62: The type doesn't support the nested "path" element. Total time: 1 second This work

Re: clojure-contrib build fails; ant does not like "path" element for jar

2008-12-05 Thread Juergen Gmeiner
Or better even: I think I'll have some more coffe :) --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, se

Re: Clojure template library

2008-12-05 Thread Jeff Rose
Rich Hickey wrote: > > > On Dec 3, 1:04 pm, Jeff Rose <[EMAIL PROTECTED]> wrote: >> I've just pushed a template library for Clojure up onto github for >> public use. You can find it here: >> >> http://github.com/rosejn/clj-libs/tree/master >> >> This library is based loosely on erb from Ruby, w

Re: Atoms

2008-12-05 Thread bOR_
Are there any screencasts planned which will feature atoms? (I found that the screencasts are an excellent way of learning clojure). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: Clojure template library

2008-12-05 Thread blackdog
Hi Jeff, Don't forget that Velocity and Freemarker are also good candidates for server side templating and with clojure's java integration a snap to use, e.g. ... (defn genSyntaxHiLight [] (let [fmc (freeMarkerConfig) tmpl (. fmc getTemplate "clojure.ftl") map (clj-n

Re: Atoms

2008-12-05 Thread Parth Malwankar
On Dec 5, 6:02 am, Rich Hickey <[EMAIL PROTECTED]> wrote: > I've added a new reference type - atom. > > Docs here: > > http://clojure.org/atoms > > Feedback welcome, > > Rich Are the following equivalent or is one recommended over the other? The first (using atoms) is definitely more convenient

function args question

2008-12-05 Thread hitesh
I'm working on some opengl code in clojure and I want to specify a vertex. However, instead of passing in the three arguments it wants, I want to specify a single vector of 3 elements. How can I do this? Here's what it would normally look like (gl represents the current opengl drawing context o

Re: function args question

2008-12-05 Thread Meikel Brandmeyer
Hi, On 5 Dez., 03:28, hitesh <[EMAIL PROTECTED]> wrote: > (apply .glVertex3f gl point) In general this is exactly how apply is used. However .foo is special: "functions" starting with a dot are translated into method calls on the first argument. So (.glVertex3f gl x y z) translates is to (. gl g

Re: function args question

2008-12-05 Thread Jeff Rose
hitesh wrote: > I'm working on some opengl code in clojure and I want to specify a > vertex. However, instead of passing in the three arguments it wants, > I want to specify a single vector of 3 elements. How can I do this? > > Here's what it would normally look like (gl represents the current >

Re: Atoms

2008-12-05 Thread Rich Hickey
On Dec 5, 5:51 am, bOR_ <[EMAIL PROTECTED]> wrote: > Are there any screencasts planned which will feature atoms? (I found > that the screencasts are an excellent way of learning clojure). Screencasts are generally a side-effect of a speaking engagement. I imagine next time I give a talk, I'll t

Re: Adding boolean?

2008-12-05 Thread MikeM
Perhaps the reason to not include it is that the utility of the boolean? function is limited. Any value can be used where a clojure boolean is expected - any non-nil value is true and nil is false. --~--~-~--~~~---~--~~ You received this message because you are subs

Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Arie van Wingerden
Hi, I am learning Clojure by working thru Kent Dybvigs book in Scheme and Clojure at the same time. A nice way to discover the differences ;-) I wonder if the next definition is appropriate to test if something ia an atom (as Scheme sees it): (defn atom? [x] (not (coll? x))) Thx, Arie

Re: PATCH: add overloaded (reader) and (writer) to clojure.contrib.duck-stream

2008-12-05 Thread Rich Hickey
On Dec 5, 3:23 am, walterc <[EMAIL PROTECTED]> wrote: > i've added overloaded versions of reader and writer to > clojure.contrib.duck-stream. they can now take an additional string > argument named "encoding" so content can be read or written with the > specified encoding instead of default enc

Re: Atoms

2008-12-05 Thread Parth Malwankar
Thanks for taking to time for such a detailed explanation Rich. This makes things much clear. And thanks Chouser for the pictorial representation. Parth On Dec 5, 6:24 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Dec 5, 5:51 am, bOR_ <[EMAIL PROTECTED]> wrote: > > > Are there any screencasts

Re: clojure-contrib build fails; ant does not like "path" element for jar

2008-12-05 Thread Stefan Bodewig
On 2008-12-05, Juergen Gmeiner <[EMAIL PROTECTED]> wrote: > BUILD FAILED > /Users/gj/site/clojure/clojure-contrib/build.xml:62: The type > doesn't support the nested "path" element. That was added in Ant 1.7.0, released two years ago. Stefan --~--~-~--~~~---~--~---

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Mark McGranaghan
This is indeed the definition used in the clojure.contrib.pred library: http://github.com/kevinoneill/clojure-contrib/tree/master/src/clojure/contrib/pred.clj#L45 - Mark M. On Fri, Dec 5, 2008 at 8:07 AM, Arie van Wingerden <[EMAIL PROTECTED]> wrote: > Hi, > > I am learning Clojure by working th

Re: License of/permission for Clojure's logo

2008-12-05 Thread Tom Hickey
I don't think we ever really discussed the colors representing anything specific. I always vaguely thought of them as earth and sky. I'm really glad that people like the logo! Cheers, Tom http://tomhickey.com On Dec 4, 12:46 pm, "Howard Lewis Ship" <[EMAIL PROTECTED]> wrote: > +1 on the Logo.

Re: Atoms

2008-12-05 Thread Julian Morrison
It seems like a pure efficiency optimization - used alone it doesn't change semantics from dosync and alter over one ref. It makes me feel wary. What if I changed my design and wanted to do more in the same transaction? What if I later wanted to call a function that uses it in the scope of a wide

Re: Atoms

2008-12-05 Thread Rich Hickey
On Dec 5, 8:50 am, Julian Morrison <[EMAIL PROTECTED]> wrote: > It seems like a pure efficiency optimization - used alone it doesn't > change semantics from dosync and alter over one ref. > > It makes me feel wary. What if I changed my design and wanted to do > more in the same transaction? What

Re: Atoms

2008-12-05 Thread Rich Hickey
On Dec 5, 8:24 am, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Dec 5, 5:51 am, bOR_ <[EMAIL PROTECTED]> wrote: > > > Are there any screencasts planned which will feature atoms? (I found > > that the screencasts are an excellent way of learning clojure). > > Screencasts are generally a side-effec

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Stephen C. Gilardi
On Dec 5, 2008, at 8:50 AM, Mark McGranaghan wrote: > This is indeed the definition used in the clojure.contrib.pred > library: > http://github.com/kevinoneill/clojure-contrib/tree/master/src/clojure/contrib/pred.clj#L45 That's true. However, with Clojure now having a specific meaning for "

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Meikel Brandmeyer
Hi, On 5 Dez., 15:03, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > That's true. However, with Clojure now having a specific meaning for   > "atom" that's different from that of the larger Lisp world, I'm   > wondering if it would be a good idea to remove atom? from pred.clj. > > Feedback wel

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Rich Hickey
On Dec 5, 9:03 am, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > On Dec 5, 2008, at 8:50 AM, Mark McGranaghan wrote: > > > This is indeed the definition used in the clojure.contrib.pred > > library: > >http://github.com/kevinoneill/clojure-contrib/tree/master/src/clojure... > > That's true.

Re: Atoms

2008-12-05 Thread Randall R Schulz
On Friday 05 December 2008 05:24, Rich Hickey wrote: > On Dec 5, 5:51 am, bOR_ <[EMAIL PROTECTED]> wrote: > > Are there any screencasts planned which will feature atoms? (I > > found that the screencasts are an excellent way of learning > > clojure). > > Screencasts are generally a side-effect of

Re: (doc)strings after param in defn

2008-12-05 Thread Randall R Schulz
On Thursday 04 December 2008 23:23, Meikel Brandmeyer wrote: > Hi, > > On 5 Dez., 00:38, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > ... > ... > > > And am I mistaken in my reading of the API docs for (defmulti ...) > > and (defmethod ...) or is there no accommodation in either for > > doc-str

Re: function args question

2008-12-05 Thread Jeff Rose
hitesh wrote: > I'm working on some opengl code in clojure and I want to specify a > vertex. However, instead of passing in the three arguments it wants, > I want to specify a single vector of 3 elements. How can I do this? > > Here's what it would normally look like (gl represents the current >

Re: Atoms

2008-12-05 Thread Rich Hickey
On Dec 5, 9:09 am, Randall R Schulz <[EMAIL PROTECTED]> wrote: > On Friday 05 December 2008 05:24, Rich Hickey wrote: > > > On Dec 5, 5:51 am, bOR_ <[EMAIL PROTECTED]> wrote: > > > Are there any screencasts planned which will feature atoms? (I > > > found that the screencasts are an excellent wa

Re: Atoms

2008-12-05 Thread Randall R Schulz
On Friday 05 December 2008 06:33, Rich Hickey wrote: > On Dec 5, 9:09 am, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > ... > > > > Are you ever going to get out to the Silicon Valley area to give a > > talk? > > I hope to get a slot at Java One in SF this spring. Anything less pricey? Maybe y

Re: DISCUSS: replace (rand)

2008-12-05 Thread bOR_
On Dec 4, 9:07 am, "don.aman" <[EMAIL PROTECTED]> wrote: > Since we're being all high-level, it'd be good for a random function > which allows us to specify the range of numbers, since % doesn't > promise an even spread of probabilities (especially for large ranges). Not sure if I understand th

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Arie van Wingerden
Hi Mark, didn't know about that. But I'm glad it appears to be okay then. Arie 2008/12/5 Mark McGranaghan <[EMAIL PROTECTED]> > > This is indeed the definition used in the clojure.contrib.pred library: > > http://github.com/kevinoneill/clojure-contrib/tree/master/src/clojure/contrib/pred.clj#L4

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Arie van Wingerden
Hi Rich, right. But still I think Meikel has got a valid point that a function would need to be defined for that. I also wondered whether a kind of type? function would be appropriate. So (type? 3) would return integer etc. Arie 2008/12/5 Rich Hickey <[EMAIL PROTECTED]> > > > > On Dec 5, 9:03

Re: PATCH: Fix in-case macro from clojure.contrib fcase library

2008-12-05 Thread Stuart Sierra
Fixed. Thanks, -Stuart Sierra On Dec 5, 12:39 am, "Tchavdar Roussanov" <[EMAIL PROTECTED]> wrote: > The attached patch fixes the compile error when in-case macro is used in > different name space. The expanded code contains a private function from > clojure.contrib.fcase name space. > > --Tchavda

Re: Elegant but very slow

2008-12-05 Thread Stuart Sierra
On Dec 4, 7:09 pm, "Christian Vest Hansen" <[EMAIL PROTECTED]> wrote: > Ah, disregard that. I found the rules: > http://shootout.alioth.debian.org/u32q/benchmark.php?test=binarytrees&lang=all#about Yeah -- " this is an adaptation of a benchmark for testing GC so we are interested in the whole tre

Re: Atoms

2008-12-05 Thread Stuart Sierra
On Dec 4, 8:02 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > I've added a new reference type - atom. I like it; it greatly simplifies a common use for Refs. "Clojure. Sometimes you just need to mutate." "Clojure. Mutate safely." -Stuart Sierra --~--~-~--~~~---~--~-

reduction

2008-12-05 Thread Chouser
Google groups files section is having issues. Here's 'reduction' as discussed in IRC, mostly written by Rich. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Rich Hickey
On Dec 5, 9:07 am, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote: > Hi, > > On 5 Dez., 15:03, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote: > > > That's true. However, with Clojure now having a specific meaning for > > "atom" that's different from that of the larger Lisp world, I'm > > wondering

Re: Test wether something is an atom (as it is known in Scheme)

2008-12-05 Thread Rich Hickey
On Dec 5, 10:28 am, "Arie van Wingerden" <[EMAIL PROTECTED]> wrote: > Hi Rich, > > right. But still I think Meikel has got a valid point that a function would > need to be defined for that. > > I also wondered whether a kind of type? function would be appropriate. > So (type? 3) would return in

Re: Monadic Parsing

2008-12-05 Thread Randall R Schulz
On Wednesday 03 December 2008 15:13, jim wrote: > Continuing with the monad theme, I decided to implement monadic > parsing in Clojure. Erik Meijer and Graham Hutton published a paper > called "Monadic Parsing in Haskell" and I implemented the examples > from that paper in Clojure. The code is a

Re: Adding boolean?

2008-12-05 Thread Tom Emerson
On Fri, Dec 5, 2008 at 8:25 AM, MikeM <[EMAIL PROTECTED]> wrote: > Perhaps the reason to not include it is that the utility of the > boolean? function is limited. Any value can be used where a clojure > boolean is expected - any non-nil value is true and nil is false. But this isn't about looking

Re: reduction

2008-12-05 Thread Rich Hickey
On Dec 5, 10:50 am, Chouser <[EMAIL PROTECTED]> wrote: > Google groups files section is having issues. > Here's 'reduction' as discussed in IRC, mostly written by Rich. > Attachments are preferred - thanks! Rich --~--~-~--~~~---~--~~ You received this message b

Re: Atoms

2008-12-05 Thread Stuart Sierra
On Dec 4, 8:02 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > I've added a new reference type - atom. > Feedback welcome, A request, if it's possible: allow watchers to be set on atoms and refs in addition to agents. I'd like to experiment with "reactive" programming using the different transactio

Mutual definitions (exercise 2.8.6 in Kent Dybvigs book TSPL)

2008-12-05 Thread Arie van Wingerden
Hi, I tried to use definitions which call each other, like so: (defn is-odd? [n] (if (= n 0) false (is-even? (- n 1 (defn is-even? [n] (if (= n 0) true (is-odd? (- n 1 but obviously Clojure rejects this, saying: Exception in thread

Re: Atoms

2008-12-05 Thread Rich Hickey
On Fri, Dec 5, 2008 at 11:01 AM, Stuart Sierra <[EMAIL PROTECTED]>wrote: > > On Dec 4, 8:02 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > > I've added a new reference type - atom. > > Feedback welcome, > > A request, if it's possible: allow watchers to be set on atoms and > refs in addition to agen

Re: reduction

2008-12-05 Thread Randall R Schulz
On Friday 05 December 2008 08:00, Rich Hickey wrote: > On Dec 5, 10:50 am, Chouser <[EMAIL PROTECTED]> wrote: > > Google groups files section is having issues. > > Here's 'reduction' as discussed in IRC, mostly written by Rich. > > Attachments are preferred - thanks! It came through as an attachm

Re: Mutual definitions (exercise 2.8.6 in Kent Dybvigs book TSPL)

2008-12-05 Thread Randall R Schulz
On Friday 05 December 2008 08:07, Arie van Wingerden wrote: > Hi, > > I tried to use definitions which call each other, like so: > > (defn is-odd? [n] > (if (= n 0) > false > (is-even? (- n 1 > > (defn is-even? [n] > (if (= n 0) > true > (is-

Re: Mutual definitions (exercise 2.8.6 in Kent Dybvigs book TSPL)

2008-12-05 Thread Arie van Wingerden
Hi Randall, yes, I am very aware that it is not an efficient solution ;-) It is only an exercise just to make (Scheme) students aware of the possibilities of mutual definitions. The assignment in Kent's book reads: ;;; Exercise 2.8.6. ;;; All of the recursive procedures shown so far have been dir

Re: Mutual definitions (exercise 2.8.6 in Kent Dybvigs book TSPL)

2008-12-05 Thread Stuart Sierra
On Dec 5, 11:17 am, Randall R Schulz <[EMAIL PROTECTED]> wrote: > You can (def is-even?) before your (defn is-odd? ...), which will allow > it to compile. The recently-added "declare" is for just this purpose: (declare is-even?) -Stuart Sierra --~--~-~--~~~---~--~

Re: PATCH: add overloaded (reader) and (writer) to clojure.contrib.duck-stream

2008-12-05 Thread walterc
will do On Dec 5, 9:33 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Dec 5, 3:23 am, walterc <[EMAIL PROTECTED]> wrote: > > > i've added overloaded versions of reader and writer to > > clojure.contrib.duck-stream.  they can now take an additional string > > argument named "encoding" so content

Re: reduction

2008-12-05 Thread Chouser
On Fri, Dec 5, 2008 at 10:50 AM, Chouser <[EMAIL PROTECTED]> wrote: > Google groups files section is having issues. > Here's 'reduction' as discussed in IRC, mostly written by Rich. I messed it up anyway -- tried to use if-let too early. Try this patch instead. --Chouser --~--~-~--~~

Another build.xml patch for contrib (was: Re: clojure-contrib build fails; ant does not like "path" element for jar)

2008-12-05 Thread Meikel Brandmeyer
Hi, Am 05.12.2008 um 14:40 schrieb Stefan Bodewig: BUILD FAILED /Users/gj/site/clojure/clojure-contrib/build.xml:62: The type doesn't support the nested "path" element. That was added in Ant 1.7.0, released two years ago. Hmmm... For me the path element works and I have an ant 1.7.0... Any

Re: A try on condp (was: Re: proposal: match multimethod)

2008-12-05 Thread Meikel Brandmeyer
Hi, Am 04.12.2008 um 10:44 schrieb Meikel Brandmeyer: I almost whipped this up yesterday, but I got sidetracked thinking about how best to provide a feature like Scheme's cond's =>. Do you know it? It feeds the value of the test to the fn on the rhs of the clause. It can be useful. It seems my

Re: Mutual definitions (exercise 2.8.6 in Kent Dybvigs book TSPL)

2008-12-05 Thread Arie van Wingerden
Ah, yes! That's defenitely more elegant. Thx, Arie 2008/12/5 Stuart Sierra <[EMAIL PROTECTED]> > > On Dec 5, 11:17 am, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > You can (def is-even?) before your (defn is-odd? ...), which will allow > > it to compile. > > The recently-added "declare" is

conj-when

2008-12-05 Thread [EMAIL PROTECTED]
I think this is pretty useful, but I'm a noob and don't know better :) I found myself trying to use atoms and refs to start with rather than taking a functional approach, maybe something like this is good in the standard lib to emphasize a functional approach? Or maybe it exists and I don't know i

Re: Improved Maven Build

2008-12-05 Thread Howard Lewis Ship
I think the best solution is to use Ant to build, but: - Include a pom.xml - Build binary and source artifacts - Use the Maven Ant Tasks to deploy the artifacts to a local (for snapshots) or remove (for final builds) repository Also, I think if the Java code was published, along with Javadoc, we

unsupported binding form for cond-let

2008-12-05 Thread Brian Doyle
I started to play with cond-let in the contrib.cond package and got an unexpected error: user=> (cond-let [x (zero? 0)] (println "hello world")) java.lang.Exception: Unsupported binding form: (zero? 0) (NO_SOURCE_FILE:11) user=> (cond-let x (zero? 0) (println "hello world")) hello world Maybe it

Re: Running out of memory when using filter?

2008-12-05 Thread Paul Mooser
I'm continuing to try to suss this out, so I decided to run with a memory profiler. I'm seeing tens of thousands of lazy conses accounting for hundreds of megabytes of memory, which perhaps implies I'm holding on to a reference to them somewhere, but I just don't see how, since as I showed above,

Re: Erlang vs Clojure

2008-12-05 Thread Jeremy Dunck
On Oct 17, 6:01 pm, Luc Prefontaine <[EMAIL PROTECTED]> wrote: > I am not very far from tackling this issue. In our bus messaging system, > we are using Terracotta with some Java components > and it's a matter of weeks before we start to investigate how we can > bridge Clojure and Terracotta. >

Re: unsupported binding form for cond-let

2008-12-05 Thread Stephen C. Gilardi
On Dec 5, 2008, at 1:33 PM, Brian Doyle wrote: > I started to play with cond-let in the contrib.cond package and got an > unexpected error: > > user=> (cond-let [x (zero? 0)] (println "hello world")) > java.lang.Exception: Unsupported binding form: (zero? 0) > (NO_SOURCE_FILE:11) I updated co

Re: Running out of memory when using filter?

2008-12-05 Thread Paul Mooser
My operating theory was that the anonymous function being used by filter was closing over both parameters to the enclosing function, but making a simple modification to avoid that didn't seem to address the problem. --~--~-~--~~~---~--~~ You received this message be

Re: Erlang vs Clojure

2008-12-05 Thread Luc Prefontaine
We just started to look at the issue. Got late in the user acceptance tests because of the radiology equipment supplier is dragging it's feet. I feel we will start before Xmas to put together a prototype. I really want this to come to life because we could use cooperative Clojure instances on our

Re: Atoms

2008-12-05 Thread Mark Engelberg
So, earlier, I asked how atoms differ from using commute on refs. It sounds like the answer is that if you use atoms in a larger transaction, then as soon as the atom set is encountered, it actually changes instantly, so if you rollback, and do the transaction again, it's already been set, and wi

New Tracing Library

2008-12-05 Thread Craig McDaniel
I'd like to submit a new tracing library to clojure.contrib. Please try it out and let me know if it is suitable. The existing clojure.contrib.trace macros allow you to explicitly trace any expression or redefine a function with deftrace so that it is traced. But deftrace doesn't work with functi

Re: New Tracing Library

2008-12-05 Thread Craig McDaniel
Correction: http://paste.lisp.org/display/71656 --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send emai

Propose retiring clojure.contrib.pred

2008-12-05 Thread Stephen C. Gilardi
The most useful predicates that were once defined in clojure.contrib.pred are now defined in clojure.core. It's currently only a shadow of its former self and should perhaps be retired. Is anyone relying on what remains in clojure.contrib.pred? Is there any objection to me deleting it from cl

Re: Running out of memory when using filter?

2008-12-05 Thread Paul Mooser
The memory profiler says that the following object is a GC root which is holding onto the collection being passed into the filter call: clojure.core$filter__3364$fn__3367 I'm not familiar enough with clojure's internals to speculate about what that means, beyond what I've already mentioned previ

My Clojure Emacs Setup (I'll show mine if you show yours)

2008-12-05 Thread bc
My setup is here: http://bc.tech.coop/blog/081205.html What does your Clojure Emacs setup look like? -- Bill Clementson --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em

Re: DISCUSS: replace (rand)

2008-12-05 Thread Mark H.
On Dec 4, 12:07 am, "don.aman" <[EMAIL PROTECTED]> wrote: > Since we're being all high-level, it'd be good for a random function > which allows us to specify the range of numbers, since % doesn't > promise an even spread of probabilities (especially for large ranges). Sure it does, as long as you

Re: Another build.xml patch for contrib

2008-12-05 Thread Stephen C. Gilardi
On Dec 5, 2008, at 12:41 PM, Meikel Brandmeyer wrote: > Anyway I added the local.properties file as suggested and also > changed the path to fileset for the issue above. It seems, that > in classpath should also contain pathelements instead paths. > So I changes this also. > > I'm not an ant guru

Re: clojure.contrib.repl-ln available

2008-12-05 Thread Stephen C. Gilardi
On Dec 3, 2008, at 11:39 AM, Randall R Schulz wrote: > Perhaps Steve would consider applying them to making his fancy REPL > more > robust for terminal users? I like the idea. If someone would like to work out the basics and post some example code, I'll be happy to try to get it running in r

Zipper & Local Context?

2008-12-05 Thread Randall R Schulz
Hi, I looked at the Clojure implementation of Huet's Zipper and it looks great. I like how it delegates construction and dissection of the tree structure to client-supplied functions so that it is generic w.r.t. to any types (especially for me, pre-existing, non-Clojure Java types) that can b

Re: Which paper discusses Henry Baker's (sp?) egal?

2008-12-05 Thread Jeremy Dunck
On Nov 21, 11:36 am, Brett Hoerner <[EMAIL PROTECTED]> wrote: > I've watched a lot of Clojure videos now, and keep hearing Rich > mention "Henry Baker's egal".  Does someone have the actual paper > title where Baker talks about this?  I have an ACM subscription (and > assume that's where I'd fin

Re: Which paper discusses Henry Baker's (sp?) egal?

2008-12-05 Thread Jeremy Dunck
On Nov 25, 4:16 am, "Alexander Kjeldaas" <[EMAIL PROTECTED]> wrote: > Which video does he mention this? I've been on the lookout for references to > egal in new languages, so this might be a nice clojure surprise! > Alexander Around 40 minutes into this video, for one: http://blip.tv/file/982823

Re: clojure.contrib.repl-ln available

2008-12-05 Thread Randall R Schulz
Steve, On Friday 05 December 2008 14:45, Stephen C. Gilardi wrote: > On Dec 3, 2008, at 11:39 AM, Randall R Schulz wrote: > > Perhaps Steve would consider applying them to making his fancy REPL > > more > > robust for terminal users? > > I like the idea. If someone would like to work out the basi

Re: clojure.contrib.repl-ln available

2008-12-05 Thread Randall R Schulz
On Friday 05 December 2008 14:57, Randall R Schulz wrote: > Steve, > > On Friday 05 December 2008 14:45, Stephen C. Gilardi wrote: > > On Dec 3, 2008, at 11:39 AM, Randall R Schulz wrote: > > > Perhaps Steve would consider applying them to making his fancy > > > REPL more > > > robust for terminal

Nested Java Types

2008-12-05 Thread Randall R Schulz
Hi, I make pretty extensive use of nested classes (most significantly Enum types). I was wondering if it might be a good idea to allow "dot" resolution to find such types. E.g.: user=> tau.run.TSEvent.TSEKind java.lang.ClassNotFoundException: tau.run.TSEvent.TSEKind (repl-1:7) user=> tau.run

Re: Atoms

2008-12-05 Thread Chouser
On Fri, Dec 5, 2008 at 11:07 AM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > I'm working on that. It has utility even outside traditional reactive > contexts, in moving the imperative part of your logic outside of your state > transformation function. I think it's a good model. > > Chouser recentl

Re: My Clojure Emacs Setup (I'll show mine if you show yours)

2008-12-05 Thread Mon Key
Nice blog entry :) My setup tends to mirror yours esp. as I've culled most of it from your blog over the years... Most of my startup scripts are modified versions of those you've shared elsewhere. I don't segment it out quite so much as it makes for transporting directory trees difficult, and my

Re: reduction

2008-12-05 Thread Chouser
Third time's charm? The previous versions of 'reduction' returned nil for empty collection when no init was given. This version follows 'reduce' more closely, calling the given function with no arguments: user=> (reduction + []) (0) --Chouser --~--~-~--~~~---~--~---

Re: Running out of memory when using filter?

2008-12-05 Thread Stuart Sierra
On Dec 5, 4:59 pm, Paul Mooser <[EMAIL PROTECTED]> wrote: > The memory profiler says that the following object is a GC root which > is holding onto the collection being passed into the filter call: > > clojure.core$filter__3364$fn__3367 That class should be the instance of the anonymous fn you d

Re: function args question

2008-12-05 Thread hitesh
Meikel & Jeff, Thank you. That really helped me get over the current hump. But as I encounter more, I'm realizing I need to learn a lot more about the Java interop. Thanks, - Hitesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: reduction

2008-12-05 Thread Chouser
On Fri, Dec 5, 2008 at 9:55 PM, Chouser <[EMAIL PROTECTED]> wrote: > Third time's charm? Apparently not. Previous versions had a couple problems. One was that when when no init was provided, the first element of the collection was not emitted by itself. This is inconsistent with Haskell's scan

Re: reduction

2008-12-05 Thread Chouser
How about this one? Same results as in my previous post. Still as lazy as possible. Plus it's so cute! (defn reduction "Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init." ([f coll] (if (seq coll) (lazy-cons (first coll

Re: Zipper & Local Context?

2008-12-05 Thread Nathan Kitchen
Could you achieve this through a combination of clojure.zip/node and get-in/assoc-in/update-in? Of course the missing piece is going back from nodes to locs. -- Nathan On Dec 5, 2:54 pm, Randall R Schulz <[EMAIL PROTECTED]> wrote: > Hi, > > I looked at the Clojure implementation of Huet's Zipper