[ANN] lein-tern 0.1.0 - DB migrations as clojure data

2014-11-14 Thread Russell
ments, suggestions, and pull requests are welcome! It's available on Clojars - add [lein-tern "0.1.0"] to the plugins vector of your project.clj. Thanks, Russell -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to th

Re: Please critique my code (barber problem with core.async)

2015-01-04 Thread Russell
Looks like the barber's loop doesn't check the "running" atom, so it will never stop... If you wanted to get rid of the atom for counting haircuts you could use a go-loop with a haircut count as an argument. Something like: (go-loop [haircuts 0] (if @running (do (cut-hair!) (recur

Is it possible / is support planned to add docstrings to clojure.spec specs?

2016-06-01 Thread Russell
that is likely to be added? Thanks, Russell -- 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

[ANN] lein-docker-compose - inject docker-compose port mappings into environ's `env`

2016-10-19 Thread Russell
b.com/HealthUnlocked/lein-docker-compose Leiningen plugin dependency: [healthunlocked/lein-docker-compose "0.1.0"] (You'll also need to be using environ and lein-environ for the plugin to work.) Russell @ HealthUnlocked PS. We are hiring :-) -- You received this message because you a

Generative integration tests

2017-01-21 Thread Russell
worth pursuing? Are there any pitfalls I should be considering? Does the syntax/structure of the integration test setup sort of make sense, or is it hopelessly confusing? Any ideas on how to improve it? Thanks for your time, Russell -- You received this message because you are su

Re: parsing program for nested parens and square brackets

2009-07-04 Thread Russell Christopher
(def matches {\( \) \[ \]}) (defn balanced? [s] (empty? (reduce #(if (= (matches (peek %1)) %2) (pop %1) (conj %1 %2)) [] s))) Learning Clojure. So far I'm really liking it. This is the first time I've tried anything outside of some REPL incantations from books, blogs, this list, etc thus it wo

Re: Is knowing Java a prerequisite for using Clojure?

2009-09-17 Thread Russell Christopher
In general I think the STM solution to most concurrency issues looks promising, however in the case of dining philosophers I found that Java locking was easier than a ref, atom or agent solution. ;; (import java.util.concurrent.locks.ReentrantReadWriteLock) (defn nth-chopstick [chopsticks i side]

Re: iterating over a nested vector

2010-04-08 Thread Russell Christopher
Another one using for (defn col-widths [arr] (for [i (range (count arr))] (apply max (map #(nth % i) arr On Thu, Apr 8, 2010 at 1:55 PM, John Sanda wrote: > Thanks for the explanation. I did see in the docs that the map function can > take multiple collections, but I guess I did not quite u

Re: iterating over a nested vector

2010-04-09 Thread Russell Christopher
http://rosettacode.org/wiki/Matrix_transposition#Clojure Does anyone know if transpose exists in core or contrib? A cursory check doesn't reveal it, seems like it should be available. Thanks On Thu, Apr 8, 2010 at 10:27 PM, Per Vognsen wrote: > Or you can separate concerns a bit more: > > (def

Re: defrecord question

2010-04-30 Thread Russell Christopher
Why does this work? (defrecord R [k]) (extend-protocol P R (p [{:keys [k]}] k)) On Fri, Apr 30, 2010 at 2:52 PM, Sean Devlin wrote: > I think you have your destructuring backwards. > > You fn should probably be (fn [{k :keys}] k) > > For example, > > user=> ((fn [{k :keys}] k) {:keys "Awesome"})

Re: a default value for get-in?

2010-05-18 Thread Russell Christopher
(defn get-in ([m ks] (reduce get m ks)) ([m ks not-found] (if-let [res (get-in m ks)] res not-found))) Longer but still uses reduce On Tue, May 18, 2010 at 12:20 PM, Stefan Kamphausen wrote: > Hi, > > On May 17, 9:34 pm, braver wrote: > > If get-in is to be consistent with get, i

Re: a default value for get-in?

2010-05-18 Thread Russell Christopher
Although that would return the default for a key with a nil value. So you're probably right reduce would have to change. On Tue, May 18, 2010 at 3:49 PM, Russell Christopher < russell.christop...@gmail.com> wrote: > (defn get-in > ([m ks] > (reduce get m ks))

Re: a default value for get-in?

2010-05-19 Thread Russell Christopher
Try #2, change the order of arguments to "get" using partial (defn get-in ([m ks] (get-in m ks nil)) ([m ks not-found] (letfn [(local-get-in [nf m ks] (get m ks nf))] (reduce (partial local-get-in not-found) m ks On Tue, May 18, 2010 at 5:23 PM, Meikel Brandmeyer wrote: > H

Re: a default value for get-in?

2010-05-19 Thread Russell Christopher
slight error w/ the previous, local-get-in should have been local-get (defn get-in ([m ks] (get-in m ks nil)) ([m ks not-found] (letfn [(local-get [nf m ks] (get m ks nf))] (reduce (partial local-get not-found) m ks On Wed, May 19, 2010 at 9:21 AM, Russell Christopher

Re: In what OS do you code?

2013-06-14 Thread Russell Whitaker
ployment target. Russell On Fri, Jun 14, 2013 at 11:11 AM, Erlis Vidal wrote: > Hi guys! > > Thanks for all the responses, it looks like Linux is the predominant OS in > the Clojure community. > > > > > On Fri, Jun 14, 2013 at 2:06 PM, Jim - FooBar(); > wrote: >> &

Re: Clojure in production

2013-06-18 Thread Russell Whitaker
But... is it also the bee's knees? Russell Whitaker Sent from my iPhone On Jun 13, 2013, at 5:38 PM, Travis Vachon wrote: > We've used Clojure at Copious (http://copious.com) to build our > activity feed (http://www.youtube.com/watch?v=0l7Va3-wXeI) and a > number

lein injections across namespace changes

2013-07-09 Thread Russell Mull
:1:1) Which is very frustrating. Is there a way to keep those namespaces refer-ed even after I change namespace in the repl? My google-fu has failed me. I'm using Clojure 1.5.1, emacs 24, lein 2.2, and nrepl.el 0.1.8-preview. - Russell -- -- You received this message because you a

Re: (newbie-ish) Modelling question - multi methods?

2013-08-12 Thread Russell Mull
change which handler you're using based on the thing it's handling. Russell -- -- 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: Do you like the Clojure syntax?

2013-08-13 Thread Russell Whitaker
ng something is subjective by definition. That's the purpose of the > poll. If you are using Clojure I just want to know your subjective feeling > towards the syntax. > -- Russell Whitaker http://twitter.com/OrthoNormalRuss http://www.linkedin.com/pub/russell-whitaker/0/b86/329 -- -

Re: [ANN][book] Clojure Reactive Programming

2015-03-26 Thread Russell Christopher
So far I'm finding the book instructive! Good job. As far as the detour, I'd keep in mind that in general Rich likely isn't in favor of it on this list but on the other hand I didn't find that the criticism was personal as no names were mentioned and I commiserate about so called "architects" cau

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-21 Thread Russell Mull
present the examples and results in the appropriate place, depending on the context, or (b) automatically recompute those results (or test against them) with a bit of tooling. Of these, only the example usages case feels like it would be useful outside LP, and thus be a candidate for common m

Re: ANN: ClojureScript 0.0-2496, cljs.test - a clojure.test port

2014-12-24 Thread Russell Mull
texts instead of *testing-contexts* - :testing-vars instead of *testing-vars* And that's it. It looks like a nearly complete port. - Russell On Tuesday, December 23, 2014 1:59:45 PM UTC-8, Yehonathan Sharvit wrote: > > What is the gap between clojure.test and cljs.test?

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2496, cljs.test - a clojure.test port

2014-12-24 Thread Russell Mull
jurescript/blob/master/src/clj/cljs/test.clj Russell On Wed, Dec 24, 2014 at 10:13 AM, Yehonathan Sharvit wrote: > What about the 'are' macro? > > > > On Wed, Dec 24, 2014 at 7:38 PM, Russell Mull > wrote: > >> Things that aren't in cljs.test: >

micrologic - A tiny, literate implementation of miniKanren/core.logic

2015-01-08 Thread Russell Mull
ist. Is this useful, confusing? Wrong in places? please let me know if you have any feedback! http://mullr.github.io/micrologic/literate.html Cheers, Russell -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Free webinar - Deep Learning: Clojure

2016-07-27 Thread Rachael Russell
Every language has many pre-defined core functions, so we can quickly get on building what we really want. This ease of use does come at a cost, though. Do we really know the power of the magic that we are wielding? In this webinar we will look at how to learn a language by implementing models

clojure.spec for specifying sequences of states over time

2016-08-05 Thread Russell Mull
Suppose you have a reactive process, something that receives a message, processes it, updates its, state, and repeats. For example: (go-loop [s :initial] (case ( :processsing :processing ->: :processing :processing -> :stopping :stopping -> (done) This is pretty easy to write as a regular expre

'encoding-of' for spec

2017-01-04 Thread Russell Mull
partial implementation is here: https://gist.github.com/e7f8230920225496370ae38fc55f2175 If there's any interest in this, I can clean it up and release it as a standalone library. It necessarily reaches into some of the guts of core.spec, so it may be more suitable as a patch to spec itself, if

[Job] Software Engineer at Puppet

2017-05-11 Thread Russell Mull
My team, which works on https://github.com/puppetlabs/puppetdb, is hiring a software engineer. We mostly use Clojure. https://puppet.com/company/careers/jobs?gh_jid=685071 (The page says Portland, but we're gladly open to anyone in US time zones) - Russell -- You received this me

Re: Question regarding core.logic

2017-09-05 Thread Russell Mull
, and it devolves to the same case. It's not really clear what you're trying to do, so it's hard to offer further advice. But you might find the whole enterprise a bit less confusing if you use keywords or strings in the places you're using symbols. - Russell -- You receiv

Re: Question regarding core.logic

2017-09-06 Thread Russell Mull
On Tuesday, September 5, 2017 at 2:03:36 PM UTC-7, Laverne Schrock wrote: > > > On Tuesday, September 5, 2017 at 1:50:59 PM UTC-5, Russell Mull wrote: >> >> It's not really clear what you're trying to do, so it's hard to offer >> further advice. &g

Surprising st/instrument behavior with lazy seqs

2017-11-14 Thread Russell Mull
* Does the fact that I got into this situation indicate that I'm doing something wrong? (The above code is clearly contrived, but I did run into this in a real program) - Russell -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: Anotating functions for pre-processing

2015-08-05 Thread Russell Mull
onstruct to set up a function before it works, using alter-var-root! or robert-hooke, is well into "spooky action at a distance" territory and should be avoided if possible. - Russell -- You received this message because you are subscribed to the Google Groups "Clojure" g

Re: Any chance of core.logic getting extended with probKanren?

2015-11-24 Thread Russell Mull
up: > https://github.com/webyrd/probKanren > Do you know if there have been any publications on this work? I've looked around a little bit, but I can only find the source code. - Russell -- You received this message because you are subscribed to the Google Groups "Clojure" g

Pattern matching on lists

2016-04-08 Thread Russell Wallace
How do you do pattern matching on lists in Clojure? I've tried using core.match but the examples all deal with vectors, and trying to specify a list in the apparently obvious ways gets an error message about invalid list syntax. -- You received this message because you are subscribed to the Go

core.async repl :reload-all issue?

2013-09-27 Thread Russell Christopher
Anyone encountered after a few reloads at the repl core.async stops working.? Thanks (ns repl.core (:require [clojure.core.async :refer :all])) ;;0.1.0-SNAPSHOT (defn producer[c] (Thread/sleep 1000) (go (>! c true)) (println "sleeping") (Thread/sleep 1)) (defn consumer [c] (let

Re: core.async repl :reload-all issue?

2013-09-27 Thread Russell Christopher
2013 at 2:06 PM, Ben Mabey wrote: > Hi Russell, > This doesn't look like a core.async specific problem, but rather the more > general problem that protocols and records are not reload safe. What I > believe is happening is the TimeoutQueueEntry type is being recompiled when >

Re: [Semi OT] Staples Acquires Runa to Transform Shopping Experience Through Personalization

2013-10-02 Thread Russell Whitaker
the staff in San Mateo. Candidates with backgrounds in > Clojure programming, deep learning and data science who are interested in > applying are encouraged to check Staples' careers page to view openings. > This is excellent news for Runa, congratulations to them! -- Russell W

Re: [ANN] Counterclockwise - Clojure plugin for Eclipse

2013-10-10 Thread Russell Mull
> - available as a Standalone Product: Download, Unzip, Code! > This is huge! Maybe it seems like a trivial thing, but removing barriers to getting started is fantastic. Thank you Laurent, for your tireless and continuing work. - Russell -- -- You received this message because y

Re: Any interest in Compojure/Ring screencasts?

2013-10-29 Thread Russell Whitaker
ld be > improved, and I'd probably wind up going into more detail on certain topics. > I'll probably charge a small fee (perhaps $10 or so) to cover costs. > > Would there be any interest in this? > > - James -- Russell Whitaker http://twitter.com/OrthoNormalRuss -- -

Re: Code layout

2013-12-10 Thread Russell Mull
I sometimes find that, when the formatting gets hairy, I need to either refactor my code or use one of the pipeline macros. (->> nums (filter even?) (reduce +)) - Russell On Wednesday, December 11, 2013 11:24:16 AM UTC+9, Plinio Balduino wrote: > > Hi there > > Wha

Re: Contributors needed for Rouge (Clojure on Ruby)

2014-01-05 Thread Russell Christopher
I wonder if Go could be a good substrate for native-compiled Clojure. On Sun, Jan 5, 2014 at 5:27 PM, Mikera wrote: > On Sunday, 5 January 2014 18:18:22 UTC, John Gabriele wrote: >> >> On Saturday, January 4, 2014 1:12:12 PM UTC-5, Michael Gardner wrote: >> >>> >>> > Hopefully the landscape for

Macro for bailout-style programming

2013-03-22 Thread Russell Mull
on a 42) :check (or (nil? b) (< b 0)) nil] (/ a b)) Which leads me to my question: does such a construct already exist? Or perhaps am I doing it wrong? I've googled around for this, but I'm not exactly sure what it's called. Cheers, Russell -- -- You r

Re: Refactoring tools

2013-03-22 Thread Russell Mull
I find myself doing that a lot by hand, a tool to help would be very useful. Some others that I've thought of are: - change between (fn [x] ...) and #(...) - pull sexp up to let, or introduce a new let (like introduce variable in java et. al) On Saturday, March 23, 2013 10:42:10 AM UTC+9, Alex

Re: [ANN] conf-er 1.0.1

2013-05-05 Thread Russell Mull
This looks simple and useful, thanks! Supposing I had a function that called this library, how could I go about testing it easily? That is, the configuration file becomes implicitly an input to the function, one that I'd like to be able to control from my tests. Perhaps something like this coul

Re: 1.2 letfn/reduce bug?

2010-06-11 Thread Russell Christopher
I couldn't see it! Thanks On Fri, Jun 11, 2010 at 12:25 PM, Krešimir Šojat wrote: > Hi, > > > (defn foo [] > > (letfn (bar [acc val] > >acc) > > (reduce bar {} (range 1 10 > > > > doesn't compile > > java.lang.IllegalArgumentException: Don't know how to crea

Re: Can anyone create a simpler version of prime factors in Clojure?

2010-06-11 Thread Russell Christopher
didn't need the assoc in my previous try (defn of [n] (letfn [(f [res k] (if (= 0 (rem (:n res) k)) {:n (/ (:n res) k) :fs (conj (:fs res) k)} res))] (:fs (reduce f {:n n :fs []} (range 2 n) On Fri, Jun 11, 2010 at 3:15 PM, russellc wrote:

Re: Can anyone create a simpler version of prime factors in Clojure?

2010-06-12 Thread Russell Christopher
You're right. Hope I haven't offended with the fail, I thought I had tested it - by iterating over a range and comparing it to Uncle Bob's but obviously I didn't do that right and then realized that factorization is likely not O(n) anyway. I'll probably take more time nex

Re: Can anyone create a simpler version of prime factors in Clojure?

2010-06-12 Thread Russell Christopher
On 12 Jun 2010, at 16:18, Russell Christopher wrote: > > > You're right. Hope I haven't offended with the fail, I thought I had > tested it - by iterating over a range and comparing it to Uncle Bob's but > obviously I didn't do that right and then realized that fac

Re: Code retreat exercices where Clojure could shine?

2012-08-30 Thread Russell Whitaker
Clojure is inherently shiny, no need to gild the lily. What's the purpose and duration of your "code retreat"? Russell On Monday, August 27, 2012 2:41:20 AM UTC-7, Denis Labaye wrote: > > Hi, > > I am organizing a code retreat in September. > > All languages ar

Re: Routing HTTP/ JSON in clojure

2012-09-04 Thread Russell Whitaker
; required but given that the system needs some algorithmic routing rules, > clojure seemed a really nice conceptual fit over the languages I normally > work with (imperative jvm ones, essentially) > > So, I'm really interested in any suggestions on how this might best be > appro

Re: Routing HTTP/ JSON in clojure

2012-09-04 Thread Russell Whitaker
oading issues introduced by the latter; see today's (4 Sep 2012) clojure IRC log: http://clojure-log.n01se.net/ Russell > david > > > On Wednesday, 5 September 2012 00:24:46 UTC+1, Russell Whitaker wrote: >> >> On Tue, Sep 4, 2012 at 1:52 PM, David Dawson >>

Re: Routing HTTP/ JSON in clojure

2012-09-05 Thread Russell Whitaker
useful as a dispatch mechanism if the shape of the JSON data > dictates what should happen to it. I would certainly recommend Clojure > for what you describe, I think you will be pleasantly suprised how > straightforward it is :) > > On Tue, Sep 4, 2012 at 7:05 PM, Russell Whitaker &g

Re: Questions regarding do form

2012-09-27 Thread Russell Whitaker
>>> (let [bar-bar (. java-object getSomething)] >>> (do >>> (if (not (is-bar? bar)) >>> (. java-object (setSomething bar-bar))) >>> java-object))) >>> >> >> >> The third: >> >> (defn my-

Re: Request for a hint

2012-11-17 Thread Russell Whitaker
> > my wife. And I wish you my kind of success. > > > > -- > Charlie Griefer > http://charlie.griefer.com/ > > I have failed as much as I have succeeded. But I love my life. I love > my wife. And I wish you my kind of success. > > -- > You received

Any Clojurists at MongoSV today?

2012-12-04 Thread Russell Whitaker
uremongodb.info/ -- Russell Whitaker http://twitter.com/OrthoNormalRuss / http://orthonormalruss.blogspot.com/ http://www.linkedin.com/pub/russell-whitaker/0/b86/329 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: when is a zipper better than get-in ?

2012-12-11 Thread Russell Whitaker
I just downloaded the sample PDF for FP-OO, and it's delightful; I'll be springing for a copy myself. Russell On Tue, Dec 11, 2012 at 11:14 AM, Brian Marick wrote: > > On Dec 11, 2012, at 1:04 PM, Brian Marick wrote: > > If you want to "edit" trees, using z

Re: Marshal 1.0.0

2012-02-05 Thread Russell Christopher
I did look at Gloss before writing Marshal and decided against using it in our application suite, I wanted something more focused utilizing InputStream/OutputStream interface and able to handle variable sized arrays/strings (size of array or string specified in packet). On Sun, Feb 5, 2012 at 6:1

Re: Marshal 1.0.0

2012-02-05 Thread Russell Christopher
ld surely slip by me when implementing my own binary- > encoding library, but which has already been addressed by Gloss. By > choosing a mature and well-known library instead of making your own, > you get more features and fewer bugs. > > On Feb 5, 4:09 pm, Russell Christopher > wr

a question about the definiton of the variable arity function in "Clojure: A Dynamic Programming Language for the JVM," by Rich Hickey

2009-05-28 Thread Benjamin L . Russell
RCE_FILE:6) > [Thrown class clojure.lang.Compiler$CompilerException] However, no definition is given for "thisfn" in the talk. Forgive me if I am missing something very obvious, but does anybody know where I can find the definition of "thisfn"? -- Benjamin L. Russell -- Benjamin L. Rus

How difficult would creating a collaborative multi-user online virtual world application be in Clojure?

2009-06-11 Thread Benjamin L . Russell
ting this project in Clojure would be feasible? -- Benjamin L. Russell -- Benjamin L. Russell / DekuDekuplex at Yahoo dot com http://dekudekuplex.wordpress.com/ Translator/Interpreter / Mobile: +011 81 80-3603-6725 "Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^ -- Benjami

Re: Reminder: IEEE Software Issue on "Multiparadigm Programming"

2010-01-24 Thread Benjamin L. Russell
downsize, and I am very busy in searching for more employment. Therefore, I have very little time. Is there any way that I could contribute to a future issue on this topic? I probably won't have much time to write until I find additional work. Sincerely yours, Benjamin L. Russell --- On S

[no subject]

2011-11-15 Thread Benjamin L. Russell
http://www.ultimateabguide.com/wp-content/themes/default/images/hello.php -- 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