bit-and reflection warning

2010-06-01 Thread rzeze...@gmail.com
When using bit-and with longs I get a reflection warning. How can I make this go away? user> (bit-and (long -10) 0x) Reflection warning, NO_SOURCE_FILE:1 - call to and can't be resolved. 4294967286 -- You received this message because you are subscribed to the Google Groups "Clojure" g

ANN: difform - diff clojure forms

2010-06-01 Thread George Jahad
user=> (difform { 1 2 3 4 5 6} { 5 6 1 2 3 7}) {1 2, 3 - 4 +7 , 5 6} Details here: http://georgejahad.com/clojure/difform.html Thanks to Runa, (my employer,) for supporting my Clojure habit! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: Complex type in clojure

2010-06-01 Thread Daniel
Good deal. There's complex number support in contrib but this is probably a much better way to go about it. This touches upon another subject though: Clojure lacks a good math library (though Liebke might kill me for that). Clojuratica is good too but not nearly fast enough for general use. Has

Re: Android 'dex' stage takes a very long time with Clojure

2010-06-01 Thread Matt Clark
Do you have a public repository of the work you've done so far? I'm very interested to learn more about this. On May 29, 7:31 pm, MHOOO wrote: > Well, that was easy enough. I modified the load function inside > RT.java to load classes/namespaces out of .dex files. (use > 'my.compiled.namespace) w

Trying to make my code extensible

2010-06-01 Thread Brent Millare
I'm trying to make my code extensible and I'm having trouble deciding what is the best way to do this. The algorithm is a tree walker that modifies a few data structures before, post, and during the traversal of each node. The code detects circular dependencies, resolves dependencies once, and ign

Re: clojure.lang.PersistentArrayMap

2010-06-01 Thread Laurent PETIT
woops, merge is indeed the function you're after 2010/6/2 Laurent PETIT > Hi, > > 2010/6/1 Ryan > >> I have the following >> >> user=> (class ({:one "1"} {:two "2"} {:three "3"})) >> clojure.lang.PersistentArrayMap >> >> but am a little confused as to how best to access the data >> >> for examp

Re: clojure.lang.PersistentArrayMap

2010-06-01 Thread Laurent PETIT
Hi, 2010/6/1 Ryan > I have the following > user=> (class ({:one "1"} {:two "2"} {:three "3"})) > clojure.lang.PersistentArrayMap > > but am a little confused as to how best to access the data > > for example: > user=> (count ({:one "1"} {:two "2"} {:three "3"})) > 1 > try directly in the REPL (

Re: clojure.lang.PersistentArrayMap

2010-06-01 Thread patrik karlin
theres a function called merge 2010/6/1 Ryan > I have the following > user=> (class ({:one "1"} {:two "2"} {:three "3"})) > clojure.lang.PersistentArrayMap > > but am a little confused as to how best to access the data > > for example: > user=> (count ({:one "1"} {:two "2"} {:three "3"})) > 1 >

Re: Emacs - Problem with running tests (yes I installed with ELPA)

2010-06-01 Thread Paul Hobbs
I have a similar issue whenever I try to print anything from slime. -- Paul Hobbs On Mon, May 31, 2010 at 11:41 PM, Steve Molitor wrote: > When I run clojure-test-run-tests I can't see the intermediate test > output. Messages like the following flash by as the tests run: > >error in process

clojure.lang.PersistentArrayMap

2010-06-01 Thread Ryan
I have the following user=> (class ({:one "1"} {:two "2"} {:three "3"})) clojure.lang.PersistentArrayMap but am a little confused as to how best to access the data for example: user=> (count ({:one "1"} {:two "2"} {:three "3"})) 1 user=> (first ({:one "1"} {:two "2"} {:three "3"})) [:three "3"] u

Complex type in clojure

2010-06-01 Thread Travis Hoffman
I was curious what it would take to add a complex number type to Clojure Core. If anyone else is curious, it doesn't take much: 1.) Add clojure.lang.Complex 2.) Add a Pattern and code to match, parse and create complex numbers in LispReader (parses number of the form 1.0+0.0i) 3.) Add ComplexOps c

Re: clojure.contrib.repl-utils show

2010-06-01 Thread looselytyped
Hi Sean, Yes, it certainly looks like it's being pulled into clojure core. Thank you for the response. If I may say so - I think your series on vimeo is awesome. Thank you for taking the time and making the effort. Kind regards, Raju On Jun 1, 11:13 am, Sean Devlin wrote: > Keep in mind that

Re: "special form" vs. "macro"

2010-06-01 Thread Sina K. Heshmati
alux wrote: > no special form at all? Cool, I'll have a look. > > Chapter 4.1 and 4.2 actually sit on my desk already since yesterday - > I just didnt read it. I hope I get a chance in the next days. If you have the time and motivation, go for it. Please note that, the wizard book had better be

Re: Rationals, and their size

2010-06-01 Thread Kevin Downey
http://github.com/richhickey/clojure/commit/5772be9fc5ac9ddf92b727908c20b9aab971224a On Mon, May 31, 2010 at 2:12 PM, alux wrote: > Yep, know that, been there ;-)) > > On 31 Mai, 21:39, ataggart wrote: >> On May 31, 12:18 am, alux wrote: >> >> > Ah, thank you - I still shy away from looking int

Re: Which GUI toolkit would you like to see wrapped in an idiomatic Clojure library?

2010-06-01 Thread Luke VanderHart
Ok... thanks everyone for the extended discussion. I'm thrilled to get so much feedback - apparently something like this is much-desired. Tentatively, based on the feedback in this thread, I'm going to provide a thick API and a Swing implementation. I will *attempt* to keep it abstract enough that

Re: "special form" vs. "macro"

2010-06-01 Thread Konrad Hinsen
On 1 Jun 2010, at 21:38, alux wrote: In a lazy lisp if and cond can be plain functions. But to define plain functions, or in any case somewhere, I need a special form. Is it that what you mean? Not quite, though it's true as well. What I meant is that you can't define if/cond as a function i

Re: : Google Chrome extension for TryClojure (tr y-clojure.org)

2010-06-01 Thread Sina K. Heshmati
"Heinz N. Gies" said: > The DNS is fixed, try-clojure.org is now working too :) Not anymore! I was actually using it. I missed C-a C-k though. SinDoc -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-01 Thread Heinz N. Gies
The DNS is fixed, try-clojure.org is now working too :) regards, Heinz On Jun 1, 2010, at 1:46 , Sean Corfield wrote: > Good to know. I'll reinstall it and look forward to using it once DNS > has propagated (if that's what's causing the problems with the > extension)... > > On Mon, May 31, 2010

Re: "special form" vs. "macro"

2010-06-01 Thread alux
Hello SinDoc, no special form at all? Cool, I'll have a look. Chapter 4.1 and 4.2 actually sit on my desk already since yesterday - I just didnt read it. I hope I get a chance in the next days. Many thanks, alux On 1 Jun., 09:38, "Sina K. Heshmati" wrote: > "alux" said: > > Hey alux, > > > wh

Re: "special form" vs. "macro"

2010-06-01 Thread alux
Hello Konrad, to ensure I understand you right (I want to understand your words, so in this very moment I dont care about other wordings): In a lazy lisp if and cond can be plain functions. But to define plain functions, or in any case somewhere, I need a special form. Is it that what you mean?

Re: API in Clojure for Java folklore

2010-06-01 Thread Jason Smith
[Note, you can implement this solution by writing stub classes by hand. This means you write stubbed out Java classes, run Javac first, and allow Clojure to overwrite the stubbed class files when it compiles. This is easy to do in Maven, and not difficult in ANT. And I have not actually tried th

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-01 Thread sergey-miryanov
Sean, Rayne made a patch and I update an extension. Please check :) On 1 июн, 05:46, Sean Corfield wrote: > Good to know. I'll reinstall it and look forward to using it once DNS > has propagated (if that's what's causing the problems with the > extension)... -- You received this message because

Naming and Organization

2010-06-01 Thread seoushi
Hello, I'm new to clojure and lisps in general and have started writing a simple game. One of the things that I feel I'm lacking in is naming functions and how the code is organized. Is there some sorta style guidelines or something of that nature out there for reference? It would be really helpf

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-01 Thread sergey-miryanov
Rayne, thank you for your work, without it nothing happens :) Yes, feel free to link to extension on your page. On 1 июн, 20:40, Rayne wrote: > This is freakin' amazin!!! Thank you so much. With your permission, > I'd love to link to this extension on the front page. This is really > great. :) >

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-01 Thread feka
Good idea! Thanks. (And try-clojure is good idea, too. So they also merit the thanks.) I can't make it grab the selection and evaluate it though. Am I missing something? Mac OS X 10.6.3, Chromium (Revision 48615) Feka On May 31, 12:04 pm, sergey-miryanov wrote: > Hi all, > >  I made a little ex

Re: Problem with "-" in definterface method name

2010-06-01 Thread Stuart Halloway
definterface makes an actual Java interface. Java does not allow "-". Attempting this should probably fail with an error message. Stu > Hi, > > It seems definterface/deftype have a problem with "-" in the method name... > > ... Clojure 1.2.0-master-SNAPSHOT (today) > > (definterface INm (^St

Re: Problem with "-" in definterface method name

2010-06-01 Thread Meikel Brandmeyer
Hi, On Tue, Jun 01, 2010 at 09:38:14AM -0700, Adrian Cuthbertson wrote: > > Is that a bug or is there a usage rule I'm missing? > seems so - underscore in the definterface method works... I would think get-nm is not a valid Java method name. Sincerely Meikel -- You received this message becau

Re: Problem with "-" in definterface method name

2010-06-01 Thread Adrian Cuthbertson
> Is that a bug or is there a usage rule I'm missing? seems so - underscore in the definterface method works... (definterface INm (^String get_nm [])) ==> user.INm (deftype Nm[nm] INm (^String get-nm [this] (str "Mr " nm))) (.get-nm (Nm. "Smith")) ==> "Mr Smith" -- You received this message be

Problem with "-" in definterface method name

2010-06-01 Thread Adrian Cuthbertson
Hi, It seems definterface/deftype have a problem with "-" in the method name... ... Clojure 1.2.0-master-SNAPSHOT (today) (definterface INm (^String get-nm [])) ==> user.INm (deftype Nm[nm] INm (^String get-nm [this] (str "Mr " nm))) ==> java.lang.IllegalArgumentException: Can't define method no

Re: clojure.contrib.repl-utils show

2010-06-01 Thread Sean Devlin
Keep in mind that REPL-utils is being discussed for inclusion in core in 1.2. Therefore, any edge build will have to pay extra attention to what is going on. This will be easier to track when frozen betas & RC's come out. Sean On Jun 1, 10:52 am, looselytyped wrote: > Hi Meikel, > > Thank you

Re: clojure.contrib.repl-utils show

2010-06-01 Thread looselytyped
Hi Meikel, Thank you for the response. I did not do that, but a quick glance at the clojure.contrib github repo tells me there is no 'show' function in it. I will try it at home (it's on my home computer). It's odd because it was working just fine - then I did a 'lein clean' and 'lein deps' and i

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-01 Thread Rayne
This is freakin' amazin!!! Thank you so much. With your permission, I'd love to link to this extension on the front page. This is really great. :) On May 31, 5:04 am, sergey-miryanov wrote: > Hi all, > >  I made a little extension for google chrome. It allows to start try- > clojure REPL via clic

Re: Future and current thread bindings

2010-06-01 Thread Meikel Brandmeyer
Hi, On Jun 1, 4:22 pm, Michael Jaaka wrote: > Shouldn't the future block inherit by default the bindings of calling > thread? Asides from the question whether bindings should be inherited or not, you can work around your trouble via bound-fn and future-call. (future-call (bound-fn [] (do-stuff

Future and current thread bindings

2010-06-01 Thread Michael Jaaka
Hi! Shouldn't the future block inherit by default the bindings of calling thread? I noticed than in all places I have to use written macro: (defmacro future-with-current-binding [ & body ] `(let [b# (get-thread-bindings)] (future (with-bindings b# ~...@body and have n

Re: Modify clojure startup behavior

2010-06-01 Thread MHOOO
Ah thanks. I've been looking for that line. On May 31, 4:06 pm, Remco van 't Veer wrote: > On 2010/05/31 14:25, MHOOO wrote: > > > I'd like to have clojure *not* `(load x)` where x is at least: > > clojure.zip, clojure.xml, clojure.set > > when starting clojure up. I didn't really find any place

License of Clojure's logo

2010-06-01 Thread Sebastián Galkin
In other discussion http://groups.google.com/group/clojure/browse_thread/thread/7f179c79f0d0bb3e appeared the topic of Clojure's logo license, but Rich didn't give a definitive response. Is there any news on the subject, or any plans to give a public permission to use the logo? I would like to u

Re: newbie question about sets not being countable

2010-06-01 Thread Stuart Halloway
You are counting the function: > (count toddg.spell/get-wordlist) Not the result of calling the function: (count (toddg.spell/get-wordlist)) Cheers, Stu -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@

newbie question about sets not being countable

2010-06-01 Thread toddg
1. I have a function that returns a set of unique words, get- wordlist() 2. (I think) this function returns a set, but the returned coll throws an UnsupportedOperationException if I try to count it 3. The weird thing is that the ancestors seem to be the same as with a set, #{} Details: --

Emacs - Problem with running tests (yes I installed with ELPA)

2010-06-01 Thread Steve Molitor
When I run clojure-test-run-tests I can't see the intermediate test output. Messages like the following flash by as the tests run: error in process filter: Elisp destructure-case failed: (:write- string "Testing my-stuff")) I do see the final message: "Ran 3 test. 0 failures, 0 errors". If

Re: : Google Chrome extension for TryClojure (try-clojure.org)

2010-06-01 Thread Jeff Rose
Awesome! Works great for me with Chromium in Ubuntu Lucid. This will be handy for trying things out and looking up docs. Thanks! -Jeff On May 31, 12:04 pm, sergey-miryanov wrote: > Hi all, > >  I made a little extension for google chrome. It allows to start try- > clojure REPL via clicking on

Re: "special form" vs. "macro"

2010-06-01 Thread Konrad Hinsen
On 1 Jun 2010, at 09:18, alux wrote: So, if you have lazy-eval, there's no need for special-forms. This is obviousely correct for if / cond. If you define special forms as in Common Lisp (that's something I learned from this discussion), yes. If you define special forms as I think Clojur

Re: "special form" vs. "macro"

2010-06-01 Thread Sina K. Heshmati
"alux" said: Hey alux, > what an interesting discussion! Whoo! ;-) > > Many thanks four your comment. > >> So, if you have lazy-eval, there's no need for special-forms. > > This is obviousely correct for if / cond. > > Looking into the other special forms ( http://clojure.org/special_forms >

Re: "special form" vs. "macro"

2010-06-01 Thread alux
Hello SinDoc, what an interesting discussion! Whoo! ;-) Many thanks four your comment. You wrote > So, if you have lazy-eval, there's no need for special-forms. This is obviousely correct for if / cond. Looking into the other special forms ( http://clojure.org/special_forms ), I wouldnt know

Re: Having trouble getting full performance from a quad-core with trivial code

2010-06-01 Thread ka
Hi Zak, I tried your example on my i7 (4 physical cores, 8 logical); here are the results - 1:298 user=> (time (do (doall (map fac (take 10 (repeat 5 nil)) "Elapsed time: 54166.665145 msecs" 1:300 user=> (time (do (doall (pmap fac (take 10 (repeat 5 nil)) "Elapsed time: 27418.263

Re: Understanding sequence abstraction

2010-06-01 Thread Richard Newman
Because seq is defined as returning nil for an empty sequence. The only way to find that out for a lazy sequence is to realize the first element. I'm not sure if that answers why seq should realize the first element. Even by what you say, only if I wanted to find if my LazySeq was nil should I