Re: Running out of memory when using filter?

2008-12-07 Thread rzeze...@gmail.com
On Dec 7, 1:52 am, Chouser <[EMAIL PROTECTED]> wrote: > On Sun, Dec 7, 2008 at 1:16 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > I'm also running into, what I believe to be, the same problem.  Every > > time I run the following code I get "java.lang.OutOfMemoryError: Java > > heap spac

Re: In core structure editor, anyone?

2008-12-10 Thread rzeze...@gmail.com
On Dec 10, 3:59 pm, falcon <[EMAIL PROTECTED]> wrote: > Could you describe in-core editing a bit more?  Sounds interesting. > +1 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

code golf

2008-12-17 Thread rzeze...@gmail.com
Neat challenge on stackoverflow: http://stackoverflow.com/questions/372668/code-golf-how-do-i-write-the-shortest-character-mapping-program I added an implementation in Clojure. One that I'm sure could be greatly improved on. I don't really care for the extremely obfuscated examples. Sure, it's

Re: code golf

2008-12-17 Thread rzeze...@gmail.com
On Dec 17, 8:09 pm, Chouser wrote: > > I don't think I agree with the premise of the question, that golf > answers help anyone learn about other languages. > > But I can't deny that golfing is fun! > > (defn enc[s e](apply str(map(into{}(for[[o _ n](partition 3 4 e)][o n]))s))) > > I can't figu

Re: code golf

2008-12-17 Thread rzeze...@gmail.com
On Dec 17, 9:53 pm, "Mark Engelberg" wrote: > This shaves 14 characters off of Chouser's solution: > (defn enc[s e](apply str(map(apply hash-map(take-nth 2 e))s))) > > rzezeski:  The problem statement  is somewhat ambiguous about what to > do if the character is missing from the mapping.  It sa

Re: Using java.ext.dirs to manage the Classpath for Clojure REPLs

2009-01-04 Thread rzeze...@gmail.com
I think this should be fine for 99% of situations, but I think it's also fair to say this is an unorthodox use of java.ext.dirs. I've never really had a firm grip on the idiomatic use of Java's extension mechanism, but I do know that they claim it is for well-established extension/optional packag

Re: Using java.ext.dirs to manage the Classpath for Clojure REPLs

2009-01-04 Thread rzeze...@gmail.com
On Jan 4, 6:06 pm, lpetit wrote: > Note that since JDK 1.6, it is possible to use the * wildcard in > classpath items to embed all the jars in a directory at once. > > So with proper use of links in a "root" directory containing a bunch > of jars, it's possible to shorten the classpath to DIR/*

(alength nil) => java.lang.IllegalArgumentException: More than one matching method found

2009-01-05 Thread rzeze...@gmail.com
I was just messing around with array's and produced the following exception. I don't actually need this to work for any reason, but I was rather surprised by the behavior. Is this a bug or expected behavior? Please note I'm using revision 1195. user=> (alength nil) java.lang.IllegalArgumentExce

Re: (alength nil) => java.lang.IllegalArgumentException: More than one matching method found

2009-01-06 Thread rzeze...@gmail.com
On Jan 6, 9:54 am, Chouser wrote: > On Mon, Jan 5, 2009 at 11:29 PM, rzeze...@gmail.com > wrote: > > > I was just messing around with array's and produced the following > > exception.  I don't actually need this to work for any reason, but I > > was rathe

Re: finding all vars starting with *

2009-01-06 Thread rzeze...@gmail.com
On Jan 4, 6:05 pm, "Brian Doyle" wrote: > Today I found out about the var *file*.  I looked it up *file* on > clojure.com/api and couldn't find anything. > Is there some place where all of these vars are defined?   Is there some way > programatically I can find > them all?  Thanks. I'm bored, a

Re: metadata question

2009-01-06 Thread rzeze...@gmail.com
On Jan 6, 11:35 pm, wubbie wrote: > Hi, > Here is the question on differences between with-meta and #^ > Specifically 1) and 2) are different in that 1) has meta info carried > over > to jumping-wubbie, while 2) has not. > What's the rationale behind this? > > user=> (def wubbie {:name "Wubbie"

Re: metadata question

2009-01-06 Thread rzeze...@gmail.com
Looking at how the #^ macro is used in core.clj confuses me even more. For example: user=> (def #^{:arglist '([name]) :doc "Say hello."} hello (fn hello [name] (println (str "Hello, " name #'user/hello user=> (hello "ryan") Hello, ryan nil I mean I kind of follow it, but not totally. Is th

Re: metadata question

2009-01-07 Thread rzeze...@gmail.com
On Jan 7, 10:37 am, Rich Hickey wrote: > On Jan 7, 1:01 am, "rzeze...@gmail.com" wrote: > > > Looking at how the #^ macro is used in core.clj confuses me even more. > > > For example: > > > user=> (def #^{:arglist '([name]) :doc "Say hel

Re: finding all vars starting with *

2009-01-09 Thread rzeze...@gmail.com
On Jan 8, 5:04 pm, Chouser wrote: > On Tue, Jan 6, 2009 at 2:53 PM, rzeze...@gmail.com wrote: > > > On Jan 4, 6:05 pm, "Brian Doyle" wrote: > >> Is there some place where all of these vars are defined?   Is there some > >> way > >> programatic

Re: Suggested functions for core: any? none?

2009-01-14 Thread rzeze...@gmail.com
On Jan 14, 12:01 am, GS wrote: > On Jan 14, 2:27 pm, "Mark Engelberg" wrote: > > > I also find the choice of some/not-any? as opposites to be hard to > > remember.  I'd rather it be some/not-some? or any/not-any? > > I think some and any? both have their place. > > (let [foo  (some prime? numseq

Re: when performance matters

2009-01-14 Thread rzeze...@gmail.com
On Jan 13, 8:04 am, Mark P wrote: > > A macro cannot depend on runtime information. A macro is a function   > > that is called at compile time, its argument is an expression (as   > > written by the programmer, or as returned by another macro), and its   > > result is a modified expression. There

Re: Two errors building closure

2009-01-16 Thread rzeze...@gmail.com
Looks like you are attempting to compile with a 1.4.x JDK. You need to compile with JDK 1.5 or higher. -Ryan On Jan 15, 5:42 pm, Ron Parker wrote: > I am trying to build Clojure on Fedora 10. When I first run ant, I get > a message about the compliance level 1.4 not supporting target version >

svn:ignore clojure.jar, classes, target

2009-01-20 Thread rzeze...@gmail.com
Any reason that clojure.jar, classes, and target are not on the svn:ignore list? -Ryan --~--~-~--~~~---~--~~ 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

merge, not just for maps?

2009-01-23 Thread rzeze...@gmail.com
user=> (doc merge) - clojure.core/merge ([& maps]) Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result. nil According to merg

Re: merge, not just for maps?

2009-01-24 Thread rzeze...@gmail.com
> On Jan 24, 10:51 am, e wrote: > > > merge confused me, too.  I was surprised to see in the docs that its input > > needn't be sorted (or have anything to do with lists)  . . . .or maybe it > > merges unsorted things however, but where's the discussion o

Re: what's the typical usage of fn constantly

2009-01-25 Thread rzeze...@gmail.com
Following James's description, I would image constantly's implementation to look something like the following. (defn constantly [value] #(identity value)) If you haven't seen the # macro before, the form below is equivalent. (defn constantly [value] (fn [] (identity value))) Making use of Chri

Re: A Clojure documentation browser

2009-02-11 Thread rzeze...@gmail.com
Nice work! Two things related to 'strcat'. 1) This is already implemented as clojure.core/str (and is more efficient than concat'ing) 2) This function is never called :) I have some idea's related to the presentation, but I don't have time to iterate them right now. -Ryan On Feb 11, 8:29 am,

Re: A Clojure documentation browser

2009-02-16 Thread rzeze...@gmail.com
On Feb 12, 3:31 pm, Craig Andera wrote: > > Nice work! > > Thanks. > > > Two things related to 'strcat'. > > > 1) This is already implemented as clojure.core/str (and is more > > efficient than concat'ing) > > 2) This function is never called :) > > Yeah, that code was cut and pasted from some ol

Re: Shouldn't "doto" be named just "with"

2009-03-06 Thread rzeze...@gmail.com
I think good arguments have been made for "doto," but I must say I prefer "with" slightly more. FWIW, Groovy calls it "with." http://javajeff.blogspot.com/2008/11/getting-groovy-with-with.html The great thing about Clojure is that if this really bothered me I could easily take matters into my o

Re: Unicode, accented characters

2009-03-06 Thread rzeze...@gmail.com
On Mar 6, 5:58 pm, max3000 wrote: > > I don't really want to use the SVN version because I'm developing an > application and can really do without the (normal) instabilities that > come with development builds. > FYI, you may want to consider using SVN for now because there have been breaking ch

Re: version of -> short-circuiting on nil

2009-03-11 Thread rzeze...@gmail.com
Not that I have any immediate use for this at the moment, but I +1 your proposal. I make use of the ?. operating in Groovy, and it can be helpful. On Mar 10, 4:08 am, Laurent PETIT wrote: > Hello, > > 2009/3/10 Jason Wolfe > > > > > > > > > > (let [person (get-the-person)] > > >   (when-not (n

Re: VimClojure 2.0.0 released (merged with Gorilla)

2009-03-12 Thread rzeze...@gmail.com
Meikel, found a few more things that might need fixing. 1) In the preview window it says "Use \p to close this buffer!", but I have m LocalLeader mapped to ",". I'm guessing maybe you hardcoded this by accident? 2) When doing a macroexpand (me or m1), the cursor is moved into the REPL buffer.

Re: speed question

2009-04-03 Thread rzeze...@gmail.com
Could Clojure have something similar to CL's 'defconstant'? http://gigamonkeys.com/book/variables.html On Apr 2, 4:09 pm, Bradbev wrote: > It seems to me that the real solution is that the Clojure compiler > needs to support global constants.  You could probably emulate the > behaviour by rebin

Re: Keeping a ref and a DB in sync

2009-04-03 Thread rzeze...@gmail.com
Brian, I imagine you are asking this in relation to your blog engine? I came up with solution, that is, if you don't mind writing the persistent data fresh every time. http://paste.lisp.org/display/77987 Basically, I added a watch to the *comment* ref, which set the *db* ref to the new state of

Re: Contribs with dependencies

2009-04-15 Thread rzeze...@gmail.com
My .02 cents... I always viewed Contrib as an incubator of sorts for Core. That it was simply a testing ground for functionality that *MIGHT* make it into Core if enough people find it useful, or Rich hands down his good graces. Requiring a few external libs here and there, and breaking Contrib

Re: Contribs with dependencies

2009-04-15 Thread rzeze...@gmail.com
My .02 cents... I always viewed Contrib as an incubator of sorts for Core. That it was simply a testing ground for functionality that *MIGHT* make it into Core if enough people find it useful, or Rich hands down his good graces. Requiring a few external libs here and there, and breaking Contrib

Re: Contribs with dependencies

2009-04-15 Thread rzeze...@gmail.com
On Apr 15, 5:07 pm, Stuart Sierra wrote: > On Apr 15, 2:10 pm, "rzeze...@gmail.com" wrote: > > > P.S.  I don't want to get off-track, but I also don't understand why > > ClojureCLR or clojurescript are included in Contrib.  I also don't > >

Re: The Path to 1.0

2009-04-17 Thread rzeze...@gmail.com
As with any decision, it will be impossible to please everyone. I think the Git vs Subversion talk is way off topic at this point, but to each his own. Rich, I think it really depends on what *YOU* want Clojure to be. If you want to take a Haskell like approach and "avoid success at all costs"

Re: Enlive questions

2009-05-05 Thread rzeze...@gmail.com
Either I've missed something, or Enlive *appears* to have problems handling comment tags. I was using Enlive against an already existing HTML file and kept getting the following exception (please note it is HTML 4.01 Strict and passed validation): java.lang.RuntimeException: java.lang.IllegalArg

Re: Enlive questions

2009-05-07 Thread rzeze...@gmail.com
On May 6, 1:36 am, Christophe Grand wrote: > Hello Ryan, > > rzeze...@gmail.com a écrit :> Either I've missed something, orEnlive*appears* > to have problems > > handling comment tags. > > Indeed. I pushed a fix, please tell me whether it works for yo

Re: immutable defs?

2009-10-06 Thread rzeze...@gmail.com
On Oct 2, 11:52 am, Mark Tomko wrote: > However, outside the scope of a function, it seems that it's possible > for bindings to be redefined later in a file without causing an > immediate error.  This could easily lead to mistakes that would > manifest as silent and potentially inexplicable beha

Re: Clojure is two!

2009-10-16 Thread rzeze...@gmail.com
On Oct 16, 12:12 pm, Rich Hickey wrote: > http://clojure.blogspot.com/2009/10/clojure-is-two.html > > Thanks again to all! > > Rich "Stu Halloway's terrific book, and more books on the way" Can anyone elaborate on this? --~--~-~--~~~---~--~~ You received this mes

Re: Web application framework (beta)

2009-12-01 Thread rzeze...@gmail.com
I'm not privy to all the technical details, but perhaps work done on Swarm could be insightful? http://code.google.com/p/swarm-dpl/ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note tha

Re: Space leak with lazy sequences.

2009-12-01 Thread rzeze...@gmail.com
I'm having similar problems, but am hesitant to post until I do some further analysis. However, I thought I'd share some techniques I'm trying to use to hunt down my memory leak. First, you can make GC verbose. -verbose:gc For even more detail, add the following. -XX:+PrintGCTimeStamps -XX:+Pr

Re: strange typecheck error

2009-12-30 Thread rzeze...@gmail.com
On Dec 30, 12:53 pm, Alex Ott wrote: > > If need, i can submit somebody full test case I think this might help because it's hard to tell what you are trying to do without a little more context. Some odd things that stand out to me: 1) You call loop, but you should be calling recur. E.g. (lo

Re: more lazy "fun"

2010-02-01 Thread rzeze...@gmail.com
On Jan 28, 3:26 pm, Raoul Duke wrote: > [gmail is freaking out, apologies if this is sent twice] > > On Thu, Jan 28, 2010 at 12:23 PM, DanL wrote: > > When exactly would a lazy sequence evaluate to false? > > i thought it was happening with code like: > > (let [final-answer (and (map #(= "foo"

Re: Some basic guidance to designing functional vs. state parts of app

2010-03-03 Thread rzeze...@gmail.com
On Mar 2, 11:34 pm, Sophie wrote: > > How do I choose? What are the trade-offs? > > Any and all guidance, insights, advice etc. welcome! > > Thanks! To me, it seems like you have two orthogonal pieces of data, and a function that builds a report from that data. You have a set of job listings,

Re: Reductions bug

2010-05-31 Thread rzeze...@gmail.com
Looks like a bug in reductions? The lazy-seq macro expects something the implements ISeq, but the result of (+) is 0. Not sure if this is the right fix, but it works. (defn reductions "Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with

bit-and reflection warning

2010-06-01 Thread rzeze...@gmail.com
When using bit-and with longs I get a reflection warning. How can I make this go away? user> (bit-and (long -10) 0x) Reflection warning, NO_SOURCE_FILE:1 - call to and can't be resolved. 4294967286 -- You received this message because you are subscribed to the Google Groups "Clojure" g

Re: apply with constructors

2010-06-02 Thread rzeze...@gmail.com
> Can you let the fn call figure that out for you? Like so: > >     (apply (fn ([p1 p2] (new Connection.Configuration p1 p2)) >                ([p1 p2 p3] (new Connection.Configuration p1 p2 p3))) >            params) > > I realize that reflection is probably better in this case, but was > wonderi

Re: bit-and reflection warning

2010-06-02 Thread rzeze...@gmail.com
I was able to make this go away by adding a method to Numbers.java. I have a use case where I'm calling bit-and with two longs tens of millions of times. Is there another way I could avoid this reflection without this change to the Java source? diff --git a/src/jvm/clojure/lang/Numbers.java b/s

Re: Passing Arguments From Java to Clojure

2010-06-16 Thread rzeze...@gmail.com
-- CallClojure.java -- import clojure.lang.RT; import clojure.lang.Var; import clojure.lang.PersistentVector; public class CallClojure { static PersistentVector toVec(int[][] arr) { PersistentVector pv = PersistentVector.EMPTY; for (int[] a : arr) { Persist

Re: Basic toolset for non-Java programmer

2010-06-18 Thread rzeze...@gmail.com
While not reflective of the entire community, here's my suggestions. > > - Build tools: There seem to be things like ant, maven, leiningen. How > do they relate to each other? Is there an "obvious" best answer or > should I be expecting to check them all out depending on my needs? In > that case,

Re: Clojure script in the classpath

2010-06-18 Thread rzeze...@gmail.com
On Jun 18, 6:15 pm, Paul Moore wrote: > I've just seen a couple of postings which, if I'm not mistaken, imply > that it's possible to have a Clojure script in my classspath. Is that > right? Yes, you can have .clj files on your classpath. In fact, you can pretty much have anything on your classp

Re: classpath and require

2010-06-18 Thread rzeze...@gmail.com
On Jun 18, 5:00 pm, Mohammad Khan wrote: > C:\Projects.clj>java -cp > c:\clojure-contrib\clojure-contrib.jar;c:\clojure\clojure.jar clojure.main > Clojure 1.1.0-alpha-SNAPSHOT > user=> (require 'examples.introduction) > java.io.FileNotFoundException: Could not locate > examples/introduction__ini

Re: Erlang/OTP in clojure

2011-08-12 Thread rzeze...@gmail.com
Ole, Glad you liked my posts on Riak. I took a quick glance at your code and it's amazing how much Clojure I've forgotten over the last year. I need to read my Joy of Clojure :) If you're looking for Erlang/OTP in Clojure land than I think an easier path might be to look at Erjang [1]. AFAICT,

Re: Baltimore Functional Programming

2011-11-30 Thread rzeze...@gmail.com
I'm also interested. I just started to go to beehive occasionally and I was recently discussing with someone how it would be nice to have a FP group. I live in Federal Hill. On Nov 30, 11:09 am, Gary Trakhman wrote: > Awesome, so it looks like there will be enough people to make this happen. >