Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread evins.mi...@gmail.com
On Dec 11, 3:58 pm, Randall R Schulz wrote: > On Thursday 11 December 2008 13:47, Sean Spencer wrote: > > > That was one of the best explanations of code as data I've ever read. > > Kudos! > > Thanks. You forced me to look up the reference to which I alluded: > > On Thursday 11 December 2008 06

Re: throw-if with no exception class

2008-12-12 Thread Ralf Bensmann
Hi Rich, I am very interested in your view of the world - why are 'checked' exceptions evil? Thanks -Ralf On Thu, Dec 11, 2008 at 2:08 PM, Rich Hickey wrote: > > > > On Dec 10, 10:52 pm, "Stephen C. Gilardi" wrote: > > On Dec 10, 2008, at 4:38 AM, Ralf Bensmann wrote: > > > > > Being a Java t

Re: In core structure editor, anyone?

2008-12-12 Thread evins.mi...@gmail.com
On Dec 11, 12:39 pm, TNeste wrote: > On Dec 10, 2:15 pm, Simon Brooke wrote: > > > I note people seem mainly to be using Emacs as an editing/development > > environment for Clojure. But as people keep pointing out, Clojure is > > homoiconic; the canonical source of a function is not a stream o

Re: Swing GUI Builder and Clojure

2008-12-12 Thread Geoffrey Teale
2008/12/12 wubbie > > Hi, > The same hello world did not work for me. > The error msgs are: > (defn hello-world [] > (qt4 > (let [app (QCoreApplication/instance) > button (new QPushButton "Go Clojure Go")] > (.. button clicked (connect app "quit()")) > (doto button > (res

Re: Swing GUI Builder and Clojure

2008-12-12 Thread Geoffrey Teale
2008/12/12 Geoffrey Teale > >> > Hi, > > Depending on which version of Clojure you are using you may find that you > need to change: > > (doto button > (resize 250 100)) > > to: > > (doto button > Argh.. goddam google mail... I meant to say: (doto button (.resize 250 100)) Note the add

Re: defining keywords ?

2008-12-12 Thread evins.mi...@gmail.com
On Dec 11, 9:08 pm, Chouser wrote: > On Thu, Dec 11, 2008 at 7:49 PM, Robert Koberg wrote: > > > Hi, > > > Would it be desirable to further define keywords such that it allows a > > special kind of namespacing. > > > * This could allow for more efficient (for the user) and targeted > > navigat

distributing a cliojure application as .jar - guide

2008-12-12 Thread prhlava
Hello, What is the position on distributing clojure classes with user application classes in single .jar file. Is including the license for clojure in the .jar as a text file enough? I would like to amend: http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips section 1.9 so the

Re: jEdit Mode for Clojure

2008-12-12 Thread blackdog
If anyone on this thread is interested I uploaded clj-jedit.tar.gz to the group file section on an incomplete jedit plugin for clojure. It has the hilighting, repl, and namespace browser (courtesy of enclojure) - anyone want to take it on and improve it, I don't have time right now?? It was based

distributing a clojure application as self contained .jar - guide

2008-12-12 Thread prhlava
Hello, What is the position on distributing clojure classes with user application classes in single .jar file. Is including the license for clojure in the .jar as a text file enough? I would like to amend: http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips section 1.9 so the "

Re: Swing GUI Builder and Clojure

2008-12-12 Thread prhlava
Swing - as it comes built in with java Vlad --~--~-~--~~~---~--~~ 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 ema

Re: Emacs / Slime questions

2008-12-12 Thread Mark Engelberg
On Sun, Dec 7, 2008 at 12:24 PM, Bill Clementson wrote: >> 3. If something in the REPL is running in an infinite loop, how do I >> interrupt evaluation? > > C-c C-c usually works for me (not sure about Windows) This isn't working for me on Clojure Box in Windows. Can anyone else tell me a way

Best style for internal variables

2008-12-12 Thread Mark Engelberg
Sometimes you use mutable state inside of a function to do some local temporary computation, and this state will never be visible outside of the function. So externally speaking, the function is still a pure function. Vars, Refs, and Atoms all seem to be reasonable choices for representing this

Re: Swing GUI Builder and Clojure

2008-12-12 Thread prhlava
Hello Rock, > Does anyone know of such a possibility? And, if not, what are the > chances of coming up with a tool like that? I'm not a Java nor a Swing > expert, so I haven't the faintest clue as to what the difficulties may > be. There is such a tool for jruby (which I tried for a basic gui)

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Rich Hickey
On Dec 12, 1:35 am, Mon Key wrote: > > Clojure does not allow for programmer-defined > > reader macros (unlike other lisps). > > I know this has been touched upon last Spring - and Stu Halloway refs > at least one discussion of this in his book. > > From a practical standpoint I am beginning to

Re: Best style for internal variables

2008-12-12 Thread Rich Hickey
On Fri, Dec 12, 2008 at 7:10 AM, Mark Engelberg wrote: > > Sometimes you use mutable state inside of a function to do some local > temporary computation, and this state will never be visible outside of > the function. So externally speaking, the function is still a pure > function. Vars, Refs,

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Mark Volkmann
On Thu, Dec 11, 2008 at 3:44 PM, Randall R Schulz wrote: > > Punctuation is not syntax. >> Clojure goes on to add a lot of syntax. The literal syntax for >> vectors [], maps {}, sets #{}, functions #(), keywords :, etc. are >> all syntax, not possible with macros, and then there are all the >>

Re: defining keywords ?

2008-12-12 Thread Rich Hickey
On Dec 12, 4:34 am, "evins.mi...@gmail.com" wrote: > On Dec 11, 9:08 pm, Chouser wrote: > > > > > On Thu, Dec 11, 2008 at 7:49 PM, Robert Koberg wrote: > > > > Hi, > > > > Would it be desirable to further define keywords such that it allows a > > > special kind of namespacing. > > > > * This

Re: throw-if with no exception class

2008-12-12 Thread Randall R Schulz
On Friday 12 December 2008 01:18, Ralf Bensmann wrote: > Hi Rich, > > I am very interested in your view of the world - why are 'checked' > exceptions evil? It's a huge and unending debate (last I checked). It's probably not worth recapping it here. I'm sure there are reams of blogs and email li

Re: Extending deref

2008-12-12 Thread Rich Hickey
On Dec 12, 2:15 am, "Mark Engelberg" wrote: > If you wanted to extend deref to new types, is there any way to do > that? For example, deref of a delay could be equivalent to a force. > Or deref of a Future could invoke the Future's get method. This would > give you the handy @ reader macro fo

Re: XML Namespaces :xmlns, was Re: xml/parse

2008-12-12 Thread J. McConnell
On Thu, Dec 11, 2008 at 8:49 PM, Robert Koberg wrote: > > Given an XML structure like: > > http://purl.org/dc/elements/1.1/"; > > http://www.w3.org/1999/xhtml";> > A HEAD Title > A BODY Title > > http://www.w3.org/1999/xhtml";> > A HEAD Title > A BODY Title > > > > whi

Re: Emacs / Slime questions

2008-12-12 Thread Shawn Hoover
On Fri, Dec 12, 2008 at 6:40 AM, Mark Engelberg wrote: > > On Sun, Dec 7, 2008 at 12:24 PM, Bill Clementson > wrote: > >> 3. If something in the REPL is running in an infinite loop, how do I > >> interrupt evaluation? > > > > C-c C-c usually works for me (not sure about Windows) > > This isn't w

Re: Running out of memory when using filter?

2008-12-12 Thread Rich Hickey
On Dec 12, 12:29 am, "Mark Engelberg" wrote: > On Mon, Dec 8, 2008 at 6:51 PM, Rich Hickey wrote: > > I don't have the latest build of Clojure with atoms, so I > reimplemented Rich's filter solution using refs, turning: > > > (defn filter > > [pred coll] > > (let [sa (atom (seq coll)) >

Re: XML Namespaces :xmlns, was Re: xml/parse

2008-12-12 Thread J. McConnell
On Fri, Dec 12, 2008 at 9:39 AM, Chouser wrote: > > On Fri, Dec 12, 2008 at 9:15 AM, J. McConnell wrote: >> >> {:tag :root, :attrs nil, :content [ >> {:tag :fragment, :attrs nil, :content [ >>{:tag ::title, :attrs nil, >> :content ["A HEAD Title"]} > > As I

Re: XML Namespaces :xmlns, was Re: xml/parse

2008-12-12 Thread Chouser
On Fri, Dec 12, 2008 at 9:15 AM, J. McConnell wrote: > > {:tag :root, :attrs nil, :content [ > {:tag :fragment, :attrs nil, :content [ >{:tag ::title, :attrs nil, > :content ["A HEAD Title"]} As I mentioned in another thread, keywords can already handle url

Re: XML Namespaces :xmlns, was Re: xml/parse

2008-12-12 Thread J. McConnell
On Fri, Dec 12, 2008 at 9:49 AM, J. McConnell wrote: > On Fri, Dec 12, 2008 at 9:39 AM, Chouser wrote: >> >> I think it's often desirable to also maintain (somewhere) the original >> document's shortcut names, and use those where applicable when >> emitting XML text again. > > I agree. Unfortuna

Re: why can't I set! stuff in user.clj?

2008-12-12 Thread Rich Hickey
On Thu, Dec 11, 2008 at 8:28 PM, Stephen C. Gilardi wrote: > > On Dec 11, 2008, at 7:24 PM, Rich Hickey wrote: > >> I am interested in the issues you are trying to address, and thanks >> for volunteering! > > Excellent. You're welcome. > >> I'd like to try to focus our efforts on release 1.0. > >

Re: XML Namespaces :xmlns, was Re: xml/parse

2008-12-12 Thread Christopher Taylor
On 12.12.2008, at 15:49, J. McConnell wrote: > > On Fri, Dec 12, 2008 at 9:39 AM, Chouser wrote: >> >> On Fri, Dec 12, 2008 at 9:15 AM, J. McConnell >> wrote: >>> >>> {:tag :root, :attrs nil, :content [ >>> {:tag :fragment, :attrs nil, :content [ >>> {:tag :

Re: Emacs / Slime questions

2008-12-12 Thread mehrheit
On Fri, 12 Dec 2008 09:32:09 -0500 "Shawn Hoover" wrote: > >It doesn't work for me on Windows either. Maybe my grep skills are >lacking, but I can't find where swank-clojure implements the interrupt >functionality. If that's the case, you're left with killing the REPL >buffer (C-x k) and restart

Re: Emacs / Slime questions

2008-12-12 Thread Tomi Neste
On Fri, Dec 12, 2008 at 5:31 PM, mehrheit wrote: > > On Fri, 12 Dec 2008 09:32:09 -0500 > "Shawn Hoover" wrote: > > > > >It doesn't work for me on Windows either. Maybe my grep skills are > >lacking, but I can't find where swank-clojure implements the interrupt > >functionality. If that's the ca

Re: In core structure editor, anyone?

2008-12-12 Thread Simon Brooke
On Dec 11, 6:39 pm, TNeste wrote: > On Dec 10, 2:15 pm, Simon Brooke wrote: > > > I note people seem mainly to be using Emacs as an editing/development > > environment for Clojure. But as people keep pointing out, Clojure is > > homoiconic; the canonical source of a function is not a stream of

Re: why can't I set! stuff in user.clj?

2008-12-12 Thread Stephen C. Gilardi
>> I think clojure.lang.Repl should translate its args to the new >> format and >> call clojure.main/-main: >> >> old: clojure.lang.Repl file1 file2 -- a b c >> new: clojure.main -i file1 -i file2 -r a b c >> >> Similarly for clojure.lang.Script: >> >> old: clojure.lang.Script file1 file2 file3

Re: why can't I set! stuff in user.clj?

2008-12-12 Thread Rich Hickey
On Fri, Dec 12, 2008 at 11:03 AM, Stephen C. Gilardi wrote: > >>> I think clojure.lang.Repl should translate its args to the new >>> format and >>> call clojure.main/-main: >>> >>> old: clojure.lang.Repl file1 file2 -- a b c >>> new: clojure.main -i file1 -i file2 -r a b c >>> >>> Similarly for c

Re: why can't I set! stuff in user.clj?

2008-12-12 Thread J. McConnell
On Fri, Dec 12, 2008 at 11:08 AM, Rich Hickey wrote: > On Fri, Dec 12, 2008 at 11:03 AM, Stephen C. Gilardi wrote: >> >> 'do' doesn't work when an early form uses a namespace and a later form >> depends on that. >> >> java -cp clojure.jar clojure.main -e "(use 'clojure.set)" -e "(union >> #{:a}

Re: distributing a clojure application as self contained .jar - guide

2008-12-12 Thread Perry Trolard
+ 1 on curiosity re: this question. In my limited Java experience, I find it more common to see a directory full of jars accompanying an application, but the benefits of a self-contained executable jar seem pretty self-evident, especially for an app who's only dependencies are clojure.jar & cloju

Re: why can't I set! stuff in user.clj?

2008-12-12 Thread Stephen C. Gilardi
On Dec 12, 2008, at 11:08 AM, Rich Hickey wrote: > > On Fri, Dec 12, 2008 at 11:03 AM, Stephen C. Gilardi > wrote: >> I think clojure.lang.Repl should translate its args to the new format and call clojure.main/-main: old: clojure.lang.Repl file1 file2 -- a b c ne

Re: jEdit Mode for Clojure

2008-12-12 Thread Daniel Spiewak
Which highlighting does it use? Daniel On Dec 12, 5:10 am, blackdog wrote: > If anyone on this thread is interested I uploaded clj-jedit.tar.gz to > the group file section on an incompletejeditplugin for clojure. It > has the hilighting, repl, and namespace browser (courtesy of enclojure) > - a

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread r
On Fri, Dec 12, 2008 at 1:38 PM, Mark Volkmann wrote: > > I really have trouble understanding the idea that punctuation and > syntactic sugar shouldn't be considered syntax. S-Expressions and its counterparts are technically a syntax. I guess the distinction was made to stress that the Clojure's

Re: Running out of memory when using filter?

2008-12-12 Thread Paul Mooser
On Dec 12, 6:37 am, Rich Hickey wrote: > I'm appreciate the time you and others have spent on this, and will > improve filter, but I'm not sure where you are getting your > presumptions about lazy sequences. They are not a magic bullet that > makes working with data bigger than memory transparent

Re: re-seq and other functions

2008-12-12 Thread Ethan Herdrick
Right, the outer parenthesis denote a list. That list contains only one element. The element is the vector ["qui" "ui" "i"] On Thu, Dec 11, 2008 at 9:43 PM, Stephen C. Gilardi wrote: > > In the latter case the result is a seq containing a single element: > the vector. There is nothing to sort/

Re: Misplaced doc strings in clojure.contrib.seq-utils

2008-12-12 Thread Perry Trolard
Here's the patch: http://clojure.googlegroups.com/web/seq-utils-doc-strings.patch Perry --~--~-~--~~~---~--~~ 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

Re: Why allow both ({:map 'example} :map) and (:map {:map 'example})?

2008-12-12 Thread kwatford
Maps are functions of their keys because that's what maps are. Keywords are functions of their maps because it is useful. (def foo [{:name "Bob", :age 20}, {:name "Sue", :age 19}]) (sort-by :age foo) (sort-by :name foo) Note that sort-by doesn't specifically take a keyword or know what maps are

Re: jEdit Mode for Clojure

2008-12-12 Thread David Moss
Daniel, To be honest, the colours are the least important, much more relevant is that structures are recursed properly and that the base language is defined. Let me know how you get on refining your mode and I'll have a look. When we have agreed on something I can update the jedit patch so we hav

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Paul Barry
On Dec 11, 6:19 pm, Rich Hickey wrote: > Yes, the critical point is that the text-based representation of code > is completely secondary: > (def x (list (list (symbol "fn") (vector) "Hello World"))) > > (class (second (first x))) > -> clojure.lang.PersistentVector > > (class (first (first x)))

Re: jEdit Mode for Clojure

2008-12-12 Thread Daniel Spiewak
Sounds like a good plan. :-) At the moment, I think that what's in the mode is pretty solid, meaning I don't have anything planned to refine it further. (except for regexp syntax, which I don't know anything about) So, if you want to evaluate it now, that'd be great! As a minor aside, I don't

Re: Dr. Dobbs: "It's Time to Get Good at Functional Programming"

2008-12-12 Thread Mark H.
On Dec 10, 1:28 pm, Randall R Schulz wrote: > There seems to be a bit of an oversight. I recall at least one other article on (Common) Lisp in Dr. Dobb's Journal which was disastrously poorly written (misleading, outdated, irrelevant information, even though the article was "pro-Lisp"). It's no

Re: Working combination of .emacs, Aquamacs, swank-clojure, clojure-mode?

2008-12-12 Thread Mark H.
Thanks Bill for posting such detailed Clojure+SLIME setup instructions on your blog! :-D One thing that tripped me up was that my .emacs was loading a custom SLIME (since I use the .emacs for Emacs 21 as well as Emacs 22, and Emacs 21 does not come with SLIME by default). The custom SLIME was an

Re: reduction

2008-12-12 Thread Christophe Grand
I was sure it was a job for iterate: (defn reductions "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) (for [s (iterate (fn [[x & s]] (if s (lazy-cons (f

compile and gen-class don't seem to work for me

2008-12-12 Thread ntupel
For the first time I tried to use gen-class (using svn r1156), but unfortunately compilation fails: u...@computer /tmp $ mkdir test u...@computer /tmp $ cd test/ u...@computer /tmp/test $ mkdir -p clojure/examples u...@computer /tmp/test $ gvim clojure/examples/instance.clj ;copied the source fr

Re: compile and gen-class don't seem to work for me

2008-12-12 Thread ntu...@googlemail.com
Ignore me. I forgot to set *compile-path*. Everything works fine after that. Sorry for the noise. On Dec 12, 9:39 pm, ntu...@googlemail.com wrote: > For the first time I tried to use gen-class (using svn r1156), but > unfortunately compilation fails: > > u...@computer /tmp $ mkdir test > u...@com

Re: Misplaced doc strings in clojure.contrib.seq-utils

2008-12-12 Thread Stuart Sierra
Thanks, Perry. It's fixed now (SVN 292). -Stuart Sierra On Dec 8, 11:02 am, Perry Trolard wrote: > In clojure.contrib.seq-utils, partition-by & group-by have docstrings > following their arglists, so (doc parition-by) prints > > - > clojure.contrib.seq-utils/partition-by

Safe to delete namespace dirs in clojure-contrib?

2008-12-12 Thread Stuart Sierra
Hi folks, When I patch files in clojure-contrib, I only modify the new namespace- is-filename versions, not the older namespace-is-directory ones. It's been a month since Clojure rev. 1094 introduced the namespace-is- file change. Are people still using releases that require the old contrib dire

Re: Why allow both ({:map 'example} :map) and (:map {:map 'example})?

2008-12-12 Thread Stuart Sierra
On Dec 11, 3:29 pm, "Aaron Cohen" wrote: > Isn't it just asking for confusion? It's useful to have it both ways: (map :one-key bunch-of-maps) (map one-map bunch-of-keys) -Stuart Sierra --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Safe to delete namespace dirs in clojure-contrib?

2008-12-12 Thread Chouser
On Fri, Dec 12, 2008 at 4:24 PM, Stuart Sierra wrote: > > Hi folks, > When I patch files in clojure-contrib, I only modify the new namespace- > is-filename versions, not the older namespace-is-directory ones. > > It's been a month since Clojure rev. 1094 introduced the namespace-is- > file change

Re: Safe to delete namespace dirs in clojure-contrib?

2008-12-12 Thread Dudley Flanders
On Dec 12, 2008, at 3:24 PM, Stuart Sierra wrote: > It's been a month since Clojure rev. 1094 introduced the namespace-is- > file change. Are people still using releases that require the old > contrib directories, or can we safely delete them? I was confused yesterday as to why my copy of test

Gorilla: Release of Version 1.1.0

2008-12-12 Thread Meikel Brandmeyer
Dear vimming Clojurians, (or was the name changed?) I'd like to announce the next release of Gorilla. New Features: - - Open the javadoc of the class under the cursor. This is currently very basic. - "Show" information about the class (or instance) under the cursor. This is inc

Re: Swing GUI Builder and Clojure

2008-12-12 Thread levand
My vote is for Swing. Despite its flaws, it's the Java standard - there's no need to worry about compatibility (SWT) or licensing (Jambi) issues, and there's a wealth of material online to study it further. It's included with Java, which is a huge plus in a tutorial setting - personally, I'd be ve

Re: Gorilla: Release of Version 1.1.0

2008-12-12 Thread Randall R Schulz
On Friday 12 December 2008 13:43, Meikel Brandmeyer wrote: > Dear vimming Clojurians, (or was the name changed?) > > I'd like to announce the next release of Gorilla. > > ... > Meikel Great news, thanks! I think I may have asked this before, but what Vim version requirements does Gorilla have?

Re: Gorilla: Release of Version 1.1.0

2008-12-12 Thread Meikel Brandmeyer
Hi Randall, Am 12.12.2008 um 22:54 schrieb Randall R Schulz: I think I may have asked this before, but what Vim version requirements does Gorilla have? To be honest: I don't know. My MacVim claims to be 7.2. So this is what I tested Gorilla with. It may work with earlier version or it may no

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Joost
Paul Barry schreef: > Ok, so it's fair to say the Clojure Reader has syntax. I don't see > how this is fundamentally different than how Ruby works, for example: > > http://www.igvita.com/2008/12/11/ruby-ast-for-fun-and-profit/ > > The clojure.lang.LispReader parses an input stream of text into a

rev.1054 question

2008-12-12 Thread mayes
First, thanks for the great work with Clojure. Second, I found some code I was working on didn't work with rev.1054. Paring things down I got the following which reproduces the behaviour: (defstruct A :a) (defn t [] (let [ A (struct A 0.0) ] (loop [i 0 l '()] (if (<

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Rich Hickey
On Dec 12, 4:13 pm, Joost wrote: > Paul Barry schreef: > > > Ok, so it's fair to say the Clojure Reader has syntax. I don't see > > how this is fundamentally different than how Ruby works, for example: > > >http://www.igvita.com/2008/12/11/ruby-ast-for-fun-and-profit/ > > > The clojure.lang.Li

Re: Gorilla: Release of Version 1.1.0

2008-12-12 Thread Randall R Schulz
On Friday 12 December 2008 13:59, Meikel Brandmeyer wrote: > Hi Randall, > > Am 12.12.2008 um 22:54 schrieb Randall R Schulz: > > I think I may have asked this before, but what Vim version > > requirements > > does Gorilla have? > > .. I guess what you should say at least is that it requires Ruby

Re: rev.1054 question

2008-12-12 Thread Rich Hickey
On Dec 12, 4:01 pm, mayes wrote: > First, thanks for the great work with Clojure. > > Second, I found some code I was working on didn't work with > rev.1054. Paring things down I got the following which > reproduces the behaviour: > > (defstruct A :a) > (defn t [] > (let [ > A (struc

iteration idioms

2008-12-12 Thread Brian Will
A very large chunk of iteration is done for the sake of producing a new collection based on an existing collection, hence functional constructs like list comprehensions and map. However, I'm not sure about how to functionally handle cases of iteration which seem to require: 1) keeping around valu

Re: iteration idioms

2008-12-12 Thread Mark Fredrickson
> > For (1), it seems you generally resort to some kind of recursion with > loop/recur. Say we wish to find the max value in a list (without using > 'max'): I can do this with reduce: user=> (defn my-max [lst] (reduce (fn [x a] (if (> x a) x a)) (first lst) (rest lst))) #'user/my-max user=> (my

Re: Running out of memory when using filter?

2008-12-12 Thread Mark Engelberg
On Fri, Dec 12, 2008 at 6:37 AM, Rich Hickey wrote: > I'm appreciate the time you and others have spent on this, and will > improve filter, but I'm not sure where you are getting your > presumptions about lazy sequences. They are not a magic bullet that > makes working with data bigger than memor

Patch to get test-clojure up-to-date [Was: Re: clojure.contrib.test-is: first major rewrite]

2008-12-12 Thread J. McConnell
On Sun, Dec 7, 2008 at 10:51 AM, Stuart Sierra wrote: > > As of clojure-contrib SVN 283, there's a new clojure.contrib.test-is. > This is a pretty major rewrite of the library. I've tried to > streamline the code and make it easier to plug in custom reporting and > assertion functions. Unfortuna

Re: Running out of memory when using filter?

2008-12-12 Thread Randall R Schulz
On Friday 12 December 2008 15:15, Mark Engelberg wrote: > ... > > --Mark Not being nearly sophisticated enough in Clojure, FP or the relevant concepts to say anything other than "that all makes complete sense to me," I wonder only what would be the impact on existing programs were the default

(use '[... and classpath

2008-12-12 Thread Oscar Picasso
I can write a): user> (use '[clojure.contrib.str-utils :only (str-join)]) nil and b) user> clojure.xml/parse # But not c) (use '[closure.xml :only (parse)]) java.io.FileNotFoundException: Could not locate closure/ xml__init.class or closure/xml.clj on classpath: (NO_SOURCE_FILE:0) [Thrown cla

Re: Running out of memory when using filter?

2008-12-12 Thread Rich Hickey
On Dec 12, 6:15 pm, "Mark Engelberg" wrote: > On Fri, Dec 12, 2008 at 6:37 AM, Rich Hickey wrote: > > I'm appreciate the time you and others have spent on this, and will > > improve filter, but I'm not sure where you are getting your > > presumptions about lazy sequences. They are not a magic

Re: (use '[... and classpath

2008-12-12 Thread J. McConnell
On Fri, Dec 12, 2008 at 6:37 PM, Oscar Picasso wrote: > > java.io.FileNotFoundException: Could not locate closure/ You've got cloSure instead of cloJure. - J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cloju

Re: (use '[... and classpath

2008-12-12 Thread Bruce Butterfield
s/closure/clojure/ On Fri, Dec 12, 2008 at 3:37 PM, Oscar Picasso wrote: > > I can write a): > user> (use '[clojure.contrib.str-utils :only (str-join)]) > nil > > and b) > user> clojure.xml/parse > # > > But not c) > (use '[closure.xml :only (parse)]) > java.io.FileNotFoundException: Could not lo

Re: Gorilla: Release of Version 1.1.0

2008-12-12 Thread Nathan Kitchen
On Dec 12, 2:29 pm, Randall R Schulz wrote: > > > I think I may have asked this before, but what Vim version > > > requirements > > > does Gorilla have? > > > .. > > I guess what you should say at least is that it requires Ruby and the > Vim Ruby module / extension / whatever. Unfortunately, ne

Re: Running out of memory when using filter?

2008-12-12 Thread Rich Hickey
On Dec 12, 1:03 pm, Paul Mooser wrote: > On Dec 12, 6:37 am, Rich Hickey wrote: > > > I'm appreciate the time you and others have spent on this, and will > > improve filter, but I'm not sure where you are getting your > > presumptions about lazy sequences. They are not a magic bullet that > >

Re: Running out of memory when using filter?

2008-12-12 Thread Paul Mooser
On Dec 12, 3:15 pm, "Mark Engelberg" wrote: >And in fact, it turns out that in those languages, uncached lazy lists end up >rarely used. Did you mean that the cached lazy lists are rarely used? Or does everyone actually choose to use the cached ones? --~--~-~--~~~---

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Joost
Rich Hickey schreef: > I'm not sure Clojure has more built-in reader constructs than Common > Lisp, which has reader syntax for vectors, arrays, pathnames, dotted > pairs, bitvectors, read-time evaluation, labels, label references, > read-time conditionals, many kinds of numbers, functions, balanc

Re: iteration idioms

2008-12-12 Thread Brian Will
Thanks, Mark. I don't suppose (reduce into ...) is a common enough idiom that it deserves its own function? Perhaps (into x) should do (reduce into x), e.g. (into [[3 5] [6 7]]) => [3 5 6 7]. This makes sense to me, but maybe it's too semantically different from (into x y). If not, though, you co

Re: Swing GUI Builder and Clojure

2008-12-12 Thread wubbie
Hi Geoffrey, Thanks for the tip. I put . for every command within the doto. Also looking forward to having a look at the Qt work you are currently doing. Cheers, Sun On Dec 12, 4:32 am, "Geoffrey Teale" wrote: > 2008/12/12 Geoffrey Teale > > > > > Hi, > > > Depending on which version of Cloj

Functional programming newbie question

2008-12-12 Thread levand
So, I'm trying to understand functional programming, particularly as it relates to the seq abstraction, and I'm hitting a slight difficulty as I'm playing around - something that seems as if it ought to be simple, is not. I'm playing with copying one seq into another. I've found several different

Re: Running out of memory when using filter?

2008-12-12 Thread Mark Engelberg
On Fri, Dec 12, 2008 at 5:28 PM, Paul Mooser wrote: > > On Dec 12, 3:15 pm, "Mark Engelberg" wrote: >>And in fact, it turns out that in those languages, uncached lazy lists end up >>rarely used. > > Did you mean that the cached lazy lists are rarely used? Or does > everyone actually choose to u

Re: Functional programming newbie question

2008-12-12 Thread mago
I guess one answer to your question would be: If the seq is persistent (immutable) why would you need to make a copy of it? On Dec 12, 8:51 pm, levand wrote: > So, I'm trying to understand functional programming, particularly as > it relates to the seq abstraction, and I'm hitting a slight diffi

Re: Functional programming newbie question

2008-12-12 Thread Mark Engelberg
On Fri, Dec 12, 2008 at 6:51 PM, levand wrote: > The next implementation is simpler, and uses recursion quite > elegantly: > (defn copy-seq [source] >(if (nil? source) > '() > (cons (first source) (copy-seq (rest source) > What would one do in a language like Scheme, without l

Re: re-gsub improvement

2008-12-12 Thread Chouser
On Dec 6, 1:29 pm, Juergen Gmeiner wrote: > Hi List, > > a little thing I have grown quite fond of: > > (re-gsub#"\b(?:word|expr|whatever)\b" >          {"word" "A WORD" >           "expr" "An Expression" >           "whatever" "WHATEVER!"} >         "welcome to the united states of whatever") >

Re: Running out of memory when using filter?

2008-12-12 Thread Rich Hickey
On Fri, Dec 12, 2008 at 10:09 PM, Mark Engelberg wrote: > > On Fri, Dec 12, 2008 at 5:28 PM, Paul Mooser wrote: >> >> On Dec 12, 3:15 pm, "Mark Engelberg" wrote: >>>And in fact, it turns out that in those languages, uncached lazy lists end >>>up rarely used. >> >> Did you mean that the cached

Updated 'show' and 'source'

2008-12-12 Thread Chouser
I've added updated versions of 'show' and 'source' to a new lib named clojure.contrib.repl-utils 'show' is for exploring classes at the REPL. What's new is that it now displays the modifiers of the class and the parameter types for each method. 'source' tries to display the Clojure source for a

Re: Running out of memory when using filter?

2008-12-12 Thread Mark Engelberg
On Fri, Dec 12, 2008 at 9:28 PM, Rich Hickey wrote: > I think it's very important not to conflate different notions of > sequences. Clojure's model a very specific abstraction, the Lisp list, > originally implemented as a singly-linked list of cons cells. It is a > persistent abstraction, first/s