map closure issue

2009-05-30 Thread Ben
I'm not sure if this is an issue or not. I broke it down to a simple case. When I pass a Java object into a map closure the object doesn't seem to get updated: (let [b (new StringBuffer)] (map #(.. b (append (str % " "))) '("blah" "blah" "blah")) b) ;=> # expected ;=> # I know it's doing wo

Re: map closure issue

2009-05-31 Thread Ben
% " ")) ["blah" "blah" "blah"])) > b) > > I think it preferable to use doseq for side-effects: > (let [b (new StringBuffer)] > (doseq [s ["blah" "blah" "blah"]] (.append b (str s " ")) >

java.lang.OutOfMemoryError when consuming many whole-numbers

2011-08-01 Thread Ben
e whole-numbers is lazy I expected it to run for a certain amount of time but never to run out of memory. Has this anything to do with using the function at the REPL or is there another reason for that? With kind regards Ben -- You received this message because you are subscribed to the Google

Re: java.lang.OutOfMemoryError when consuming many whole-numbers

2011-08-01 Thread Ben
better have it bound to a var ...) Or do I just not even think about it and always bind it to a fn? Ben -- 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: Clojure Cheat Sheet

2009-10-19 Thread Ben Mabey
general utility > functions i have written! > They used LaTeX[1].. look at the source files: http://clojure.googlegroups.com/web/clojure-cheat-sheet.zip -Ben 1.http://www.latex-project.org/ --~--~-~--~~~---~--~~ You received this message because you are sub

Simple functional programming lexicon?

2010-03-17 Thread Ben Armstrong
happy that at least somebody cares about this stuff, so that I don't have to? Ben -- 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: Simple functional programming lexicon?

2010-03-17 Thread Ben Armstrong
. It is because it doesn't go deeply into FP ('monad' is mentioned once, in an aside, and is unexplained in that reference) that I was looking for other references. I'll have a look at some of the others on this page. Ben -- You received this message because you are subscribed

Re: Simple functional programming lexicon?

2010-03-17 Thread Ben Armstrong
ure's philosophy you can't beat Rich Hickey's Amazon Bookshelf. I'm not sure at this point how deep I want to go. Nice resource, though. Ben -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Simple functional programming lexicon?

2010-03-17 Thread Ben Armstrong
On 17/03/10 05:57 PM, eyeris wrote: On Mar 17, 7:28 am, Ben Armstrong wrote: Or should I just ignore threads like "Why do functions in the state monad only accept one value?" Yes, ignore those for now. Write an entire program in Clojure before you read anything about mo

Re: Simple functional programming lexicon?

2010-03-18 Thread Ben Armstrong
I've filed this one away. I had better stick with clojure for now until I get more comfortable with it. Thanks. :) Ben -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

Re: Coercing a map to a record

2010-05-22 Thread Ben Mabey
east doesn't require that you know in advance the keys of Bar. -Ben -- 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 p

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

2013-05-20 Thread Ben Wolfson
th > 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 > --- > You received this message because you are subscribed to the Google Groups >

Re: How to: reduce boolean operations?

2013-05-22 Thread Ben Wolfson
to themselves, > but it's really designed to be given forms. > The fact that booleans evaluate to themselves is irrelevant, and if it were relevant, "and" wouldn't work on forms in general. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 10:37 AM, Cedric Greevey wrote: Huh. I just solved it. The debug exception handler has to do something a bit fancier, that's all: 1. Dig up the bytecode of the method executing the throw and copy it somewhere. 2. Unwind by one call. 3. Take the bytecode in 1, alter it to wrap the t

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 12:19 PM, Lee Spector wrote: On May 28, 2013, at 2:16 PM, Ben Mabey wrote: You can disable locals clearing with a compiler flag. nrepl-ritz even has helper function that will compile the given form using that flag. If you want to disable locals clearing on a project wide basis

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 1:05 PM, Lee Spector wrote: On May 28, 2013, at 2:40 PM, Ben Mabey wrote: The flag is a system property: "-Dclojure.compiler.disable-locals-clearing=true". So you can add that string to your project.clj's :jvm-opts if you are using lein. This will, of course,

Re: [GSoC] core.matrix NDArray project feature requests

2013-05-28 Thread Ben Mabey
On Tue May 28 02:40:33 2013, Dmitry Groshev wrote: Sorry, I wasn't clear enough in my proposal. I've mentioned clojurecheck [1] in it and the possibility of extending it, because in my Erlang experience property-based testing is extremely helpful for things that operates on something pure in com

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-29 Thread Ben Mabey
help improve the state of affairs. I know my company would donate to a campaign to improve clojure debuggers. -Ben 1. https://github.com/technomancy/limit-break (I have never gotten limit-break to work for me though.) 2. https://github.com/clojuredocs/cds/issues/27 -- -- You received this mes

Re: regular expressions how-to: recognize lines?

2013-05-29 Thread Ben Wolfson
options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+uns

Re: Making things go faster

2013-06-05 Thread Ben Mabey
staying far away from midje, if you want a tight test loop the repl is your best bet, and midje's design makes using it from the repl really awkward. When was the last time you tried to use midje from the REPL? Ever since the 1.5 release I've found the workflow quite nice and usab

Re: idiot question about macros

2013-06-07 Thread Ben Wolfson
re+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop rec

Re: idiot question about macros

2013-06-07 Thread Ben Wolfson
On Fri, Jun 7, 2013 at 12:30 PM, David Pollak wrote: > > > > On Fri, Jun 7, 2013 at 11:14 AM, Ben Wolfson wrote: > >> >> >> The macro (which IMO is terrible and shouldn't be emulated) >> > > Why do you think the macro is terrible?

Re: [ANN] if-and

2013-06-10 Thread Ben Wolfson
ery? #(% x) ts)) #'user/allpreds user> (allpreds false false?) true user> (allpreds nil false?) false With if-and being definable in terms of allpreds: user> (defn if-and* [x & ts] (when (apply allpreds x ts) x)) #'user/if-and* user> (if-and* false false?) false user

Re: [ANN] if-and

2013-06-10 Thread Ben Wolfson
at the >>> first falsey test of course. Might be more convenient (fewer lambdas >>> needed) sometimes and more efficient sometimes -- on the other hand, to use >>> as a function itself it will need wrapping in a lambda: #(if-and % % >>> tests-using-%). >>> >

Re: Hotspot JIT optimisations

2013-06-16 Thread Ben Mabey
ot amenable to HotSpot optimizations. This is a great place for invokedynamic, especially during production scenarios where the root value of Vars remain stable. That is, invokedynamic would eliminate the volatile lookup on every call and likely lead to HotSpot inlining." -Ben -- --

why is catch defined with bare symbols?

2013-06-19 Thread Ben Wolfson
e/catch. (I assume it could do that, anyway! It's implemented in Java in the compiler and I'm not sure what information is available at that point.) Since symbols from clojure.core are imported by default, in most cases it wouldn't make a difference. But in cases like (a), (b), and

separate namespace for extra-special forms?

2013-06-23 Thread Ben Wolfson
This strikes me as pretty odd: user> (let [z 1 try 2 fn* 3] (try (let [x (fn* ([a b c] [a b c]))] (x z try fn*)) (catch Exception e e))) [1 2 3] -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drink

Re: separate namespace for extra-special forms?

2013-06-23 Thread Ben Wolfson
for these guys at all. On Sun, Jun 23, 2013 at 2:46 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Special forms are special when used in a list. IMO it's a bad idea to use > special forms > as local names, a caveat which is surprisingly under-documente

Re: lein repl and missing yank

2013-06-26 Thread Ben Wolfson
On Wed, Jun 26, 2013 at 4:31 PM, Cedric Greevey wrote: > Have you tried control-V, which has been the industry standard paste key > binding for at least the past 20 years? > In terminals, and terminal applications? -- Ben Wolfson "Human kind has used its intelligence to vary

Re: core.async

2013-06-29 Thread Ben Wolfson
cr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving email

Re: Is there a better way to update a map atom?

2013-06-29 Thread Ben Wolfson
supplied function, which is entirely up to the user of swap!). There's a separate compare-and-set! function for atoms. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social li

Re: Is there a better way to update a map atom?

2013-06-29 Thread Ben Wolfson
anyway the relationship between swap! and reset! is that (reset! atom newval) === (swap! atom (constantly newval)). (Though that isn't how reset! is implemented.) On Sat, Jun 29, 2013 at 5:21 PM, Ben Wolfson wrote: > On Sat, Jun 29, 2013 at 5:07 PM, Brandon Bloom > wrote: > &

Re: Is there a better way to update a map atom?

2013-06-29 Thread Ben Wolfson
On Sat, Jun 29, 2013 at 5:27 PM, Cedric Greevey wrote: > > On Sat, Jun 29, 2013 at 8:21 PM, Ben Wolfson wrote: > >> On Sat, Jun 29, 2013 at 5:07 PM, Brandon Bloom > > wrote: >> >>> > Can anyone explain the relationship between swap! and reset! ? >&g

Re: Is there a better way to update a map atom?

2013-06-29 Thread Ben Wolfson
, I think it would still be right to say that reset! conceptually doesn't do a comparison against anything, even though, again, as an implementation detail, it could.) Or just look at the source for clojure.lang.Atom.swap(): > IOW, "the first 100 lines of Atom.java contain all the answers"

Re: Microsoft Rx -style operations with core.async

2013-06-30 Thread Ben Wolfson
re+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving email

Re: Microsoft Rx -style operations with core.async

2013-06-30 Thread Ben Wolfson
because then you could also send nil over the channels, if you wanted to. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drink

Re: core.async implemented on top of Pulsar

2013-07-01 Thread Ben Wolfson
ould be nice if there were some guarantee of linearity for channels so that I don't try to pass one to e.g. take-while and then also try to read from it elsewhere, but that's not directly related.) Also, if---as the references to go and Erlang suggest---it will be possible to have hun

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-02 Thread Ben Wolfson
lojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop recei

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-02 Thread Ben Wolfson
stuff is significantly > different from other libs, and more similar (but simpler, due to the lack > of legacy) to Haskell's categorical stuff. > > > On Tuesday, July 2, 2013 9:15:10 PM UTC+2, Ben wrote: > >> I haven't played around with this but it looks as if the se

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-02 Thread Ben Wolfson
rs-0.2.2.0 ... linking ... done. Loading package mtl-2.0.1.0 ... linking ... done. (12,4) Prelude Control.Monad.State> On Tue, Jul 2, 2013 at 2:45 PM, Ben Wolfson wrote: > I did look at the docs and I don't really get how to return a monadic > value in the right monad, the way "r

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-02 Thread Ben Wolfson
rts your aesthetic views maybe a macro (bind* or mdo) would > help, since instead of [], any vector, let's say [1 2 3] would do, but > then, it's a special case when you actually want the monad to stay the same. > > Thank you for helpful comments, BTW :) > > On Wed

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-02 Thread Ben Wolfson
ot;, even the second one is up for grabs! It does seem somewhat odd to me to advertise the package as being familiar to Haskellers and to employ category-theoretic concepts and then to be so blasé about the definition of a monad. (I wonder if you can get away with this changing of type at all if you

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-02 Thread Ben Wolfson
On Tue, Jul 2, 2013 at 5:06 PM, Ben Wolfson wrote: > On Tue, Jul 2, 2013 at 4:33 PM, Dragan Djuric wrote: > > >> Regarding monadic laws, which one exactly demands that you cannot change >> the monad (not counting the fact that haskell's implementation does it that >

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-03 Thread Ben Wolfson
On Wed, Jul 3, 2013 at 12:32 AM, Dragan Djuric wrote: > > > On Wednesday, July 3, 2013 2:06:34 AM UTC+2, Ben wrote: > >> On Tue, Jul 2, 2013 at 4:33 PM, Dragan Djuric wrote: >> >>> And in this case you have to explicitly specify which monad you want to >

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-03 Thread Ben Wolfson
On Wed, Jul 3, 2013 at 7:07 AM, Ben Wolfson wrote: > However, I think this, regarding the second law, is telling: "The second > does not too, since it says what happens when you bind with (pure m) not > (pure n)" > > *all* the laws only say what happen when you s

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-03 Thread Ben Wolfson
think) and while the implementation might choose different ways of mapping the function depending on the type of the first argument to bind, that's an implementation detail. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic,

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-03 Thread Ben Wolfson
nd you don't know in advance what the "lift" should be, since more than one interpretation of the reader monad is possible---all that's required here is that the monad support an "ask" operation). I suppose you could thread specimen special return, bind, ask, and lift f

core.match error?

2013-07-03 Thread Ben Wolfson
t] nil [:s :d] nil [:r :d] :x [:s :t] nil) IllegalArgumentException No matching clause: :r :d user/eval1087 (NO_SOURCE_FILE:1) They're the same except the order of the first two match expressions has been flipped. Surely this should match on the third ro

Re: core.match error?

2013-07-03 Thread Ben Wolfson
MATCH-80 >> >> David >> >> >> On Wed, Jul 3, 2013 at 9:07 PM, Ben Wolfson wrote: >> >>> This is with 0.2.0-rc2. >>> >>> This expression evaluates as expected: >>> >>> user> (m/match [:r :d] >>>

Re: (newbie) replace certain values of a map based on a predicate

2013-07-05 Thread Ben Wolfson
ge because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > >

ANN: conditions 0.1.0, a simple resumable exceptions library

2013-07-07 Thread Ben Wolfson
#x27;t print anything ("abort" jumps to the handler) and evaluates to 0. The README and docstrings in core.clj are fairly extensive; comments on any aspect are welcome. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic

Re: group-by replacement when an item has many groups?

2013-07-08 Thread Ben Wolfson
ooglegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Ben Wolfson
gt; 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, s

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Ben Wolfson
some-condition (recur ...) (foo ... where you can't use recur for the call to foo, even though it's in tail position, because the recur target is the loop expression. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Ben Wolfson
c x)) #'user/od? user=> (c/run-cont (evn? 500)) true But the result is about 2x slower than what the clojure-tco macro produces (around 600ms vs around 300ms, for me). -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, ar

Re: State monad issue

2013-07-11 Thread Ben Wolfson
l=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://g

Re: [ANN] Proteus: local mutable variables for the masses

2013-07-11 Thread Ben Wolfson
cribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which

Re: [ANN] Proteus: local mutable variables for the masses

2013-07-11 Thread Ben Wolfson
x) (do (.set x 2) nil) (.x x) proteus> (clojure.pprint/pprint (macroexpand-1 '(let-mutable [x 1] (letfn [(x [] 4)] (set! x 4) x (clojure.core/let [x (new proteus.Containers$L 1)] (do (letfn* [x (fn* x ([] 4))] (do (.set x 4) nil) (.x x > > Zach > > > On Thursday,

Re: [ANN] Proteus: local mutable variables for the masses

2013-07-11 Thread Ben Wolfson
sefully (I think) grouped together. On Thu, Jul 11, 2013 at 7:02 PM, Zach Tellman wrote: > It looks like the macroexpansion code in conditions.free is fairly > generic. What would you say to putting it into its own library? > > > On Thu, Jul 11, 2013 at 6:54 PM, Ben Wolfson wrote:

Re: ClojureScript concurrency?

2013-07-12 Thread Ben Mabey
a good presentation on 'Concurrency Is Not Parallelism': http://vimeo.com/49718712 -Ben -- -- 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 a

communicating quits to timeouts AND parent loop in core.async

2013-07-17 Thread Ben Mabey
(println "Hello World!") (alts! [(timeout 1) stop]) (println "I'm done sleeping, going to recur now..."))) stop) This seems ideal and a good use case for adding some sort of function to detect termination. Thoughts? Thanks, Ben -- -- You receive

Re: communicating quits to timeouts AND parent loop in core.async

2013-07-17 Thread Ben Mabey
me-out stop-timeout The problem, as I see it, is that with your approach the channel from each alts! needs to propagated to the end of the loop. So, I would either need to restructure the code above to do that or use an atom and have the go-loop/sleep macros take care of it for me. -Ben

Re: communicating quits to timeouts AND parent loop in core.async

2013-07-17 Thread Ben Mabey
uot;Hello World!") (let [[v c]] (alts! [(timeout 1) stop])] (if (= c stop) :done (do (println "I'm done sleeping, going to recur now...") (recur))) On Wed, Jul 17, 2013 at 2:47 PM, Ben Mabey >

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Ben Wolfson
On Tue, Jul 23, 2013 at 1:50 PM, Stefan Kamphausen wrote: > > It complects require and refer ;-) > How so? -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Ben Wolfson
On Tue, Jul 23, 2013 at 1:55 PM, Sean Corfield wrote: > On Tue, Jul 23, 2013 at 1:53 PM, Ben Wolfson wrote: > > On Tue, Jul 23, 2013 at 1:50 PM, Stefan Kamphausen > > wrote: > >> It complects require and refer ;-) > > How so? > > Because use = require + r

Re: querying a clojure data structure

2013-07-24 Thread Ben Wolfson
abel "pizza" "it")}})) {:annotation #{(label "pizza" "it")}} macroparser.parsers> i.e., match a map with one value whose key is :annotation and whose value is a set containing a seq of 'label, anything, and "it". -- Ben Wolfson "Hu

Re: Does this abstraction have any existing name?

2013-07-26 Thread Ben Wolfson
Google >>>> Groups "Clojure" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to clojure+u...@**googlegroups.com. >>>> >>>> For more options, visit >>>> https://groups.g

Re: Does this abstraction have any existing name?

2013-07-26 Thread Ben Wolfson
On Fri, Jul 26, 2013 at 9:27 PM, Yoshinori Kohyama wrote: > Thank you, Ben. > > If I think the map as a tree, then as a functor, what I do is 'fmap' (in > Haskell or some languages), > ,as you say. > Thanks for saying that. > > Does Algo supply things around Fun

Re: Does this abstraction have any existing name?

2013-07-26 Thread Ben Wolfson
On Fri, Jul 26, 2013 at 9:31 PM, Ben Wolfson wrote: > On Fri, Jul 26, 2013 at 9:27 PM, Yoshinori Kohyama wrote: > >> Thank you, Ben. >> >> If I think the map as a tree, then as a functor, what I do is 'fmap' (in >> Haskell or some languages), >> ,as

Re: ANN: substantiation, An opinionated nested maps validations library

2013-07-27 Thread Ben Wolfson
cause 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 to >

Re: is intellij idea a good ide for clojure development?

2013-07-28 Thread Ben Wolfson
ough the wrongful holder would call it theft, isn't clearly problematic. You may think that Stallman is wrong that code can be wrongly held, but that's independent of the analogies he draws. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may

Re: [GSoC] CinC mid-term evaluation status

2013-07-31 Thread Ben Wolfson
://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For mor

Re: clojure keyword spec

2013-07-31 Thread Ben Wolfson
at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com

with-redefs vs. constant folding

2013-08-14 Thread Ben Wolfson
Is this a bug? user> (with-redefs [list +] (list 1 2)) ;; expected: 3 3 ;; huzzah user> (with-redefs [+ list] (+ 1 2)) ;; expected: (1 2) 3 ;; blast! -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or s

Re: core.async - handling nils

2013-08-16 Thread Ben Wolfson
On Fri, Aug 16, 2013 at 4:50 PM, Brandon Bloom wrote: > I ran into the other half of this problem: If you expect nils to signify > closed channels, then you can't leverage the logically false nature of nil > without excluding explicit boolean false values. Given the pleasant syntax > of if-let /

Re: core.async - handling nils

2013-08-16 Thread Ben Wolfson
On Fri, Aug 16, 2013 at 5:07 PM, Brandon Bloom wrote: > > have every other value come wrapped in a Just or Some-like constructor > > That's what I meant by "a pair of quote/unquote operators" > ah, gotcha -- Ben Wolfson "Human kind has used its intelli

Re: vec to map with consolidated vals

2013-08-16 Thread Ben Wolfson
oups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For mor

Re: core.async - handling nils

2013-08-17 Thread Ben Wolfson
A sentinel value also prevents channels from being able to send/receive arbitrary values, without further wrapping. Sent from my iPhone On Aug 17, 2013, at 5:48 PM, Mikera wrote: > My overall sense is that the convenience of using if-let directly in a few > use cases doesn't justify making ch

Re: What's your preference, partial or closures?

2013-08-18 Thread Ben Wolfson
ot; 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 to > clojure+unsubscr...@googlegroups.com > For more options, visit t

Re: preference and implications of using as-> vs let

2013-08-19 Thread Ben Mabey
quared (* x x) x-squared (if (pos? y) (+ x-squared y) (- x-squared y))] x-squared) -Ben -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: ANN: clj-tuple, efficient small collections

2013-08-24 Thread Ben Wolfson
emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based.

Re: profiler?

2013-08-27 Thread Ben Mabey
d I really like the VisualGC plugin for VisualVM). For microbenchmarks I find criterium to be useful. -Ben -- -- 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: core.async - handling nils

2013-08-27 Thread Ben Wolfson
-first macro correctly handles this! It's not just `(when-let [~x (first ~xs)] ~@body). when-first nicely hides away what would otherwise be "much more ugly". -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, ferment

Re: Rxjava + Clojure Users

2013-08-27 Thread Ben Mabey
ts further exploration. I'd love to hear other peoples thoughts on this as well. -Ben -- -- 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 member

eval/macros with functions with metadata

2013-08-27 Thread Ben Wolfson
iculty, but this appears not to be the case. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure."

Re: eval/macros with functions with metadata

2013-08-28 Thread Ben Wolfson
at runtime. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure." [Larousse, "Drink" entry] --

Re: eval/macros with functions with metadata

2013-08-28 Thread Ben Wolfson
a is the right move, though it's kidn of dissatisfying. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-based. ... Family and social life also offer numerous other occasions to consume drinks for pleasure.&quo

Re: eval/macros with functions with metadata

2013-08-28 Thread Ben Wolfson
f (fn [] x) >f-sym (gensym)] > (intern *ns* gensym (weak-ref f)) > (with-meta (eval `(fn [] (do-stuff-with @~f))) {::strong-ref f})) > > So that way f will be freed up when the resulting fn is gced. > > On 28 August 2013 17:59, Ben Wolfson wrote: > > On Wed, A

Re: A macro for writing defn-like macros?

2013-09-03 Thread Ben Wolfson
the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- Ben Wolfson "Human kind has u

Re: A macro for writing defn-like macros?

2013-09-03 Thread Ben Wolfson
used, for example, here: https://github.com/bwo/monads/blob/master/src/monads/util.clj#L28-L43 and here: https://github.com/ReadyForZero/babbage/blob/1.1/src/babbage/graph.clj#L28-L79 On Tue, Sep 3, 2013 at 9:23 AM, Ben Wolfson wrote: > I've got something that helps with this stuff:

Re: A macro for writing defn-like macros?

2013-09-03 Thread Ben Mabey
lojure/tools.macro/blob/master/src/main/clojure/clojure/tools/macro.clj#L275-L298 HTH, Ben -- -- 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

Re: [ANN] riddley: code-walking without caveats

2013-09-03 Thread Ben Wolfson
it :y) [it it-1] it) nil)) (let* [it (get {:x {:y 3}} :x)] (if it (let* [it (get it :y)] (if it [it it-1] it)) nil)) The inner let* should be binding it-1. -- Ben Wolfson "Human kind has used its intelligence to vary the flavour of drinks, which may be sweet, aromatic, fermented or spirit-

Re: [ANN] riddley: code-walking without caveats

2013-09-04 Thread Ben Wolfson
roup. > 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 to > clojure+unsubscr...@googlegroups.com > For more options, visit this group

Re: Building Trees

2013-09-09 Thread Ben Wolfson
ts 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 > --- > You received this mess

Re: Testing macros that throw errors at compile time?

2015-01-22 Thread Ben Wolfson
received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. &

Re: which are the pros and cons between stuartsierra/component and prismatic/graph?

2015-02-04 Thread Ben Mabey
On 2/4/15 5:46 AM, Juan A. Ruz wrote: Hi guys! Can anyone give some insight on the features or downsides of choosing component vs graph libs? Or maybe explain the advantages of using defrecords instead of plain fns? The two are not mutually exclusive. We use both to manage our system's lif

Re: Extending the LispReader with "embeded language lorms"

2015-02-10 Thread Ben Wolfson
On Tue, Feb 10, 2015 at 11:29 AM, Alex Miller wrote: > Hi Henrik, > > There is a long-standing philosophical position in Clojure that it should > not be possible to write programs that cannot be read by other users. > What does that mean? -- Ben Wolfson "Human kind has u

Re: Let bindings and immutability

2015-02-11 Thread Ben Wolfson
Google > Groups "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Ben Wolfson "Human kind has used its intellig

Re: Removing the 5th, 10th, 15th ... element of a list

2015-02-17 Thread Ben Wolfson
-- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optou

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-05 Thread Ben Wolfson
this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > --

  1   2   3   4   5   6   >