odd error with filter

2009-01-26 Thread bOR_
Here is the error. (filter #(:born \...@%) world) java.lang.IllegalArgumentException: Start must be less than or equal to end: 2147483647, -2147483648 It is probably something I have done wrong in the code (the simulation crashed with a "java.lang.RuntimeException: Agent has errors (NO_SOURCE_FI

Re: import doesn't work when jar was loaded with add-classpath ?

2009-01-26 Thread Gaetan Morice
In fact it has been corrected in the clojure svn.Sorry for the noise, Gaetan 2009/1/26 gaetan > > I am not sure of that but it may come, as Eric suggest, from the > import function in core.clj. Indeed this function is based on > Class#forName which use Reflection#getCallerClass to find the clas

Re: Dauphin: mona lisa genetic algorithm in clojure

2009-01-26 Thread bOR_
According to one of the posts beneath the log, the issue has been fixed in the latests svns. I have no clue what the technical problem was in clojure's source. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure

Re: Ugly Sudoku solver

2009-01-26 Thread Tzach
Thanks Konrad I do not understand the benefit of storing the map-board result. The map-board function it self is using lazy for loop. Why isn't the laziness transitive automatically? On Jan 11, 12:05 pm, Konrad Hinsen wrote: > On 11.01.2009, at 08:56,Tzachwrote: > > > Following your good advice,

Re: greatest and least

2009-01-26 Thread Mark Engelberg
I personally don't think I'd use the functions that return more than one min/max. I think in such contexts, I'm usually more interested in just sorting the whole collection. So I'd be happy just with the ones that return one result. --~--~-~--~~~---~--~~ You rece

Re: Parallel inner product

2009-01-26 Thread Luc Prefontaine
user=> (time (dot-product vec1 vec2)) "Elapsed time: 2646.265984 msecs" 114088450 user=> (time (inner-product vec1 vec2)) "Elapsed time: 5098.085298 msecs" 114088450 Java command is: rlwrap --remember -c -b "(){}[],^%0@"";:''|\" -f /home/lprefontaine/.clojure/.clj_comple

Re: def vs. intern

2009-01-26 Thread James Reeves
On Jan 27, 2:08 am, Mark Volkmann wrote: > Let's see if I've got this straight. > > (def foo 1) creates a Var in the default namespace with a value of 1. > > (create-ns 'com.ociweb.demo) ; creates a new namespace > (intern 'com.ociweb.demo foo 2) ; creates another Var named foo, but > it's not in

def vs. intern

2009-01-26 Thread Mark Volkmann
Let's see if I've got this straight. (def foo 1) creates a Var in the default namespace with a value of 1. (create-ns 'com.ociweb.demo) ; creates a new namespace (intern 'com.ociweb.demo foo 2) ; creates another Var named foo, but it's not in the default namespace But the last line gives a java

Regression tests for contrib consideration

2009-01-26 Thread Shawn Hoover
I've written a few tests for bug fixes from the main line of Clojure, and I would like to get feedback and contribute them to contrib if they're useful. I have patches to clojure.contrib.test-clojure for the following topics: reader: numeric constants of different types don't overwrite each other

Re: fit for contribution to clojure.contrib.ns-utils?

2009-01-26 Thread Dan Larkin
On Jan 17, 2009, at 6:29 PM, Stephen C. Gilardi wrote: > > I think it's interesting experimental code. Please do send in a CA > and let's get something like this into ns-utils. > I am now listed on http://clojure.org/contributing so feel free to commit resolve* (or something like it). --~-

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-26 Thread Jason Wolfe
On Jan 26, 2009, at 4:24 PM, Mark Engelberg wrote: > > Hey, I just looked back at the original post that started the thread. > At some point, I had changed my function so (cartesian-product) > returned nil instead of (nil), but based on Jason's post, I've changed > it back in another paste annotat

Parallel inner product

2009-01-26 Thread redhotmonk
Could someone who has a machine with more than 2 cores please run the following code? It calculates the inner product of two given vectors. Usage: (inner-product [1 2 3] [4 5 6]) => 32 You can change the "9000" which is sprinkled over the code (I know it's not beautiful, but I'm new to clojure so

Re: Dauphin: mona lisa genetic algorithm in clojure

2009-01-26 Thread Christopher
This is a great post. However, the author brings up an issue with the way that lambdas are handled by the JVM. According to the article, lambdas are not garbage collected and can therefore overrun the PermGen, a special place in the heap for storing anonymous classes, and as a result, the user mus

Re: changes to test_clojure and test_contrib

2009-01-26 Thread Stephen C. Gilardi
On Jan 26, 2009, at 7:43 PM, Shawn Hoover wrote: I have a few tests in the works and am lacking commit access as well. Should test contributions follow the procedure of group discussion, then file an issue, then post a patch? If so, what would you like to know about the patch(es)? I cons

Re: greatest and least

2009-01-26 Thread Vincent Foley
Chouser asked me Saturday night if it would be possible to reduce the number of functions in the module. I looked at the problem, and if we want to keep the two sets of functions (returning one element and returning many elements), idiomatically, it seems like all the functions will have to stay:

Re: changes to test_clojure and test_contrib

2009-01-26 Thread Shawn Hoover
On Sun, Jan 25, 2009 at 6:51 PM, Frantisek Sodomka wrote: > I have some tests ready for test_clojure. I asked Rich for SVN access > rights. There is gonna be more tests soon :-) > > Frantisek > Contrib Stewards, I have a few tests in the works and am lacking commit access as well. Should test co

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-26 Thread Mark Engelberg
Hey, I just looked back at the original post that started the thread. At some point, I had changed my function so (cartesian-product) returned nil instead of (nil), but based on Jason's post, I've changed it back in another paste annotation. --~--~-~--~~~---~--~~ Y

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-26 Thread Mark Engelberg
I updated the paste with the changes we've discussed. http://paste.lisp.org/display/74134#3 I'll keep playing around to see if I can get it faster, but so far, this is the fastest way I've found to generate the cartesian product in standard order. --~--~-~--~~~---~--

Re: default namespaces

2009-01-26 Thread Stephen C. Gilardi
On Jan 26, 2009, at 6:39 PM, Mark Volkmann wrote: I still have a question though. Why is it that when I use the ns macro to create a new namespace, the core symbols are still available even though I haven't done a refer on clojure.core? That's one of the features of the ns macro. It handles t

Dauphin: mona lisa genetic algorithm in clojure

2009-01-26 Thread bOR_
Hope this isn't a double-post, but here is a nice example of a rewrite of some reddit post on a genetic algorithm for generating the mona lisa in clojure by Yann N. Dauphin http://npcontemplation.blogspot.com/2009/01/clojure-genetic-mona-lisa-problem-in.html --~--~-~--~~~-

Re: default namespaces

2009-01-26 Thread Mark Volkmann
On Mon, Jan 26, 2009 at 5:31 PM, Mark Volkmann wrote: > In a running script it seems that the symbols in clojure.core are > always available regardless of the current namespace. I just learned this isn't true. Just like in a REPL, the default namespace for a running script is initially set to us

default namespaces

2009-01-26 Thread Mark Volkmann
In a running script it seems that the symbols in clojure.core are always available regardless of the current namespace. This is different in a REPL. The initial default namespace, user, pulls in all of core (with a refer) so those symbols can be used without namespace-qualifying them. However, if

Re: "immigrate" function for namespaces

2009-01-26 Thread Cosmin Stejerean
On Mon, Jan 26, 2009 at 4:48 PM, James Reeves wrote: > > On Jan 26, 10:29 pm, Cosmin Stejerean wrote: > > Can you help me understand the difference between this and use (or :use > in > > ns)? > > use is internal to the current namespace. You can use other namespaces > without their publics being

Re: "immigrate" function for namespaces

2009-01-26 Thread James Reeves
On Jan 26, 10:29 pm, Cosmin Stejerean wrote: > Can you help me understand the difference between this and use (or :use in > ns)? use is internal to the current namespace. You can use other namespaces without their publics being added to the current namespace. So: => (ns a) => (def x 10) => (ns

Re: an example where locking is appropriate?

2009-01-26 Thread Stuart Halloway
Hi Christian, You are right, I left out the @result. (So far I haven't yet needed the value so I don't have a test for that scenario. Classic case of over-documenting.) I will take the double-check out. Not only is its value limited, its confusion potential is high. Stuart > "All other i

Re: "immigrate" function for namespaces

2009-01-26 Thread Cosmin Stejerean
On Mon, Jan 26, 2009 at 4:20 PM, James Reeves wrote: > > Hi folks, > > I've recently found myself having to choose between dividing > functionality between many specific namespaces, or having a few very > generic namespaces. In theory, being specific is the better choice, as > it allows users to m

"immigrate" function for namespaces

2009-01-26 Thread James Reeves
Hi folks, I've recently found myself having to choose between dividing functionality between many specific namespaces, or having a few very generic namespaces. In theory, being specific is the better choice, as it allows users to more accurately pick what they want to use. But if most of the time

Re: 'ls.c'/csv fixed space style directory listing, figure out the formatting to issues

2009-01-26 Thread BerlinBrown
On Jan 26, 4:47 pm, "Stephen C. Gilardi" wrote: > On Jan 26, 2009, at 4:31 PM, BerlinBrown wrote: > > > I want to output a directory with a similar listing (see below), but > > only a fixed number of spaces. Is there a clojure approach to > > already do this. > > > -rw 13290 1216183460872 Lis

Re: import doesn't work when jar was loaded with add-classpath ?

2009-01-26 Thread gaetan
I am not sure of that but it may come, as Eric suggest, from the import function in core.clj. Indeed this function is based on Class#forName which use Reflection#getCallerClass to find the class loader. May be it uses the application class loader instead of the root class loader of clojure (in whi

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-01-26 Thread Jan Rychter
Rich Hickey writes: > On Jan 26, 11:15 am, Cosmin Stejerean wrote: >> On Mon, Jan 26, 2009 at 6:34 AM, Rich Hickey wrote: >> >> > On Jan 25, 4:10 pm, Laurent PETIT wrote: >> > > #- makes sense (CL didn't always make things the wrong way :-) >> >> > > And indeed, #; *could* break a lot of alrea

Re: 'ls.c'/csv fixed space style directory listing, figure out the formatting to issues

2009-01-26 Thread Stephen C. Gilardi
On Jan 26, 2009, at 4:31 PM, BerlinBrown wrote: I want to output a directory with a similar listing (see below), but only a fixed number of spaces. Is there a clojure approach to already do this. -rw 13290 1216183460872 LispExample_Flow.png -rw 3211 1217537516267 PDFReport.java I think in Co

functional lazy shuffle

2009-01-26 Thread bOR_
In addition to the functional shuffle thread (can't seem to post to that one anymore, might be too old?), I've written a lazy shuffle. Not sure if it is the best way to write it, but I needed a lazy shuffle primarily because I wanted to randomly pair a few agents from a large vector of agents with

Re: an example where locking is appropriate?

2009-01-26 Thread Christian Vest Hansen
"All other invocations return the first calculated value." I fail to spot the part of your function where you keep this promise. >From what I can tell, your function would return nil on all but the first invocation. I think you forgot to write "@result" in the else case in your last if clause.

Re: Stream utilities in clojure.contrib

2009-01-26 Thread Konrad Hinsen
On 26.01.2009, at 20:58, Mark Engelberg wrote: > On Mon, Jan 26, 2009 at 4:38 AM, Rich Hickey > wrote: >> Continuations, like TCO, will have to come from the JVM. > > Perhaps a better question to ask is whether it is possible to > implement yield without user-available continuations. I assume

'ls.c'/csv fixed space style directory listing, figure out the formatting to issues

2009-01-26 Thread BerlinBrown
I want to output a directory with a similar listing (see below), but only a fixed number of spaces. Is there a clojure approach to already do this. -rw 13290 1216183460872 LispExample_Flow.png -rw 3211 1217537516267 PDFReport.java I think in Common Lisp, the powerful 'format' could make this h

Re: NewBie Q: doall forces eval and dorun not; but why?

2009-01-26 Thread Christian Vest Hansen
On Mon, Jan 26, 2009 at 3:20 PM, e wrote: > cool. Thanks for the info about #{}. I'm glad I learned about that. To > learn even more, what is the reasoning behind that choice? I've seen the > sharp used for other things in clojure; is there a connection? It activates a special read-table for

Re: import doesn't work when jar was loaded with add-classpath ?

2009-01-26 Thread bOR_
Thanks for that solution. Ran into the same problem as well, and right now I don't want to solve it, but just finish something else. On Dec 13 2008, 11:21 pm, Eric Sessoms wrote: > Did you ever get this resolved?  I just had the same thing start > happening to me today, after not experiencing an

an example where locking is appropriate?

2009-01-26 Thread Stuart Halloway
Lancet's runonce function needs to wrap a function with runs-only-once semantics, *and* make subsequent callers wait for the return value before proceeding. There was a thread on this last November where Rich explained several approaches (http://groups.google.com/group/clojure/msg/406be93eb

Re: Pretty printing a function's symbol

2009-01-26 Thread Daniel Jomphe
Daniel Jomphe wrote: > Now, all I need is to understand why my use of > (:name (meta (var expect#))) doesn't work. Hmm, seeing (var ...) is a special form, it probably doesn't evaluate its argument. Thus it tries to give me the interned symbol of the let- bound expect#, which is obviously wrong.

Re: Pretty printing a function's symbol

2009-01-26 Thread Daniel Jomphe
Daniel Jomphe wrote: > What is (var ...)? I didn't find it in the api docs, nor in the Vars > and Environment page. Sorry, I didn't search well enough; found it. Now, all I need is to understand why my use of (:name (meta (var expect#))) doesn't work. --~--~-~--~~~--

Re: Pretty printing a function's symbol

2009-01-26 Thread Daniel Jomphe
Perry Trolard wrote: > You can get the symbol that names the function from the Var's > metadata, like: > > user=> (:name (meta (var =))) > = Thank you Perry. What is (var ...)? I didn't find it in the api docs, nor in the Vars and Environment page. I'm yet to make your code work for my specifi

Re: Stream utilities in clojure.contrib

2009-01-26 Thread Mark Engelberg
On Mon, Jan 26, 2009 at 4:38 AM, Rich Hickey wrote: > Continuations, like TCO, will have to come from the JVM. Perhaps a better question to ask is whether it is possible to implement yield without user-available continuations. I assume it's possible since Python has yield, but not continuations

Re: Streams work

2009-01-26 Thread Mark H.
On Jan 24, 2:25 pm, Frantisek Sodomka wrote: > Word "streams" invokes association to data-flow languages. For a > while, I was following Project V: > > Simple Example of the Difference Between Imperative, Functional and > Data > Flow.http://my.opera.com/Vorlath/blog/2008/01/06/simple-example-of-

lancet can now build itself!

2009-01-26 Thread Stuart Halloway
Lancet is a build DSL written in Clojure, and a sample app in the book [1]. It combines ant tasks with a Clojure build language, and uses Chouser's shell-out to implement a system call for jumping to OS level stuff. Lancet's own build script is below. There isn't much in the way of docs,

Re: Pretty printing a function's symbol

2009-01-26 Thread Perry Trolard
Hi Daniel, You can get the symbol that names the function from the Var's metadata, like: user=> (:name (meta (var =))) = user=> Best, Perry --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Pretty printing a function's symbol

2009-01-26 Thread Daniel Jomphe
Hi, I'm learning Clojure by playing with a simple test toolkit: (fn-with-tests + [[= 2 [1 1]] [= 2 [1 1]] [= 2 [1 0]] [= 2 [2 0]]]) .. FAIL: [# 2 [1 0]] . === Tests Done === Some tests FAILED! false As you can see, I want to report t

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-01-26 Thread Cosmin Stejerean
On Mon, Jan 26, 2009 at 12:07 PM, Rich Hickey wrote: > > > > On Jan 26, 11:15 am, Cosmin Stejerean wrote: > > On Mon, Jan 26, 2009 at 6:34 AM, Rich Hickey > wrote: > > > > > On Jan 25, 4:10 pm, Laurent PETIT wrote: > > > > #- makes sense (CL didn't always make things the wrong way :-) > > > >

Re: clojure.contrib.sql and SQL Server = cast exceptions?

2009-01-26 Thread Stephen C. Gilardi
Brian S., You're quite welcome. I'm glad you're back in action. I'm going to add a check for the type of that argument to give a more helpful error message than "ClassCastException". --Steve On Jan 26, 2009, at 1:34 PM, BrianS wrote: Steve, Exactly the problem. As soon as I turned the

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-26 Thread Jason Wolfe
On Jan 26, 2009, at 10:28 AM, Mark Engelberg wrote: > > I've tested that already, and it takes even longer for all but trivial > inputs, because rec now prevents the combinations sequence from being > garbage collected, and the memory allocation bogs things down > tremendously. Ah, I noticed the

Re: clojure.contrib.sql and SQL Server = cast exceptions?

2009-01-26 Thread BrianS
Steve, Exactly the problem. As soon as I turned the SQL statements into vectors that contained the SQL strings, everything worked. I was still working on old sample code from prior to the changeover of parameter to a SQL vector rather than string, and that was the Cast Exception. Everything

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-26 Thread Mark Engelberg
I've tested that already, and it takes even longer for all but trivial inputs, because rec now prevents the combinations sequence from being garbage collected, and the memory allocation bogs things down tremendously. On Mon, Jan 26, 2009 at 10:26 AM, Jason Wolfe wrote: > >> Also, it's worth poin

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-26 Thread Jason Wolfe
> Also, it's worth pointing out that your newer version prints the > combinations out in a non-standard order. Good point ... I shouldn't have tried to avoid adding the "let": (defn combinations "Take a seq of seqs and return a lazy list of ordered combinations (pick 1 from each seq)" [seq

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-26 Thread Jason Wolfe
> > For simple inputs, the two approaches have similar performance. On > complex inputs, my tests show the iterative version tends to run about > twice as fast. > > Try running on an extreme input like: > ["ACDFG" "A" "B" "C" "D" "E" "F" "ABCD" "G" "H" "I" "ABEG" "J" "K" > "BCDE" "L" "ABCDG" "M"

Re: (clojure.contrib.lazy-seqs/combinations) should return [[]], not nil?

2009-01-26 Thread Mark Engelberg
Also, it's worth pointing out that your newer version prints the combinations out in a non-standard order. I don't know whether people should really rely on the order, but I think most people would expect it to print out in the same order as a series of nested for loops. --~--~-~--~~

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-01-26 Thread James G. Sack (jim)
Rich Hickey wrote: > > > On Jan 25, 4:10 pm, Laurent PETIT wrote: >> #- makes sense (CL didn't always make things the wrong way :-) >> >> And indeed, #; *could* break a lot of already existing editors for a while >> > > Yes, the issues are: > > #; is bad for editors > > #- would be incompati

Re: Symbols and Metadata

2009-01-26 Thread Meikel Brandmeyer
Hi, Am 26.01.2009 um 18:15 schrieb gun43: (defmacro deftarget [sym doc & forms] (let [has-run-fn (gensym "hr-" ) reset-fn (gensym "rf-" )] `(let [[~has-run-fn ~reset-fn once-fn#] (runonce (fn [] ~...@forms))] (def ~(with-meta sym {:doc doc :has-run-fn has-run-fn :reset-fn reset-fn})

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-01-26 Thread Rich Hickey
On Jan 26, 11:15 am, Cosmin Stejerean wrote: > On Mon, Jan 26, 2009 at 6:34 AM, Rich Hickey wrote: > > > On Jan 25, 4:10 pm, Laurent PETIT wrote: > > > #- makes sense (CL didn't always make things the wrong way :-) > > > > And indeed, #; *could* break a lot of already existing editors for a >

Re: Embed Clojure in OSGi Bundles

2009-01-26 Thread Gaetan Morice
2009/1/26 Laurent PETIT > 2009/1/26 gaetan > >> On 26 jan, 13:29, Laurent PETIT wrote: >> > Hello Gaetan, >> > >> > Thanks for the shared code. I think that for a first version in >> clojuredev, >> > I'll too just implement the full builder, and wait for performance >> problems >> > before wri

Symbols and Metadata

2009-01-26 Thread gun43
While trying to understand the doubly indented lines in the following definition from "Programming Clojure" by Stuart Halloway: (defmacro deftarget [sym doc & forms] (let [has-run-fn (gensym "hr-" ) reset-fn (gensym "rf-" )] `(let [[~has-run-fn ~reset-fn once-fn#] (runonce (fn [] ~...@forms))

Re: clojure.contrib.sql and SQL Server = cast exceptions?

2009-01-26 Thread Stephen C. Gilardi
Thanks, Brian, It looks like there's a problem with the arguments to with-query- results. I recently changed with-query-results to accept/expect the query as a vector containing a string and params rather than just a string. Here's a correct call to with-query-results for the currently che

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-01-26 Thread Cosmin Stejerean
On Mon, Jan 26, 2009 at 6:34 AM, Rich Hickey wrote: > > > > On Jan 25, 4:10 pm, Laurent PETIT wrote: > > #- makes sense (CL didn't always make things the wrong way :-) > > > > And indeed, #; *could* break a lot of already existing editors for a > while > > > > Yes, the issues are: > > #; is bad

Re: clojure.contrib.sql and SQL Server = cast exceptions?

2009-01-26 Thread BrianS
Steve, Thanks for the reply, here is the error stack trace I retrieved when running the code from clojure.contrib.sql. The actual function I was running was "db-read", and the stack trace can be found at http://clojure.pastebin.com/f660e0aac . Thanks, Brian On Jan 26, 10:25 am, "Stephen C. Gi

Re: clojure.contrib.sql and SQL Server = cast exceptions?

2009-01-26 Thread Stephen C. Gilardi
Hi Brian, Could you please paste a copy of the stack trace for the ClassCastException you're seeing to http://clojure.pastebin.com and post the URL for it here? If you're driving your program at the repl, you can get a stack trace from the most recent exception with: (.printStac

clojure.contrib.sql and SQL Server = cast exceptions?

2009-01-26 Thread BrianS
I have been able to connect up clojure and my SQL Server 2005 server, using the sample code include with clojure-contrib, at least in terms of connecting, and responding to command like CREATE TABLE and INSERT INTO. However, whenever I use the commands to access the tables and pull back results (

Re: Embed Clojure in OSGi Bundles

2009-01-26 Thread Laurent PETIT
2009/1/26 gaetan > On 26 jan, 13:29, Laurent PETIT wrote: > > Hello Gaetan, > > > > Thanks for the shared code. I think that for a first version in > clojuredev, > > I'll too just implement the full builder, and wait for performance > problems > > before writing an incremental one (thus saving d

Re: what's the typical usage of fn constantly

2009-01-26 Thread e
you didn't beat it to death. I learned something. I also got confused. You identity implementation makes perfect sense. But even with your explanation, I'm still lost as to how the contrib one works. Lucky for me you brought this up so I can challenge myself to try to understand what's going on

Re: IntelliJ Plugin Pre-Alpha 0.03 Available

2009-01-26 Thread Peter Wolf
By request... Here some screenshots showing the IntelliJ Plugin in action http://code.google.com/p/clojure-intellij-plugin/wiki/PageName?ts=1232979185&updated=PageName Enjoy Peter Laurent PETIT wrote: > Hello, > > Could you place some screenshots in a wiki page ? > > I'm too lazy to install I

Re: Agent watchers on Refs

2009-01-26 Thread Tom Ayerst
I used a couple of watchers to push model updates onto the EDT in a Swing app; it 'just worked'. I haven't pushed the envelope on it but the abstraction is clear and clean IMHO. Tom 2009/1/26 Rich Hickey > > > > On Jan 25, 4:06 pm, Stuart Sierra wrote: > > Hi Rich, all, > > > > Ever since t

Re: NewBie Q: doall forces eval and dorun not; but why?

2009-01-26 Thread e
cool. Thanks for the info about #{}. I'm glad I learned about that. To learn even more, what is the reasoning behind that choice? I've seen the sharp used for other things in clojure; is there a connection? On Mon, Jan 26, 2009 at 1:36 AM, Meikel Brandmeyer wrote: > Hi, > > Am 26.01.2009 um

Re: Embed Clojure in OSGi Bundles

2009-01-26 Thread gaetan
On 26 jan, 13:29, Laurent PETIT wrote: > Hello Gaetan, > > Thanks for the shared code. I think that for a first version in clojuredev, > I'll too just implement the full builder, and wait for performance problems > before writing an incremental one (thus saving development time for adding > oth

Re: Agent watchers on Refs

2009-01-26 Thread Rich Hickey
On Jan 25, 4:06 pm, Stuart Sierra wrote: > Hi Rich, all, > > Ever since the new implementation of watchers I've been itching to try > out Cells again. It worked great for agents. I ran into a snag, > though, when I tried to make cells out of refs. Here's an example. > > I make two refs: > >

Re: zipper: missing root-loc

2009-01-26 Thread Rich Hickey
On Jan 25, 3:50 pm, Chouser wrote: > On Sun, Jan 25, 2009 at 9:46 AM, Jan Rychter wrote: > > > From what I understand, currently the only way is to get the root > > node and then recreate the entire zipper structure. This seems > > unnecessary. > > I think what you're asking for sounds very re

Re: Stream utilities in clojure.contrib

2009-01-26 Thread Rich Hickey
On Jan 26, 3:20 am, Konrad Hinsen wrote: > On 25.01.2009, at 21:33, Rich Hickey wrote: > > Something else that would be nice for implementing generators and > thus streams is Scheme-style continuations. That would permit to > write generators like in Python, as loopy code with "yield" calls >

Re: Stream utilities in clojure.contrib

2009-01-26 Thread Rich Hickey
On Jan 26, 3:20 am, Konrad Hinsen wrote: > On 25.01.2009, at 21:33, Rich Hickey wrote: > > > Looks interesting. I made AStream.Iter an IFn, so you can try that. > > Thanks! It works fine, the changes to stream-utils are checked in. > > There is just one situation that still requires a wrapper:

Re: Support for disabling forms (reader macro similar to CL's #-(and))

2009-01-26 Thread Rich Hickey
On Jan 25, 4:10 pm, Laurent PETIT wrote: > #- makes sense (CL didn't always make things the wrong way :-) > > And indeed, #; *could* break a lot of already existing editors for a while > Yes, the issues are: #; is bad for editors #- would be incompatible with CL's #-, and couldn't be upgrade

Re: Embed Clojure in OSGi Bundles

2009-01-26 Thread Laurent PETIT
Hello Gaetan, Thanks for the shared code. I think that for a first version in clojuredev, I'll too just implement the full builder, and wait for performance problems before writing an incremental one (thus saving development time for adding other functionalities right now). BUT I think I'll not f

Re: Embed Clojure in OSGi Bundles

2009-01-26 Thread Laurent PETIT
Thank you very much ! 2009/1/26 gaetan > > > On 23 jan, 20:57, Laurent PETIT wrote: > > OK, I understand better now, I think. > > > > Did you experience the problems you have exposed ? Or is it an > anticipation > > of problems ? > > > > Yes I directly experience the problem when I first implem

Re: Embed Clojure in OSGi Bundles

2009-01-26 Thread gaetan
On 23 jan, 20:57, Laurent PETIT wrote: > OK, I understand better now, I think. > > Did you experience the problems you have exposed ? Or is it an anticipation > of problems ? > Yes I directly experience the problem when I first implement a Clojure REPL inside Eclipse and do not have access to s

Re: zipper: missing root-loc

2009-01-26 Thread Jan Rychter
Chouser writes: > On Sun, Jan 25, 2009 at 9:46 AM, Jan Rychter wrote: >> From what I understand, currently the only way is to get the root >> node and then recreate the entire zipper structure. This seems >> unnecessary. > > I think what you're asking for sounds very reasonable. What do I do

Re: zip/down bug?

2009-01-26 Thread Jan Rychter
Christophe Grand writes: > Jan Rychter a écrit : >> I think zip/down has a bug. It effectively does (when (children loc) >> ...), and since in Clojure empty list isn't false, it ends up adding >> nodes in my tree. >> >> Shouldn't it check for (when-not (empty? (children loc)) ...) ? >> > The c

Re: Stream utilities in clojure.contrib

2009-01-26 Thread Konrad Hinsen
On 25.01.2009, at 21:33, Rich Hickey wrote: > Looks interesting. I made AStream.Iter an IFn, so you can try that. Thanks! It works fine, the changes to stream-utils are checked in. There is just one situation that still requires a wrapper: it is not possible to make a stream directly from a s