Re: Joy of Clojure example not working

2021-08-14 Thread Chouser
In this case, I think the git repo has correct code where the book does not; "clang" instead of "gcc": (defmethod compile-cmd [::osx "gcc"] [m] (str "/usr/bin/" (get m

Re: PSA: A slight tweak to "concat"

2019-07-08 Thread Chouser
I see I introduced the bug while adding support for chunked seqs to concat. I'm grateful someone has found and fixed my mistake. Thanks, Alex! —Chouser On Sat, Jul 6, 2019 at 7:57 AM Matching Socks wrote: > > There's activity on a ticket in Jira to fix a quirk of "concat" th

Re: order of returned values from keys and vals

2014-02-01 Thread Chouser
of smallish maps. --Chouser On Sat, Feb 1, 2014 at 10:35 PM, Justin Smith noisesm...@gmail.com wrote: Realistically, how many situations are there where running keys and vals independently is preferable to running seq once and using the two element vectors that returns? Usually this way one can

Re: infinite loop print out of cyclic structure at repl

2013-10-01 Thread Chouser
Bah, mutable state! To be cursed in all its forms! Here is the same content as was at that paste.lisp.org link. I haven't tested it with recent versions of Clojure or anything: https://gist.github.com/Chouser/6783292 --Chouser On Tue, Oct 1, 2013 at 12:44 PM, Patrik Sundberg patrik.sundb

Re: Natively Compiled Clojure

2013-01-21 Thread Chouser
Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- --Chouser -- You received

Call for Presentations: Commercial Users of Functional Programming 2012

2012-02-24 Thread Chouser
The 2012 CUFP call for presentations is out: http://cufp.org/cufp-2012-call-presentations The program committee is hoping for better representation from the Clojure community this year, so if you've got something interesting to say about Clojure, please submit a proposal! --Chouser -- You

Re: Empty list type

2011-11-01 Thread Chouser
true, and that () and (list) will return something for which empty? will return true. --Chouser -- 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: Idiomatic record construction in 1.3

2011-10-26 Thread Chouser
. Off the top of my head I don't see why this would be impossible, but it may not be desirable. --Chouser -- 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

Re: Tail Recursion In Erjang

2011-10-21 Thread Chouser
or a trampoline site) simple or complected? --Chouser -- 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 1.3 wonky behavior

2011-10-20 Thread Chouser
correctly. --Chouser -- 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 unsubscribe from this group, send

Re: ClojureScript Mobile BOF at the Clojure/conj?

2011-10-18 Thread Chouser
docs spreadsheet, defining some time slots, and dropping talks / BOFs / topical hack sessions in, quasi-unconference style. I love this idea -- google spreadsheet of extra events. /me waits for someone to post a link. --Chouser -- You received this message because you are subscribed

Re: Recursively convert Java Map to Clojure Map

2011-10-16 Thread Chouser
aren't (yet!) protocols, I supposed you'd have to either use a non-standard conj and assoc, or create a wrapper around the Java Maps. Of course there are complications with all three of these solutions, so you'll have to choose carefully based on your needs. --Chouser -- You received this message

Re: Partitioning problem

2011-09-23 Thread Chouser
each time instead of doing an n*log(n) sort-by. --Chouser -- 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: clojurescript closure problem?

2011-09-22 Thread Chouser
On Thu, Sep 22, 2011 at 8:46 AM, David Nolen dnolen.li...@gmail.com wrote: It's a known issue: http://dev.clojure.org/jira/browse/CLJS-39 I somehow missed that one and had filed this one as well: http://dev.clojure.org/jira/browse/CLJS-59 --Chouser -- You received this message because you

Re: How does clojure class reloading work?

2011-09-22 Thread Chouser
clojure.lang.DynamicClassLoader@581de498 --Chouser -- 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: How does clojure class reloading work?

2011-09-22 Thread Chouser
On Thu, Sep 22, 2011 at 8:52 PM, Phil Hagelberg p...@hagelb.org wrote: On Thu, Sep 22, 2011 at 2:19 PM, Chouser chou...@gmail.com wrote: It looks like each top-level form currently gets its own fresh DynamicClassLoader. [...] (do (def a #()) (def b #())) If you'll pardon a nit-pick

Re: [newbie] filter confusion

2011-09-20 Thread Chouser
)) What version of Clojure are you using? --Chouser -- 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: How to convert general recursion to loop .. recur syntax

2011-09-15 Thread Chouser
premature computation and stack overflows, even in cases where no amount of tail-call-optimization would help! And all this while delivering code so similar to the problem statement and therefore concise, compared to the long and tortured loop/recur version I posted yesterday. --Chouser -- You

Re: How to convert general recursion to loop .. recur syntax

2011-09-14 Thread Chouser
] Jonathan Claggett helped write that. I'm not sure there was ever a moment where we both understood it simultaneously. It essentially does what zippers do, but holds the data in a loop/recur frame rather than a data structure. Any further explanation is left as an exercise to the reader. --Chouser

Re: Neighbors function from The Joy of Clojure

2011-09-14 Thread Chouser
, Fogus. It was used again only briefly in section 11.2 to define the legal moves that a king can make in chess, which of course includes diagonals.  :-) Ah, indeed. Sorry to mislead. --Chouser -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: heaps in clojure

2011-09-13 Thread Chouser
 of this in clojure? .. Is there some other way to achieve this? some sort of lazy sort would be perfect. I know I need the full collection to start with .. but that is fine. A seq on a sorted set should be pretty efficient. (take 3 (sorted-set 8 2 1 4 6 9 7 3)) ;= (1 2 3) --Chouser -- You

Re: Programmer Day

2011-09-13 Thread Chouser
dec int)) s) '[ibqqz qsphsbnnfs ebz])) --Chouser -- 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: Misleading Exception due to function name containing -

2011-09-12 Thread Chouser
thing))) #'user/foo-fn user= (defn other-fn [] (foo-fn)) #'user/other-fn user= (other-fn) Exception bad thing user/foo-fn (NO_SOURCE_FILE:1) Perhaps you can post a minimal example that demonstrates the problem. Also, what version of Clojure are you using? --Chouser -- You received this message

Re: On Lisp with Clojure

2011-09-09 Thread Chouser
. --Chouser -- 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 unsubscribe from this group, send email

Re: java interop not possible in #=(..) reader syntax?

2011-09-09 Thread Chouser
it then looks for an instance method or field. --Chouser http://joyofclojure.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 from new members are moderated - please be patient

Re: What's wrong with my *print-dup* persistence?

2011-09-09 Thread Chouser
#=(+ 1 #=(+ 2 4))) vs. (eval (read-string (+ 1 (+ 2 4 --Chouser -- 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

Re: not= counterintuitive?

2011-09-03 Thread Chouser
On Sat, Sep 3, 2011 at 10:59 AM, Alex Baranosky alexander.barano...@gmail.com wrote: Sounds like you want a function such as: none= ...which could be written as #(not-any? #{1} [1 2 3]) --Chouser -- You received this message because you are subscribed to the Google Groups Clojure group

Re: ClojureScript can't call JavaScript functions relying on `this`

2011-08-29 Thread Chouser
no method one() Have you tried calling the method using the interop form? (. x (two)) --Chouser -- 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

Re: clojurescript support of ns-* functions

2011-08-19 Thread Chouser
. Does that help? --Chouser -- 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 unsubscribe from

Re: Errors in Clojure

2011-08-19 Thread Chouser
that should never be used because I never specified them anywhere, so, I kinda need the stack trace to track down the problem. Some versions of Clojure provide a function pst at the repl: (pst) This tries to print the stack trace in a prettier way. --Chouser -- You received this message

Re: Toward in-browser ClojureScript debugging ?

2011-08-09 Thread Chouser
working on it at the moment. It would certainly be nice to have! --Chouser -- 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

Re: Referencing Clojure code from the ClojureScript namespace

2011-08-08 Thread Chouser
happens while the ClojureScript is being compiled. The macros must produce valid ClojureScript code so that it can be compiled to JavaScript, at which point it has lost all access to Clojure and must make do with ClojureScript and JavaScript functions. --Chouser -- You received this message because

Re: ClojureScript binding problem

2011-08-01 Thread Chouser
thinking that (method) is a normal function call. Actually, I'm still hoping we'll be able to come up with something less ugly that is nevertheless consistent with normal Clojure syntax. I have no idea what that would be. --Chouser -- You received this message because you are subscribed

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Chouser
itself uses, but nothing compared to streaming HD video. So, you could use ClojureScript and jQuery to write a snappy little demo and prove to everyone the value of that approach. I'm sure I'm not the only one that would be interested in seeing such a demo. --Chouser -- You received this message

ClojureScript announcement video

2011-07-21 Thread Chouser
Video is now available of Rich Hickey's talk at ClojureNYC yesterday announcing ClojureScript. http://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498 Thanks to the Clojure/core team for getting this online so rapidly! --Chouser -- You received this message because you are subscribed

Re: Most concise way to determine that a sequence is consecutive integers starting with one?

2011-07-01 Thread Chouser
[xs] (every? #(apply = %) (map vector xs (iterate inc 1 (defn f [xs] (every? true? (map = xs (iterate inc 1 --Chouser -- 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

Re: Re: first element after an element in the sorted-set?

2011-05-24 Thread Chouser
rsubseq: (first (rsubseq (sorted-set 1 2 3 4 5 6) 3)) ;= 2 --Chouser http://joyofclojure.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 from new members are moderated

Re: Applying collection of functions

2011-04-07 Thread Chouser
two. More classes is better, right? :-P --Chouser http://joyofclojure.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 from new members are moderated - please be patient

Re: Applying collection of functions

2011-04-07 Thread Chouser
On Thu, Apr 7, 2011 at 9:11 AM, Baishampayan Ghose b.gh...@gmail.com wrote: On Thu, Apr 7, 2011 at 6:34 PM, Chouser chou...@gmail.com wrote: Given a collection of functions (def fs [#(* % 10) #(+ % 1)]) and some numbers (def c [1 2 3]) How do I apply all the functions to c so

Re: Your favorite utility function or macro.

2011-03-25 Thread Chouser
, I would guess people wrote it for other lisps even previous to that. --Chouser http://joyofclojure.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 from new members

Re: Comparing clojure speed to java speed

2011-03-11 Thread Chouser
out. --Chouser -- 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 unsubscribe from this group, send

Re: Clojure on JS VMs

2011-03-03 Thread Chouser
now, but it does show it's possible and hopefully has some tidbits that will be useful in later implementations. --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Problems with lazy-xml

2011-02-12 Thread Chouser
currently trying to come up with a different way of passing around the non-descendant events so that drop-last isn't necessary, but it's ...tricky, at least for my poor fuzzy brain. --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure

Re: Problems with lazy-xml

2011-02-11 Thread Chouser
post. Chouser, could you spare a second here? I've been looking and looking at mktree and siblings for two days now and can't for the life of me find out why it would eagerly parse the whole contents of an element as soon as I acces its struct! The code looks perfectly correct. I can

Re: Efficient queue types for Clojure.

2011-01-22 Thread Chouser
log2, not log32 like the hashed collections. --Chouser http://joyofclojure.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 from new members are moderated - please

Re: Testing if a sequence is lazy

2011-01-19 Thread Chouser
at your own risk. :-) http://gist.github.com/589694 --Chouser http://joyofclojure.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 from new members are moderated - please

Re: a loop gives boxing warning when it shouldn't

2011-01-03 Thread Chouser
On Sat, Jan 1, 2011 at 5:47 PM, Albert Cardona sapri...@gmail.com wrote: Hi all, I'd apreciate help on figuring out why a loop gets number boxing warnings, when it shouldn't: http://clojure.pastebin.com/9uLZqGhy I just filed this as: http://dev.clojure.org/jira/browse/CLJ-701 --Chouser

Re: clojure - javascript

2010-12-21 Thread Chouser
Chouser. I plan to refactor your code to use Javascript's prototype system, but really just wanted it online because it's an excellent starting point. Now it could be forked and demo'd easily. I'd be happy if someone were to get more use out it. Eventually I hope we have JS generated from a pure

Re: Error Handling for Callback API to Blocking API example in Joy of Clojure

2010-12-21 Thread Chouser
On Sun, Dec 19, 2010 at 3:36 AM, HiHeelHottie hiheelhot...@gmail.com wrote: In Joy of Clojure, there is a callback API to blocking API example in the section on promises.  Chouser outlines it a briefly in a discussion on Promise/Deliver use cases here - http://groups.google.com/group/clojure

Re: Let usage question

2010-10-28 Thread Chouser
in earlier versions of JoC), but is still good to be aware of. --Chouser http://joyofclojure.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 from new members are moderated

Re: finding value nearest x

2010-09-25 Thread Chouser
#(Math/abs (- % 136)) (first asc) (first desc))) That's O(log n) instead the simpler (apply min-key ...) which is O(n). --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: partition-starting-every : yet another partition function

2010-09-16 Thread Chouser
partition-starting-every Partition the sequence starting each partition when the f is true. [f coll] (lazy-seq (when-let [[x xs] (seq coll)] (let [[a b] (split-with (complement f) xs)] (cons (cons x a) (partition-starting-every f b)) --Chouser http://joyofclojure.com

Re: Line numbers for forms embedded in macros

2010-09-12 Thread Chouser
* on. (defmacro print-meta [ args] (binding [*print-meta* true] (prn args))) I think you'll find some useful data in there. There won't be line numbers on your arrows, but will be on the preceding forms. --Chouser http://joyofclojure.com/ -- You received this message

Re: Thinking in Clojure

2010-09-03 Thread Chouser
it in Yegge's enjoyable essay: http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html --Chouser -- 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

Re: Does 'require' with the :reload option have a tendency to build up memory?

2010-09-03 Thread Chouser
of them together. That's why I was thinking that it may have possibly been some implicit weirdness with reload. Which classes show the most increase in instance count? Or perhaps you could attach or post the full list of before and after instance counts somewhere. --Chouser http://joyofclojure.com

Re: Does 'require' with the :reload option have a tendency to build up memory?

2010-09-02 Thread Chouser
that lists the object counts by class. I think jvisualvm that comes with Sun's JDK will do it, and I know yourkit will. Check your counts before a :reload and again after -- might give a good clue as to what's going on. --Chouser http://joyofclojure.com/ -- You received this message because you

Re: Why do is used in this function?

2010-08-31 Thread Chouser
s))   (recur (rest s Good tips! Another option: (defn printall [s] (doseq [i s] (println Item: i))) --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Basic colour in the standard REPL

2010-08-27 Thread Chouser
of the different colors: (do (println hi) 5) --Chouser http://joyofclojure.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 from new members are moderated - please be patient

Re: inserting into vector

2010-08-26 Thread Chouser
with vectors, O(n) where n is (- (count v) i). --Chouser http://joyofclojure.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 from new members are moderated - please be patient

Re: inserting into vector

2010-08-26 Thread Chouser
On Thu, Aug 26, 2010 at 11:53 AM, Chouser chou...@gmail.com wrote: On Thu, Aug 26, 2010 at 9:44 AM, Jon Seltzer seltzer1...@gmail.com wrote: I know what assoc does: user= (assoc [\a \b \c] 0 \d)  ;please extend to much larger vector with index somewhere in the middle [\d \b \c] but what

Re: inserting into vector

2010-08-26 Thread Chouser
On Thu, Aug 26, 2010 at 12:43 PM, David Nolen dnolen.li...@gmail.com wrote: On Thu, Aug 26, 2010 at 11:53 AM, Chouser chou...@gmail.com wrote: On Thu, Aug 26, 2010 at 9:44 AM, Jon Seltzer seltzer1...@gmail.com wrote: I know what assoc does: user= (assoc [\a \b \c] 0 \d)  ;please extend

Re: Simple Regex Question

2010-08-21 Thread Chouser
#(?=(.))?(\w)\2*) (map (fn [[s pre]] {:s s, :pre pre}))) returns a lazy seq: ({:s aaa, :pre nil} {:s bbb, :pre } {:s a, :pre } {:s bb, :pre a} {:s a, :pre } {:s b, :pre a} {:s bb, :pre }) --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google

Re: Today's clojure trick question

2010-08-18 Thread Chouser
false) :truthy :falsey) ;= :falsey --Chouser http://joyofclojure.com/ 1: http://download-llnw.oracle.com/javase/1.5.0/docs/api/java/lang/Boolean.html#Boolean%28boolean%29 -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Nil Coalesce

2010-08-17 Thread Chouser
nil) Clojure golf is the most fun golf! (defn nil-coalesce [a b] (map #(or %1 %2) a (concat b (repeat nil Or if you really want to treat nil and false differently: (defn nil-coalesce [a b] (map #(if (nil? %1) %2 %1) a (concat b (repeat nil --Chouser http://joyofclojure.com

Re: Nil Coalesce

2010-08-17 Thread Chouser
? %1) %2 %1) a (concat b (repeat nil I am not sure to get it. Won't map advance in  parrallel in the sequences, jumping over the values in b where there is something in a? Oh, indeed. I misunderstood the problem statement. My apologies. --Chouser http://joyofclojure.com/ -- You

Re: Nil Coalesce

2010-08-17 Thread Chouser
? a) [(first b) (rest b)] [a b])) [0 b]) rest (map first))) This is much like Jeff Valks solution, but lazy. --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups

Re: Bug in try/finally?

2010-08-11 Thread Chouser
be included in clojure-test, but I don't see your name on the contributor's list: http://clojure.org/contributing Have you sent in your CA? --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Bug in try/finally?

2010-08-11 Thread Chouser
On Wed, Aug 11, 2010 at 8:01 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: Ticket and patch welcome! Done and done: https://www.assembla.com/spaces/clojure/tickets/422 --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups

Re: jna Java Native Acess and clojure ....

2010-08-11 Thread Chouser
interop code, so quite well and naturally. --Chouser http://joyofclojure.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 from new members are moderated - please be patient

Re: Question on defrecord

2010-08-11 Thread Chouser
define the factory fn (named or not), you need to specify all the args the real record constructor requires. --Chouser http://joyofclojure.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

Re: lazy-seq realization/retention within futures

2010-08-11 Thread Chouser
the entire seq, and creating a future does create a closure. --Chouser http://joyofclojure.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 from new members are moderated

Re: lazy-seq realization/retention within futures

2010-08-11 Thread Chouser
On Wed, Aug 11, 2010 at 3:06 PM, Stuart Halloway stuart.hallo...@gmail.com wrote: Chouser, There is now a ticket and roadmap for fixing this: See https://www.assembla.com/spaces/clojure/tickets/423-make-sure-future-clears-closed-overs. Did you see that my examples didn't use future at all

Re: order of returned values from keys and vals

2010-08-11 Thread Chouser
having it in the docstring of keys and vals would be nice. --Chouser http://joyofclojure.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 from new members are moderated

Re: Bug in try/finally?

2010-08-10 Thread Chouser
to me there must be a better solution, though I don't see yet what it would be. --Chouser -- 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

Re: Bug in try/finally?

2010-08-10 Thread Chouser
On Tue, Aug 10, 2010 at 2:51 PM, Chouser chou...@gmail.com wrote: That patch seems to essentially reverse this one: http://github.com/clojure/clojure/commit/5e9f2b293b307aa7953cd390360d24549e542b92 ...which suggests to me there must be a better solution, though I don't see yet what it would

Re: jna Java Native Acess and clojure ....

2010-08-09 Thread Chouser
your needs. --Chouser http://joyofclojure.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 from new members are moderated - please be patient with your first post

Re: explode string

2010-07-01 Thread Chouser
(next (.split #(?=) string)) But why do you one-char strings instead of just a seq of chars? --Chouser http://joyofclojure.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

Re: Can't send from agent error handler?

2010-06-29 Thread Chouser
what was decided explicitly. Thanks for the report. Ticket is here: http://www.assembla.com/spaces/clojure/tickets/390 Please try out the patch there and see if it works and/or causes other problems. Thanks. --Chouser http://joyofclojure.com/ -- You received this message because you

Re: Can't send from agent error handler?

2010-06-29 Thread Chouser
and you still won't see the CODE DOESN'T REACH HERE message. If you wrap your await call in its own exception handler, you'll be able to see that's what's going on. --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Protocols

2010-06-28 Thread Chouser
, it appears that docstring is not (yet?) accurate. --Chouser http://joyofclojure.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 from new members are moderated - please

Re: Question: pmap + number of threads + number of cpus

2010-06-28 Thread Chouser
of more than 32 elements, you'll see your example doesn't go beyond the first 32 (range's chunk size). ...or you can use a PersistentList instead of a range, which produces unchunked seqs, and see that it only uses procs+2 threads. --Chouser http://joyofclojure.com/ -- You received this message

Re: lazy-xml defect (?)

2010-06-23 Thread Chouser
it shouldn't and fails to escape text and attribute values. I'd be happy to see it use lazy-xml's implementation instead, unless people have issues with how lazy-xml does it. --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure

Re: Unexpected conj behavior

2010-06-15 Thread Chouser
, :c 3, :d 4} --Chouser http://joyofclojure.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 from new members are moderated - please be patient with your first post

Re: Non-tail recursion (Clojure way to hierarchies)

2010-06-15 Thread Chouser
: (take 8 (map :item (tree-seq :kids :kids (node 1 ;= (1 10 100 1000 1 10 100 1000) Hope that helps! --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: update-in oddness

2010-06-04 Thread Chouser
m k (apply f (get m k) args))) (apply f m args))) (update-in* {nil 2} [nil] (constantly 3)) ;= {nil 3} --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Question on destructure source

2010-06-03 Thread Chouser
[{a :a b :b} {:a 1 :b 2}] [a b]) ;= [1 2] ...which is what you'd do if there was no support for :keys --Chouser http://joyofclojure.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

Re: Insert into an indexed seq

2010-04-27 Thread Chouser
://functionaljava.googlecode.com/svn/artifacts/2.21/javadoc/fj/data/Seq.html --Chouser http://joyofclojure.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 from new members are moderated - please

Re: let's all link to the getting started pages!

2010-04-06 Thread Chouser
/getting_started -- should that page be replaced or at least simplified and include a prominent link to the assembla page? --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Set as function

2010-04-05 Thread Chouser
as well with a function that returns true and false, so that's not a particularly good example. Which of the items in this set comes first in this vector? (some #{:b :c} [:a :c :d]) ;= :c --Chouser -- You received this message because you are subscribed to the Google Groups Clojure group

Re: Confused about =, native java arrays and seqs...

2010-03-24 Thread Chouser
changes the underlying array values? Pray. (let [a (into-array (range 5)), s (seq a)] (prn s) (aset a 1 42) (prn s)) ; (0 1 2 3 4) ; (0 42 2 3 4) I'd recommend keeping the exposure of arrays to very small and isolated pieces of code, if they must be used at all. --Chouser

Re: Java method call irritation

2010-03-19 Thread Chouser
alternate hinting syntaxes not entirely unlike what you suggest: http://clojure-log.n01se.net/date/2010-01-21.html#08:34 --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Long-running STM updates will never complete... is there a solution?

2010-03-16 Thread Chouser
On Tue, Mar 16, 2010 at 5:25 AM, Christophe Grand christo...@cgrand.net wrote: On Mon, Mar 15, 2010 at 11:27 PM, Chouser chou...@gmail.com wrote: I make no claims about the Rightness of this suggestion, but simply offer another example of a work-around:    (dosync (alter r identity) (alter r

Re: A Tour of Enlive

2010-03-15 Thread Chouser
into your current namespace but into the one declared in scrape1. Anyway, that's a minor nit -- it's a great tutorial, thanks for writing it up! --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: Long-running STM updates will never complete... is there a solution?

2010-03-15 Thread Chouser
offer another example of a work-around: (dosync (alter r identity) (alter r f)) That is, a dummy write via alter is also sufficient to allow the transaction to succeed, just like 'ensure'. --Chouser -- You received this message because you are subscribed to the Google Groups Clojure group

Re: (seq? x) vr.s (not (empty? x))

2010-03-11 Thread Chouser
= (not (empty? '())) false What you demonstrated is that (seq x) is not the same as (seq? x) -- useful to know, but not the point of the docstring. Also note that it's not necessary or idiomatic to quote the empty list: user= (seq ()) nil --Chouser http://joyofclojure.com/ -- You received this message

Re: Clojure Implementation issues that may affect performance?

2010-03-09 Thread Chouser
for some operations has much better performance. When using primitive locals as Tim is suggesting, remember that currently numeric literals are boxed by default as well. So you actually want ( ia (int 2)) and so on as well. --Chouser http://joyofclojure.com/ -- You received this message because you

Re: Bug in Clojure 1.2 case macro

2010-02-24 Thread Chouser
' is built around the test values being constants, and when that's what you have offers excellent performance. If your test values are not known until runtime, use 'if', 'cond', or 'condp'. --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups

Re: Using zip-filter to remove nodes

2010-02-24 Thread Chouser
have to have some kind of mechanism for continuation, or perhaps using a monad or one of these new cells. Christophe Grand's enlive lib address a lot of these problems for html and some xml. I'd recommend you take a look at it and see if it would work in your case. --Chouser http

Re: Bug in Clojure 1.2 case macro

2010-02-23 Thread Chouser
of the docs for case I think you'll see it's not a bug but documented behavior. The values in the case test clauses must be constants, so not a var or local. If you need those test values to be evaluated then your work around of using condp (or cond) is entirely appropriate. --chouser

Re: Clojure on Go

2010-02-20 Thread Chouser
of the support code (STM, namespaces, etc.) are all written almost entirely in Java. This is already beginning to change (see Rich's recent work on cells and generic vectors), but there's quite a ways to go yet. When that work is done, compiling Clojure to golang might indeed be a fun project. --Chouser

  1   2   3   4   5   6   7   >