Hi Randall,
Am 05.12.2008 um 23:54 schrieb Randall R Schulz:
However, I would like to be able to examine the tree in the locality
of
the current traversal point through path or position specifications.
This approach is commonly used in describing algorithms about logical
formulas (which are in
Chouser a écrit :
> How about this one? Same results as in my previous post. Still as
> lazy as possible. Plus it's so cute!
>
> (defn reduction
> "Returns a lazy seq of the intermediate values of the reduction (as
> per reduce) of coll by f, starting with init."
> ([f coll]
>(if (seq
On Dec 5, 7:37 pm, Stuart Sierra <[EMAIL PROTECTED]> wrote:
> Here's an experiment -- make the filter a normal function, i.e.:
>
Yeah, I tried that in various forms previously - I wanted to make sure
that I wasn't implicitly capturing the parameters of documents-from-
vendors, so I did basically
I got" Failed to load Main-Class manifest attribute from C;/clojure/
clojure/clojure" when I tried to run clojure. Could someone assist me
in getting this solved.
Emeka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Hello,
Clojure newbie here. I'm porting a small Scheme matrix/linear algebra
library over to Clojure as a way to get familiar. In my scheme lib, I
have a (matrix-mult A B) function, but it would be nice to have the
more standard notation (* A B) or (* 3 A) for scalar multiplication.
I see *, /,
On Sat, Dec 6, 2008 at 4:27 AM, Christophe Grand <[EMAIL PROTECTED]> wrote:
>
> But I don't think it's still O(n). I searched for a way to define
> recursively such lists but the only way I found involves using mutation.
> Now with an atom it must be cleaner.
Your comprehension of such things is
On Sat, Dec 6, 2008 at 4:52 AM, Paul Mooser <[EMAIL PROTECTED]> wrote:
>
> Ok, even after the change precisely as you described, I still get the
> same result. The following object is a GC root of a graph worth
> several hundreds of megabytes of memory, consisting basically of a
> giant chain of l
Thanks for all the suggestions!
This modified version is very close to that in the thread:
http://groups.google.com/group/clojure/browse_thread/thread/f0303a9e00b38529/99f02fef21721a2f?lnk=gst&q=alioth+tree#99f02fef21721a2f
(Thanks for pointing that out Meikel. I should have searched old
threads
On Saturday 06 December 2008 01:00, Meikel Brandmeyer wrote:
> Hi Randall,
>
> Am 05.12.2008 um 23:54 schrieb Randall R Schulz:
> > However, I would like to be able to examine the tree in the
> > locality of the current traversal point through path or position
> > specifications. This approach is
On Saturday 06 December 2008 03:18, janus wrote:
> I got" Failed to load Main-Class manifest attribute from C;/clojure/
> clojure/clojure" when I tried to run clojure. Could someone assist me
> in getting this solved.
Start by telling us precisely what you did to "run clojure." Also, your
Subjec
--- On Sat, 12/6/08, Randall R Schulz wrote:
> On Saturday 06 December 2008 03:18, janus wrote:
>> I got" Failed to load Main-Class manifest attribute from C;/clojure/
>> clojure/clojure" when I tried to run clojure.
>
> Start by telling us precisely what you did to "run clojure." [...]
Plus I'm
>Start by telling us precisely what you did to "run clojure."
I have the below in my batch file
SET CLASSPATH=/clojure/clojure/clojure.jar ;\
/clojure/clojure/clojure-contrib.jar;\
java clojure.lang.Repl
To run means clicking batch file. I followed the instructiom from
Clojure Programming Book.
Dave,
> Plus I'm pretty suspicious of that semicolon.
Which one are you referring to?
Emeka
On Dec 6, 4:05 pm, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- On Sat, 12/6/08, Randall R Schulz wrote:
>
> > On Saturday 06 December 2008 03:18, janus wrote:
> >> I got" Failed to load Main-Class man
On 6 déc, 05:09, Mark Fredrickson <[EMAIL PROTECTED]>
wrote:
> Alternatively, could I provide a "multi-
> math" lib to redefine the core math functions?
Type classes would be king.
But at least you can use your definition :
(ns test.test
(:refer-clojure :exclude [+ -]))
(defn +
[a b]
33
On Saturday 06 December 2008 08:10, janus wrote:
> >Start by telling us precisely what you did to "run clojure."
>
> I have the below in my batch file
> SET CLASSPATH=/clojure/clojure/clojure.jar ;\
> /clojure/clojure/clojure-contrib.jar;\
> java clojure.lang.Repl
The instructions are these:
SET
Has anyone been able to use type hints to successfully close the last
bit of difference between the Clojure and Java version on this
benchmark?
On Sat, Dec 6, 2008 at 6:14 AM, PeterB <[EMAIL PROTECTED]> wrote:
> Running in Clojure REPL for java 1.6.0_11 with -server option:
>
> result: -2
> E
A while back I posted an experimental patch to capture each form that
is compiled into a fn. This might be useful in your case, where you
have identified a function but don't have details on it. Here's the
thread:
http://groups.google.com/group/clojure/browse_frm/thread/e63e48a71935e31a?q=
Also,
Would it be possible to make anonymous fns have a "toString" which
incorporates the file and line number they're defined on?
On Sat, Dec 6, 2008 at 9:37 AM, MikeM <[EMAIL PROTECTED]> wrote:
>
> A while back I posted an experimental patch to capture each form that
> is compiled into a fn. This mig
On Friday 05 December 2008 14:54, Randall R Schulz wrote:
> Hi,
>
> I looked at the Clojure implementation of Huet's Zipper and it looks
> great. I like how it delegates construction and dissection of the
> tree structure to client-supplied functions so that it is generic
> w.r.t. to any types (es
I can, and what it has is the elements you might expect for something
defined in the context of filter:
coll
pred
coll is a lazy-cons, and is the start of a chain of a larger number
of lazy conses. One thing that is interesting is that it does not
appear to be the head of the sequence - it's ne
On Dec 6, 5:45 am, Chouser <[EMAIL PROTECTED]> wrote:
> This may not be worth much, but can you see the data members of that
> object? It's not itself the head of a cons chain, presumably, so I'm
> wondering if the data member that *is* at the head has a useful name.
I can, and it has the elemen
On Dec 6, 9:37 am, MikeM <[EMAIL PROTECTED]> wrote:
> A while back I posted an experimental patch to capture each form that
> is compiled into a fn. This might be useful in your case, where you
> have identified a function but don't have details on it. Here's the
> thread:http://groups.google.com/
If you have a space between "jar" and ";" that is a problem.
Stuart
>> Start by telling us precisely what you did to "run clojure."
>
> I have the below in my batch file
> SET CLASSPATH=/clojure/clojure/clojure.jar ;\
> /clojure/clojure/clojure-contrib.jar;\
> java clojure.lang.Repl
>
> To run m
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")
Patch at http://groups.google.at/group/clojure/web/re-gsub.
On Sat, Dec 6, 2008 at 12:52 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> - Renamed the conflicting (defn replace ...) and (defn remove ...)
But 'remove' is also defined by clojure.core
> user=> (load-file "/dar/clojure/zipper-test.clj")
> java.lang.ClassCastException: clojure.lang.LazyCo
On Saturday 06 December 2008 12:27, Chouser wrote:
> On Sat, Dec 6, 2008 at 12:52 PM, Randall R Schulz wrote:
> > - Renamed the conflicting (defn replace ...) and (defn remove ...)
>
> But 'remove' is also defined by clojure.core
That's the point. I changed the names in (my modified copy of) zip.
A wrapper for neo4j, which is a non-relational database using a
network of nodes with properties and traversable relationships.
This is my first Clojure wrapper library, I've tried to keep the
spirit of Clojure by only wrapping things that were verbose or un-
lispy. Please comment and critique. P
Hi all,
A lot of people are writing Clojure-related blog posts; however, I am
often only interested in the Clojure posts they do and not the other
posts. Therefore, I've created a mashup of clojure-related blog posts
using Yahoo Pipes. The description is here:
http://bc.tech.coop/blog/081206.html
--- On Sat, 12/6/08, Julian Morrison wrote:
> A wrapper for neo4j, which is a non-relational database
> using [...] traversable relationships.
Hey, wait...
Dave
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Cl
On Sat, 6 Dec 2008 13:24:52 -0800 (PST)
bc <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> A lot of people are writing Clojure-related blog posts; however, I am
> often only interested in the Clojure posts they do and not the other
> posts. Therefore, I've created a mashup of clojure-related blog po
On Saturday 06 December 2008 13:43, Dave Newton wrote:
> --- On Sat, 12/6/08, Julian Morrison wrote:
> > A wrapper for neo4j, which is a non-relational database
> > using [...] traversable relationships.
>
> Hey, wait...
OK. But I can't hold my breath forever...
> Dave
RRS
--~--~-~--
Hey, I was just looking at neo4j last night. Can you point me to any
papers about the theory behind those kinds of a databases?
Thanks,
Jim
On Dec 6, 3:15 pm, Julian Morrison <[EMAIL PROTECTED]> wrote:
> A wrapper for neo4j, which is a non-relational database using a
> network of nodes with pro
On Saturday 06 December 2008 13:24, bc wrote:
> Hi all,
>
> A lot of people are writing Clojure-related blog posts; however, I am
> often only interested in the Clojure posts they do and not the other
> posts. Therefore, I've created a mashup of clojure-related blog posts
> using Yahoo Pipes. The
A relationship and a relation are different things. Relation means
more or less "table". There are no tables in neo4j, only anonymous
nodes, properties of those nodes, and named connections
("relationships") between nodes.
On Dec 6, 9:43 pm, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- On Sat, 12
Not papers, but...
http://en.wikipedia.org/wiki/Network_database
http://en.wikipedia.org/wiki/Navigational_database
Neo4j is basically a really old design refreshed. The advantages are
that it's fast, dynamic, and schema-free, and fairly lispy in its
inherently recursive structure. The disadvant
On Sat, Dec 6, 2008 at 4:24 PM, bc <[EMAIL PROTECTED]> wrote:
>
> A lot of people are writing Clojure-related blog posts; however, I am
> often only interested in the Clojure posts they do and not the other
> posts.
Thanks, this is a great idea.
At the risk of sounding self-absorbed, though, I n
All,
It is my mistake, this is the error once again. Failed to load Main-
Class manifest attribute from C:\clojure\clojure\clojure-contrib.jar.
I did what Shulz said , however , I still have the same problem.
Emeka
On Dec 6, 7:17 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> If you have a sp
--- On Sat, 12/6/08, janus wrote:
> It is my mistake, this is the error once again. Failed to
> load Main-Class manifest attribute from
> C:\clojure\clojure\clojure-contrib.jar.
> I did what Shulz said, however, I still have the same problem.
Can you post the *exact* classpath and/or files and/or
On Saturday 06 December 2008 14:51, janus wrote:
> All,
>
> It is my mistake, this is the error once again. Failed to load Main-
> Class manifest attribute from C:\clojure\clojure\clojure-contrib.jar.
> I did what Shulz said , however , I still have the same problem.
Two things:
1) My name is Sc
Well, I've dug around on this some more, and I'm unfortunately no
closer to finding an answer. I decided to try to whittle down the
source code to the minimal set which exhibits the problem, and post
the result here, so that at least there's a higher chance that if I'm
making a mistake, someone mi
On Dec 6, 2008, at 6:21 PM, Paul Mooser wrote:
(defn splode [index-path]
(with-local-vars [doc-count 0]
(doseq [document (filter my-filter-pred (document-seq index-
path))]
(var-set doc-count (inc @doc-count)))
'done))
The fn in question is likely the one in the macro expansion of
(for [x (range 1 20) :when (> x 8) :while (< 0 (rem x 13))] x) ==>
java.lang.Exception: Unsupported binding form: :while
But:
(for [x (range 1 20) :when (> x 8)] x) ==>
(9 10 11 12 13 14 15 16 17 18 19)
And:
(for [x (range 1 20) :while (< 0 (rem x 13))] x) ==>
(1 2 3 4 5 6 7 8 9 10 11 12)
Is it
I played around with some code, trying to explore the memory problems
with 'filter' that is discussed in another thread, when I noticed an
unexpected behavior from 'nth'.
Behold:
user=> (nth (repeatedly (fn [] 0)) 1000)
java.lang.OutOfMemoryError: Java heap space (NO_SOURCE_FILE:0)
user=> (d
On Saturday 06 December 2008 17:11, Christian Vest Hansen wrote:
> I played around with some code, trying to explore the memory problems
> with 'filter' that is discussed in another thread, when I noticed an
> unexpected behavior from 'nth'.
>
> Behold:
>
> user=> (nth (repeatedly (fn [] 0)) 1
On Sat, Dec 6, 2008 at 11:11 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> On Saturday 06 December 2008 13:24, bc wrote:
> Also, what is the "feed:" scheme? When I click those links (in Firefox
> on my Linux system), nothing happens. What sort of application supports
> it? For whatever reaso
On Dec 6, 4:35 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
> The fn in question is likely the one in the macro expansion of the
> lazy-cons inside filter. As a next step, I would try replacing the
> call to "doseq" with the equivalent loop/recur:
That's a good idea, Steve - I didn't t
On Sun, Dec 7, 2008 at 2:22 AM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> On Saturday 06 December 2008 17:11, Christian Vest Hansen wrote:
>> I played around with some code, trying to explore the memory problems
>> with 'filter' that is discussed in another thread, when I noticed an
>> unexp
On Dec 6, 2008, at 8:28 PM, Paul Mooser wrote:
That's a good idea, Steve - I didn't totally understand the code you
included, but I do always forget that clojure has destructuring in its
binding forms, so I rewrote it like this, which I believe should be
fine (correct me if I am wrong):
Thank
I think I've been able to duplicate your results with a simpler
example.
I first tried this:
(defn splode [n]
(with-local-vars [doc-count 0]
(doseq [document (filter #(= % 1) (range n))]
(var-set doc-count (inc @doc-count)))
'done))
and it doesn't blow up with (splode 10
On Dec 2, 10:42 am, bOR_ <[EMAIL PROTECTED]> wrote:
> I'll compare it later on to the one ruby is using (Mersenne Twister
> Algorithm, which is excellent for monte carlo-like simulations), just
> to get my own bearings.
>
An alternative to MT that is as good, according to RNG expert George
Marsag
It doesn't blow the heap on my machine, using the "Clojure in a Box"
setup, and I only have 1GB of memory total. I added a couple 0s, and
it didn't make a difference.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I'm working on Specjure, a library that is similar to Ruby's RSpec for
TDD/BDD.
Originally I ported the RSpec API exactly, but changed it later to be more
friendly to functional Clojure (unlike OO Ruby.)
It is still being worked on, but I'm announcing it to the list now if anyone
would like to sta
Some more experimentation:
(defn splode3 [n]
(with-local-vars [doc-count 0]
(doseq [document (filter #(= % (- n 1)) (map inc (range n)))]
(var-set doc-count (inc @doc-count)))
'done))
which does not blow up with (splode3 10).
--~--~-~--~~~---~-
This also fails:
(defn splode [n]
(doseq [document (filter #(= % 20) (map inc (range n)))]))
Looking at the heap dump, I see that the first item for which the
filter returns true is the root of the chain of lazy cons's that's
being kept.
The filter is constructing a lazy-cons from the fi
You reproduced it for sure --
On Dec 6, 5:58 pm, MikeM <[EMAIL PROTECTED]> wrote:
> Next, I tried this (since your app filters the seq from a map):
>
> (defn splode2 [n]
> (with-local-vars [doc-count 0]
> (doseq [document (filter #(= % 1) (map inc (range n)))]
> (var-set doc-count (in
On Dec 6, 2008, at 9:48 PM, Paul Mooser wrote:
I also saw your subsequent example which uses a different anonymous
function which does NOT blow up, and that's very interesting. I'm not
sure why this would be, but it seems that filter ends up holding on to
the collection its filtering internally
I think I understand. The lazy-cons that filter is constructing
maintains a reference to the whole coll in its tail so that it can
evaluate (rest coll) when it is forced. Hmmm!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
On Dec 7, 3:51 am, janus <[EMAIL PROTECTED]> wrote:
> All,
>
> It is my mistake, this is the error once again. Failed to load Main-
> Class manifest attribute from C:\clojure\clojure\clojure-contrib.jar.
> I did what Shulz said , however , I still have the same problem.
>
Could you copy the err
On Dec 6, 2008, at 10:27 PM, Paul Mooser wrote:
I think I understand. The lazy-cons that filter is constructing
maintains a reference to the whole coll in its tail so that it can
evaluate (rest coll) when it is forced. Hmmm!
In the current implementation of filter, coll is held the entire tim
Except your version of filter doesn't do any filtering on the rest in
the case where the first satisfies the predicate.
On Sat, Dec 6, 2008 at 7:43 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:
> If you use a definition of filter like this in your test, I think it will
> succeed:
>
> (defn fi
On Dec 6, 2008, at 10:43 PM, Stephen C. Gilardi wrote:
The following separation into two functions appears to solve it.
I'll be looking at simplifying it.
Well it doesn't run out of memory, but it's not an implementation of
filter either... ah well.
--Steve
smime.p7s
Description: S/MI
On Dec 6, 2008, at 10:52 PM, Mark Engelberg wrote:
Except your version of filter doesn't do any filtering on the rest in
the case where the first satisfies the predicate.
Right. It's looking to me now like this may have to be solved in Java.
I don't see how to write this in Clojure without
Well, part of the puzzle is to figure out why filter works just fine
on the output of the range function, but not on the output of the map
function.
I'm starting to wonder whether there might be a fundamental bug in the
java implementation of LazyCons. Maybe it doesn't implement "first"
correctl
OK, I see what you're saying now. Range doesn't cause problems
because it's not coded in a way that links to a bunch of other cells.
So it's plausible that the problem is the way filter hangs on to the
collection while generating the rest (since it's not a tail-recursive
call in that case).
This
On Dec 6, 2008, at 11:08 PM, Mark Engelberg wrote:
Well, part of the puzzle is to figure out why filter works just fine
on the output of the range function, but not on the output of the map
function.
Good point and my previous analysis was all wet. lazy-cons is a macro.
Its arguments aren't
On Sat, Dec 6, 2008 at 2:42 PM, Chouser <[EMAIL PROTECTED]> wrote:
>
> On Sat, Dec 6, 2008 at 4:24 PM, bc <[EMAIL PROTECTED]> wrote:
>>
>> A lot of people are writing Clojure-related blog posts; however, I am
>> often only interested in the Clojure posts they do and not the other
>> posts.
>
> Tha
On Sat, Dec 6, 2008 at 2:11 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> On Saturday 06 December 2008 13:24, bc wrote:
>> Hi all,
>>
>> A lot of people are writing Clojure-related blog posts; however, I am
>> often only interested in the Clojure posts they do and not the other
>> posts. The
On Fri, Dec 5, 2008 at 5:23 PM, Mon Key <[EMAIL PROTECTED]> wrote:
>
> Nice blog entry :)
Thanks! :)
> My setup tends to mirror yours esp. as I've culled most of it from
> your blog over the years...
> Most of my startup scripts are modified versions of those you've
> shared elsewhere.
Glad you
On Dec 6, 8:38 pm, puzzler <[EMAIL PROTECTED]> wrote:
> Maybe LazyCons shouldn't cache. Make LazyCons something that executes
> its function every time. For most things, it's not a problem because
> sequences are often traversed only once. If a person wants to cache
> it for multiple traversals
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 space".
(use 'clojure.contrib.duck-streams)
(count (line-seq (reader "big.csv")))
If I change "count" to "dorun" then it will return without problem.
I also have this problem, unless I set my heap to be substantial -
going up in increments of 128M, I need to have at least a 768M heap
for this to not occur. That seems completely crazy, but the rest of
you are saying you don't have this issue.
Maybe it's time to start looking at what platforms w
It's been mentioned before but I'd like to see a planet.clojure.org à
la the planet planet powered sites (http://www.planetplanet.org/).
On Dec 6, 2008, at 4:24 PM, bc wrote:
>
> Hi all,
>
> A lot of people are writing Clojure-related blog posts; however, I am
> often only interested in the C
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 space".
>
> (use 'clojure.contrib.duck-streams)
> (count (line-seq (r
On Dec 7, 11:18 am, Paul Mooser <[EMAIL PROTECTED]> wrote:
> I also have this problem, unless I set my heap to be substantial -
> going up in increments of 128M, I need to have at least a 768M heap
> for this to not occur. That seems completely crazy, but the rest of
> you are saying you don't
I run Java 6 on Unbuntu with an initial heap size of 500M and a maximum
of 1G.
I never use the default allocations.
$ java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)
user=> (time (nth (repeatedl
75 matches
Mail list logo