Re: newbie troubles with new lazy-seq hotness (OutOfMemory)

2009-02-23 Thread bsmith.occs
On Feb 23, 11:46 pm, Jeffrey Straszheim wrote: > Have you figured this out yet? > > On Mon, Feb 23, 2009 at 4:58 PM, Jeffrey Straszheim < > > straszheimjeff...@gmail.com> wrote: > > The identifier "fibl" is holding on to the head of the sequence. Yes, this works: (defn fibl [] ((fn h [a b]

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Laurent PETIT
Hello, What about giving back 'lazy-cons (or lcons as a shortcut), with the optional possibility to give the cons an internal name ? This could allow for self-recursive definition, such as this one for a fibonacci generator function as : user=>(defn fib-fn [] (lcons [fib] 1 (lcons 1 (map + fib (re

Re: Directed Graphs for Contrib

2009-02-23 Thread Jeffrey Straszheim
I did make one important update. The nodes no longer need to be integers. You can build a graph of nodes and adjacency lists without the pain of mapping to indexes. Also, the "adjacency lists" can be a provided map, or any function from node->neighbors. (The fact that Clojure maps are functions

Re: test-is integration via SLIME

2009-02-23 Thread Michel Salim
On Wed, Feb 18, 2009 at 7:07 PM, Phil Hagelberg wrote: > I've been cooking up a little tool to help with running tests using > test-is. It's a little cumbersome to need to switch back and forth > between the test buffer and the repl to see the test results, so I've > created an Emacs mode that ac

Re: Where to put fixed-point?

2009-02-23 Thread Michel Salim
On Mon, Feb 23, 2009 at 11:06 PM, Jeffrey Straszheim wrote: > For my graph code in contrib, I've created a function fixed-point.  It is, I > believe, generally useful.  However, it is not properly a "graph" function > per se, and might belong elsewhere in the library. > > Does anyone have a bette

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Michel Salim
On Mon, Feb 23, 2009 at 10:26 PM, Raffael Cavallaro wrote: > > > > On Feb 23, 9:31 pm, Jeffrey Straszheim > wrote: >> The speed of the JVM's big ints, and therefore Clojure's, doesn't seem to be >> competitive. > > Clearly the JVM's big ints doesn't compare favorably with GMP. On the > other han

Where to put fixed-point?

2009-02-23 Thread Jeffrey Straszheim
For my graph code in contrib, I've created a function fixed-point. It is, I believe, generally useful. However, it is not properly a "graph" function per se, and might belong elsewhere in the library. Does anyone have a better suggestion of a file in contrib to put a fixed-point function? --~--

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Raffael Cavallaro
On Feb 23, 9:31 pm, Jeffrey Straszheim wrote: > The speed of the JVM's big ints, and therefore Clojure's, doesn't seem to be > competitive. Clearly the JVM's big ints doesn't compare favorably with GMP. On the other hand, Clojure falls near the middle of the range of the various lisps and sche

Re: :use feature requests

2009-02-23 Thread wlr
On Feb 23, 2:59 pm, Chouser wrote: > On Mon, Feb 23, 2009 at 2:33 PM, Stephen C. Gilardi wrote: > > How about this as an alternative in the same spirit as your proposal: > > >        - change the name of :require to :use -- :use with no options changes > > from an implicit "refer all" to an impl

Re: Would people be interested in extending test-is with random tests?

2009-02-23 Thread Michel S.
Hi James, Stuart: I started Quiche after taking a look at Fact, actually; the difference between what I'm proposing and Fact is that the latter is a standalone test framework, whereas the random-testing part of Quiche (property) and Fact (fact) could, IMHO, be built on top of test-is. I've not s

Re: Directed Graphs for Contrib

2009-02-23 Thread Jeffrey Straszheim
It would be easy to convert from your form to adjacency lists, so if you want it write a converter :) I think we should keep the algorithms *basically* efficient. I don't see that as premature optimization at all. On Mon, Feb 23, 2009 at 9:37 PM, Eric wrote: > > > > On Feb 23, 6:38 pm, Jeffrey

Re: Directed Graphs for Contrib

2009-02-23 Thread Eric
On Feb 23, 6:38 pm, Jeffrey Straszheim wrote: > Well, right now I'm just handling directed graphs, and basically treating > nodes as integer indexes, with a simple formula from index to adjacency list > of nodes. > I would actually like to see an implementation that more closely resembles the

Re: Clojure & Slime, how to jump to a def/defn?

2009-02-23 Thread David Nolen
You're right, works perfectly on clojure sources, but not the instances you've described. It would be great if this would work again. I don't understand swank/slime well enough to try it myself. On Mon, Feb 23, 2009 at 9:23 PM, Alec Berryman wrote: > > David Nolen on 2009-02-23 16:58:40 -0500: >

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Jeffrey Straszheim
The speed of the JVM's big ints, and therefore Clojure's, doesn't seem to be competitive. On Mon, Feb 23, 2009 at 5:46 PM, Raffael Cavallaro < raffaelcavall...@gmail.com> wrote: > > > > On Feb 23, 2:51 pm, "Stephen C. Gilardi" wrote: > > > The fibs implementation in clojure.contrib.lazy-seqs is

Re: Operating on multidimensional primitive arrays without reflection?

2009-02-23 Thread Jason Wolfe
Sweet, thanks! I forgot that you could extract sub-arrays like that in Java. Maybe aset-* could be changed to incorporate this trick? -Jason On Feb 23, 2009, at 6:22 PM, David Nolen wrote: > (time (let [arr (make-array Float/TYPE 1 1)] > (dotimes [_ 10] > (let [#^floats su

Re: Clojure & Slime, how to jump to a def/defn?

2009-02-23 Thread Alec Berryman
David Nolen on 2009-02-23 16:58:40 -0500: > Is this supported yet? M-. is supposed to handle this, but I get an error > when I try. It works for me with Clojure sources (for example, M-. on rest), even if they're in jars, but not with applications I've compiled through load-file, slime-compile-d

Re: Operating on multidimensional primitive arrays without reflection?

2009-02-23 Thread David Nolen
(time (let [arr (make-array Float/TYPE 1 1)] (dotimes [_ 10] (let [#^floats sub-arr (aget arr 0)] (aset-float sub-arr 0 0.0) Seems to work? Looks an eligible candidate for a macro. On Mon, Feb 23, 2009 at 9:04 PM, Jason Wolfe wrote: > > I'm trying to call some third-party code th

Re: Would people be interested in extending test-is with random tests?

2009-02-23 Thread Stuart Sierra
Hi Michel, I find that when I want to use randomness in tests, I just create a random value and use it. I've never felt a compelling need for special test-related syntax for random values. The "property" syntax is shorter, but I tend to think it's only useful in testing very mathematical code w

Operating on multidimensional primitive arrays without reflection?

2009-02-23 Thread Jason Wolfe
I'm trying to call some third-party code that expects a two- dimensional double array, and I can't figure out how to create and fill this in Clojure without a huge perf hit (which profiling shows to be coming from reflection): user> (time (let [arr (make-array Double/TYPE 1)] (dotimes [_ 10]

Re: Directed Graphs for Contrib

2009-02-23 Thread Jeffrey Straszheim
Well, right now I'm just handling directed graphs, and basically treating nodes as integer indexes, with a simple formula from index to adjacency list of nodes. I'm not opposed to a more elaborate implementation. Patch welcome :) On Mon, Feb 23, 2009 at 7:33 PM, Jeff Rose wrote: > > Jeffrey St

Clojure-Contrib: Maven/Continous Integration

2009-02-23 Thread Howard Lewis Ship
I've added a patch for clojure-contrib so that the clojure-contrib module can build post-checkin, and nightly. I'd really like to see it taken, so I can set up continuous integration on tapestry.formos.com. Basically, we'll be able to have clojure-contrib build after any change to clojure-contrib

Re: Directed Graphs for Contrib

2009-02-23 Thread Jeff Rose
Jeffrey Straszheim wrote: > As part of my Datalog work I'm putting together some directed graph > algorithms, mostly things like finding strongly connected components, > and building dependency stratifications (think topological sort but with > the results groups in tiers of non-interdependent

Re: Would people be interested in extending test-is with random tests?

2009-02-23 Thread Vincent Foley
I'm definitely interested. There is Fact that does this already as well as ClojureCheck (http://bitbucket.org/kotarak/clojurecheck/ overview/). I think you should try to contact James and Meikel and see if it would be a good idea to join forces. I don't mind multiple libraries that do the same

Re: transactions and retries

2009-02-23 Thread Rich Hickey
On Feb 23, 2009, at 4:47 PM, Mark Volkmann wrote: > > On Mon, Feb 23, 2009 at 3:19 PM, Rich Hickey > wrote >> >> On Feb 23, 2009, at 3:44 PM, Mark Volkmann wrote: >> >>> On Mon, Feb 23, 2009 at 2:31 PM, Dan wrote: > If I understand correctly, when there is an attempt to modify a >

environment when calling clojure from Java

2009-02-23 Thread Thom
I'm new to clojure, and I'm trying to figure out how to integrate it into a somewhat large Java codebase. At a particular point the the program's execution, I'd like to spin up a thread with a swank server on it, but the following code doesn't seem to work. Can I get a pointer from the experienced

Re: :use feature requests

2009-02-23 Thread Cosmin Stejerean
On Mon, Feb 23, 2009 at 3:52 PM, Perry Trolard wrote: > > +1 from me, too. > > As to an :all shortcut that's synonymous with :exclude (), I think > convenience at the REPL is a good argument for :all. (I'm assuming > that the `require` macro would disappear, too.) > > For Cosmin's thought (:as mu

Would people be interested in extending test-is with random tests?

2009-02-23 Thread Michel Salim
I recently wrote a test framework for Scheme, initially similar to what test-is provides; recently, it has been extended to add random checks akin to Haskell's QuickCheck. The syntax is very similar (I have not bothered defining a 'deftest' form, but that is trivial): (define a-test (test a-test

Re: newbie troubles with new lazy-seq hotness (OutOfMemory)

2009-02-23 Thread Jeffrey Straszheim
Have you figured this out yet? On Mon, Feb 23, 2009 at 4:58 PM, Jeffrey Straszheim < straszheimjeff...@gmail.com> wrote: > The identifier "fibl" is holding on to the head of the sequence. > > > On Mon, Feb 23, 2009 at 4:04 PM, bsmith.occs wrote: > >> >> ;; >> -

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Raffael Cavallaro
On Feb 23, 2:51 pm, "Stephen C. Gilardi" wrote: > The fibs implementation in clojure.contrib.lazy-seqs is not a function   > that returns fib(n) given n. > I think defining a fib(n) function somewhere in contrib or core that   > operates as efficiently as we can manage would be a good idea.

Re: alternate syntax

2009-02-23 Thread Michel Salim
On Mon, Feb 23, 2009 at 10:42 AM, Mark Volkmann wrote: > > I have an idea I'd like to float to see if there are reasons why it's > a bad idea. > > What if Clojure had an alternate "surface" syntax that was translated > into standard Clojure syntax by a kind of preprocessor? > > Many people that d

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Stuart Halloway
Beautiful-thanks. > Using a good old sequence of vectors: > (defn fibo [] > (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1]))) > > Christophe > > Stuart Halloway a écrit : >> I have updated the sample source from the book >> (http://tinyurl.com/clojure-samples >> ) to the new laziness. Along

Re: How to get rid of reflection warning from countdown latch?

2009-02-23 Thread Michel Salim
On Mon, Feb 23, 2009 at 12:20 PM, Anand Patil wrote: > > Hi all, > > I'm getting > > Reflection warning, line: 150 - reference to field countDown can't be > resolved. > > from > >(if cell-updated? >(if (not (:updating @cell)) >(.countDown latch > > Is there any way to

Re: alternate syntax

2009-02-23 Thread Rayne
On Feb 23, 12:01 pm, Laurent PETIT wrote: > I know also of gorilla (vim plugin), and certainly emacs (not sure about > enclojure, though) that offer parens colorizing (also named rainbow parens). Enclojure doesn't, yet at least. --~--~-~--~~~---~--~~ You receive

Clojure & Slime, how to jump to a def/defn?

2009-02-23 Thread David Nolen
Is this supported yet? M-. is supposed to handle this, but I get an error when I try. David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.co

Re: newbie troubles with new lazy-seq hotness (OutOfMemory)

2009-02-23 Thread Jeffrey Straszheim
The identifier "fibl" is holding on to the head of the sequence. On Mon, Feb 23, 2009 at 4:04 PM, bsmith.occs wrote: > > ;; > - > ;; using clojure.jar from source r1301 > ;; > ;; I'm new to clojure and working from B7.0 of Prog

pretty printing code

2009-02-23 Thread Mark Volkmann
I recall several people discussing creation of pretty printers for Clojure code on this mailing list. Are any of them in a usable state? I'm looking for one that can be invoked on a file from a terminal window, not one that is part of an editor/IDE plugin. -- R. Mark Volkmann Object Computing, I

Re: :use feature requests

2009-02-23 Thread Perry Trolard
+1 from me, too. As to an :all shortcut that's synonymous with :exclude (), I think convenience at the REPL is a good argument for :all. (I'm assuming that the `require` macro would disappear, too.) For Cosmin's thought (:as mutually exclusive with :exclude, :only, & :rename), it does seem to me

Re: transactions and retries

2009-02-23 Thread Mark Volkmann
On Mon, Feb 23, 2009 at 3:19 PM, Rich Hickey wrote > > On Feb 23, 2009, at 3:44 PM, Mark Volkmann wrote: > >> On Mon, Feb 23, 2009 at 2:31 PM, Dan wrote: If I understand correctly, when there is an attempt to modify a Ref that has been modified in another thread since the current

Re: alternate syntax

2009-02-23 Thread Fogus
> Removing parens doesn't solve the problem with (+ 1 2). For writing out math > formulas a macro that allows infix notation would be useful (and I'm pretty > sure I've seen at least one). A long time ago I worked for a company that for reasons I will not go into now, wanted to distribute a modif

newbie troubles with new lazy-seq hotness (OutOfMemory)

2009-02-23 Thread bsmith.occs
;; - ;; using clojure.jar from source r1301 ;; ;; I'm new to clojure and working from B7.0 of Programming Clojure. ;; This version still uses lazy-cons. Nevertheless I'm trying to grok lazy-seq ;; as described here: http://cloju

Re: transactions and retries

2009-02-23 Thread Rich Hickey
On Feb 23, 2009, at 3:44 PM, Mark Volkmann wrote: > > On Mon, Feb 23, 2009 at 2:31 PM, Dan wrote: >>> If I understand correctly, when there is an attempt to modify a Ref >>> that has been modified in another thread since the current >>> transaction >>> began then the current transaction will

Re: Macro madness

2009-02-23 Thread Telman Yusupov
Try this syntax: ~'link Cheers, Telman On Feb 23, 3:25 pm, max3000 wrote: > Hi, > > I'm new to lisp and clojure, so what follows may be a very easy (i.e. > stupid) question... > > I want a macro to generate multi-methods. Here is the macro I crafted: > > (defmacro mcf [type class set-expr & fo

Re: Macro madness

2009-02-23 Thread Jason Wolfe
Check out the part of this page on "syntax quote" http://clojure.org/reader As I understand it, syntax-quote namespace-resolves symbols to prevent accidental variable capture. 90% of the time, any variables you let within a macro should be suffixed by a "#". So, if you replace all occurrences

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread chris
As the sequence is very cheap to calculate it is difficult to see the benefit of keeping it in memory under any circumstances. I would replace the one in contrib with Christophe's short, easy to understand implementation. Caching values isn't getting you anywhere; just wasting resources. Chris

Re: alternate syntax

2009-02-23 Thread Cosmin Stejerean
On Mon, Feb 23, 2009 at 2:38 PM, Dan wrote: [...] The problem is (+ 1 2) which is unlike how you normally do maths > > Removing parens doesn't solve the problem with (+ 1 2). For writing out math formulas a macro that allows infix notation would be useful (and I'm pretty sure I've seen at least

Re: alternate syntax

2009-02-23 Thread Joshua Fox
It's a good idea. Not for anyone to actually use, but as an demonstration of "code is data," and of the separation of surface syntax from the code data-structure. Can you do this without reader macros? Can you keep it homoiconic? (Apparently so, given the transformation rules, but I wonder if there

Re: alternate syntax

2009-02-23 Thread Stuart Sierra
On Feb 23, 10:42 am, Mark Volkmann wrote: > What if Clojure had an alternate "surface" syntax that was translated > into standard Clojure syntax by a kind of preprocessor? > > Many people that don't like Lisp dialects don't like them because of > the parentheses. I'm trying to address that. Heh

Re: :use feature requests

2009-02-23 Thread Cosmin Stejerean
On Mon, Feb 23, 2009 at 2:29 PM, James Reeves wrote: > > On Feb 23, 6:54 pm, Chouser wrote: > > (ns n01se.net.graph.issues > > (:import (java.text SimpleDateFormat ParsePosition) > >(java.util GregorianCalendar Calendar) > >(org.jfree.chart ChartFrame)) > > (:use [cloj

Re: transactions and retries

2009-02-23 Thread Mark Volkmann
On Mon, Feb 23, 2009 at 2:31 PM, Dan wrote: >> If I understand correctly, when there is an attempt to modify a Ref >> that has been modified in another thread since the current transaction >> began then the current transaction will retry immediately. Isn't it >> true that it has no chance of comp

Re: *features*-var

2009-02-23 Thread Stuart Sierra
I've always thought *features* was a nuisance in CL, since very few values were ever standardized. It ends up being used like browser- sniffing code in JavaScript. -Stuart Sierra On Feb 23, 12:16 pm, pmf wrote: > Some (most, if not all) CL variants have a *features*-var available > that contain

Re: alternate syntax

2009-02-23 Thread Tom Ayerst
http://xkcd.com/297/ 'nuff said ;-) Tom 2009/2/23 Vincent Foley > > I'm opposed to this idea. I don't think we should pander to the > masses by creating a schism between new and experienced users. New > users should be introduced to the real thing immediately and it is up > to the tutorials

Re: alternate syntax

2009-02-23 Thread Dan
On Mon, Feb 23, 2009 at 3:32 PM, Vincent Foley wrote: > > I'm opposed to this idea. I don't think we should pander to the > masses by creating a schism between new and experienced users. New > users should be introduced to the real thing immediately and it is up > to the tutorials and community

Re: alternate syntax

2009-02-23 Thread Vincent Foley
I'm opposed to this idea. I don't think we should pander to the masses by creating a schism between new and experienced users. New users should be introduced to the real thing immediately and it is up to the tutorials and community to help them overcome the fear/ puzzlement of parentheses. Like

Re: transactions and retries

2009-02-23 Thread Dan
> > If I understand correctly, when there is an attempt to modify a Ref > that has been modified in another thread since the current transaction > began then the current transaction will retry immediately. Isn't it > true that it has no chance of completing until the transaction that > changed that

Re: :use feature requests

2009-02-23 Thread James Reeves
On Feb 23, 6:54 pm, Chouser wrote: > (ns n01se.net.graph.issues >   (:import (java.text SimpleDateFormat ParsePosition) >            (java.util GregorianCalendar Calendar) >            (org.jfree.chart ChartFrame)) >   (:use [clojure.zip                    :only (xml-zip node)] >         [clojure

Macro madness

2009-02-23 Thread max3000
Hi, I'm new to lisp and clojure, so what follows may be a very easy (i.e. stupid) question... I want a macro to generate multi-methods. Here is the macro I crafted: (defmacro mcf [type class set-expr & forms] '(defmethod make ~type [fd controller] (let [control (new ~class)] (doto

transactions and retries

2009-02-23 Thread Mark Volkmann
If I understand correctly, when there is an attempt to modify a Ref that has been modified in another thread since the current transaction began then the current transaction will retry immediately. Isn't it true that it has no chance of completing until the transaction that changed that Ref either

Re: :use feature requests

2009-02-23 Thread Vincent Foley
Stuart is gonna love you guys ;) On Feb 23, 2:59 pm, Chouser wrote: > On Mon, Feb 23, 2009 at 2:33 PM, Stephen C. Gilardi wrote: > > > > > > > At that point, it seems only a small step to remove "require" entirely which > > I think would be a long-term plus--coalescing two very similar things >

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Stephen C. Gilardi
On Feb 23, 2009, at 11:43 AM, Stuart Halloway wrote: Also, the current 'fibs' implementation in clojure.contrib.seq fails the test above, because it holds the entire sequence as it goes. We should replace it with whatever the community comes up with on this thread. The fibs implementation in

Re: suggestion for resultset-seq and duplicate column names

2009-02-23 Thread Rob
On Feb 23, 8:33 am, Rich Hickey wrote: > Sounds good to me - any drawbacks to this? Does it require that the > columns be named explicitly? I can't think of any drawbacks. When the column is not named explicitly, getColumnLabel returns the same thing as getColumnName. Rob --~--~-~--

Re: :use feature requests

2009-02-23 Thread Chouser
On Mon, Feb 23, 2009 at 2:33 PM, Stephen C. Gilardi wrote: > > At that point, it seems only a small step to remove "require" entirely which > I think would be a long-term plus--coalescing two very similar things > (require and use) into one (use) with (possibly) an additional option. > > In order

Re: :use feature requests

2009-02-23 Thread Stephen C. Gilardi
On Feb 23, 2009, at 1:54 PM, Chouser wrote: After kicking around some alternatives, I realized 'use' is sufficient for all cases: (ns n01se.net.graph.issues (:import (java.text SimpleDateFormat ParsePosition) (java.util GregorianCalendar Calendar) (org.jfree.chart ChartFra

:use feature requests

2009-02-23 Thread Chouser
I have a feature request for the 'use' function. First an example. I have some real-world code like this: (ns n01se.net.graph.issues (:import (java.text SimpleDateFormat ParsePosition) (java.util GregorianCalendar Calendar) (org.jfree.chart ChartFrame)) (:use [clojure.

Re: alternate syntax

2009-02-23 Thread Meikel Brandmeyer
Hi, Am 23.02.2009 um 19:42 schrieb Dan Larkin: But.. but... macros? code is no longer data? It still is. Macros don't work on the String "(foo bar)" but on the data structure (list 'foo 'bar). Whether this is represented as >foo bar<, (foo bar) or implicit via indentation doesn't change this.

Re: alternate syntax

2009-02-23 Thread Matt Revelle
On Feb 23, 2009, at 1:21 PM, MarkH wrote: > > Yes, clojure needs an alternative surface syntax for obvious reasons. > And anybody that brings up Dylan as a counter-example doesn't know > what they're talking about. Dylan died because Apple killed it. > It may be more productive to help newcomer

Re: alternate syntax

2009-02-23 Thread Dan Larkin
But.. but... macros? code is no longer data? On Feb 23, 2009, at 10:42 AM, Mark Volkmann wrote: > > I have an idea I'd like to float to see if there are reasons why it's > a bad idea. > > What if Clojure had an alternate "surface" syntax that was translated > into standard Clojure syntax by a k

Re: alternate syntax

2009-02-23 Thread MarkH
Yes, clojure needs an alternative surface syntax for obvious reasons. And anybody that brings up Dylan as a counter-example doesn't know what they're talking about. Dylan died because Apple killed it. --~--~-~--~~~---~--~~ You received this message because you ar

Re: challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Christophe Grand
Using a good old sequence of vectors: (defn fibo [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1]))) Christophe Stuart Halloway a écrit : > I have updated the sample source from the book > (http://tinyurl.com/clojure-samples > ) to the new laziness. Along the way, I replaced the lazy-co

Re: better syntax highlighting for Clojure

2009-02-23 Thread Stuart Halloway
Laurent, I originally grabbed the js and css from the Google groups files. I haven't changed the colors--I merely adapted the js to do a better job of identifying clojure names. The js and css should work on any website, which is why I thought this might be of general interest. Stuart > H

Another look at streams

2009-02-23 Thread Konrad Hinsen
I have been playing a bit more with the concept of a data stream for building computational pipelines. The result has replaced my previous experimental stream-utils library in clojure.contrib: http://code.google.com/p/clojure-contrib/source/browse/trunk/src/ clojure/contrib/stream_ut

Re: better syntax highlighting for Clojure

2009-02-23 Thread Laurent PETIT
Hello Stuart, Can you explain what this is ? Is it just something related to your book, or something that also colors syntax on websites (maybe the clojure website, or github ..) ? Indeed, if these are the "commonly accepted" colors for clojure code, I'll consider adapt clojure-dev to stick with

Re: alternate syntax

2009-02-23 Thread Laurent PETIT
While in another answer to this post, I said I had in mind to experiment with such a thing when time permits on clojure-dev, I've then followed some links, seen some attempts to remove parentheses ... ... and was very surprised to feel a little "losts" without the parenthesis on the examples ! :-)

Re: alternate syntax

2009-02-23 Thread David Nolen
On Mon, Feb 23, 2009 at 12:10 PM, Mark Volkmann wrote: > The parens don't bother me. My concern though is that many people > won't take the time to learn Clojure primarily because of the parens. > The preprocessor would appease those people and not change anything > for those that like Clojure jus

Re: alternate syntax

2009-02-23 Thread Dudley Flanders
On Feb 23, 11:29 am, Phil Hagelberg wrote: > I hate to sound like a Smug Lisp Weenie™, but if people want to learn > Clojure, they're going to have to get comfortable with its > syntax. Parentheses aren't some embarrassing historical accident; > they're part of the reason lisps are so powerful.

Re: *features*-var

2009-02-23 Thread Cosmin Stejerean
On Mon, Feb 23, 2009 at 11:16 AM, pmf wrote: > > Some (most, if not all) CL variants have a *features*-var available > that contains information about what the implementation supports and > what not. Seeing that the issue of determining the Clojure-version in > use come up from time to time, mayb

Re: alternate syntax

2009-02-23 Thread .Bill Smith
> What if Clojure had an alternate "surface" syntax that was translated > into standard Clojure syntax by a kind of preprocessor? > > Many people that don't like Lisp dialects don't like them because of > the parentheses. Agreed the parentheses take getting used to, and I respect that you want to

Re: alternate syntax

2009-02-23 Thread Laurent PETIT
2009/2/23 Cosmin Stejerean > On Mon, Feb 23, 2009 at 11:10 AM, Mark Volkmann > wrote: > >> >> On Mon, Feb 23, 2009 at 10:55 AM, Christian Vest Hansen >> wrote: >> > >> > On Mon, Feb 23, 2009 at 4:42 PM, Mark Volkmann >> > wrote: >> >> >> >> I have an idea I'd like to float to see if there are

Re: alternate syntax

2009-02-23 Thread Phil Hagelberg
Mark Volkmann writes: > The parens don't bother me. My concern though is that many people > won't take the time to learn Clojure primarily because of the parens. Rule one of programming: never code anything you're not going to use yourself. Unless you're getting paid to do it. Or something. >

Re: How to get rid of reflection warning from countdown latch?

2009-02-23 Thread Anand Patil
This blind stab worked... is it correct? (if cell-updated? (if (not (:updating @cell)) (.countDown #^java.util.concurrent.CountDownLatch latch Thanks, Anand On Feb 23, 5:20 pm, Anand Patil wrote: > Hi all, > > I'm getting > > Reflection warning, line: 150 - referenc

Re: alternate syntax

2009-02-23 Thread Cosmin Stejerean
On Mon, Feb 23, 2009 at 11:10 AM, Mark Volkmann wrote: > > On Mon, Feb 23, 2009 at 10:55 AM, Christian Vest Hansen > wrote: > > > > On Mon, Feb 23, 2009 at 4:42 PM, Mark Volkmann > > wrote: > >> > >> I have an idea I'd like to float to see if there are reasons why it's > >> a bad idea. > >> > >>

How to get rid of reflection warning from countdown latch?

2009-02-23 Thread Anand Patil
Hi all, I'm getting Reflection warning, line: 150 - reference to field countDown can't be resolved. from (if cell-updated? (if (not (:updating @cell)) (.countDown latch Is there any way to get rid of it? Thanks, Anand --~--~-~--~~~---~-

*features*-var

2009-02-23 Thread pmf
Some (most, if not all) CL variants have a *features*-var available that contains information about what the implementation supports and what not. Seeing that the issue of determining the Clojure-version in use come up from time to time, maybe it would be useful to introduce something like this fo

Re: alternate syntax

2009-02-23 Thread Dan
My opinion is that since Lisp is the programmable programming language, people shouldn't hesitate to try to write code to modify it to their liking. I actually think parenthesis are neat and the new syntax wouldn't be an improvement (and I've been programming in Python for the last 8 years) but don

Re: alternate syntax

2009-02-23 Thread Mark Volkmann
On Mon, Feb 23, 2009 at 10:55 AM, Christian Vest Hansen wrote: > > On Mon, Feb 23, 2009 at 4:42 PM, Mark Volkmann > wrote: >> >> I have an idea I'd like to float to see if there are reasons why it's >> a bad idea. >> >> What if Clojure had an alternate "surface" syntax that was translated >> int

Re: alternate syntax

2009-02-23 Thread Kevin Downey
You might be interested in my pet macro: pl http://github.com/hiredman/odds-and-ends/blob/8a84e6ddbad9d71f714ba16c3e1239633228a7eb/functional.clj#L94 it does transformations on code using zippers. for example: (pl inc $ inc $ 0) expands to (inc (inc 2)) pl is just a toy but it might be worth lo

Re: alternate syntax

2009-02-23 Thread Christian Vest Hansen
On Mon, Feb 23, 2009 at 4:42 PM, Mark Volkmann wrote: > > I have an idea I'd like to float to see if there are reasons why it's > a bad idea. > > What if Clojure had an alternate "surface" syntax that was translated > into standard Clojure syntax by a kind of preprocessor? Do you by any chance m

challenge: best fibo implementation under the new laziness?

2009-02-23 Thread Stuart Halloway
I have updated the sample source from the book (http://tinyurl.com/clojure-samples ) to the new laziness. Along the way, I replaced the lazy-cons based implementation of the fibonacci numbers with this: (defn fibo ([] (concat [0 1] (fibo 0 1))) ([a b] (let [n (+ a b)]

Re: alternate syntax

2009-02-23 Thread David Nolen
Interesting thread on LtU on this subject: http://lambda-the-ultimate.org/node/1646 On Mon, Feb 23, 2009 at 10:42 AM, Mark Volkmann wrote: > > I have an idea I'd like to float to see if there are reasons why it's > a bad idea. > > What if Clojure had an alternate "surface" syntax that was transla

Re: Directed Graphs for Contrib

2009-02-23 Thread Jeffrey Straszheim
I don't remember that post, but my work also deals with cycles, and a strongly connected component algorithm will be one of my first submissions. On Mon, Feb 23, 2009 at 10:52 AM, cliffc wrote: > > As a compiler writer I do a lot of graph-work, but nearly all of it > has cycles. > There was a th

better syntax highlighting for Clojure

2009-02-23 Thread Stuart Halloway
I have improved the clojure.js bits [1]. Various small changes, but the big issue was to discontinue using \b for end of word, which does not work well with names-like-this. Feedback or additional improvements welcome. Stuart [1] http://github.com/stuarthalloway/programming-clojure/blob/95

Re: Directed Graphs for Contrib

2009-02-23 Thread cliffc
As a compiler writer I do a lot of graph-work, but nearly all of it has cycles. There was a thread earlier about defining cyclic graphs in Clojure. Can someone point me to it? Thanks, Cliff On Feb 22, 7:55 am, Rich Hickey wrote: > On Feb 22, 2009, at 10:11 AM, Jeffrey Straszheim wrote: > > > J

alternate syntax

2009-02-23 Thread Mark Volkmann
I have an idea I'd like to float to see if there are reasons why it's a bad idea. What if Clojure had an alternate "surface" syntax that was translated into standard Clojure syntax by a kind of preprocessor? Many people that don't like Lisp dialects don't like them because of the parentheses. I'

Generating classes with annotations

2009-02-23 Thread Robert Lally
Hi, Is it possible to add annotations to classes generated with clojure? There seems to be an AnnotationWriter class in the source, but I've not had any luck tracing it back to anything useable. Thanks, Rob. --~--~-~--~~~---~--~~ You received this message because

Re: suggestion for resultset-seq and duplicate column names

2009-02-23 Thread Rich Hickey
On Feb 22, 7:59 pm, Rob wrote: > Hi, > > How about having this function call .getColumnLabel instead > of .getColumnName. That way, you can do a join with duplicate column > names and rename them in the SQL query... > > select name name1, name name2, ... from ... > > and resultset-seq won't th

Re: with-meta and concat

2009-02-23 Thread Rich Hickey
On Feb 23, 4:21 am, Christophe Grand wrote: > Chouser a écrit : > > > > > On Sun, Feb 22, 2009 at 4:07 PM, jim wrote: > > >> In some old code, I did something like: > > >> (with-meta (concat [1 3] [8 4]) > >>{:tail true})) > > >> which now fails. I believe it's because the

Re: Clojure running atop Java ME (Micro Edition) for mobile phones

2009-02-23 Thread budden
+1 --~--~-~--~~~---~--~~ 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 email to clojure+unsubscr...@googlegroups.com Fo

Re: with-meta and concat

2009-02-23 Thread Christophe Grand
Chouser a écrit : > On Sun, Feb 22, 2009 at 4:07 PM, jim wrote: > >> In some old code, I did something like: >> >> (with-meta (concat [1 3] [8 4]) >>{:tail true})) >> >> which now fails. I believe it's because the result of concat is now >> some kind of reference. >> >> Do

Re: Directed Graphs for Contrib

2009-02-23 Thread Francesco Bellomi
I agree -- an important goal is to define a suitable common way to represent graphs in terms of idiomatic Clojure data structures. Francesco On Feb 22, 4:11 pm, Jeffrey Straszheim wrote: > Just as a point of fact, I don't plan to make a complete *every algorithm > you can think of* package, jus

Re: Changed clojure.contrib.test-clojure to load without running, add run method

2009-02-23 Thread Frantisek Sodomka
I wonder about testing clojure.contrib in general. Some libraries like math, miglayout, monads, sql and test-is define their own tests "tests.clj" in their subdirectory. Others - shell_out and str_utils - have their tests in test_contrib. Should we merge these two approaches into one? Frantisek

Re: Directed Graphs for Contrib

2009-02-23 Thread Konrad Hinsen
On 22.02.2009, at 02:59, Jeffrey Straszheim wrote: > As part of my Datalog work I'm putting together some directed graph > algorithms, mostly things like finding strongly connected > components, and building dependency stratifications (think > topological sort but with the results groups in

  1   2   >