Re: Cleaning up after pcalls?

2009-05-26 Thread Timothy Pratley
> So I presume that pcalls is leaving some future-detritus that requires > 60 seconds to timeout.  What should I be doing to clean up after > pcalls? (shutdown-agents) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: regression

2009-05-26 Thread kyle smith
Thanks for the feedback Daniel, I've incorporated your ideas and re- uploaded. I'm not sure where you're seeing mutable data structures. Anyhow, I now only call eval once each time scorer is called, which is massively faster. This has allowed for additional testing points, and now I get a perfec

Cleaning up after pcalls?

2009-05-26 Thread David Andrews
At svn 1365 I think (not terribly current while slime sorts itself out). If I feed the following script to clojure-main: (defn trivial-task [] nil) (pcalls trivial-task trivial-task) It takes a full minute and change to execute: $ time java -server -cp ../clojure/clojure.jar clojure.main pc

Re: ns :use with :rename

2009-05-26 Thread Stephen C. Gilardi
On May 26, 2009, at 11:33 PM, tsuraan wrote: Is there an example of using :rename in a :use in the ns macro? I'm trying to get it to work, but the best I can come up with is: (ns namespace (:use other-namespace :rename { :existing :newname })) Here's the correct syntax: (ns namespace (

ns :use with :rename

2009-05-26 Thread tsuraan
Is there an example of using :rename in a :use in the ns macro? I'm trying to get it to work, but the best I can come up with is: (ns namespace (:use other-namespace :rename { :existing :newname })) and when compiling, I get "ClassCastException: java.lang.Boolean cannot be cast to clojure.lan

Re: Feedback on new persistentmatrix datatype

2009-05-26 Thread aperotte
Hi Konrad, I think I understand your point now. You would like the indexing to match the implicit dimension order of the nested structure. I was also concerned about storage order because I wanted to at some point integrate this datastructure with colt or parallel colt and the incanter library.

Re: regression

2009-05-26 Thread Daniel Lyons
On May 26, 2009, at 2:59 PM, kyle smith wrote: > > I have written code that will randomly guess the mathematical form of > a list of xy ordered pairs. My code and a sample run are in guess- > check.clj in the files section. The final sum of squares is > fantastic! This code is just for fun, b

Enclojure Plugin for Netbeans Release

2009-05-26 Thread Ffailla
This release has the minor changes listed below. Clojure Plugin for Netbeans * Using Clojure 1.0.0 * Removed com.infolace.format dependency Enclojure Library * org.enclojure.common.jar dependency removed from org.enclojure.repl The plugin can be downloaded here: http://code.google.com/p/enclo

regression

2009-05-26 Thread kyle smith
I have written code that will randomly guess the mathematical form of a list of xy ordered pairs. My code and a sample run are in guess- check.clj in the files section. The final sum of squares is fantastic! This code is just for fun, but I would appreciate some feedback. --~--~-~--~---

Re: svn r1370 appears to have broken binding

2009-05-26 Thread Stephen C. Gilardi
Hi Frantisek! On May 25, 2009, at 7:11 AM, Frantisek Sodomka wrote: (def a) (deftest test-binding (are (= _1 _2) (binding [a 4] a) 4 ; regression in Clojure SVN r1370 )) I see those tests going in over time... Thanks so much for making them! The checkin notes for this change ment

Re: quote vs quasiquote

2009-05-26 Thread Meikel Brandmeyer
Hi, Am 26.05.2009 um 20:47 schrieb kyle smith: Ahh, of course. I've actually learned that trick before. Thanks. There is also the mega-hacky quasiquote macro: (defn- self-eval? [thing] (or (keyword? thing) (number? thing) (instance? Character thing) (string? thing)

Re: quote vs quasiquote

2009-05-26 Thread kyle smith
Ahh, of course. I've actually learned that trick before. Thanks. --~--~-~--~~~---~--~~ 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

Re: quote vs quasiquote

2009-05-26 Thread Sean Devlin
I would lead the desired term with ~' For example: `(+ 1 2) => (clojure.core/+ 1 2) `(~'+ 1 2) => (+ 1 2) This is very useful when defining a function in a macro On May 26, 2:30 pm, kyle smith wrote: > user> (def nums '(1 2 3)) > #'user/nums > user> (def funs '((+ (1 2 3)) (- (1 2 3 > #'

Re: quote vs quasiquote

2009-05-26 Thread CuppoJava
Hi Kyle, This will work: `((~'+ ~nums) (~'- ~nums)) Hope this helps -Patrick --~--~-~--~~~---~--~~ 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 unsubscr

quote vs quasiquote

2009-05-26 Thread kyle smith
user> (def nums '(1 2 3)) #'user/nums user> (def funs '((+ (1 2 3)) (- (1 2 3 #'user/funs user> funs ((+ (1 2 3)) (- (1 2 3))) user> (def funs `((+ ~nums) (- ~nums))) #'user/funs user> funs ((clojure.core/+ (1 2 3)) (clojure.core/- (1 2 3))) I would expect these two approaches to be the same,

Re: Architecture for a clojure project

2009-05-26 Thread Meikel Brandmeyer
Hi, Am 26.05.2009 um 14:15 schrieb Rich Hickey: Yes - keep your functions out of your data. If you are used to engine.getMove(position) it becomes: (get-move engine position) If you want polymorphism you can make get-move a multimethod. If the 'engine' concept is only about code (e.g. has no

Re: Feedback on new persistentmatrix datatype

2009-05-26 Thread Konrad Hinsen
On May 26, 2009, at 14:59, aperotte wrote: > Numpy does things a bit differently, I think in a large part because > their format is row major. Based on my understanding of the two > formats, in the multidimensional generalization of row and column > major the left most and the right most indices

Re: some vs. every?

2009-05-26 Thread Sean Devlin
Oops, thanks On May 26, 9:45 am, Laurent PETIT wrote: > Please refer to Chouser's answer for your main point, > > Regards, > > -- > laurent > > 2009/5/26 Sean Devlin : > > > > > Okay, excellent counterexample for some.  I understand that behavior > > now. > > > I guess I should focus on my main

Re: some vs. every?

2009-05-26 Thread Laurent PETIT
Please refer to Chouser's answer for your main point, Regards, -- laurent 2009/5/26 Sean Devlin : > > Okay, excellent counterexample for some.  I understand that behavior > now. > > I guess I should focus on my main point, changing/aliasing the name to > some? to be consistent with every? > >

Re: some vs. every?

2009-05-26 Thread Sean Devlin
Okay, excellent counterexample for some. I understand that behavior now. I guess I should focus on my main point, changing/aliasing the name to some? to be consistent with every? On May 26, 9:34 am, Laurent PETIT wrote: > Hi, > > (comp first filter) and some are not equivalent. > > Consider th

Re: some vs. every?

2009-05-26 Thread Chouser
On Tue, May 26, 2009 at 9:11 AM, Sean Devlin wrote: > > To add to my own post: > > There is also a discrepancy in what is returned from the two > > (some identity [1 2 3]) -> 1 > (every? identity [1 2 3]) -> true The naming difference matches the behavior difference. The ? in 'every?' suggests

Re: some vs. every?

2009-05-26 Thread Laurent PETIT
Hi, (comp first filter) and some are not equivalent. Consider this less simple case: user=> (defn negate-or-nil [x] (when (even? x) (- x))) #'user/negate-or-nil user=> (first (filter negate-or-nil [1 2 3])) 2 user=> (some negate-or-nil [1 2 3]) -2 user=> some returns the result of the predicat

Re: some vs. every?

2009-05-26 Thread Sean Devlin
To add to my own post: There is also a discrepancy in what is returned from the two (some identity [1 2 3]) -> 1 (every? identity [1 2 3]) -> true I would expect the following to occur (some identity [1 2 3]) -> true Granted, it's all the same to an if statement. However, current behavior of

some vs. every?

2009-05-26 Thread Sean Devlin
I just noticed a quirk in the core API. The some and every? functions have different naming conventions. Is there a reason for this? If not I think renaming/creating an alias some? would be very helpful. --~--~-~--~~~---~--~~ You received this message because you

Re: Feedback on new persistentmatrix datatype

2009-05-26 Thread aperotte
Konrad, I did some thinking about this and I think what's there is actually what I intended for it to be. I did expect for (nth data 1) and (nth m 1) to return similar structures and that was part of the reasoning. Numpy does things a bit differently, I think in a large part because their forma

Re: Architecture for a clojure project

2009-05-26 Thread Rich Hickey
On May 25, 9:17 pm, Andrew Wagner wrote: > I'm trying to wrap my head around how to architect this project. I've got > some functional programming experience (with Haskell), but am pretty new to > Lisps, and feel a bit lost without the type system. > > So. The project is a chess AI. Now the nic

Re: Architecture for a clojure project

2009-05-26 Thread max3000
I really like the above class solution (but maybe its my OO background! ;). Howerver, I thought gen-class wasn't doing anything when not AOT-ing. In other words, unless you are doing AOT compilation, gen-class shoudn't be used. Did I miss something? Thanks, Max On May 26, 1:23 am, Daniel Lyo

Re: using clojure.parallel functions / JSR-166

2009-05-26 Thread Rich Hickey
On May 25, 10:01 pm, Mark Volkmann wrote: > I understand that at least some of the functions in the > clojure.parallel namespace depend on addtional JAR files related to > JSR-166. I found the > sitehttp://gee.cs.oswego.edu/dl/concurrency-interest/which has links to > JAR files for that. When

Re: Swank broken at r1369

2009-05-26 Thread graham
Ah, sorry, I'm using swank-clojure. It was also broken, but now it's working again with the latest clojure svn. I didn't realise there was an alternative! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: Weird Clojure Box - library issue

2009-05-26 Thread hoeck
On 20 Mai, 14:25, Shawn Hoover wrote: > I can't help with COM, but this patch might help slime automatically connect > to the REPL on Windows > XP:http://bitbucket.org/shoover/clojure-box-swank-clojuremq/src/tip/hack... Hi Shawn, thanks for this patch, now starting swank-clojure on windows w

Re: using clojure.parallel functions / JSR-166

2009-05-26 Thread Laurent PETIT
I remember Rich pointing the files section of the clojure google group where he had uploaded a working version of JSR-166. 2009/5/26 Mark Volkmann : > > I understand that at least some of the functions in the > clojure.parallel namespace depend on addtional JAR files related to > JSR-166. I found