Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Jeff Valk
On 25 February 2009, Adrian Cuthbertson wrote: > > Hmm, I get a stack overflow when trying that make macro. > After using macroexpand-1... > (with-meta (struct stuff 1 2) {:type (keyword (str *ns*) (name (quote > stuff)))}) > I still get the stack overflow. > > I'm on svn 1307, jdk 1.5 mac osx

Re: Clojure plugin for IntelliJ IDEA published

2009-02-25 Thread CuppoJava
Hi Ilya, I also just started using the plugin and it's very good. Thank you for this great plugin. I have a few questions about how to use it though: How to I start a REPL without loading a script? Just a blank slate REPL? Is there a shortcut for Sending current sexp, or selected text to REPL? M

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Michael Wood
On Wed, Feb 25, 2009 at 8:27 PM, Mark Colburn wrote: > > #!/bin/sh > DP="${0%/*}" > java -cp ~/src/clojure/clojure.jar:${DP}/clj:${DP}/java - > Dnet.sourceforge.waterfront.plugins=${DP}/clj/net/sourceforge/ > waterfront/ide/plugins clojure.main ${DP}/clj/net/sourceforge/ > waterfront/ide/main.clj

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Adrian Cuthbertson
Hmm, I get a stack overflow when trying that make macro. After using macroexpand-1... (with-meta (struct stuff 1 2) {:type (keyword (str *ns*) (name (quote stuff)))}) I still get the stack overflow. I'm on svn 1307, jdk 1.5 mac osx. Any ideas? Regards, Adrian. On Thu, Feb 26, 2009 at 7:08 AM, J

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Jeff Valk
How about appending type metadata automagically... (defstruct stuff :a :b) (defmacro make "Creates a new instance of struct t and appends 'type' t as metadata" [t & vs] `(with-meta (struct ~t ~...@vs) {:type (keyword (str *ns*) (name '~t))})) user> (make stuff 1 2) {:a 1, :b 2} us

The Sequential interface (implementation question)

2009-02-25 Thread dmiller
Regarding the Sequential interface: There are a number of places where (x instanceof Sequential) is taken to imply something else about x: (a) that casting in the form of ((IPersistentCollection)x) is okay, or (b) that RT.seq(x) will succeed, or (c) that Rt.count(x) will succeed Note that

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Chouser
On Wed, Feb 25, 2009 at 10:09 PM, David Nolen wrote: > This is nothing short of amazing for those who want to build ad-hoc type > systems. Plus custom printing. (defmethod print-method ::Foo [o w] (doto w (.write "#"))) (defn make-foo [x] #^{:type ::Foo} {:x x}) user=> (make-foo "whee

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread David Nolen
This is nothing short of amazing for those who want to build ad-hoc type systems. (defstruct #^{:type ::my-struct} my-struct :a :b) (type #'my-struct) ; -> :user/my-struct! I have a lot of code fixing to do now :) Also Konrad's point that using multimethods for dispatch-fns would be ugly, but act

Re: error-kit and threads

2009-02-25 Thread Jeffrey Straszheim
Awesome! Thanks. And I can't think of a better way. This is ultimately the same problem found in this sort of code: (let [something-we-need-to-close (open whatever)] (try (something-lazy something-we-need-to-close) (finally (close something-we-need-to-close This was discussed recen

Re: JDK Annotation support?

2009-02-25 Thread pmf
On Feb 26, 1:05 am, Mark Derricutt wrote: > Personally I'd probably find adding annotations at the method level more > useful than at the gen-class level.  Although both would certainly be handy. > > Some examples I'm thinking of would be adding say the spring @Component > annotation to a class,

Timing utilities for clojure.contrib?

2009-02-25 Thread Jason Wolfe
I wrote a small set of functions for executing code while measuring and/or limiting its time and/or memory consumption. I did this both to run timing experiments, and to let me run things at the REPL without risking an infinite loop (and having to restart Clojure from scratch). Would anyone else

Re: error-kit and threads

2009-02-25 Thread Chouser
On Wed, Feb 25, 2009 at 12:32 PM, Chouser wrote: > On Wed, Feb 25, 2009 at 9:05 AM, Jeffrey Straszheim > wrote: >> Does the stuff in error kit work across thread boundaries.  I'm thinking, >> for instance, if you run a computation using pmap, the individual >> computations are run inside of Java

Waterfront Assertion Failure

2009-02-25 Thread Onorio Catenacci
Hi Itay (and everyone else), Every time I try to run Waterfront I keep running into the same error. On line 83 of kit.clj the assertion fails. Version of Clojure: Revision: 1173 I just pulled Waterfront from the SourceForge site. (RC1-147). I didn't see the older version so I don't know if tha

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Onorio Catenacci
On Feb 25, 9:17 am, Itay Maman wrote: > For those of you who tried one of Waterfront's earlier revisions and > then switched to revision 147 (latest): > > In 147 there was a change in the plugin loading order (due to plugin > dependencies). If you ran earlier versions you will get the following >

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Stuart Sierra
On Feb 24, 6:47 pm, Itay Maman wrote: > After a few hours of intense work I managed to port Waterfront's code > to Clojure's latest snapshot. This version is now available for > download as "RC1-147" at the same location Very impressive, Itay. This strikes me as a good candidate for a "Clojure

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Stephen C. Gilardi
On Feb 24, 2009, at 6:47 PM, Itay Maman wrote: This version is fully functional and so far I didn't encounter any bugs. I guess that over the course of the next few days, as people start using this version, a few issues may come up. I'd be glad to fix these. I also took Mike's suggestion, Wate

Re: compiling a GUI app and also: interference of Java's built-in architechture

2009-02-25 Thread rob
Someone mentioned the "application context" pattern in a recent post on this list. I think that would be a great way to functionally implement GUIs in general. The idea is that new states are generated from previous ones and passed as a parameter instead of having a globally defined state that y

Re: new laziness: terminology help

2009-02-25 Thread Mark Engelberg
On Wed, Feb 25, 2009 at 6:59 AM, Stuart Halloway > I believe it would be simpler to leave out this footnote. In my > perfect world, seq/ISeq/sequence are synonyms, and nillability is a > property only of *functions*: seq and next. I understand why it is useful to use the noun "seq" to mean the fo

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Rich Hickey
On Feb 25, 12:19 pm, Konrad Hinsen wrote: > On Feb 25, 2009, at 17:40, David Nolen wrote: > > > Should print and println be multimethods? It seems the ability to > > custom print a data structure would be generally useful. > > It's already there, just not documented as far as I know. All the >

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Laurent PETIT
2009/2/26 Stephen C. Gilardi > > On Feb 25, 2009, at 6:50 PM, Telman Yusupov wrote: > > +1 on setting a sane CLASSPATH and not depending on other environment >> variables. >> >> Then there is no need to specify a custom -cp for every Clojure/Java >> program/script either... >> > > The problem I

Re: JDK Annotation support?

2009-02-25 Thread Mark Derricutt
Personally I'd probably find adding annotations at the method level more useful than at the gen-class level. Although both would certainly be handy. Some examples I'm thinking of would be adding say the spring @Component annotation to a class, so that the instance could be autowired into other cl

Re: If/cond thoughts..

2009-02-25 Thread Timothy Pratley
I like that definition of if --~--~-~--~~~---~--~~ 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+unsu

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Stephen C. Gilardi
On Feb 25, 2009, at 6:50 PM, Telman Yusupov wrote: +1 on setting a sane CLASSPATH and not depending on other environment variables. Then there is no need to specify a custom -cp for every Clojure/Java program/script either... The problem I see with using CLASSPATH this way is that it (pote

Re: JDK Annotation support?

2009-02-25 Thread Rich Hickey
On Feb 25, 6:51 pm, Mark Derricutt wrote: > Has anyone looked at adding support for JDK annotations to clojure's > compiler at all? > There's no support right now. Is what you want enhancements to gen- class? Rich --~--~-~--~~~---~--~~ You received this messag

JDK Annotation support?

2009-02-25 Thread Mark Derricutt
Has anyone looked at adding support for JDK annotations to clojure's compiler at all? ...and then Buffy staked Edward. The End. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Telman Yusupov
+1 on setting a sane CLASSPATH and not depending on other environment variables. Then there is no need to specify a custom -cp for every Clojure/Java program/script either... Cheers, Telman P.S. My very simple CLASSPATH setup detailed here: http://yusupov.com/blog/2009/basic-clojure-setup-part

Javascript generator

2009-02-25 Thread jim
I've just uploaded a javascript generator ala Parenscript. It's pretty half-baked, so be cautious using it until we get the bugs ironed out. http://clojure.googlegroups.com/web/js_gen.clj The code for the generator is about 250 lines. It depends on the mini- kanren implementation I just upload

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Stephen C. Gilardi
On Feb 25, 2009, at 6:14 PM, Laurent PETIT wrote: I've already answered to the external stuff in another message (and sorry for having been so crude, but I really think it's not a so good idea. In that particular case : clojure does not depend on clojure contrib. So clojure svn must not de

Mini-Kanren

2009-02-25 Thread jim
I've just uploaded a file that has the Mini-Kanren logic programming system described in "The Reasoned Schemer" implemented in idiomatic Clojure. The file is: http://clojure.googlegroups.com/web/mini_kanren.clj I'm offering this as a candidate for inclusion into clojure.contrib. There are thre

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Jeff Rose
Stephen C. Gilardi wrote: > > On Feb 25, 2009, at 1:27 PM, Mark Colburn wrote: > >> #!/bin/sh >> DP="${0%/*}" >> java -cp ~/src/clojure/clojure.jar:${DP}/clj:${DP}/java - >> Dnet.sourceforge.waterfront.plugins=${DP}/clj/net/sourceforge/ >> waterfront/ide/plugins clojure.main ${DP}/clj/net/source

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Laurent PETIT
I've already answered to the external stuff in another message (and sorry for having been so crude, but I really think it's not a so good idea. In that particular case : clojure does not depend on clojure contrib. So clojure svn must not depend on clojure-contrib svn). Concerning the https vs http

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Laurent PETIT
2009/2/25 Achim Passen > Hi!Am 25.02.2009 um 23:14 schrieb Stephen C. Gilardi: > > (If this flies, at some point it would be good to add "contrib" to the > svn-ignore list for Clojure's top level directory so it wouldn't even show > up as an untracked node.) > > > Another way to do this is to add

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Stephen C. Gilardi
On Feb 25, 2009, at 5:51 PM, Achim Passen wrote: Another way to do this is to add contrib as an svn external: http://svnbook.red-bean.com/en/1.0/ch07s03.html Set up like this, an "svn update" in the root directory would update both projects. Very cool. I saw this kind of thing in action fo

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Achim Passen
Hi! Am 25.02.2009 um 23:14 schrieb Stephen C. Gilardi: > (If this flies, at some point it would be good to add "contrib" to > the svn-ignore list for Clojure's top level directory so it wouldn't > even show up as an untracked node.) Another way to do this is to add contrib as an svn external

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Meikel Brandmeyer
Hi, Am 25.02.2009 um 23:39 schrieb Laurent PETIT: No, please, don't mix projects directory hierarchies, +1 Where is the problem to tell the people: "Set up a sane CLASSPATH containing the clojure.jar and clojure-contrib.jar you want!" and then just use that? Maybe there isn't even a "CLOJURE

Re: CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Laurent PETIT
No, please, don't mix projects directory hierarchies, Since clojure-contrib has such a great visibility that it's almost impossible to depend on a lib and not to depend on clojure-contrib also, I would stick to something simple, and say that the env variable for clojure-contrib home should be CLOJ

CLOJURE_HOME (was Re: Waterfront - The Clojure-based editor for Clojure)

2009-02-25 Thread Stephen C. Gilardi
On Feb 25, 2009, at 4:52 PM, Phil Hagelberg wrote: I like the idea, but does this imply that clojure-contrib.jar should be in the same directory? Or should it look in $CLOJURE_HOME/../clojure-contrib/clojure-contrib.jar. That would work in my setup, but it seems clumsy. Perhaps Rich would

Re: Extensive use of let?

2009-02-25 Thread Kevin Downey
You should look at "->" it lest you take (op3 (op2 (op1 input))) and write it as (-> input op1 op2 op3) there is also "comp" which composes functions, and partial for partial application. some example comp usage: http://github.com/hiredman/clojurebot/blob/297e266b0badf0f301a556e95771b940a80016e7/

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Phil Hagelberg
"Stephen C. Gilardi" writes: > I propose that we Clojure-using folks adopt CLOJURE_HOME as our > "standard" environment variable that can be used to find clojure.jar > and other interesting bits of Clojure. The proposed value of > CLOJURE_HOME is an absolute path to the top level of an svn check

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Mark Volkmann
On Wed, Feb 25, 2009 at 2:47 PM, Stephen C. Gilardi wrote: > > On Feb 25, 2009, at 1:27 PM, Mark Colburn wrote: > >> #!/bin/sh >> DP="${0%/*}" >> java -cp ~/src/clojure/clojure.jar:${DP}/clj:${DP}/java - >> Dnet.sourceforge.waterfront.plugins=${DP}/clj/net/sourceforge/ >> waterfront/ide/plugins c

Re: Extensive use of let?

2009-02-25 Thread Laurent PETIT
Hello, I fear there isn't (at least for me) a simple general answer for such a general problem, because : * it will really depend on the context : are op1 and op2 themselves cryptic names that would benefit from having their result clearly named ? are op1 and op2 "low level operations" for which

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Dave Griffith
There is a small but particularly nasty corner of the third circle of Hell reserved for people who mandate environment variables. Don't go there. On Feb 25, 3:47 pm, "Stephen C. Gilardi" wrote: > On Feb 25, 2009, at 1:27 PM, Mark Colburn wrote: > > > #!/bin/sh > > DP="${0%/*}" > > java -cp ~/s

Re: Multimethods in other namespaces

2009-02-25 Thread David Nolen
That should work fine as far as I can tell. On Wed, Feb 25, 2009 at 3:36 PM, Jeffrey Straszheim < straszheimjeff...@gmail.com> wrote: > If in namespace one I define >(defmulti fred dispatch-fred) > > and have imported that ns into another, can I just do > > (defmethod fred ::val [x] )

Re: Extensive use of let?

2009-02-25 Thread Jason Wolfe
There's also a middle ground: (defn my-fn2 [input]   (op5 (op4 (op1 input) (op2 input If your "op" names are descriptive, this can still be very easy to read, with significantly fewer characters than the "let" version (you'll get use to reading inside-out quickly). You can also

Re: Extensive use of let?

2009-02-25 Thread Joshua Fox
Of course, the use of let does not make the code any more imperative or less functional, as long as there are no side effects. Also, the scope is limited to the let block, keeping it "clean," and there should be no harm to performance. IMHO, the code with let is simply more readable and therefore

Extensive use of let?

2009-02-25 Thread levand
Recently, in my code, I have been struggling with which of the two equivalent forms is, in a general sense, "better". (defn my-fn1 [input] (let [value1 (op1 input) value2 (op2 input) value3 (op4 value1 value2)] (op5 value3))) (defn my-fn2 [input] (op5 (op4 (op1 input) (op

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Stephen C. Gilardi
On Feb 25, 2009, at 1:27 PM, Mark Colburn wrote: #!/bin/sh DP="${0%/*}" java -cp ~/src/clojure/clojure.jar:${DP}/clj:${DP}/java - Dnet.sourceforge.waterfront.plugins=${DP}/clj/net/sourceforge/ waterfront/ide/plugins clojure.main ${DP}/clj/net/sourceforge/ waterfront/ide/main.clj $* I propose

Multimethods in other namespaces

2009-02-25 Thread Jeffrey Straszheim
If in namespace one I define (defmulti fred dispatch-fred) and have imported that ns into another, can I just do (defmethod fred ::val [x] ), or do I need to scope the method name? --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: dorun and map

2009-02-25 Thread Perry Trolard
The dynamic resource consumption discussion is interesting & I'm curious about scope, but just to be clear about side-effects in the case of: (dorun (map #(println %) my-vector)) The idiomatic way to do this is (doseq [i my-vector] (println i)) Perry --~--~-~--~~~--

Re: unbean

2009-02-25 Thread .Bill Smith
> It occurs to me that the "unbean" function could be very useful when > writing tests for code that calls Java objects. Yes, that is exactly the use I have in mind. Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Mark Colburn
#!/bin/sh DP="${0%/*}" java -cp ~/src/clojure/clojure.jar:${DP}/clj:${DP}/java - Dnet.sourceforge.waterfront.plugins=${DP}/clj/net/sourceforge/ waterfront/ide/plugins clojure.main ${DP}/clj/net/sourceforge/ waterfront/ide/main.clj $* On Feb 25, 1:32 am, Itay Maman wrote: > On Feb 25, 11:08 am,

Re: unbean

2009-02-25 Thread Kevin Albrecht
It occurs to me that the "unbean" function could be very useful when writing tests for code that calls Java objects. Anyone have thoughts on its use in this way? On Feb 24, 9:18 pm, ".Bill Smith" wrote: > > I tend to associate "bean" with Java beans, so the naming seems to be > > reversed IMHO:

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread mikel
On Feb 25, 9:26 am, Konrad Hinsen wrote: > I have just added a new library to clojure.contrib. It provides a   > proof-of-concept implementation of algebraic data types. An example   > for what you can do with it: > > (deftype tree >    empty-tree >    (leaf value) >    (node left-tree right-tr

Re: error-kit and threads

2009-02-25 Thread Chouser
On Wed, Feb 25, 2009 at 9:05 AM, Jeffrey Straszheim wrote: > Does the stuff in error kit work across thread boundaries.  I'm thinking, > for instance, if you run a computation using pmap, the individual > computations are run inside of Java futures, which will propagate exceptions > back to the c

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Konrad Hinsen
On Feb 25, 2009, at 17:40, David Nolen wrote: > Should print and println be multimethods? It seems the ability to > custom print a data structure would be generally useful. It's already there, just not documented as far as I know. All the printing routines end up calling clojure.core/print-m

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread David Nolen
> > 1) User-friendly printing. > > I implement the multimethods print-method and print-dup for my > classes, which allows me to specify how objects are printed. print- > method and print-dup dispatch on class, so my types need to be > classes or at least derive from a class that is distinct from th

Re: Clojure plugin for IntelliJ IDEA published

2009-02-25 Thread Ilya Sergey
Hello, Robert. Thank you for kind words. Yes, this plugin is officially supported, you may post any issues to mentioned bugtracker. But I prefer to use my gmail address for Google Groups service. Kind regards, Ilya Sergey On Feb 25, 5:22 pm, Robert Lally wrote: > I've been using this since yes

Re: Clojure plugin for IntelliJ IDEA published

2009-02-25 Thread Robert Lally
I've been using this since yesterday, and it really is very good. Up until now, I've been thrashing between aquamacs, vim and textmate for my clojure programming, all have been unsatisfying to me in some way. This is certanly a step up. Ilya, I noticed that you posted from a gmail address. Is thi

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Konrad Hinsen
On Feb 25, 2009, at 16:32, Jeffrey Straszheim wrote: > Is there any reason they cannot be implemented as structs with some > sort of type tag? I suspect that could be done, but some nice features would be lost: 1) User-friendly printing. I implement the multimethods print-method and print-du

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Jeffrey Straszheim
Is there any reason they cannot be implemented as structs with some sort of type tag? On Wed, Feb 25, 2009 at 10:26 AM, Konrad Hinsen wrote: > > I have just added a new library to clojure.contrib. It provides a > proof-of-concept implementation of algebraic data types. An example > for what you c

Algebraic data types in clojure.contrib

2009-02-25 Thread Konrad Hinsen
I have just added a new library to clojure.contrib. It provides a proof-of-concept implementation of algebraic data types. An example for what you can do with it: (deftype tree empty-tree (leaf value) (node left-tree right-tree)) (def a-tree (node (leaf :a) (node (

Re: new laziness: terminology help

2009-02-25 Thread Stuart Halloway
> All sequences are represented by (chains of) (possibly lazy) seqs, of > type ISeq. So yes, sequence/seq(noun)/ISeq are technically synonyms, > but [1] Great. > [1] In practice, a sequence fn (like map et al) may return an empty > sequence, while seq/next will instead return a (forced) thing w

Re: dorun and map

2009-02-25 Thread Rich Hickey
On Feb 25, 9:12 am, Jeffrey Straszheim wrote: > I really like the "close it as the last item in the sequence" trick. Sadly, > I don't see how it can be made exception safe. > Or partial consumption safe. But there is a solution I've already developed for resource management scope, called sco

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Itay Maman
For those of you who tried one of Waterfront's earlier revisions and then switched to revision 147 (latest): In 147 there was a change in the plugin loading order (due to plugin dependencies). If you ran earlier versions you will get the following message as Waterfront is launching: Can't load

Re: new laziness: terminology help

2009-02-25 Thread Rich Hickey
On Feb 24, 9:30 pm, Stuart Halloway wrote: > I am wrestling the sequences chapter of the book into conformance with > the new laziness, and I am finding it tricky to infer accurate > definitions of the words sequence, seq (noun), seq (function), and > ISeq from the variety of extant documentati

Re: dorun and map

2009-02-25 Thread Jeffrey Straszheim
I really like the "close it as the last item in the sequence" trick. Sadly, I don't see how it can be made exception safe. On Wed, Feb 25, 2009 at 9:02 AM, Stuart Sierra wrote: > > On Feb 25, 8:29 am, Meikel Brandmeyer wrote: > > That's interesting. I almost never use doall or dorun together wi

error-kit and threads

2009-02-25 Thread Jeffrey Straszheim
Does the stuff in error kit work across thread boundaries. I'm thinking, for instance, if you run a computation using pmap, the individual computations are run inside of Java futures, which will propagate exceptions back to the caller when the caller gets the value. So, pmap should work fairly tr

Re: dorun and map

2009-02-25 Thread Stuart Sierra
On Feb 25, 8:29 am, Meikel Brandmeyer wrote: > That's interesting. I almost never use doall or dorun together with > map. I found that most side-effects don't give interesting result   > values. I often find I need to do this when the mapping function depends on a dynamic context, like an open s

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Jeffrey Straszheim
Count me interested also. On Wed, Feb 25, 2009 at 7:49 AM, Itay Maman wrote: > > > > On Feb 25, 11:48 am, linh wrote: > > where can i read about "application context" pattern? > It is something I had occasionally used in the past. As I started > working on Waterfront, I realized it is well suit

Re: dorun and map

2009-02-25 Thread Mark Volkmann
On Wed, Feb 25, 2009 at 7:29 AM, Meikel Brandmeyer wrote: > Hi, > > Am 24.02.2009 um 22:25 schrieb Mark Volkmann: > >> Right. That's what I'm doing now ... in many places. I was just asking >> if there is a single function that combines them. It seems reasonable >> to have one since those to func

Re: Flatten a list

2009-02-25 Thread Jeffrey Straszheim
I always end up doing (filter identity '(:fred :mary nil :sue)) (remove nil? ...) is actually more clear. I'll try to remember that. On Tue, Feb 24, 2009 at 10:42 PM, Timothy Pratley wrote: > > user=> (remove nil? '(:a nil nil :b :a)) > (:a :b :a) > > On Feb 25, 2:38 pm, Sean wrote: > > I've go

Re: dorun and map

2009-02-25 Thread Meikel Brandmeyer
Hi, Am 24.02.2009 um 22:25 schrieb Mark Volkmann: Right. That's what I'm doing now ... in many places. I was just asking if there is a single function that combines them. It seems reasonable to have one since those to functions seem to be called together a lot. That's interesting. I almost ne

Re: If/cond thoughts..

2009-02-25 Thread Michel Salim
On Wed, Feb 25, 2009 at 6:19 AM, glow wrote: > > Hi everyone! > I am currently learning Lisp and Clojure. A few days ago i read how > "if" in Arc works and I wonder why it is not the same in Clojure: > (if a b       ; if a then b >    c d       ; elseif c then d >      e)      ; else e. > I thoug

Re: new laziness: terminology help

2009-02-25 Thread Stuart Halloway
I like this, and I am OK with seq (function) being the oddball that returns a seq or nil. Rich, this is what Beta 8 of the book currently says -- ok with you? Stuart > I believe that one of Rich's stated purposes with the latest revision > of the laziness branch was to get rid of some of the

Re: Bugfix for core.line-seq [patch]

2009-02-25 Thread Rich Hickey
On Feb 24, 12:58 pm, Toralf Wittner wrote: > Dear list members, > > It seems that core.line-seq contains a small bug w.r.t. laziness. The > side effect (. rdr (readLine)) occurs before lazy-seq, so the sequence > created is not fully delayed. Fix attached. > Fixed in svn 1306 - thanks for the

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Itay Maman
On Feb 25, 11:48 am, linh wrote: > where can i read about "application context" pattern? It is something I had occasionally used in the past. As I started working on Waterfront, I realized it is well suited for GUI apps in a functional language. I am not sure where you can find information abou

If/cond thoughts..

2009-02-25 Thread glow
Hi everyone! I am currently learning Lisp and Clojure. A few days ago i read how "if" in Arc works and I wonder why it is not the same in Clojure: (if a b ; if a then b c d ; elseif c then d e) ; else e. I thought a bit about it and it seems that Clojure hasn't improved

Re: bug? ClassNotFoundException from macro

2009-02-25 Thread MikeM
Thanks very much for the help. Looks like quoting will work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this grou

Re: Clojure documentation problems

2009-02-25 Thread David Sletten
On Feb 19, 2009, at 2:52 AM, David Sletten wrote: > > The macros page at clojure.org (http://clojure.org/macros) has links > to several points in the API page. The link to the "if-not" macro > appears to be broken (http://clojure.org/api#if-not). There is no > such entry in the API. The same hol

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread linh
where can i read about "application context" pattern? i this the idiomatic way to write GUI in functional languages? i'm writing a small swing based app in clojure, and i have problems wirting the gui, because the gui code tends to be very imperative and messy. On 24 Feb, 15:04, Itay Maman wrote

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Itay Maman
On Feb 25, 11:08 am, bOR_ wrote: > I'm trying to rewrite the wf.bat to a linux version, but I was a bit > puzzled what all the ;%~dp0 's mean. In .bat files %~dp0 specifies the directory where the .bat file is located. In sh scripts, it should be `dirname $0`. >Apparently the bash version of i

Re: bug? ClassNotFoundException from macro

2009-02-25 Thread Frantisek Sodomka
I get different error (running from REPL): (test2 (+ 1 1)) => java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0) (test2 10) => java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0) I think that it has to do with 'test1' in your macro. Function 'test1' gets compiled into a Java class and

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread bOR_
I'm trying to rewrite the wf.bat to a linux version, but I was a bit puzzled what all the ;%~dp0 's mean. Apparently the bash version of it is ${0%/*} java -cp ~/src/clojure/clojure.jar;${0%/*}clj;${0%/*}java - Dnet.sourceforge.waterfront.plugins=${0%/*}clj/net/sourceforge/ waterfront/ide/plugins