clojure.contrib.repl-utils.show and bigint

2009-04-22 Thread miki
Hello All, Is the fact that the output of (show java.math.BigInteger) and (show bigint) differ is a bug or a feature? :) All the best, -- Miki --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: The Path to 1.0

2009-04-22 Thread Rich Hickey
On Apr 21, 12:18 pm, Daniel Jomphe danieljom...@gmail.com wrote: Paul Stadig wrote: Others have commented on the whole groupId, artifactId, etc., etc. But in terms of the parts of the version number, they are named major.minor.incremental-qualifier as documented here:

Re: The Path to 1.0

2009-04-22 Thread Laurent PETIT
Hi, 2009/4/22 Rich Hickey richhic...@gmail.com: [...] {:major 1, :minor 0, :incremental 0, :qualifier :rc1 :interim true} [...] Possible values of :qualifier include :rc, :beta etc, and :interim will be true for non-release builds. I don't think :qualifier is used correctly here (at least

Re: The Path to 1.0

2009-04-22 Thread Laurent PETIT
OOooops sorry, I mistook qualifier for classifier, :qualifier seems totally appropriate here, sorry for the noise, -- Laurent 2009/4/22 Laurent PETIT laurent.pe...@gmail.com: Hi, 2009/4/22 Rich Hickey richhic...@gmail.com: [...] {:major 1, :minor 0, :incremental 0, :qualifier :rc1

Re: ICFP 2009

2009-04-22 Thread Rich Hickey
On Apr 20, 10:42 pm, Andrew Wagner wagner.and...@gmail.com wrote: It would be fun to have a team of clojure programmers work on the ICFP '09 contest. Has this been done previously? Anybody interested? I'm new to clojure and to lisps in general, but have a pretty good grasp of functional

Re: The Path to 1.0

2009-04-22 Thread Daniel Jomphe
Daniel Jomphe wrote: Rich Hickey wrote: I don't mind the build producing clojure-1.0.0.jar etc, but it doesn't now. The master build is Ant. Where is the best place to put the version info so it can be leveraged by Ant, Maven and the clojure core runtime in order to produce

Re: clojure.contrib.repl-utils.show and bigint

2009-04-22 Thread Stephen C. Gilardi
On Apr 22, 2009, at 2:38 AM, miki wrote: Is the fact that the output of (show java.math.BigInteger) and (show bigint) differ is a bug or a feature? :) java.math.BigInteger is a class. bigint is a function. Differing output from show is expected. --Steve smime.p7s Description: S/MIME

Re: clojure.contrib.repl-utils.show and bigint

2009-04-22 Thread Chouser
On Wed, Apr 22, 2009 at 2:38 AM, miki miki.teb...@gmail.com wrote: Is the fact that the output of (show java.math.BigInteger) and (show bigint) differ is a bug or a feature? :) Feature! The symbol java.math.BigInteger refers to the BigInteger class, and 'show' shows that. The symbol bigint

Re: clojure.contrib.repl-utils.show and bigint

2009-04-22 Thread miki
Hello, Is the fact that the output of (show java.math.BigInteger) and (show bigint) differ is a bug or a feature? :) java.math.BigInteger is a class. bigint is a function. Differing output from show is expected. Ah, OK. Thanks, -- Miki

Simple sequence question: inserting something after blocks of fulfilling elements

2009-04-22 Thread samppi
Let's say I have a sequence of integers: (def a (3 9 1 5 102 -322 ...)) Is there a function for inserting an object—let's say :foo—after elements that fulfill a certain predicate? Furthermore, I mean inserting :foo after any block of elements that fulfill it: (mystery-function (partial 6)

Adding dependent jars without restarting your repl

2009-04-22 Thread Craig McDaniel
Phil, that's useful advice about unpacking jar files to a project's dependency directory versus dropping jar files in there. That would be a good candidate for a FAQ regarding how to add dependent jars during development without restarting your REPL. And it decreases questions about the

Re: The Path to 1.0

2009-04-22 Thread Laurent PETIT
2009/4/22 Rich Hickey richhic...@gmail.com: [...] {:major 1, :minor 0, :incremental 0, :qualifier :rc1 :interim true} for interim versions and {:major 1, :minor 0, :incremental 0} for releases. :interim tracks the SNAPSHOT segment of the version string. [...] I don't mind the build

Re: 'first vs 'nth on maps

2009-04-22 Thread Victor Rodriguez
On Mon, Apr 20, 2009 at 5:17 PM, Hugh Winkler hwink...@gmail.com wrote: On Mon, Apr 20, 2009 at 1:59 PM, David Nolen dnolen.li...@gmail.com wrote: Maps aren't ordered so this isn't a good idea anyway. It's a good idea if you have a sorted map. My example should have used sorted-map. The

Re: Simple sequence question: inserting something after blocks of fulfilling elements

2009-04-22 Thread Michael Wood
On Wed, Apr 22, 2009 at 4:57 PM, samppi rbysam...@gmail.com wrote: Let's say I have a sequence of integers:  (def a (3 9 1 5 102 -322 ...)) Is there a function for inserting an object—let's say :foo—after elements that fulfill a certain predicate? Furthermore, I mean inserting :foo after

Re: Abstract data types in functional languages

2009-04-22 Thread Victor Rodriguez
On Tue, Apr 21, 2009 at 12:01 PM, David Nolen dnolen.li...@gmail.com wrote: Nice post thanks for putting it together.  My gut feeling is that the need for information hiding is still overinflated, but... until someone builds a 200k LOC Clojure program who will know for sure? Here's my shot at

Re: Simple sequence question: inserting something after blocks of fulfilling elements

2009-04-22 Thread Adam Blinkinsop
On Wed, Apr 22, 2009 at 9:58 AM, Michael Wood esiot...@gmail.com wrote: On Wed, Apr 22, 2009 at 4:57 PM, samppi rbysam...@gmail.com wrote: Let's say I have a sequence of integers: (def a (3 9 1 5 102 -322 ...)) Is there a function for inserting an object—let's say :foo—after

Re: Simple sequence question: inserting something after blocks of fulfilling elements

2009-04-22 Thread Laurent PETIT
2009/4/22 Michael Wood esiot...@gmail.com: On Wed, Apr 22, 2009 at 4:57 PM, samppi rbysam...@gmail.com wrote: Let's say I have a sequence of integers:  (def a (3 9 1 5 102 -322 ...)) Is there a function for inserting an object—let's say :foo—after elements that fulfill a certain

Re: Abstract data types in functional languages

2009-04-22 Thread David Nolen
You're missing the clever hack ;) I'm hashing the private data structure and associating it to the map. This is what is used in the equality test. You can verify yourself that it works. my-object ;; - {:private -1261861093} my-other-object ;; - {:private -1261861093} Make sense? A few quick tests

Re: Simple sequence question: inserting something after blocks of fulfilling elements

2009-04-22 Thread Meikel Brandmeyer
Hi, Am 22.04.2009 um 16:57 schrieb samppi: Let's say I have a sequence of integers: (def a (3 9 1 5 102 -322 ...)) Is there a function for inserting an object—let's say :foo—after elements that fulfill a certain predicate? Furthermore, I mean inserting :foo after any block of elements that

cannot use swig native shared libraries

2009-04-22 Thread Antonio, Fabio Di Narzo
Hi all. I'm having problems with using swig-generated wrappers with Clojure. I'm running ubuntu-8.04-i386, gcc-4.2.4, swig-1.3.33, openjdk-1.6.0, latest clojure release. I've cut down a minimal reproducible example. The swig file: ---file:swig_test.i--- %module swig_test %{ int

Recursively delete files

2009-04-22 Thread Phil Hagelberg
I couldn't find an equivalent to rm -rf in the JDK, so I wrote these functions: (defn delete-file Delete file f. Raise an exception if it fails. [f] (or (.delete (file f)) (throw (java.io.IOException. (str Couldn't delete f) (defn delete-file-recursively Delete file f. If

Re: Simple sequence question: inserting something after blocks of fulfilling elements

2009-04-22 Thread Michael Wood
On Wed, Apr 22, 2009 at 8:03 PM, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 22.04.2009 um 16:57 schrieb samppi: Let's say I have a sequence of integers: (def a (3 9 1 5 102 -322 ...)) Is there a function for inserting an object—let's say :foo—after elements that fulfill a certain

Re: cannot use swig native shared libraries

2009-04-22 Thread Dimiter malkia Stanev
I might be wrong, but shouldn't you compile the .c file to .o with -fpic, and then link with ld with -shared? maybe just adding -fpic to: gcc -fpic -shared ${JNI_CFLAGS} swig_test_wrap.c -o libswig_test.so might do it. On Apr 22, 6:41 am, Antonio, Fabio Di Narzo antonio.fa...@gmail.com

Re: Simple sequence question: inserting something after blocks of fulfilling elements

2009-04-22 Thread Meikel Brandmeyer
Hi Micheal, Am 22.04.2009 um 21:18 schrieb Michael Wood: Your version gives the same answer as mine, but I believe what he wants is something that skips over all the elements that pass the test and only inserts one instance of o after them. That's why in his example there is not a :foo after

Re: Recursively delete files

2009-04-22 Thread André Thieme
On 22 Apr., 21:12, Phil Hagelberg p...@hagelb.org wrote: I couldn't find an equivalent to rm -rf in the JDK, so I wrote these functions: (defn delete-file   Delete file f. Raise an exception if it fails.   [f]   (or (.delete (file f))       (throw (java.io.IOException. (str Couldn't

Re: Simple sequence question: inserting something after blocks of fulfilling elements

2009-04-22 Thread Christophe Grand
Hi all! (defn mystery-function [pred coll] (lazy-seq (when (seq coll) (let [[run etc] (split-with pred coll)] (if (seq run) (concat run (cons :foo (mystery-function pred etc))) (cons (first coll) (mystery-function pred (rest coll Christophe

Re: Recursively delete files

2009-04-22 Thread e
why is 'when' preferred ... so we know what the considerations are? Thanks On Wed, Apr 22, 2009 at 6:47 PM, André Thieme splendidl...@googlemail.comwrote: On 22 Apr., 21:12, Phil Hagelberg p...@hagelb.org wrote: I couldn't find an equivalent to rm -rf in the JDK, so I wrote these

Re: 'first vs 'nth on maps

2009-04-22 Thread e
i've noticed a pattern in explanations in clojure that interface and runtime are related. Is that the point being made here? Make expensive things hard or at least explicit? Maybe instead of nth, since that causes controversy, call it find-nth or something? On Wed, Apr 22, 2009 at 12:58

Re: Recursively delete files

2009-04-22 Thread Phil Hagelberg
André Thieme splendidl...@googlemail.com writes: This could really be helpful for some fixtures during unit testing. That's exactly what I'm using it for. =) I think anyone else who has tests that write files is going to need something like this too, which is what made me think it'd be

Re: Recursively delete files

2009-04-22 Thread Dimiter malkia Stanev
I think this might come from Common Lisp (or Scheme, not sure). In anycase CL also has unless which is exactly the opposite of when - e.g. it would do the else part of if. http://www.lispworks.com/documentation/HyperSpec/Body/m_when_.htm Basically some of the Common Lispers are saying that

Re: Recursively delete files

2009-04-22 Thread Cosmin Stejerean
On Wed, Apr 22, 2009 at 6:30 PM, Phil Hagelberg p...@hagelb.org wrote: Yeah, I had originally put this in the clojure.contrib.java-utils namespace, which defines file. Not sure if that's the best place for it, but I don't see anything else that would be a better fit. This kind of

Re: ICFP 2009

2009-04-22 Thread fft1976
On Apr 22, 4:55 am, Rich Hickey richhic...@gmail.com wrote: I think it would be great if a Clojure team could have a go. Rich Interestingly, in the 11 year history of the ICFP contest, a Lisp variant never won, not even a third prize (unless you consider Dylan a Lisp), and not for lack of

Re: ICFP 2009

2009-04-22 Thread Chouser
On Mon, Apr 20, 2009 at 10:42 PM, Andrew Wagner wagner.and...@gmail.com wrote: It would be fun to have a team of clojure programmers work on the ICFP '09 contest. Has this been done previously? Anybody interested? I'm new to clojure and to lisps in general, but have a pretty good grasp of

Re: ICFP 2009

2009-04-22 Thread Victor Rodriguez
On Wed, Apr 22, 2009 at 10:49 PM, Chouser chou...@gmail.com wrote: On Mon, Apr 20, 2009 at 10:42 PM, Andrew Wagner wagner.and...@gmail.com wrote: It would be fun to have a team of clojure programmers work on the ICFP '09 contest. Has this been done previously? Anybody interested? I'm new to

Re: ICFP 2009

2009-04-22 Thread Mark Engelberg
Try your hand at one of the older contests, like this one: http://www.boundvariable.org/task.shtml --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: StackOverflowError Question

2009-04-22 Thread jleehurt
Hi Chrisophe, You are correct, the doall also solves the problem. Based on that, I moved the doall out of matrixMultiply and into the computeActualResponse function, so that the caller can decide whether they want lazy evaluation for matrixMultiply or not: (defn computeActualResponse