Weird exception behavior

2008-10-23 Thread jim
So am I doing something wrong or is this a bug when an exception is thrown from inside a call to map? Thanks, Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Weird exception behavior

2008-10-24 Thread jim
Thanks Rich. --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED] For more op

Re: trampoline for mutual recursion

2008-11-25 Thread jim
Very nice. Thanks, Rich. I had implemented my own version, but it's much nicer to have it in the language. Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gr

Re: trampoline for mutual recursion

2008-11-27 Thread jim
say, this is an of-a-piece design, so I would vote that trampoline itself should be kept cruft-free. My $.02 Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: Lazy living, without variables

2008-12-01 Thread jim
ts factored out and the individual pieces are easier to unit test. The 'downside' is that it takes more thought. You really have to understand the problem you're working on. Jim On Dec 1, 10:08 am, Stuart Halloway <[EMAIL PROTECTED]> wrote: > Lazyness is just so cool: >

Re: Lazy living, without variables

2008-12-01 Thread jim
what you wrote. Functional programming is a totally different mind set than imperative programming. You might pick up "The Little Schemer" and "The Seasoned Schemer". They do a good job of changing your perspective. Jim On Dec 1, 2:55 pm, puzzler <[EMAIL PROTECTED]> wrote: >

RDF in Clojure - best practise?

2009-05-24 Thread Jim Downing
, jim --~--~-~--~~~---~--~~ 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 To unsubscribe from this group, send email to clojure+unsubscr...@google

Re: Silly question from Programming Clojure

2009-06-05 Thread Jim Weirich
ll programming concepts/models, aka > functional, imperative, object oriented, data flow, ... : see > http://www.info.ucl.ac.be/~pvr/book.htm ) I've not seen this one and the link seems to be broken. Try this: http://www.info.ucl.ac.be/~pvr/book.html -- -- Ji

Re: Mnesia like?

2009-06-16 Thread Jim Menard
torial See also Geir Magnusson Jr.'s MongoDB Java driver, which comes with a Clojure example that I wrote for him last year: http://github.com/geir/mongo-java-driver/tree/master http://github.com/geir/mongo-java-driver/blob/ca5b3ab3c2ab1caf8918cc84902abb7b476ba52b/src/examples/clojure/

Re: Classic TDD Bowling Game in Clojure

2009-07-20 Thread Jim Oly
ere worth making, but I am sure it could use more work. I am not particularly excited about the score-* set of functions, but I haven't come up with a better design for it yet. Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Uncle Bob: bowling meets Clojure

2009-07-20 Thread Jim Oly
problem by ignoring roll altogether. Jim --~--~-~--~~~---~--~~ 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 moderated

Re: Uncle Bob: bowling meets Clojure

2009-07-21 Thread Jim Oly
ata). This may not be a big deal since Uncle Bob did not include tests for roll but concentrated only on score. Jim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Clojure Workshop in London next Monday

2009-07-21 Thread Jim Weirich
On Jul 14, 2009, at 8:56 PM, Alex Scordellis wrote: > Next Monday evening we're hosting a Clojure Workshop at the > ThoughtWorks offices in central London. Rats! I noticed this too late to make the event. Too bad, it looked like fun. -- -- Jim Weirich -- jim.weir..

Cambridge (UK) Informal Clojure UG meetup

2009-08-27 Thread Jim Downing
Hi all, I'm meeting up with a few folks to chat about Clojure over a few beers next Monday evening at 8pm in the Kingston Arms, Cambridge (UK). Additional company very welcome! http://jimdowning.wordpress.com/2009/08/27/cambridge-clojure-user-group-meeting/ Cheers

Re: Cambridge (UK) Informal Clojure UG meetup

2009-08-27 Thread Jim Downing
Correction: That's *Tuesday* 1st September... 2009/8/27 Jim Downing : > Hi all, > > I'm meeting up with a few folks to chat about Clojure over a few beers > next Monday evening at 8pm in the Kingston Arms, Cambridge (UK). > Additional company very welcome! > >

Re: clojure-mode survey

2009-09-11 Thread Jim Menard
I do something similar to Brenton. I use clojure-mode, and vote for keeping it as-is, making SLIME integration optional or ancillary. Jim On Fri, Sep 11, 2009 at 12:21 PM, Brenton wrote: > > I use clojure-mode. > > I have a ruby script named clj that I use to start Clojure from t

Re: clojure-mode survey

2009-09-12 Thread Jim Menard
Phil, > Jim Menard writes: > >> I do something similar to Brenton. I use clojure-mode, and vote for >> keeping it as-is, making SLIME integration optional or ancillary. > > Could you guys give SLIME another shot via M-x clojure-install? If you > haven't been usin

Re: clojure-mode survey

2009-09-12 Thread Jim Menard
On Sat, Sep 12, 2009 at 4:30 PM, Phil Hagelberg wrote: > > Jim Menard writes: > >> A few comments and questions about the setup process: >> >> At the end of the process, the mini-buffer says, "You must specify >> either a `swank-clojure-binary' or

Re: Conjure 0.2 released.

2009-09-14 Thread Jim Menard
Matt, There's a missing double quote on line 11 of lancet.sh. After adding that, I had no problem compiling Conjure. Looking forward to trying it. Jim On Mon, Sep 14, 2009 at 9:49 AM, Matt wrote: > > I'm happy to inform everyone of the Conjure 0.2 release. Check it out > at

Re: Is knowing Java a prerequisite for using Clojure?

2009-09-17 Thread Jim Weirich
in Java'. I would also recommend this book. I choose this book for a Java course I was teaching because it was one of the few books at that time that wasn't stuffed with "Blatant Java Propaganda(tm)", but took an honest look at the positives and negativ

Cross platform clojure

2009-11-03 Thread Jim Downing
ureCLR will therefore be a parallel implementation of Clojure, rather than an alternative core under a larger pure Clojure universe of contrib libraries and developer code. Have I understood this right? What will be the best way to go about writing and managing a cross-platform

Cambridge (UK) Informal Clojure interest group meetup

2009-11-04 Thread Jim Downing
http://upcoming.yahoo.com/event/4842358 Cheers, jim --~--~-~--~~~---~--~~ 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 modera

Re: tree-shaking a jarred Clojure app?

2009-11-20 Thread Jim Downing
ools to do the job. I might have misunderstood, but isn't the problem the same as in Java; you can't know from a static analysis which classes are going to be loaded? Best regards, jim -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: ANN: Web application framework (beta)

2009-11-29 Thread Jim Powers
On Sun, Nov 29, 2009 at 7:21 PM, jim wrote: > I finally got time to find the bug in my web application framework. > Here is the code to the framework: > > http://intensivesystems.net/tutorials/code/web_session.clj This does indeed look cool, but here's the problem I hav

Re: ANN: Web application framework (beta)

2009-11-30 Thread Jim Powers
that one can avoid building wizards, and having to split up stuff into separate steps. Another good approach for managing state is to build the application in javascript. On Mon, Nov 30, 2009 at 5:09 AM, Jim Powers wrote: > > > This does indeed look... -- You received this message becaus

Re: Clojure Koans?

2009-12-02 Thread Jim Weirich
or the moment. If anyone wants to run with the idea, feel free. -- -- Jim Weirich -- jim.weir...@gmail.com -- 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 fro

Re: Is str supposed to be able to output lazy strings?

2009-12-07 Thread Jim Blomo
clojure-contrib also has a str-join function, which could be helpful for joining SQL conditions: (use '[clojure.contrib.str-utils :only (str-join)]) (str-join " AND " (map identity [1 2 3])) Jim On Sun, Dec 6, 2009 at 11:03 AM, samppi wrote: > Also, you should also conside

Re: Ensure

2010-03-19 Thread Jim Blomo
7;t need to happen. As Christophe demonstrated, the first transaction essentially ran with a :max-history of 0 and the transaction had to retry. The next time around, the ref had adequate history to store its previous state so that a retry was not needed. Jim -- You received this message because you ar

PDF generation with Clojure?

2010-05-25 Thread Jim Tittsler
Is there a library for generating PDF pages/reports with Clojure? (Or a Java library that interoperates more naturally than others?) -- 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 th

Problem seeing fn metadata unless I eval or load a file

2010-05-27 Thread Jim Menard
metadata I defined now. WHY?? user=> (meta ctest.funcs/f1) {:ns #, :name f1, :file "ctest/funcs.clj", :line 3, :arglists ([]), :wadl {:url "/f1", :method "GET", :doc "The f1 function."}} Jim -- Jim Menard, http://www.io.com/~jimm/ -- You received t

Re: Problem seeing fn metadata unless I eval or load a file

2010-05-27 Thread Jim Menard
Christophe, Thank you for your research and for opening the ticket. Jim On Thu, May 27, 2010 at 9:59 AM, Christophe Grand wrote: > Hi, > > On Thu, May 27, 2010 at 3:28 PM, Jim Menard wrote: >> >> I've given some functions metadata that I want to use elsewhere. My

Re: Screencast: Clojure development with Sublime Text 2

2013-05-19 Thread Jim - FooBar();
ooo thanks a lot :) quick question...how did you tell sublime to use lein2 instead of lein ? Jim On 18/05/13 21:36, James MacAulay wrote: This is a little show-and-tell I recorded today: http://www.youtube.com/watch?v=wBl0rYXQdGg Hopefully it's useful for some of you. Feedback we

Re: find first match in a sequence

2013-05-19 Thread Jim - FooBar();
no need to traverse the entire seq with 'filter' if you only want the 1st match... (some #(when (odd? %) %) [2 4 6 7 8 9]) => 7 Jim On 19/05/13 13:42, Thumbnail wrote: ... or just (comp first filter) ((comp first filter) odd? [2 4 6 7 8 9]) => 7 -- -- You recei

Re: find first match in a sequence

2013-05-19 Thread Jim - FooBar();
ha! you cheated with iterate... try this which is closer to the example... (first (filter odd? (map #(do (println "realized " %) %) [2 4 6 7 8 9]))) realized 2 realized 4 realized 6 realized 7 realized 8 realized 9 7 Jim On 19/05/13 15:31, Cedric Greevey wrote: On Sun, Ma

Re: find first match in a sequence

2013-05-19 Thread Jim - FooBar();
remember the 32-chunked model... :) Jim On 19/05/13 15:54, Jim - FooBar(); wrote: ha! you cheated with iterate... try this which is closer to the example... (first (filter odd? (map #(do (println "realized " %) %) [2 4 6 7 8 9]))) realized 2 realized 4 realized 6 realized 7 r

Re: Stackoverflow on a function listing files in a directory recursively

2013-05-20 Thread Jim - FooBar();
directories Jim ps: I tried this on my 2T external drive which is almost full and I got tired of waiting after 15 minutes! No overflow, but no answer either... :) On 20/05/13 21:12, Ramesh wrote: Hi all, I have the following function to list all the files recursively under a directory

Re: Stackoverflow on a function listing files in a directory recursively

2013-05-20 Thread Jim - FooBar();
actually yes it is! :) I thought file-seq was going down one level only but looking at the implementation it seems it goes down all levels...I'm trying it out now Jim On 20/05/13 21:31, Gary Trakhman wrote: Is this not sufficient? file-seq https://github.com/clojure/clojure/blob/maste

Re: Stackoverflow on a function listing files in a directory recursively

2013-05-20 Thread Jim - FooBar();
well no it doesn't descent into directories...I just tried it... Jim On 20/05/13 21:39, Jim - FooBar(); wrote: actually yes it is! :) I thought file-seq was going down one level only but looking at the implementation it seems it goes down all levels...I'm trying it out now Jim O

why is this behaving badly?

2013-05-24 Thread Jim - FooBar();
Proceed? (y/n):") (when (-> *in* (java.util.Scanner.) .next (.charAt 0) (= \y)) any ideas? Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: why is this behaving badly?

2013-05-24 Thread Jim - FooBar();
thanks a lot guys :) Both solutions work! Jim On 24/05/13 20:42, Andy Fingerhut wrote: Try adding (flush) after the print call. On Fri, May 24, 2013 at 12:35 PM, Jim - FooBar(); mailto:jimpil1...@gmail.com>> wrote: Hi everyone, I am trying to do something very simple like

Re: Any alternatives for these two ugly patterns?

2013-05-25 Thread Jim - FooBar();
tains? obj :attr) obj (assoc obj :attr something)) it's more evident now, but you still mention obj 3 times... your second example seems just fine to me...if you have to test for something, well, you have to test for something!!! Jim -- -- You received this message because you are su

Re: Any alternatives for these two ugly patterns?

2013-05-25 Thread Jim - FooBar();
no need for macros... :) (definline safe-assoc [m k v] `(if (contains? ~m ~k) ~m (assoc ~m ~k ~v))) (definline pred-transform [obj pred tf] `(if ~(pred obj) ~obj ~(tf obj))) Jim On 25/05/13 12:44, atkaaz wrote: may I see the macro for the latter, if you decide to go that way ? thx

Re: Any alternatives for these two ugly patterns?

2013-05-25 Thread Jim - FooBar();
so maybe a let + gensym would be in order? yes that is what you do to avoid double-evaluation...:) I was making a different point though, the fact that definline produces a first class fn which still expands like a macro. Jim -- -- You received this message because you are subscribed to

Re: Any alternatives for these two ugly patterns?

2013-05-25 Thread Jim - FooBar();
(rpred obj) tf)) ;;if false do the transformation Jim On 25/05/13 14:29, atkaaz wrote: yep that was interesting thanks btw; it was a function that was acting like a macro, how odd On Sat, May 25, 2013 at 4:26 PM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote:

org.junit.Assert/assertArrayEquals massive confusion!

2013-05-28 Thread Jim - FooBar();
!! In fact the only methods that take 3 args expect a String as the first argwhat is happening? can anyone shine some light please? I am utterly confused... thanks in advance, Jim [1]http://junit.sourceforge.net/javadoc/org/junit/Assert.html -- -- You received this message because you ar

Re: org.junit.Assert/assertArrayEquals massive confusion!

2013-05-28 Thread Jim - FooBar();
*) (-0.5345224838248488 0.2672612419124244 0.801783725737273*2*))) observe the last digit of the 3rd number (the bold ones)! This is why the test fails in Clojure... thanks again :) Jim On 28/05/13 17:42, Jim - FooBar(); wrote: Hi everyone, sometimes I feel really stupid

Re: org.junit.Assert/assertArrayEquals massive confusion!

2013-05-28 Thread Jim - FooBar();
) true user=> (acmp (double-array [0.01 0.7 2.2]) (double-array [0.011 0.695 2.199]) 0.005) false user=> Will work on any seqables of float/double. On Tue, May 28, 2013 at 12:57 PM, Jim - FooBar(); mailto:jimpil1...@gmail.com>> wrote: ooo thanks Chris

[ANN] Immutant is now officially in beta!

2013-05-29 Thread Jim Crossley
ntal complexity in real-world applications. It provides support for Ring handlers, asynchronous messaging, caching, scheduled jobs, XA transactions, clustering, and highly-available "daemon" services. Thanks, Jim -- -- You received this message because you are subscribed to the Google Group

clojure-west videos clarification

2013-05-30 Thread Jim - FooBar();
g yes?... :-( thanks in advance, Jim -- -- 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 moderated - please be patient with your first post.

Re: clojure-west videos clarification

2013-05-30 Thread Jim - FooBar();
On 30/05/13 13:17, Benjamin R. Haskell wrote: On Thu, 30 May 2013, Jim - FooBar(); wrote: Hi all, I just stumbled upon this: http://clojurewest.org/news/2013/5/29/clojurewest-2013-videos-1.html but I have a question! Can anyone clarify (maybe Alex?) what the dates right next to the

cyclic dependencies out of nowhere?

2013-05-30 Thread Jim - FooBar();
chess.clj... any ideas guys? I've had this error before but it was pretty obvious where the cycle was...Here, I'm very confused! core.clj and util.clj are the lowest level code and thus depend on nothing from the same project! thanks in advance for your time, Jim -- -- You receiv

Re: cyclic dependencies out of nowhere?

2013-05-30 Thread Jim - FooBar();
post back with the "solution"...but of course nothing is secret, as you demonstrated :) btw, the commit you're showing is not exactly what fixed it...that was before my post I think... Jim On 30/05/13 22:58, atkaaz wrote: looks like you found it: https://github.co

how would you improve this map-reduce style fn?

2013-06-01 Thread Jim - FooBar();
e) (pmap (fn [p] (reduce #(conj %1 (f %2)) [] p)) ) (apply concat)) ) ;;concat the inner vectors that represent the partitions ([f coll] (mapr f coll (+ 2 cpu-no thanks, Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: how would you improve this map-reduce style fn?

2013-06-01 Thread Jim - FooBar();
ppend! (r/map f (vec coll))) hmmm...I'll have to think about that for a while... thanks a lot James :) I was suspecting it can be simplified... Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: how would you improve this map-reduce style fn?

2013-06-01 Thread Jim - FooBar();
clj it seems that cat uses an ArrayList underneath...is this why it's considered high-performance? I also see there is 'foldcat' which is (foldcatappend!coll) - exacly what you 're sugegsting! interesting stuff...I'll try it now :) Jim -- -- You received this message bec

Re: optional first map argument

2013-06-03 Thread Jim - FooBar();
you quite a bit of hassle and make the code more evident... (defn my-widget [& {:keys [attrs contents]}] ... or if you don't know exactly what keys will come in you can relax it a bit with (defn my-widget [& {:as opts]}] ... HTH, Jim ps: assuming there is no constrain I&

Re: optional first map argument

2013-06-03 Thread Jim - FooBar();
x27;re eventually calling expects variadic args (from hiccup I guess). (apply hiccup/widget* attrs contents) Jim -- -- 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 No

importing a java class which 'requires' your namespace in a static block

2013-06-05 Thread Jim - FooBar();
you ever had that? what do you do when one of your java sources delegates back to a namespace of yours? is that completely bad design perhaps? thanks for your time, Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: importing a java class which 'requires' your namespace in a static block

2013-06-05 Thread Jim - FooBar();
! I'm still not quite sure what happened but I can reload my namespace just fine! thanks! :) Jim -- -- 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: Shortcut for variadic map destructuring?

2013-06-06 Thread Jim - FooBar();
On 06/06/13 20:23, JvJ wrote: Is there a shorter form of [&{:keys [] :as m}]? if you don't care about the actual keys just do this: [& {:as m}] HTH, Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to th

extending a protocol to primitive arrays strange problem

2013-06-13 Thread Jim - FooBar();
I do the following in a separate namespace, it compiles just fine! (defprotocol FOO (bar [this a] [this a b])) (extend-protocol FOO (Class/forName "[D") (bar ([this a] 1) ([this transform limits] 2))) thanks in advance :) Jim -- -- You received this message because you are subscr

bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
ass/forName "[F") (bar ([_ a] a) ([_ a b] (+ a b))) ) CompilerException java.lang.UnsupportedOperationException: nth not supported on this type: Character, compiling:(NO_SOURCE_PATH:1:1) Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

'amap' issue after extending a protocol to a primitive array type

2013-06-13 Thread Jim - FooBar();
case that would be doubles. If we extended the protocol to longs then only longs would work and so forth... I'm almost certain that this is not intentional...any opinions? Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
On 13/06/13 18:16, Marshall Bockrath-Vandegrift wrote: "Jim - FooBar();" writes: CompilerException java.lang.UnsupportedOperationException: nth not supported on this type: Character, compiling:(NO_SOURCE_PATH:1:1) If you examine the implementation of `extend-protocol` and

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
o the macro definitely receives a Class? You say you've encountered this a lot...can you elaborate? what did you do? many many thanks, Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojur

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
On 13/06/13 18:47, Jim - FooBar(); wrote: On 13/06/13 18:28, Leon Barrett wrote: It shouldn't be necessary to examine the source to know what's going on in a builtin, really, but I also encountered this one recently. The way the extend-protocol macro finds which entries are types

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
On 13/06/13 18:52, Jim - FooBar(); wrote: On 13/06/13 18:47, Jim - FooBar(); wrote: On 13/06/13 18:28, Leon Barrett wrote: It shouldn't be necessary to examine the source to know what's going on in a builtin, really, but I also encountered this one recently. The way the extend-prot

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
eflector.invokeMatchingMethod (Reflector.java:80) any other type I try from now onwards will fail with the same exception. Could it be because Clojure changes the types internally to longs? I don't understand!forgive me but I'm a bit annoyed with this... Jim On 13/06/13 19:02, A

Re: bug in 'extend-protocol' ???

2013-06-13 Thread Jim - FooBar();
properly stupid now! thanks all of you who bothered responding... Jim On 13/06/13 21:03, Jim - FooBar(); wrote: I wish I could...if I do that I can't call amap on any other primitive array but the first extended - I get the exception I posted earlier and it has nothing to do with

Re: In what OS do you code?

2013-06-14 Thread Jim - FooBar();
I use GNU/Linux exclusively as well...no other OS makes me feel in control :) Jim On 14/06/13 18:57, Mikhail Kryshen wrote: I use GNU/Linux (specifically, Fedora at home and openSUSE, which I don't like much compared to other distros, at work): - I do not trust proprietary software ve

Re: In what OS do you code?

2013-06-14 Thread Jim - FooBar();
hehe :) does this mean that apple is the new Microsoft ? this can't be good... Jim On 14/06/13 19:18, Clinton Dreisbach wrote: I think that's more like "Linux is the predominant OS among people who love to talk about their OS." In my experience, there's a lot more

simple brute-force password cracker runs out of memory

2013-06-16 Thread Jim - FooBar();
r/foldcat but the same error appears after a while. Of course now someone is going to say that this is not the right approach for password cracking. Ideally you want to stop searching as soon as you find a match. But that approach is not really parallelisable. I thought that laziness would save me

type-hints positioning convention?

2013-06-17 Thread Jim - FooBar();
or(s) put the type hint right after 'defn' (before the var about to be defined) and again it gets rid of reflection! Which one is it? both are acceptable? thanks in advance, Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: In what OS do you code?

2013-06-17 Thread Jim Cheesman
Windows 7 at work, Ubuntu at home. Both have good and bad points, I'm quite happy coding in either (once properly set up). On Friday, 14 June 2013 15:46:37 UTC+2, Erlis Vidal wrote: > > Hi, > > I'm a bit curious to know in what OS do you code. Do you prefer iOS, > Linux, Windows? Why is tha

'foldcat' slower than 'mapv' even for 10,000 elements

2013-06-17 Thread Jim - FooBar();
ge or am I missing something? Jim -- -- 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 moderated - please be patient with your first post. To u

Re: type-hints positioning convention?

2013-06-17 Thread Jim - FooBar();
away any time soon. -S I see... thanks Stuart :) Jim -- -- 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 moderated - please be patient w

Re: type-hints positioning convention?

2013-06-17 Thread Jim - FooBar();
uit) user=> (set! *warn-on-reflection* true) true user=> (defn foo [^String s] (.substring s 0 (.length s))) #'user/foo user=> (foo "jim") "jim" user=> (.length (foo "jim")) *Reflection warning, NO_SOURCE_PATH:1:1 - reference to field length c

Re: type-hints positioning convention?

2013-06-17 Thread Jim - FooBar();
OK now I'm confused! If you are using an unnamed fn form there is only one place to put the return type-hin,t and that is between the 'fn' and the '[...]' ...but, you've just demonstrated that this causes reflection...where else can we put it? Jim On 17

extending a protocol to arrays and handle nesting too

2013-06-19 Thread Jim - FooBar();
nding to object-arrays, thinking that the outer array is an Object[], fails miserably. How on earth am I supposed to handle nesting in a general way? thanks in advance... Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: Problem filtering with definline'd function

2013-06-20 Thread Jim - FooBar();
There is already a symbol? predicate in core. Why are you defining your own? Does your problem disappear when you use the one from core? What exactly are you trying to do? I use definline quite frequently and have never encountered such problems... Jim On 20/06/13 10:35, Colin Fleming wrote

Re: Problem filtering with definline'd function

2013-06-20 Thread Jim - FooBar();
sions of the same class lying around because of what you said about compiling and recompiling... Jim -- -- 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 m

Re: Namespace qualification of symbols

2013-06-20 Thread Jim - FooBar();
p the behaviour is different because ` & ' are used to achieve different tasks. It often helps me to think of ` as resolving the symbol whereas ' doesn't do anything to it. hope this is clearer now... this is nice video http://www.infoq.com/presentations/Clojure-Macro

fastest way to produce a PersistentList

2013-06-21 Thread Jim - FooBar();
that lists do not have transient counterparts. Therefore, the call to 'into' will be slow...in addition, I'm performing 2 passes with this... any ideas? Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: (clojure 1.5.1) Weird performance results when using let versus def for variable

2013-06-21 Thread Jim - FooBar();
machine and don't forget that we 're counting the time it takes to populate the array as well... (defn- array-sum-ints [n] (let [^ints a (int-array n)] (dotimes [n n] (aset a n 1)) (areduce a i ret 0 (+ ret (aget a i) Jim On 21/06/13 13:36, Colin Yates wro

Re: fastest way to produce a PersistentList

2013-06-21 Thread Jim - FooBar();
s. It should always return the same type and do the mapping in the most efficient manner... (apply list (map f the-seq)) does work but is not very efficient and I think you will get the results reversed... Jim -- -- You received this message because you are subscribed to the Google Groups &qu

Re: Function returns nil

2013-06-21 Thread Jim - FooBar();
aaa yes, of course! :) Jim On 21/06/13 13:47, John D. Hume wrote: If you use for, which is lazy, wrap it in a doall to force it to do its work before with-open closes your reader. On Jun 21, 2013 6:52 AM, "Jim" <mailto:jimpil1...@gmail.com>> wrote: Only use &#x

Re: Function returns nil

2013-06-21 Thread Jim - FooBar();
sequence exactly! also, that's why macros are for...every time I think "I wish there was X in clojure.core...", the next thought is macros :) what you wish is rather trivial to implement and it doesn't even have to be a macro... Jim -- -- You received this message be

Re: Function returns nil

2013-06-21 Thread Jim - FooBar();
'for' accepts a :when clause which will get you even further :) Jim ps: it also accepts a :let clause if you find it useful On 21/06/13 14:06, Jay C wrote: Thanks for all the input. Using for as in Phillip's suggestion seems to have gotten me somewhere, but now the function

Re: fastest way to produce a PersistentList

2013-06-21 Thread Jim - FooBar();
stest way...if that's not fast-enough then the consumer can choose not to use it...but I do want to offer the fastest way to do it by default (should the user choose it)...much like 'conj' works polymorphically regards, Jim -- -- You received this message because you are s

Re: (clojure 1.5.1) Weird performance results when using let versus def for variable

2013-06-21 Thread Jim - FooBar();
uded that Clojure does indeed match java's performance. The specific use-case actually was summing up primitive arrays. I encourage you read it...In a nutshell, If you're using leiningen, add this entry to your project.clj and rerun your benchmarks. :jvm-opts ^replace [] Jim [

Re: (clojure 1.5.1) Weird performance results when using let versus def for variable

2013-06-21 Thread Jim - FooBar();
fact as fast as Java -- I apologize for the false statement (I was unaware that new versions of leiningen disable advanced JIT optimizations by default, which lead to the numbers I reported). Jim On 21/06/13 14:54, Michael Klishin wrote: 2013/6/21 Jim - FooBar(); <mailto:jimpil1...@g

Re: fastest way to produce a PersistentList

2013-06-21 Thread Jim - FooBar();
ly accomplishes what you want. that does sound more work but I'll look into it anyway...:) David thanks a lot, Jim On Fri, Jun 21, 2013 at 9:32 AM, Jim - FooBar(); <mailto:jimpil1...@gmail.com>> wrote: On 21/06/13 14:08, Philip Potter wrote: Your logic here is incorr

Re: (clojure 1.5.1) Weird performance results when using let versus def for variable

2013-06-21 Thread Jim - FooBar();
meant the guys from Prismatic not the OP on this thread. Yes, this doesn't apply to Colin... my bad...I'm really sorry... Jim -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: can't compile anything except "def"

2013-06-22 Thread Jim - FooBar();
lojure and properly set up your environment? Jim -- -- 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 moderated - please be patient with

Re: can't compile anything except "def"

2013-06-22 Thread Jim - FooBar();
On 22/06/13 15:16, Dennis Haupt wrote: i don't know what "properly set up the environment" means exactly, but i can run my script in the repl what repl? intelliJ's repl? or a bare repl from your terminal? do you want to use Clojure JVM or Clojure CLR? Jim -- -- You r

Re: can't compile anything except "def"

2013-06-22 Thread Jim - FooBar();
lly...it's just that your error you reported earlier is very weird... Jim -- -- 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 moderated

Re: New Fuzzy Matching Library - Fuzzy Matcher

2013-06-27 Thread Jim - FooBar();
consume whatever he needs, but if you consider it nitpicking, well, I can see your point... :) this is all in the spirit of wanting to help... Jim On 27/06/13 10:55, Jim wrote: Hi Smit, I hope you don't mind a couple of comments :) I had a look at your edit-distance implementat

Re: core.async

2013-06-29 Thread Jim - FooBar();
On 29/06/13 12:07, Peter Taoussanis wrote: I honestly feel like I'm witnessing history being made. Thank you Rich Hickey, and everyone else in this community for making my work every day so enjoyable. +100! that makes 2 of us :) Thanks indeed Rich (and everyone else of course)...

question about java 'finalizers' (Charlie's Hunt talk)

2013-06-29 Thread Jim - FooBar();
condly, he said they are not good practice because they require 2 GC cyclesbut why do they require 2 GC cycles? Did anyone else watch this presentation yet? Any clues? thanks, Jim ps: I seriously hope he didn't mean the try/finally idiom because clojure makes significant use of it...

clojure on raspberry pi looks decent

2013-06-30 Thread Jim - FooBar();
rite factorial I can't write a proper timing function!!! (fail...) not bad at all in my opinion... :) generally, even with leiningen I find that once the vm is up and as long as I don't use concurrency, the experience is very smooth... now if only there was an editor to sup

<    1   2   3   4   5   6   7   8   9   10   >