Re: Simulations in Clojure/Clojurescript

2018-01-12 Thread Bobby Eickhoff
I don't have any examples to provide, but I would highly recommend reading through Rich's essay on Identity and State: https://clojure.org/about/state Bobby On Thursday, January 11, 2018 at 12:43:00 AM UTC-5, Michael Nardell wrote: > > On Wednesday, January 10, 2018 at 4:56:24 PM UTC-8,

Re: [ANN] Git Deps for Clojure!

2018-01-09 Thread Bobby Eickhoff
I find it somewhat ironic given all of the recent discussion of growth vs. breakage in the world of Clojure that this latest release of clojure tools -- if I understand correctly -- includes, as advertised above, a breaking change. :-P On Tuesday, January 9, 2018 at 9:44:12 AM UTC-5, Alex

Re: How to transform deeply nested map into a series of arrays?

2017-03-11 Thread Bobby Eickhoff
Given the recent discussions about specter, I thought I'd add a spectral solution. Disclaimer: I'm still a specter novice. An unrolled solution might look like this: (select [ALL (collect-one FIRST) LAST ALL (collect-one FIRST) LAST ALL (collect-one FIRST) LAST] data) =>

Re: What does it mean to say that special forms can't be used as arguments to functions?

2016-12-19 Thread Bobby Eickhoff
Here, "if" is not actually an argument to the + function. The arguments to + are 10 and 1, i.e. (+ 10 1). The reason this is true is because, in Clojure, the arguments to functions are evaluated before the function call, i.e. evaluation is strict. To see an example of how if (and other

Re: recursive bindings not available in let form?

2016-12-02 Thread Bobby Eickhoff
Note that letfn does allow recursive bindings, though I couldn't comment as to the implementation details. On Friday, December 2, 2016 at 3:01:13 PM UTC-5, Paul Gowder wrote: > > Hi clojure-world, > > I think maybe this is actually related to the complexities of binding > referenced in the

Re: [beginner] idiomatic way to parse lazy sequence

2016-11-08 Thread Bobby Eickhoff
Here are a few thoughts. This algorithm sounds like a fold, i.e. a reduction. You're iterating over a sequence while accumulating into a collection. A collection of collections, in this case. You're starting value for the fold might be this: {:first {}, :second {}} You're reducing function

Re: comp and partial vs ->>

2016-10-28 Thread Bobby Eickhoff
I agree that forms like (partial > 3) are clearer than #() forms. However, I've been avoiding partial in code bases for a while -- it was measurably slower than the alternative. Is that still the case? Has anyone else observed slowness with partial? On Thursday, October 27, 2016 at 8:44:14

Re: 0-arity of transducer in transduce

2016-08-31 Thread Bobby Eickhoff
Mathias, I've never found a satisfactory answer to this question. It has been asked before. https://groups.google.com/d/msg/clojure/HK9LkmlRyjY/S0U1u2nQCQAJ https://groups.google.com/d/msg/clojure/uVKP4_0KMwQ/-oUJahvUarIJ Hoping someone with more insight will comment on this situation. Bobby

Re: Having trouble doing what I want using macros, is there a better way?

2016-06-10 Thread Bobby Eickhoff
Having spent quite a bit of time recently dissecting transducers , I'd tend to agree with Tim: core transducers will probably give you most of what you want. I'd also agree that writing macros should be your last

Deconstructing Transducers

2016-05-27 Thread Bobby Eickhoff
Precondition: I didn't really understand transducers Action: I spent some time tinkering with them Postcondition: I've written a blog post about it: Deconstructing Transducers Constructive feedback is more than

Re: Return from a function

2016-04-14 Thread Bobby Eickhoff
The result of the last expression evaluated is always returned. Hence, the shape of the function is what determines the points of return and the returned values. For example, if you're entire function is defined as one (if ...) statement, there are two possible points of return, each of the

Re: Puzzle solving in Clojure

2016-04-12 Thread Bobby Eickhoff
doall holds on to the head of the seq, "causing the entire seq to reside in memory at one time." (https://clojuredocs.org/clojure.core/doall) Instead, just find the first solution: (->> (permutations (range 10)) (filter check?) (first) (print-solution)) On Friday, April 8, 2016 at 9:28:55

Re: Prismatic Schema - Self-reference in schema definitions

2016-03-05 Thread Bobby Eickhoff
Note also that I'm giving each Zone "object" it's own :type property. That's how I'm able to dispatch on the type. It also plays well with multimethods. On Saturday, March 5, 2016 at 7:26:27 PM UTC-5, Bobby Eickhoff wrote: > > It sounds like what you're describing

Re: Prismatic Schema - Self-reference in schema definitions

2016-03-05 Thread Bobby Eickhoff
It sounds like what you're describing is (structurally) an algebraic data type, i.e. a generic type with specific variants. I've been able to do something like this in my own projects. Here I'm considering Zone the general type and each variant is Zone:Hand, Zone:Deck, (def Zone:Hand ...)

clojars down?

2016-01-01 Thread Bobby Eickhoff
Is anyone else having trouble connecting to clojars.org? Firefox can't connect: "The connection has timed out". Neither can lein: INFO: I/O exception (java.net.NoRouteToHostException) caught when processing request to {s}->https://clojars.org:443: No route to host -- You received this

Re: clojure core eval appears recursive?

2015-07-24 Thread Bobby Eickhoff
eval isn't calling itself, it's calling the method Compiler#eval. (defn eval ...) binds the function to a var named eval, but (. clojure.lang.Compiler (eval form)) is invoking a static method. See the dot special form docs http://clojure.org/java_interop#Java Interop-The Dot special form.

Re: Satisfies? seems strangely slow

2015-01-22 Thread Bobby Eickhoff
Clojure isn't doing the caching. The JVM is doing the caching. In this case, Clojure just has mechanical sympathy for how the JVM operates. On Thursday, January 22, 2015 at 11:10:56 PM UTC-5, Michael Blume wrote: It sounds like basically dispatch is fast because we bothered to make it fast

Re: how do you name your protocols?

2014-09-06 Thread Bobby Eickhoff
What might be an advantage to using something like the I-prefix? At first glance, this appears to be unbeneficial hungarian notation. Aesthetically, this seems backwards (to me). I want interfaces and protocols to have the most readable names. I'm willing to concede on less readable names

Re: Is Korma still a good current choice for DB backend?

2014-07-24 Thread Bobby Eickhoff
Slight tangent: I've never used honeysql, but every time I see the name I want it to be pronounced honeysuckle. Is that the naming intent, or is it simply honey s q l? On Tuesday, July 22, 2014 8:10:16 AM UTC-4, Jonathon McKitrick wrote: Development and support seem to have slowed down.

Re: object identity

2014-02-26 Thread Bobby Eickhoff
This seems like a reasonable optimization. I read something similar a few years ago (http://lorgonblog.wordpress.com/2008/05/24/catamorphisms-part-four/): What we want is a function which will be smart, and only allocate new data structures when necessary. Indeed, one of the main advantages

Re: Why cannot last be fast on vector?

2012-06-29 Thread Bobby Eickhoff
Warren, you're on the right track with your alternative design: Intuitively and ideally, last should return the last element of a finite, ordered collection. But Clojure's last operates on sequences, not collections. This is problematic because sequences can be (effectively) infinite.

Re: letrec

2011-12-15 Thread Bobby Eickhoff
'declare' wouldn't be good because of the scope of vars. There's no sense using global (albeit namespaced) variables for what probably only need to be local identifiers. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send

Re: The Website / Wikispaces

2011-10-07 Thread Bobby Eickhoff
Yes, and I also frequently get the Wikispaces homepage after hitting the browser's back button (while surfing through the pages at clojure.org). -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to