Re: Choosing a Clojure build tool

2010-03-28 Thread B Smith-Mannschott
On Mon, Mar 29, 2010 at 08:24, Mark Derricutt wrote: > Why do you need to edit the settings twice a day?  Strikes me as a problem. >  You could move the relevant settings into a which is > only activated based on network/env settings, so those changes are > automatic? > -- > Pull me down under..

Re: Choosing a Clojure build tool

2010-03-28 Thread Mark Derricutt
Why do you need to edit the settings twice a day? Strikes me as a problem. You could move the relevant settings into a which is only activated based on network/env settings, so those changes are automatic? -- Pull me down under... On Fri, Mar 26, 2010 at 8:36 PM, Konrad Hinsen wrote: > 2) B

Bug - Clojure -e disables stdin

2010-03-28 Thread Asim Jalis
Is this a bug? echo "hi" | java -cp $HOME/jars/clojure.jar clojure.main -e '(println (line-seq (java.io.BufferedReader. *in*)))' The output is nil. This works fine if argument to -e is saved to a file and then the file name is specified on the command line. -- Asim -- You received this messag

[Noob] Impact of gen-class on clojure-ness

2010-03-28 Thread Steven Devijver
Hi, I'm thinking about writing some piece of software completely in clojure (yeah!) However, it is my first time so I want to make sure I know what I'm doing. Specifically, I prefer to define the important components of my software as Java interfaces. Partly to see myself think, partly because it

Re: copying structures

2010-03-28 Thread Rick Mouritzen
The Clojure data structures are immutable, so there's no need to copy. Just "modify" the existing structure and you have a new immutable instance. If you are coming from Java, it helps to think of these immutable structures like Java's String. On Sun, Mar 28, 2010 at 9:29 AM, strattonbrazil wrot

Re: Polyglot (Clojure) Maven (Was: Re: Choosing a Clojure build tool)

2010-03-28 Thread Antony Blakey
My current proposal for the Clojure DSL for polyglot maven looks like this: -- (defproject com.linkuistics.lamdras/website "1.0-SNAPSHOT" :model-version "4.0.0" :name "Lamdras Website" :description "Acumen / LRMDS Integr

Re: ANN: labrepl, making Clojure more accessible

2010-03-28 Thread Eric Thorsen
I just sent you a message before I saw this... I'm in the midst of cutting a new release of the Enclojure plugin and I'm working on also providing a prepackaged version of Netbeans with the Enclojure plugin installed. I wanted to include the LapRepl in the release and the pre-packaged netbeans (as

Re: copying structures

2010-03-28 Thread Richard Newman
Is this the common way to do it? (def sister (assoc brother :name "Cindy")) If you want to change the value of one key in a map, yes. (In this example it looks weird, of course.) If you want to create a new map by taking only some values from another map: user=> (def sister (assoc (sele

Re: copying structures

2010-03-28 Thread strattonbrazil
Is this the common way to do it? (def sister (assoc brother :name "Cindy")) Reading up more on structs, it seems they have base keys that can't be dissoc. Is that the main difference then between it and a hash? On Mar 28, 2:48 pm, strattonbrazil wrote: > I did a poor job explaining myself.  S

Re: copying structures

2010-03-28 Thread Richard Newman
Is there a shorter way to do this? See my earlier message. dissoc and assoc will do what you want. (def brother {:name "Gary" :address "..." :mother "Mary" :father "John"}) (def sister (assoc brother :name "Cindy")) user=> sister {:name "Cindy", :address "...", :mother "Mary", :father "John

Re: byte and 2s complement

2010-03-28 Thread ataggart
Bytes in java are signed values [-128,127]. I've submitted a ticket to add a ubyte function which simply checks for [0,255]. Note that this only deals with down-casting. Shift functions work on ints, thus you'd need to mask the byte to an int with (bit-and % 0xFF). If you don't do this, then when

Re: copying structures

2010-03-28 Thread strattonbrazil
I did a poor job explaining myself. Sorry. I understand that copying an immutable structure is worthless. I want a copy of a structure except one or two specific properties. For example, (defstruct person :name :address :mother :father) (def brother (struct person "Gary" ...)) (def sister (st

Re: byte and 2s complement

2010-03-28 Thread Glen Rubin
Halelujah! On Mar 28, 4:29 pm, Michael Wood wrote: > On 28 March 2010 22:07, Glen Rubin wrote: > > > I guess not, some of the values I am obtaining are off.  I have tried > > searching for a java class that will understand a signed (two's > > complement) hex (16 bit, 0xff32) > > > This is someth

Re: byte and 2s complement

2010-03-28 Thread Michael Wood
On 28 March 2010 22:07, Glen Rubin wrote: > I guess not, some of the values I am obtaining are off.  I have tried > searching for a java class that will understand a signed (two's > complement) hex (16 bit, 0xff32) > > This is something so basic, I know there must be some in built > function for t

Re: byte and 2s complement

2010-03-28 Thread Glen Rubin
I guess not, some of the values I am obtaining are off. I have tried searching for a java class that will understand a signed (two's complement) hex (16 bit, 0xff32) This is something so basic, I know there must be some in built function for this?? On Mar 28, 3:06 pm, Glen Rubin wrote: > I am w

Re: Ants in anger

2010-03-28 Thread alux
Addendum: After about a day of CPU time most of the refs are at 9 or 10 with their history length. a. On 28 Mrz., 14:18, alux wrote: > Hi, > > I played with Richs ant colony these days, and want to report about > experience with 4 cores. > > First I didn't want my computer to idle, so I set > >

byte and 2s complement

2010-03-28 Thread Glen Rubin
I am working with 2's complement hex. It looks like i can get the value of any number by just using byte? e.g.: (byte 0xff32) -- 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 post

Re: copying structures

2010-03-28 Thread B Smith-Mannschott
On Sun, Mar 28, 2010 at 18:29, strattonbrazil wrote: > This may be really basic.  So much so that it's hard to find on the > internet, but is there something like a copy constructor in clojure, A copy-constructor is redundant in a language where values are immutable. (Just refer to it since it ca

Re: copying structures

2010-03-28 Thread Laurent PETIT
As for papers on the Interner on the subject of persistent data structures, one gentle introduction might be this blog entry: http://eclipsesource.com/blogs/2009/12/13/persistent-trees-in-git-clojure-and-couchdb-data-structure-convergence/ (with examples from several fields: git, clojure, etc.) H

Re: copying structures

2010-03-28 Thread Richard Newman
This may be really basic. So much so that it's hard to find on the internet, but is there something like a copy constructor in clojure, where I can copy everything in a structure except one or two keys? Maybe something like struct-map, but fills in the other variables not supplied by another data

copying structures

2010-03-28 Thread strattonbrazil
This may be really basic. So much so that it's hard to find on the internet, but is there something like a copy constructor in clojure, where I can copy everything in a structure except one or two keys? Maybe something like struct-map, but fills in the other variables not supplied by another data

Re: converting long string to number

2010-03-28 Thread feka
Really embarrassing in two ways: - Could not remove my previous post. :-) - I should have tried to create such a big number (at least after reading all the answers here) before posting... It is possible to crate a 5 digit big integer. PS: Watch out though. The aim of the problem is to add up t

Re: converting long string to number

2010-03-28 Thread feka
Looks like you are doing the 13th Project Euler problem. That means you have exactly one hundred 50 digit numbers. I am new to Clojure but AFAIK you wont be able to handle a 5000 digit number in it. You have to find another way. There is at least one... ;-) --Feka On Mar 25, 11:40 pm, Glen Rubin

Ants in anger

2010-03-28 Thread alux
Hi, I played with Richs ant colony these days, and want to report about experience with 4 cores. First I didn't want my computer to idle, so I set * (def dim 140) was 80 * (def food-places 13) was 35 - I hoped for more defined routes. In vain. * (def food-range 1000) was 100 to have enough. and

java.lang.AbstractMethodError with lazy deftypes (lazytest)

2010-03-28 Thread Mike Mazur
Hi, I'm playing with Stuart Sierra's lazytest[1]. I'm trying to get access at the test results of a test. I defined a spec and when I evaluate it, it looks like I get a TestResults back. Trying to assign this to a var fails with a java.lang.AbstractMethodError: Clojure=> (spec my-spec

Re: Polyglot (Clojure) Maven (Was: Re: Choosing a Clojure build tool)

2010-03-28 Thread Antony Blakey
On 28/03/2010, at 8:01 PM, B Smith-Mannschott wrote: > - Clojure code manipulating poloyglot's notation is more complex > because it must be parsed first, and then recombined. Leiningen's > notation already is 'parsed'. Partly parsed. The most 'correct' form would be [groupdId artifactId version

Re: Fighting with Emacs ;-)

2010-03-28 Thread alux
Ah. Okay. Thank you. Hello Michał, reading your mail, I was completely convinced I already did exactly this. Seemingly I made a number of mistakes that didn't cancel out. First, the defs are in the namespace if and only if the namespace expression is evaluated first. I didn't realise I do non co

Re: Polyglot (Clojure) Maven (Was: Re: Choosing a Clojure build tool)

2010-03-28 Thread B Smith-Mannschott
On Sun, Mar 28, 2010 at 08:39, Antony Blakey wrote: > > On 28/03/2010, at 4:42 PM, Antony Blakey wrote: > >> (defproject main "org.clojars.the-kenny:clojure-couchdb:0.2" >>  :add-default-plugins true >>  :description "Simple Clojure interface to Apache CouchDB, fork of the >> original project wit

Re: Can I GPL my Clojure project?

2010-03-28 Thread Antony Blakey
On 28/03/2010, at 5:33 PM, Stefan Kamphausen wrote: > It will be interesting how the licenses will be interpreted in Clojure > where Java and Lisp bump together. The Java-world probably had it's > discussion, too, no? The "Classpath Exception" is the principal result of this discussion: http:/

Re: Can I GPL my Clojure project?

2010-03-28 Thread Stefan Kamphausen
Hi, On 28 Mrz., 06:55, Mike Meyer wrote: > And to answer the critical question you didn't ask: > > 5) Can I distribute a jar file for my Clojure project under the GPL? > > No. When you compile your code, code from clojure (and clojure-contrib > if you use it) will be included in the resulting ja