Re: Java Class Factory

2009-12-03 Thread Jarkko Oranen
On Dec 3, 6:15 am, lazy1 miki.teb...@gmail.com wrote: Hello, I'm trying to create a factory method for Java classes, however I'm doing something wrong. (import '(java.util Dictionary HashMap)) (def *containers* { :dict Dictionary :hash HashMap}) (defn new-container   [type]   (new

Re: Java Class Factory

2009-12-03 Thread sross
On Dec 3, 4:15 am, lazy1 miki.teb...@gmail.com wrote: Hello, What is the right way to do this? As people have mentioned, new is a special form which evaluates it's arguments at compile time and cannot be used with a dynamic class name. Fortunately you can use the reflection API and create

Re: Specified behavior of every?

2009-12-03 Thread ajuc
(p(x) is true for all x in set X) is equivalent to (there are no such x in set X that p(x) is not true) So IMHO it's good that (every? pred []) returns true. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: 'sync' call in writeClassFile

2009-12-03 Thread Roman Roelofsen
I am a Linux user as well and this indeed sounds a bit alarming (but I haven't tested it on my machine yet, though...) Does somebody has a bit more information about the reason, current state, etc.? Thanks! 2009/11/28 David Brown cloj...@davidb.org: This commit:     commit

Creating a matrix mirrored around it's main diagonal

2009-12-03 Thread Tiemo Kieft
Hi, I'm trying to create a matrix, basically it's a vector of vectors. I copied the code from ants.clj to create the matrix, however, I have to mirror the matrix around it's main diagonal (see below). Currently I'm doing this by first creating the matrix like this: (apply vector (map (fn [i]

Re: Creating a matrix mirrored around it's main diagonal

2009-12-03 Thread CuppoJava
Matrix arithmetic is one of those cases where I feel indexing is clearer than filter/map functions. However, if you're representing matrices as vectors as vectors, this will likely come with a little bit of extra overhead. That's not a problem usually because if you plan on doing any sort of

Re: Space usage of lazy seqs

2009-12-03 Thread Johann Hibschman
On Dec 2, 9:59 pm, Johann Hibschman joha...@gmail.com wrote: On Dec 2, 9:09 pm, David Brown cloj...@davidb.org wrote: You can tune the max with -Xmx1G for example, to limit it to one GB. That's a good idea; then I'll know for sure if it's keeping a handle to the entire file. Ok, that's a

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread bOR_
Second question: how do I access documentation of a lein nailgun plugin? I know how to start it, but to stop it, I now just kill its pid. On Dec 2, 2:16 pm, bOR_ boris.sch...@gmail.com wrote: Q: I noticed that the leinnailgunruns as java -client. Being used to seeing -server everywhere, I

Re: Space usage of lazy seqs

2009-12-03 Thread Aaron Cohen
On Thu, Dec 3, 2009 at 9:13 AM, Johann Hibschman joha...@gmail.com wrote: On Dec 2, 9:59 pm, Johann Hibschman joha...@gmail.com wrote: On Dec 2, 9:09 pm, David Brown cloj...@davidb.org wrote: You can tune the max with -Xmx1G for example, to limit it to one GB. That's a good idea; then I'll

Re: Generalizing - -

2009-12-03 Thread Roman Roelofsen
Are there any plans to add -$ to core or contrib? 2009/11/13 Laurent PETIT laurent.pe...@gmail.com: Oh yes, thanks for refreshing my memory. And indeed it makes sense to place the question mark in the questioned side :) 2009/11/13 Wilson MacGyver wmacgy...@gmail.com: Yes, it's groovy, and

Leiningen + Emacs + ELPA + slime/swank install problems

2009-12-03 Thread Rick Moynihan
Hi all, I recently started playing with leiningen, and it looks like it's going to help remove a lot of the incidental complexity in getting projects started with clojure! However I had some what of a hard time getting it going with Emacs/clojure-mode/slime... This is likely because

Re: Getting Started in Mac OS X Snow Leopard

2009-12-03 Thread Andreas Pauley
Hi all, I followed the above swank-clojure instructions using both Aquamacs and the plain emacs for Mac OS X on my Leopard Macbook. I also tried it on an Ubuntu (Hardy) desktop. In all of these cases the process fails when slime tries to connect to the Lisp interpreter. Just to be explicit,

Re: Generalizing - -

2009-12-03 Thread Stephen C. Gilardi
On Dec 3, 2009, at 10:31 AM, Roman Roelofsen wrote: Are there any plans to add -$ to core or contrib? The rules on contrib are that the work must be original to the author. Even with Andrew's disclaimer that it be considered public domain, he would still need a contributor agreement in place

Re: Java Class Factory

2009-12-03 Thread lazy1
Hello All, What is the right way to do this? (defn new-container [type] (.newInstance (*containers* type))) (defmacro new-container [type] `(new ~(*containers* type))) Thanks! These are both great and also very educational. The reason for this coding style is that I'm writing a wrapper

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread Meikel Brandmeyer
Hi, On Dec 3, 3:19 pm, bOR_ boris.sch...@gmail.com wrote: Second question: how do I access documentation of a lein nailgun plugin? I know how to start it, but to stop it, I now just kill its pid. You can stop the nailgun server itself by ng ng-stop. I'm not sure whether this also stops the

Re: Generalizing - -

2009-12-03 Thread Meikel Brandmeyer
Hi, On Dec 3, 4:41 pm, Stephen C. Gilardi squee...@mac.com wrote: Are there any plans to add -$ to core or contrib? The rules on contrib are that the work must be original to the author. Even with Andrew's disclaimer that it be considered public domain, he would still need a contributor

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread bOR_
On Dec 3, 3:19 pm, bOR_ boris.sch...@gmail.com wrote: Second question: how do I access documentation of a lein nailgun plugin? I know how to start it, but to stop it, I now just kill its pid. Answered that by just vimming the lein-nailgun.jar file :). Next bit of trivia: There are currently

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread bOR_
Additionally, Ato's nailgun also generates two warnings upon installing with 'lein deps': [WARNING] POM for 'org.clojars.ato:nailgun:pom:0.7.1:compile' is invalid. It will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for project org.clojars.ato:nailgun at /home/boris/.m2/

Re: Java Class Factory

2009-12-03 Thread Meikel Brandmeyer
Hi, On Dec 3, 4:46 pm, lazy1 miki.teb...@gmail.com wrote: What is the right way to do this? (defn new-container  [type] (.newInstance (*containers* type))) (defmacro new-container [type] `(new ~(*containers* type))) Thanks! These are both great and also very educational. The

Re: Remove Value From Vector at Given Index

2009-12-03 Thread Mark N
You might want to use partition-all from seq-utils, since partition may drop the end elements if it can't make a full size partition. For example user= (flatten (partition 2 3 [2 4 5 8])) (2 4) But user= (flatten (partition-all 2 3 [2 4 5 8])) (2 4 8) On Dec 1, 9:31 pm, Wilson MacGyver

Re: Getting Started in Mac OS X Snow Leopard

2009-12-03 Thread christophe mckeon gonzalez de leon
you might want to try watching peepcode's emacs video. he suggests using the carbon emacs port. i'm not sure if i'll be going with that or with the plain terminal version, i'm just getting acquainted with emacs myself. http://www.apple.com/downloads/macosx/unix_open_source/carbonemacspackage.html

Re: Clojure Koans?

2009-12-03 Thread Daniel Simms
On Wed, Dec 2, 2009 at 11:39 AM, Matthew Williams matthew.d.willi...@gmail.com wrote: The project is up on Github: http://github.com/edgecase/ruby_koans Another get-to-know-your-language project that I like is: http://pythonchallenge.com ... and can be fun for wizards as well (since part of

Re: Space usage of lazy seqs

2009-12-03 Thread David Brown
On Wed, Dec 02, 2009 at 08:18:33PM -0800, Dave M wrote: On Dec 2, 9:09 pm, David Brown cloj...@davidb.org wrote: ... If you're running JDK 6, you can run the virtualvm, or jconsole to get a better handle on the memory usage, and even dig into what it might used for. Google does not return

Re: Remove Value From Vector at Given Index

2009-12-03 Thread Sean Devlin
He's another (longer) way (vec (filter identity (map (fn [x idx] (if (zero? (mod 3 idx)) x)) [2 4 5 8 6 4] (iterate inc 0 I'd use a form of partition production, though. Some thing like this: (apply concat (partition-all 2 3 [2 4 5 8 6 4])) The concat should be faster than

master Clojure API doc now live

2009-12-03 Thread Tom Faulhaber
Folks, We now have an official site for API documentation on the latest master branch of Clojure, for those who aren't content to stay with the release version. It is on GitHub here: http://richhickey.github.com/clojure/ This will be kept up-to-date with the GitHub checkins to master within a

Re: Remove Value From Vector at Given Index

2009-12-03 Thread CuppoJava
And here's yet another way: (for [[x b] (zip coll (cycle [true true false])) :when b] x) where zip is defined: (def zip (partial map vector)) -Patrick -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: master Clojure API doc now live

2009-12-03 Thread Sean Devlin
Tom, Thanks for all of you work. This is cool. Sean On Dec 3, 2:31 pm, Tom Faulhaber tomfaulha...@gmail.com wrote: Folks, We now have an official site for API documentation on the latest master branch of Clojure, for those who aren't content to stay with the release version. It is on

Re: simple journal-based persistenсe for Clojure

2009-12-03 Thread Pelle Braendgaard
I was just starting to research if there was a prevayler like solution for clojure. Thanks. I'll start playing with it. Do you have a github project for it yet? P On Wed, Dec 2, 2009 at 9:18 AM, Sergey Didenko sergey.dide...@gmail.com wrote: It creates journals in readable and executable

Flightcaster makes a couple big open source contributions

2009-12-03 Thread bradford cross
Incanter: http://measuringmeasures.blogspot.com/2009/12/flightcaster-merges-statistical.html Crane: http://measuringmeasures.blogspot.com/2009/12/flightcaster-open-sources-crane_03.html -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Flightcaster makes a couple big open source contributions

2009-12-03 Thread liebke
I just blogged about FlightCaster's new involvement with Incanter here: http://incanter-blog.org/2009/12/03/flightcaster/ David On Dec 3, 3:19 pm, bradford cross bradford.n.cr...@gmail.com wrote: Incanter:http://measuringmeasures.blogspot.com/2009/12/flightcaster-merges-sta...

Re: Generalizing - -

2009-12-03 Thread Wojciech Kaczmarek
On Thu, Dec 3, 2009 at 17:02, Meikel Brandmeyer m...@kotka.de wrote: Are there any plans to add -$ to core or contrib? The rules on contrib are that the work must be original to the author. Even with Andrew's disclaimer that it be considered public domain, he would still need a contributor

Re: Flightcaster makes a couple big open source contributions

2009-12-03 Thread bradford cross
We're really excited about the way the merge has turned out and the rapid progress we expect for the next several months! On Thu, Dec 3, 2009 at 12:23 PM, liebke lie...@gmail.com wrote: I just blogged about FlightCaster's new involvement with Incanter here:

feedback on (shortish) code wanted - parallel factorial examples

2009-12-03 Thread prhlava
Hello, I would like to extend the examples section on clojure wiki with parallel factorial example codes (one version is sligtly simpler, one performs better). Your feedback on the code is more than welcome, as I still consider myself beginner on clojure (but coming up with the algorithm +

Re: Remove Value From Vector at Given Index

2009-12-03 Thread ataggart
There's take-nth in core, but no drop-nth (which sounds like what you need), so I wrote it: (defn drop-nth [n coll] (lazy-seq (when-let [s (seq coll)] (concat (take n s) (drop-nth n (next (drop n s))) So, in your example: (vec (drop-nth 2 [2 4 5 8 6 4])) On Dec 1, 7:06 pm, Don

Re: Remove Value From Vector at Given Index

2009-12-03 Thread ataggart
On Dec 3, 2:10 pm, ataggart alex.tagg...@gmail.com wrote: There's take-nth in core, but no drop-nth (which sounds like what you need), so I wrote it: (defn drop-nth [n coll]   (lazy-seq     (when-let [s (seq coll)]       (concat (take n s) (drop-nth n (next (drop n s))) So, in your

Re: simple journal-based persistenсe for Clojure

2009-12-03 Thread Sergey Didenko
Well, I'm not fluent with git yet. I'll create the github project, that can not be hard. In comparison with Prevayler, the persister does not block the reads, because it relies on Clojure STM. However it blocks the writes as Prevayler, because currently there is no way to reliably get/ generate

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread Gilbert
Just wanted to say that lein-nailgun is just a very primitive plugin, which is why you're seeing all kinds of problems. Essentially, it's a one-liner that calls the main function in com.martiansoftware.nailgun.NGServer. To call nailgun as a server inside a plugin, I think the only way would be

Re: API pages

2009-12-03 Thread Daniel
Looks fine in 3.5.4. On Dec 2, 11:24 pm, Sean Devlin francoisdev...@gmail.com wrote: Hey, the API page doesn't look right in Firefox 3.5 The cut off around halfway through the page. I think this also happens in Safari, but I'm not sure right now. Oh, and IE 6... YUCK! (But that's expected

Re: combining vimclojure, classpaths and leiningen

2009-12-03 Thread Gilbert
Also, ato's nailgun is just a plain nailgun server. It doesn't have any of the vimclojure stuff attached to it. All the extra dependencies from lein-nailgun is from vimclojure.jar. On Dec 3, 8:13 am, bOR_ boris.sch...@gmail.com wrote: Additionally, Ato's nailgun also generates two warnings upon

Re: API pages

2009-12-03 Thread ataggart
Looks fine in Safari 4.0.3. On Dec 2, 9:24 pm, Sean Devlin francoisdev...@gmail.com wrote: Hey, the API page doesn't look right in Firefox 3.5 The cut off around halfway through the page. I think this also happens in Safari, but I'm not sure right now. Oh, and IE 6... YUCK! (But that's

Re: Getting Started in Mac OS X Snow Leopard

2009-12-03 Thread Phil Hagelberg
Andreas Pauley apau...@gmail.com writes: It looks like Clojure is not installed. Install now? (y or n) Loading url...done Loading url-auth...done Contacting host: repo.technomancy.us:80 Loading url-cache...done Loading mail-utils...done Reading [text/plain]... 571k of 571k (100%) Loading

Re: API pages

2009-12-03 Thread Timothy Pratley
On Dec 3, 4:24 pm, Sean Devlin francoisdev...@gmail.com wrote: The cut off around halfway through the page. I've had this happen regardless of browser in the past also. There was some IRC about it a month ago http://clojure-log.n01se.net/date/2009-10-26.html 22:28 Flox_: About the Firefox / API

Re: API pages

2009-12-03 Thread Tom Faulhaber
Yeah, I remember seeing that on IRC, but never knew what to do about it. It's hard for me to diagnose since I'm not seeing it in Firefox 3.5.4 on my systems (1 Ubuntu, 2 Windows). If anyone who's seeing it can give me more info, I'd fix it up. More generally, if there's someone in the community

Re: ClojureCLR questions

2009-12-03 Thread mac
Apologies if this has been answered, did a quick search but found only pieces of info. Is it possible to run ClojureCLR on Mono yet? There was an issue with the BigDecimal dependency from J#? /Markus On Dec 3, 5:21 am, dmiller dmiller2...@gmail.com wrote: 1. CLR Interop:  Interop is the focus