Re: using contains? on transient collections

2012-02-29 Thread Andy Fingerhut
Some related JIRA tickets, http://dev.clojure.org/jira/browse/CLJ-700 http://dev.clojure.org/jira/browse/CLJ-757 http://dev.clojure.org/jira/browse/CLJ-932 All have patches, although I don't personally know whether they are correct fixes. Andy On Feb 29, 2012, at 10:08 PM, Mark Engelberg wrot

Re: checking if a method is defined

2012-02-29 Thread Meikel Brandmeyer (kotarak)
Hi, as others said: to check that a protocol function exists you can use resolve as with every other function. If you wanted to know, whether a type participates in a protocol directly, you would check whether it implements the protocol's interface . user=> (defprotocol Foo (foo [this])) Foo u

Re: using contains? on transient collections

2012-02-29 Thread Mark Engelberg
It is the expected behavior for everyone who has ever gotten burned by this bug :) Seriously though, this has come up several times over the last couple of years. I remain baffled that this has never been fixed (at least not as of 1.3). There are two ways this could potentially be fixed. On the

Re: checking if a method is defined

2012-02-29 Thread Armando Blancas
> > What should I be using to check that the symbol .firstName and > .fullName are defined in the current scope? > "fullName" is easier because it gets interned in the current namespace: user=> (ns-interns 'user) {fullName #'user/fullName, ->Person #'user/->Person,

using contains? on transient collections

2012-02-29 Thread Sunil S Nandihalli
Hey everybody, I did the following (contains? (transient {:a 10}) :a) and it returns false while doing (:a (transient {:a 10})) returns 10 Is this expected behaviour. Using clojure-version 1.2.1 (I know it is old .. ) Thanks, Sunil. -- You received this message because you are subscribed

Re: checking if a method is defined

2012-02-29 Thread Cedric Greevey
On Wed, Feb 29, 2012 at 5:12 PM, Frank Wilson wrote: > Hi, > > The behaviour of resolve for named functions seems pretty clear to me: > > (resolve 'xyz) > > returns nil  (when xyz has not been defined). > > and > > (defn xyz [x] 1) > > (resolve 'xyz) > > returns #'user/xyz (when xyz is defined) >

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2012-02-29 Thread sean neilan
Oh happy day. :) Adding swank-cdt to dev dependencies solved my problem. Thank you very much! Sent from my iPhone On Feb 29, 2012, at 7:50 PM, Sean Corfield wrote: > I'm on OS X Lion and using: > * Emacs 24.0.90 > * clojure-mode 1.11.4 > * lein 1.6.2 > * swank-clojure 1.4.0 as a dev-dependenc

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2012-02-29 Thread Sean Corfield
I'm on OS X Lion and using: * Emacs 24.0.90 * clojure-mode 1.11.4 * lein 1.6.2 * swank-clojure 1.4.0 as a dev-dependency (and as a global plugin, if it matters) I start the REPL via M-x clojure-jack-in when viewing my project.clj file. When I do (use 'swank.cdt) I see the following: CDT ready Cle

Re: Clojure 3.1 and Contrib(s)

2012-02-29 Thread Softaddicts
You need to include individual jars in your eclipse project dependencies if you want to benefit from the integrated REPL of the ccw eclipse plugin. The next ccw major release will have leiningen and eclipse project class path synchronization using the dependencies listed in your project.clj file

Re: Clojure 3.1 and Contrib(s)

2012-02-29 Thread sean neilan
Using eclipse to edit files is OK but *don't use it manage your dependencies in Clojure.* You should use leiningen to manage additions to your project. After starting a project with lein new projectName you can edit the project.clj file in the folder that is created. You'll see something like thi

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2012-02-29 Thread sean neilan
I'm sorry, the context of the message was not included. It's a reply to a thread in April 2011. I have converted to Emacs and am using swank! Hooray! Now, I want to use swank-cdt but I have this problem. After installing swank-clojure 1.4.0 with lein, I run (use 'swank.cdt) in a repl and I get th

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2012-02-29 Thread sean neilan
I'm having the same issue on OSX with leiningen. Unfortunately, it appears the cake project has been taken down so I cannot use it to resolve the tools.jar problem. http://releases.clojure-cake.org/cake gives a 404 The error I'm getting when I do (use 'swank.cdt) can be seen here http://pasteb

Clojure 3.1 and Contrib(s)

2012-02-29 Thread Lawrence
Hello, I have clojure 1.2 and eclipse, with contrib, running together, but I don't understand how clojure 1.3 and eclipse integrate with the contributions. It seems like it's simplily a matter of getting a contrib from github and what? running it through lein and using the jar file? adding the sou

Re: Bret Victor's live editable game in ClojureScript

2012-02-29 Thread Chris Granger
Hi Bost, I think you may have actually missed the point in the video :) There's no pausing necessary - if I made the guy move on his own and changed his speed, you'd see it happen immediately. No modes here, aside from the projection exist. Likewise the only thing that gets recompiled is the code

Re: for behavior difference between clojure and clojurescript?

2012-02-29 Thread David Nolen
Yes it's a known issue. Right now, = only works for two args. For the time being this is for performance reasons, a decent = is critical. The way ClojureScript currently handles multiple arity fns is quite unfortunate from a performance perspective - it uses the JavaScript arguments object. This r

Re: Clojure in Python

2012-02-29 Thread Timothy Baldridge
>>How is performance looking so far? On CPython...well about as good as CPython is comared to Java. On PyPy however, we're pretty close to Clojure. Currently on a factorial example, clojure-jvm runs in about 15 sec. On clojure-py it's about 24 sec. But there's always room for more optimization.

Re: Clojure in Python

2012-02-29 Thread Mark Rathwell
> Currently we have about half of core.clj ported from JVM clojure to > python clojure. I know it's early, but have there been any thoughts/plans around interop and dependency management, possibly providing some sort of bridge between lein and pip/easy_install/virtualenv? And is performance the m

Re: Clojure in Python

2012-02-29 Thread Sean Corfield
On Wed, Feb 29, 2012 at 3:42 PM, Timothy Baldridge wrote: > The core.clj file is probably the best way to get an idea of how > clojure-py differs and is similar to clojure: > https://github.com/halgari/clojure-py/blob/master/clojure/core.clj > > Currently we have about half of core.clj ported from

Re: Clojure in Python

2012-02-29 Thread Timothy Baldridge
> Not sure how many people have seen this, looks interesting though: > > https://github.com/halgari/clojure-py The core.clj file is probably the best way to get an idea of how clojure-py differs and is similar to clojure: https://github.com/halgari/clojure-py/blob/master/clojure/core.clj Currentl

Re: for behavior difference between clojure and clojurescript?

2012-02-29 Thread Neale Swinnerton
i had a cljs repl up and running...here's the comparison and the emitted JS ClojureScript:cljs.user> (= 0 0 0) true ; js => cljs.core._EQ_.call(null,0,0,0); ClojureScript:cljs.user> (= 0 0 1) true ; js =>  cljs.core._EQ_.call(null,0,0,1); ClojureScript:cljs.user> (== 0 0 1) false ; js => (functi

Re: for behavior difference between clojure and clojurescript?

2012-02-29 Thread Alan Malloy
On Feb 29, 2:36 pm, Benjamin Peter wrote: > Hello, > > when I was trying to port a little clojure app to clojurescript I > think I noticed a difference in behavior of the "for" macro. > > I am quite new to clojure and maybe you can tell me where my problem > is or if my assumptions that there migh

Re: for behavior difference between clojure and clojurescript?

2012-02-29 Thread Jordan Berg
Hi, You should be using == for comparison between numbers. (for [a [0 1] b [0 1] :when (not (== 0 a b))] [a b]) has the same results between clojure and clojurescript. Cheers, Jordan On Wed, Feb 29, 2012 at 5:36 PM, Benjamin Peter wrote: > Hello, > > when I was trying to port

Clojure in Python

2012-02-29 Thread Mark Rathwell
Not sure how many people have seen this, looks interesting though: https://github.com/halgari/clojure-py -- 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 that posts from new members ar

for behavior difference between clojure and clojurescript?

2012-02-29 Thread Benjamin Peter
Hello, when I was trying to port a little clojure app to clojurescript I think I noticed a difference in behavior of the "for" macro. I am quite new to clojure and maybe you can tell me where my problem is or if my assumptions that there might be a problem could be correct. As far as I see it, t

checking if a method is defined

2012-02-29 Thread Frank Wilson
Hi, The behaviour of resolve for named functions seems pretty clear to me: (resolve 'xyz) returns nil (when xyz has not been defined). and (defn xyz [x] 1) (resolve 'xyz) returns #'user/xyz (when xyz is defined) However if I try to define types: (defprotocol Named (fullName [Named]))

Re: [ANN] mcache 0.2.0 released

2012-02-29 Thread DHM
On Wednesday, February 29, 2012 6:03:32 AM UTC-8, Fogus wrote: > > > 3. Added a core.cache/CacheProtocol implementation > > This is great news. Thank you for taking the time to do this. I > would love to know how core.cache helped and hindered you. > I'd say integrating with CacheProtocol hel

Re: Question about this little method I wrote

2012-02-29 Thread JuanManuel Gimeno Illa
A similar version: (defn combinations [[x & xs]] (if xs (for [e x c (combinations xs)] (cons e c)) (map list x))) Juan Manuel El lunes 27 de febrero de 2012 15:23:30 UTC+1, Bill Caputo escribió: > > Here's a version that uses destructuring (but is otherwise the s

Re: Cake with TextMate & RVM

2012-02-29 Thread JuanManuel Gimeno Illa
Maybe it is that you haven't included the directory where the cake executable is in the text mate PATH. For instance, my PATH is defined as: /Users/jmgimeno/Local/cake/bin:/usr/bin because my cake executable is in /Users/jmgimeno/Local/cake and textmate needs /usr/bin for other things. To c

Re: Specifying the error message on validation-error of a dynamic var?

2012-02-29 Thread Alex Baranosky
TimMc on IRC helped me find this line in the source: https://github.com/clojure/clojure/blob/1.3.x/src/jvm/clojure/lang/ARef.java#L29 If I change my validator to throw a RuntimeException, then I get the behavior I want. Thanks Tim! -- You received this message because you are subscribed to the

Re: Question about this little method I wrote

2012-02-29 Thread Steve Miner
There's contrib library that you might find interesting: https://github.com/clojure/math.combinatorics -- 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 that posts from new members are

Specifying the error message on validation-error of a dynamic var?

2012-02-29 Thread Alex Baranosky
Is there any way to specify the error message when using set- validator! with a dynamic var? In a situation like this: (binding [*my-var* -1] (foo)) I'd like to be able to throw a custom exception when they try to bind to a negative number. Using set-validator! like this, the Exception messag

[ANN] fobos_clj 0.0.2 and TinyWordSegmenter 0.0.5

2012-02-29 Thread Yasuhisa Yoshida
Hi all, I'm pleased to announce the 0.0.2 release of fobos_clj (Supervised machine learning classifier called 'FOBOS')[1]. You can use support vector machine or logistic regression with this library. The learned model file is quite small, so you can use this library in your own application.

Re: cld 0.1.0 - Clojure Language Detection

2012-02-29 Thread Ulises
> I'm more curious about why the output isn't even deterministic. The > same input string produced three different results. You can see in the FAQ (http://code.google.com/p/language-detection/wiki/FrequentlyAskedQuestion) that: "Langdetect uses random sampling for avoiding local noises(person nam

Re: Google Summer of Code 2012 - any mentors?

2012-02-29 Thread Christopher Redinger
Core has not submitted the application. The application process just opened Monday and goes until March 9th. There have been some leaders among Clojure/dev that have stepped up to organize things. Keep watching http://dev.clojure.org/display/community/Google+Summer+of+Code+2012 for more details

Re: cld 0.1.0 - Clojure Language Detection

2012-02-29 Thread Cedric Greevey
I'm more curious about why the output isn't even deterministic. The same input string produced three different results. -- 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 that posts from

Re: cld 0.1.0 - Clojure Language Detection

2012-02-29 Thread Michael Wood
On 29 February 2012 17:48, Lee Hinman wrote: > On Tuesday, February 28, 2012 6:03:26 PM UTC-7, Robin Kraft wrote: >> >> Awesome! I'm seeing some inconsistency though. Does anyone know why a >> Bayesian classifier would produce such different results? Could it be >> because of the short input text?

Re: cld 0.1.0 - Clojure Language Detection

2012-02-29 Thread Lee Hinman
On Tuesday, February 28, 2012 6:03:26 PM UTC-7, Robin Kraft wrote: > > Awesome! I'm seeing some inconsistency though. Does anyone know why a > Bayesian classifier would produce such different results? Could it be > because of the short input text? > > (lang/detect "My name is joe") > ["af" {"af

Re: need hint for "A nil key " on 4clojure

2012-02-29 Thread Roman Perepelitsa
Most 4clojure exercises are meant for you to familiarize yourself with the clojure standard library. Usually you'll spend more time looking for the appropriate function on clojuredocs than actually coding the solution. Here's the section on collections: http://clojuredocs.org/quickref/Clojure%20Co

Re: Call static java method specified at runtime

2012-02-29 Thread Aaron Cohen
On Tue, Feb 28, 2012 at 10:40 AM, Bost wrote: > I have a java class with several static methods: > > package org.domain.test; > > public class My { >  static public void sBar(String x, String y) > { System.out.println("sBar "+x+":"+y); } >  static public void sBaz(String x, String y) > { System.ou

Re: [ANN] mcache 0.2.0 released

2012-02-29 Thread Michael Fogus
>  3. Added a core.cache/CacheProtocol implementation This is great news. Thank you for taking the time to do this. I would love to know how core.cache helped and hindered you. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: [ANN] mcache 0.2.0 released

2012-02-29 Thread Jim Crossley
Hi Dave, This is awesome! :) DHM writes: [...] > Thanks to Jim Crossly for the suggestion to look into CacheProtocol. > Also, Jim, I hope you don't mind that I borrowed your naming scheme > for the put functions. :-) Not at all. I love that within a coupla weeks we've introduced two distribut

Re: need hint for "A nil key " on 4clojure

2012-02-29 Thread Kevin Ilchmann Jørgensen
So, you need to give it a function which takes an key and a collection. (fn [k coll] ...) It should return true if two things are true. That the collection _contains_ the key, and the key is _nil_ Enjoy! /Kevin On Wed, Feb 29, 2012 at 7:15 AM, weiyongq wrote: > "A nil key " > http://www.4cl

Re: Google Summer of Code 2012 - any mentors?

2012-02-29 Thread Sanel Zukan
Another two ideas were added :) (Native Clojure and Code optimizer). Hoping readers will not mind for putting myself as mentor on one of them, but if there are better candidates, feel free to take it :) I did a little bit gcj + Clojure playing and I'm eager to see native Clojure without jvm. Alth

Cake with TextMate & RVM

2012-02-29 Thread James
Hi, I'm trying to get Cake to work with TextMate. I've installed both the TextMate bundle and Cake, but when trying to evaluate a script: (print (+2 2)) -^ Ctrl-X I get "env: cake: No such file or directory" I'm using RVM, so have spent some time studying this thread that discus

Call static java method specified at runtime

2012-02-29 Thread Bost
I have a java class with several static methods: package org.domain.test; public class My { static public void sBar(String x, String y) { System.out.println("sBar "+x+":"+y); } static public void sBaz(String x, String y) { System.out.println("sBaz "+x+":"+y); } } I'd like to execute these me

Re: Bret Victor's live editable game in ClojureScript

2012-02-29 Thread Bost
Hey Laurent here in Germany we have a soviet-style censorship worse than during the cold war. Youtube says: Unfortunately, this video is not available in Germany because it may contain music for which GEMA has not granted the respective music rights. Sorry about that. (And I can't use web proxy f

Re: Bret Victor's live editable game in ClojureScript

2012-02-29 Thread Bost
Great work Chris but I think you missed exactly the most important point of Victor's talk. It's about being modeless! When you stop the game in order to change the speed you lose the dynamic aspect. In your case it takes ~ 2secs to "recompile & restart" but if you have a game with 10^6 LoC then it

Re: Parsing NMON data (CSV)

2012-02-29 Thread Bill Allen
Use incanter. On Feb 27, 2012 2:29 PM, "meteorfox" wrote: > Thanks for the suggestion but I'm already using it to parse it, it's > really simple to use. > > What I really meant is, what could be a good library for making graphs > based on sampled data?. > > Suppose I have the following > > , , ,

Re: Google Summer of Code 2012 - any mentors?

2012-02-29 Thread daly
On Tue, 2012-02-28 at 01:35 -0600, Devin Walters wrote: > One item that hasn't made the project ideas list that I've seen > numerous threads about is documentation. Does this fall within the > scope of GSoC? > > > It seems like there are a lot of opportunities to either organize, > revise, update

Re: Question about this little method I wrote

2012-02-29 Thread Nicolas Duchenne
Hi Mike, If I understood your aim correctly, and if you accept changing the output of (combinations [[1 2]]) to ((1) (2)) instead of (1 2), which I think makes more sense,then the reduce function does the job in one line for you. (defn combinations [items] (reduce #(for [l % i %2] (conj l i)) [

Re: Workflow and development tools for ClojureScript One

2012-02-29 Thread Vijay Kiran
Hi Karl, My emacs setup is also based on live coding. For ClojureScript One hacking, I use lein swank and slime-connect - for clojure. And for cljs, I use inferior-lisp. When I'm in a cljs file, I just disable the slime-mode, so it uses the inferior-lisp. ./Vijay On Sunday, February 19, 20

Re: Disable colored output

2012-02-29 Thread Vladimir Matveev
> mvn goalname -Dinsert.property.here=true I tried this and it didn't work. > AFAICT, the lazytest maven plugin launches tests in a separate JVM: So I think the only way to overcome this is to make the plugin understand new configuration option. On Feb 27, 3:17 pm, Rob Lally wrote: > I'm reason

Re: lazy-sequences and memory leaks

2012-02-29 Thread Caspar Hasenclever
Hi Sunil, Might the problem lie within the function that consumes the seq-of-maps? There is a reduce in there that accumulates some data. I can't tell from the code whether that would amount to much, though. Regards, Caspar -- You received this message because you are subscribed to the Google

Re: cld 0.1.0 - Clojure Language Detection

2012-02-29 Thread Robin Kraft
Awesome! I'm seeing some inconsistency though. Does anyone know why a Bayesian classifier would produce such different results? Could it be because of the short input text? (lang/detect "My name is joe") ["af" {"af" "0.8571390166207665", "lt" "0.14285675907555712"}] (lang/detect "My name is joe")

Can I use clojure's logo to write an article to a magazine?

2012-02-29 Thread Leandro Moreira
Hi, I didn't find what license is owned by logo of Clojure and I would like to use it on a magazine article. I saw a conversation, not conclusive, in which Rich Hickey (or his brother) gives the permission for a guy but it wasnt clear about the current license that rule the logo. Do you have any

[ANN] mcache 0.2.0 released

2012-02-29 Thread DHM
Last week I released mcache 0.1.0, a protocol-based clojure library for memcached. This latest change contains significant changes, summarized here: 1. Renamed the functions, and got rid of the "cache-" prefix 2. Removed increment and decrement functions from the protocol, as these seemed like

need hint for "A nil key " on 4clojure

2012-02-29 Thread weiyongq
"A nil key " http://www.4clojure.com/problem/134 l look it no Elementary.please give me some help. -- 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 that posts from new members are moder

Re: Google Summer of Code 2012 - any mentors?

2012-02-29 Thread Alexander Yakushev
Can someone confirm that Clojure/core has already sent an application GSoC participation? I am just wondering if core is already interested in this kind of event or the initiative currently comes only from mentors. -- You received this message because you are subscribed to the Google Groups "Cl

Re: How to submit clojure bug report?

2012-02-29 Thread Kevin Ilchmann Jørgensen
Hi You should be able to submit bugs here: http://dev.clojure.org/jira This explains the process: http://clojure.org/patches /Kevin On Wed, Feb 29, 2012 at 11:12 AM, N8Dawgrr wrote: > I found a bug in Clojure core, and know its solution, question is how > to submit a bug report? > > FYI here i

How to submit clojure bug report?

2012-02-29 Thread N8Dawgrr
I found a bug in Clojure core, and know its solution, question is how to submit a bug report? FYI here is the bug: => (.withMeta list {:a 1}) # This is reporducable in Clojure 1.2 and Clojure 1.3 This cause of this issue is in: svn/trunk/src/jvm/clojure/lang/PersistentList.java with the stati