records alias with local vars

2019-08-28 Thread Brian Craft
In this example (defrecord x [y]) (defn b [x] (.getBytes ^String x)) The compiler fails to resolve .getBytes. It emits reflection code, saying x is a class. It is resolved by deleting the defrecord, or renaming the parameter. Is this expected, or documented? Are there other cases like this?

Re: Blocking behavior of >!! ?

2019-05-20 Thread Brian Beckman
Thanks everyone for your answers. I understand much better now. I just had to make up some words like "rendezvous" and "pseudothread" to help me piece together these implicit concepts. On Sunday, May 19, 2019 at 10:33:07 AM UTC-7, Brian Beckman wrote: > > The d

Re: Blocking behavior of >!! ?

2019-05-20 Thread Brian Beckman
angs. > > If it helps you can read "go" as "please run this somewhere else, possibly > at a different time" and let the current thread continue after the go. > > I can't explain this very well but the documentation aspect is accurate. > > On Sunday,

Blocking behavior of >!! ?

2019-05-19 Thread Brian Beckman
The documentation for >!! reads: - clojure.core.async/>!! ([port val]) puts a val into port. nil values are not allowed. Will block if no buffer space is available. Returns true unless port is already closed. I have a case where I believe that the channel has no

Re: avoiding casts with aget & friends

2019-01-31 Thread Brian Craft
Is there any way to inspect what the jit does to it? On Wednesday, January 30, 2019 at 10:07:38 PM UTC-8, Alex Miller wrote: > > > > On Wed, Jan 30, 2019 at 11:07 PM Brian Craft > wrote: > >> With much experimentation, I ended up with this: >> >> (let [a 1

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
nesday, January 30, 2019 at 8:41:49 PM UTC-8, Brian Craft wrote: > > The full context is large. But, for example, in this code: > > (let [a 1 > b (:foo {:foo 3}) > c (if (< a b) a b)]) > > b and c are Object (if the disassembly is to be believed) which leads

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
rom that I > could probably talk a little more about what I would expect the compiler to > understand and how you might be able to influence it. > > On Wed, Jan 30, 2019 at 8:50 PM Brian Craft > wrote: > >> If there is unnecessary casting or boxing, how do y

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
ere is unnecessary casting or > boxing. > > > > On Wed, Jan 30, 2019 at 6:55 PM Brian Craft > wrote: > >> I haven't tried much. I'm getting the java via clj-java-decompiler.core >> 'decompile' macro. >> >> A long cast does drop the cast (which is really counter-intu

Re: avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
Usually this is > the kind of thing it's good at, but it might take 10k invocations before it > does. > > > On Wednesday, January 30, 2019 at 4:03:43 PM UTC-6, Brian Craft wrote: >> >> Profiling is showing a lot of time spent in RT.longCast, in places like >> this:

avoiding casts with aget & friends

2019-01-30 Thread Brian Craft
Profiling is showing a lot of time spent in RT.longCast, in places like this: (aget flat-dict (bit-and 0xff (aget arr j))) arr is hinted as ^bytes, and flat-dict as ^objects. which compiles to this: Object code2 = RT.aget((Object[])flat_dict, RT.intCast(0xFFL &

partition & fold

2019-01-26 Thread Brian Craft
Still trying to understand reducers & transducers. Is the difference between r/folder and r/reducer the parallelization? Anyone know what this error is about? (r/foldcat (r/map #(apply + %) (r/folder (into [] (range 1000)) (partition-all 5 ArrayIndexOutOfBoundsException 47427

Re: r/fold combinef and reducef init values

2019-01-26 Thread Brian Craft
EAN > An Architect's View -- http://corfield.org/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > > > *From: *Brian Craft > *Sent: *Friday, January 25, 2019 3:36 PM > *Subject: *r/fold combinef and reducef init values &g

Re: r/fold combinef and reducef init values

2019-01-25 Thread Brian Craft
Looks like it's something that's changed over different clojure releases. On Friday, January 25, 2019 at 3:35:58 PM UTC-8, Brian Craft wrote: > > From the docs: > > r/fold takes a reducible collection and partitions it into groups of > approximately n (default 512) eleme

r/fold combinef and reducef init values

2019-01-25 Thread Brian Craft
>From the docs: r/fold takes a reducible collection and partitions it into groups of approximately n (default 512) elements. Each group is reduced using the reducef function. The reducef function will be called with no arguments to produce an identity value in each partition. The results of

transducer parallelism

2019-01-25 Thread Brian Craft
Are there any docs on transducer parallelism? I had the impression, from various sources, that they could operate in parallel, but in doing some benchmarks over a largish collection (counting character frequencies in 1.3M strings), transduce never uses more than one thread. Is this expected?

undocumented one-argument call of reducer

2019-01-25 Thread Brian Craft
The transducers doc suggests transduce works with standard reducing functions, but then transduce makes a one-argument call to the function. The code docs for transduce say the reducing function must support a one-argument call, but don't give any information about what that call should do.

removing trailing zeros in floating point formatting

2018-07-26 Thread Brian Craft
Probably more of a java question, but I'm finding that floating point formats with (format) are inflating data sizes enormously with meaningless trailing zeros, because the underlying java conversion methods don't work as they do on other platforms. E.g., in C printf("%.6g %.6g %.6g %.6g\n",

Re: D + Clojure?

2018-04-05 Thread Brian
I'm interested. For my own uses I would be curious to see how difficult it would be to update (degrade? retrograde? :) ) to 3.5/Pathfinder. On Thu, Apr 5, 2018 at 11:04 AM, Davide Taviani wrote: > Hey! > I'm a DM, a user of OrcPub2 and a full-time clojure + cljs developer

Re: core.async consumer + producer working by chunk?

2018-01-06 Thread Brian J. Rubinton
https://dev.clojure.org/jira/browse/ASYNC-210 <https://dev.clojure.org/jira/browse/ASYNC-210> > On Jan 6, 2018, at 12:11 PM, Brian J. Rubinton <brianrubin...@gmail.com> > wrote: > > Thanks! I will. Just signed the CA. > > > On Sat, Jan 6, 2018, 12:10 PM

Re: core.async consumer + producer working by chunk?

2018-01-06 Thread Brian J. Rubinton
Thanks! I will. Just signed the CA. On Sat, Jan 6, 2018, 12:10 PM Alex Miller <a...@puredanger.com> wrote: > > > On Saturday, January 6, 2018 at 10:56:06 AM UTC-6, Brian J. Rubinton wrote: >> >> Alex - it makes sense to me that the buffer temporarily expand

Re: core.async consumer + producer working by chunk?

2018-01-06 Thread Brian J. Rubinton
Typo — I meant to say the channel executes puts during a take! even though the buffer is full before executing the puts. This is clearer in code (please see the gist). > On Jan 6, 2018, at 11:55 AM, Brian J. Rubinton <brianrubin...@gmail.com> > wrote: > > Alex - it

Re: core.async consumer + producer working by chunk?

2018-01-06 Thread Brian J. Rubinton
simply having the producer put items one by one on the channel? > > I will do that. My current producer is doing too many other things, but if I > break it up into separate threads or go blocks for each work queue, then that > should work. Thank you. > > > On Saturday, Ja

Re: core.async consumer + producer working by chunk?

2018-01-06 Thread Brian J. Rubinton
Rob - I’d go with Gary's approach, which essentially moves the splitting up of the chunk of results from the core.async channel’s transducer to the producing function. You can do that using a channel with a fixed buffer of 50 and >!!. As long as the next db query is blocked until each of the

Re: core.async consumer + producer working by chunk?

2018-01-05 Thread Brian J. Rubinton
I don’t know; I don’t fully understand the implementation differences of >!! and offer!. The behavior of offer! makes me think the buffer is not empty until all the outputs of the transducer are consumed, but the behavior of >!! makes me think otherwise. Moritz - is the buffer cleared if: -

Re: core.async consumer + producer working by chunk?

2018-01-05 Thread Brian J. Rubinton
; ( ( (offer! work-queue (range 50)) nil user> (dotimes [_ 48] ( (offer! work-queue (range 50)) true user> ( On Jan 5, 2018, at 2:10 PM, Rob Nikander <rob.nikan...@gmail.com> wrote: > > > > On Friday, January 5, 2018 at 2:03:00 PM UTC-5, Brian J. Rubinton wrote: > >

Re: core.async consumer + producer working by chunk?

2018-01-05 Thread Brian J. Rubinton
query’s result is consumed. Brian > On Jan 5, 2018, at 1:44 PM, Rob Nikander <rob.nikan...@gmail.com> wrote: > > Hi, > > I’m wondering if there is a core.async design idiom for this situation... > > - A buffered channel > - One producer feeding it > -

Re: Converting json to work with clojure.spec

2017-08-06 Thread Brian Scaturro
Hi Jonathon, I am trying to figure out the same thing. I am using all namespace qualified keys, but curious how this works when using s/conform on a json payload. Did you ever find a solution for this? Thanks! Brian On Sunday, December 4, 2016 at 10:11:55 AM UTC-5, Jonathon McKitrick wrote

Re: with-open pattern

2017-05-05 Thread Brian Craft
This looks like a partial solution: https://github.com/pjstadig/scopes perhaps inspired by this discussion: https://dev.clojure.org/display/design/Resource+Scopes On Friday, May 5, 2017 at 5:10:27 AM UTC-7, Herwig Hochleitner wrote: > > 2017-05-04 19:35 GMT+02:00 Brian Craft

Re: with-open pattern

2017-05-04 Thread Brian Craft
he scenarios you’re thinking of, though. > > On Thursday, May 4, 2017 at 1:35:48 PM UTC-4, Brian Craft wrote: >> >> The with-open style is used a lot in the jdbc lib, and elsewhere. It's >> pretty simple when data is very small, as you can just evaluate the entire >>

with-open pattern

2017-05-04 Thread Brian Craft
The with-open style is used a lot in the jdbc lib, and elsewhere. It's pretty simple when data is very small, as you can just evaluate the entire result with doall, etc. How do you deal with larger data, where you need to evaluate iteratively? If there's only one with-open it can be reasonably

Re: Seeking critique of "pattern" in clojure.spec (LONG)

2017-04-11 Thread Brian Beckman
I'd suggest, if you need Double, use Double. If you need something close > to Double, and you can build on top of it, simpler to go with the style of > my first gist. If you can't build on top of double, deftype is probably > what you want. > > On Monday, 10 April 2017 21:41:35 UTC-7

Re: Seeking critique of "pattern" in clojure.spec (LONG)

2017-04-10 Thread Brian Beckman
Wow... that's a comprehensive solution, Didier :) Bravo! It's a good lesson for s/fdef, which I haven't yet studied. I gather from your solution that "orchestra" is not needed to spec :ret types? As to semantics, on the one hand, I can spec ::virtual-time as a light overlay over Double and

Re: Seeking critique of "pattern" in clojure.spec (LONG)

2017-04-10 Thread Brian Beckman
James -- just the kind of simplification I was looking for! In fact, I think the following will do everything I need --- generate numbers avoiding only NaN (which isn't equal to itself, nor less than anything) (s/def ::virtual-time (s/with-gen (s/and number? #(not (Double/isNaN %)))

Re: Seeking critique of "pattern" in clojure.spec (LONG)

2017-04-10 Thread Brian Beckman
These are good comments that give me things to think about. I'm grateful. * The pattern concerned me because (1) it was just the first thing I came up with, so not sure there wasn't a better way staring me in the face (2) I didn't see any clearly better alternatives, so not sure whether I just

Seeking critique of "pattern" in clojure.spec (LONG)

2017-04-10 Thread Brian Beckman
"I apologize for the length of this post ..." Blaise Pascal? I am seeking critique of a certain "programming pattern" that's arisen several times in a project. I want testable types satisfying a protocol, but the pattern I developed "feels" heavyweight, as the example will show, but I don't

Re: Priority Map with efficient search on values?

2017-04-08 Thread Brian Beckman
hen I need to. On Friday, April 7, 2017 at 10:55:44 PM UTC-7, Brian Beckman wrote: > > I have found a few data types in Clojure that support search and priority > queues. In particular, I found > > Priority Maphttps://github.com/clojure/data.priority-map > PSQhttps://goo.g

Priority Map with efficient search on values?

2017-04-07 Thread Brian Beckman
I have found a few data types in Clojure that support search and priority queues. In particular, I found Priority Maphttps://github.com/clojure/data.priority-map PSQhttps://goo.gl/Dw4gkV data.avlhttps://goo.gl/e07q7H I would be grateful for a few clarifying words on whether any of

Re: escape characters to make a string literal

2017-03-30 Thread Brian Craft
30, 2017 at 2:13:23 AM UTC-7, Christophe Grand wrote: > > A funny thing is that octal or hexadecimal escapes are not part of EDN > (even if most readers recognize them). > > On Wed, Mar 29, 2017 at 8:49 PM, Brian Craft <craft...@gmail.com > > wrote: > >> A funny h

Re: escape characters to make a string literal

2017-03-29 Thread Brian Craft
A funny hole in the meta-programming story. I don't think the String or Character classes have methods that do this. Also interesting, clojure's print methods will handle some escapes, but not others: cavm.core=> (println (pr-str "foo\tbar")) "foo\tbar" nil cavm.core=> (println (pr-str

escape characters to make a string literal

2017-03-29 Thread Brian Craft
Is there an easy way to display a string as a string literal that can be read by clojure? E.g. > (let [x "\001"] (what-goes-here x)) "\001" -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: instrument code only in dev, with lein

2017-03-23 Thread Brian Craft
So, this seems to work pretty easily, though I'm relying on 'require' resolving references in the same order as the directories in :source-paths. For :source-paths ["src-dev", "src"], it will find src-dev/foo/instrument.clj,instead of src/foo/instrument.clj, when both exist. I can't find

instrument code only in dev, with lein

2017-03-17 Thread Brian Craft
How do you instrument code, e.g. apply ring wrap-reload, wrap-stacktrace-web, etc., only in dev, not in uberjar? -- 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: structuring parallel code

2017-01-30 Thread Brian Craft
I think java locks may be the only good answer. I can't usefully divide the vector, because the distribution of updates is uniform along the length of it. Perhaps there's a solution with queues, with multiple threads generating potential placements, and a single thread updating the vector and

Re: structuring parallel code

2017-01-30 Thread Brian Craft
Clojure’s reducers library > <https://clojure.org/reference/reducers> to be helpful. > > On Monday, January 30, 2017 at 9:38:01 PM UTC-5, Brian Craft wrote: >> >> ans: this scales badly. >> >> There must be a way in clojure to operate on large data structures

Re: structuring parallel code

2017-01-30 Thread Brian Craft
ans: this scales badly. There must be a way in clojure to operate on large data structures in parallel, no? On Monday, January 30, 2017 at 6:03:39 PM UTC-8, Brian Craft wrote: > > Would this not scale badly? When the vector is hundreds of thousands, or > millions? > > On Mon

Re: structuring parallel code

2017-01-30 Thread Brian Craft
modified at once > without stepping on other unrelated refs. > > On Mon, Jan 30, 2017 at 5:26 PM, Brian Craft <craft...@gmail.com > > wrote: > >> I'm experimenting with ref, dosync, and alter to run some code in >> parallel, but so far haven'

structuring parallel code

2017-01-30 Thread Brian Craft
I'm experimenting with ref, dosync, and alter to run some code in parallel, but so far haven't been able to figure out how to structure it such that it runs faster, instead of slower. The problem looks something like this. The current state is a long vector. Input is a long sequence of values.

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
ot really alive." > -- Margaret Atwood > > > > On 12/9/16, 3:00 PM, "Brian Craft" <clo...@googlegroups.com > on behalf of craft...@gmail.com > wrote: > > > > Trying to profile some code, and the stack traces look like > > > > clo

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
FastThrow* > > On Friday, December 9, 2016 at 6:25:24 PM UTC-5, Brian Craft wrote: >> >> Yes, but not very practical: since I don't know which one to change, this >> would be a huge rewrite of code to eliminate #() and (fn []). >> >> >> On Friday, December 9, 2016

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
PM UTC-8, Brian Craft wrote: > > Yes, but not very practical: since I don't know which one to change, this > would be a huge rewrite of code to eliminate #() and (fn []). > > > On Friday, December 9, 2016 at 3:16:06 PM UTC-8, Alex Engelberg wrote: >> >> If you're

Re: finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
[] (/ 1 0)) > > ArithmeticException Divide by zero clojure.lang.Numbers.divide > (Numbers.java:158) > user=> (pst) > ArithmeticException Divide by zero > clojure.lang.Numbers.divide (Numbers.java:158) > clojure.lang.Numbers.divide (Numbers.java:3808) > user/eval20857/my-fn-with-a-nam

finding clojure functions from the mangled names

2016-12-09 Thread Brian Craft
Trying to profile some code, and the stack traces look like clojure.something0 clojure.something1 clojure.something2 clojure.something100 foo$fn_1000$fn_1002$fn_10003.invoke() How can I figure out what that last function is? I can access the symbol from the repl,

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-25 Thread Brian Marick
> On Aug 24, 2016, at 9:28 PM, adrian.med...@mail.yu.edu wrote: > > I do not think your tone and lack of constructive feedback to Alex's (and > others) thoughtful responses is helping your case. Probably not(*), though I would characterize the responses differently. They are polite, and

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-24 Thread Brian Marick
> On Aug 24, 2016, at 7:46 PM, Brian Marick <mar...@roundingpegs.com> wrote: > So why not do it in the bottom layer? Is there some deep reason why only an > unserious programmer would want information in anything other than the > current clojure.spec order? (We’re talking her

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-24 Thread Brian Marick
> On Aug 24, 2016, at 8:39 AM, Stuart Halloway > wrote: > > 3. "Follow the inverted pyramid so people see what is most important." This > kind of thing is easily done in a layer above spec, e.g. a custom REPL > printer for spec macro errors. Worth working on but

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-23 Thread Brian Marick
> On Aug 22, 2016, at 7:50 PM, Alex Miller wrote: > You've complained in other channels about the "learning to read" error > messages part and I think you've taken it entirely the wrong way or maybe I > just disagree. There are benefits from reporting errors in a generic,

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-22 Thread Brian Marick
> On Aug 22, 2016, at 11:23 AM, Leon Grapenthin > wrote: > > Still the error messages are simply far from good enough and that is what > appears to me as the main problem OP has. This is important. Will the new, stricter error messages be improved before 1.9 is

[ANN] Shrubbery 0.4.0, a stubbing, spying, and mocking library for Clojure protocols

2016-08-22 Thread Brian Guthrie
/github.com/bguthrie/shrubbery [com.gearswithingears/shrubbery "0.4.0"] Cheers, Brian -- 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: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-21 Thread Brian Marick
As an update. I’ve fixed the `ns` oopsie in Suchwow (one file), and the coincident `ns` oopsie in Midje (one file). But this happens when running Midje’s self-tests against Clojure 1.9alpha11: > Exception in thread "main" java.lang.IllegalArgumentException: Call to > clojure.core/fn did not

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-20 Thread Brian Marick
> On Aug 20, 2016, at 6:30 PM, Timothy Baldridge <tbaldri...@gmail.com> wrote: > > Brian, let's make it more concrete then...why should the Clojure compiler > continue to support undocumented features that make code unportable? Because: 1. People who want to port to clojur

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-20 Thread Brian Marick
> On Aug 20, 2016, at 5:26 PM, s...@corfield.org wrote: > > I disagree (strongly) with your position here Brian. I’ll try to explain > clearly why but first a little background… I too have felt the pain of having to maintain backward compatibility. However, I’m reminded, in this c

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-20 Thread Brian Marick
> On Aug 20, 2016, at 9:03 AM, Alex Miller wrote: > > We discussed this before releasing the specs and decided to start on the > strict side. That said, this is still an alpha and there is plenty of time to > change our minds prior to official release of 1.9 if that ends

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-20 Thread Brian Marick
> On Aug 20, 2016, at 9:03 AM, Alex Miller wrote: > > You left out this next important line too since it points you to exactly the > file and line where the error occurs: > > , compiling:(such/sequences.clj:1:1) This is interesting. Here’s why I missed it. I attach the

Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-20 Thread Brian Marick
Yesterday, a bug was filed against Suchwow under 1.9alpha11. It turns out to have been a use of `ns …(require…` instead of `(ns …(:require`. Not in Suchwow, but in Midje. Unfortunately, the Suchwow file the bug report pointed at *also* had that typo - apparently I am prone to it - so adding the

'lein trampoline test' fails on first run with 'No implementation of method'

2016-08-14 Thread Brian Craft
With an empty target directory 'lein trampoline test' fails with a protocol exception, 'No implementation of method'. Running 'lein test' works fine. After running 'lein test', 'lein trampoline test' also works. Anyone know what's going on? Seems like something isn't being compiled, or

Re: [ANN] Flake 0.4.0: Decentralized, k-ordered unique ID generator

2016-06-22 Thread Brian Platz
On Wednesday, June 22, 2016 at 7:25:50 AM UTC-4, Bruno Bonacci wrote: > > > To answer Brian on the "potential" problem of the clock drift I would > recommend to have a look to > https://aphyr.com/posts/299-the-trouble-with-timestamps. Beside the > hardware

Re: [ANN] Flake 0.4.0: Decentralized, k-ordered unique ID generator

2016-06-21 Thread Brian Platz
enough to warrant the risks. My other curiosity is if System/nanoTime is guaranteed to increment across threads. I know at least a while ago that this guarantee did not exist. -Brian On Tuesday, June 21, 2016 at 8:38:58 AM UTC-4, Bruno Bonacci wrote: > > > Hi this change it is actually ea

Re: clojure.spec - dynamic specs

2016-06-18 Thread Brian Platz
On Friday, June 17, 2016 at 4:04:31 PM UTC-4, Alex Miller wrote: > > > > On Friday, June 17, 2016 at 2:46:37 PM UTC-5, Brian Platz wrote: >> >> >> I'd like to be able to use clojure.spec for input validation where the >> specs are stored in a database usin

clojure.spec - dynamic specs

2016-06-17 Thread Brian Platz
I'd like to be able to use clojure.spec for input validation where the specs are stored in a database using a data structure to represent them. s/keys and its requirement to use the registry makes this challenging. I'm able to generate specs dynamically using a workaround like: (eval (cons

Re: How to update state in a webapp

2016-05-29 Thread Brian Platz
In a web-app you probably want the thread safety an atom provides, so it would be a good choice. You can include a reference to your atom in your system config if you want to retain the reloaded-like / dependency injection pattern: (def changing-config (atom {})) ;; system-map (def sys-map

Re: [ANN] components.md

2016-04-19 Thread Brian Platz
/tolitius/mount#swapping-alternate-implementations -Brian On Apr 19, 2016, at 6:03 AM, Jeroen van Dijk <jeroentjevand...@gmail.com> wrote: > Hi Brian, > > When looking at the Readme of Mount (I think) I already see global state > backed in. > > (defstate ^{:on-reload :n

ANN: Structural-typing 2.0.1

2016-04-17 Thread Brian Marick
"Structural typing for Clojure, somewhat inspired by Elm. Tailored to 'flow-style' programming, where complex structures flow through a series of functions, each of which makes a smallish change. Can also be used in testing tools and the like that need to describe how a nested structure

Re: Return from a function

2016-04-17 Thread Brian Marick
Colin Yates wrote: Also, you might want to invest in either core.typed or prismatic schema for validating shapes of data. I think Brian Marick of Midje fame has a similar answer but I can't recall the name. https://github.com/marick/structural-typing/ -- You received this message because

Re: [ANN] components.md

2016-04-08 Thread Brian Platz
ly see that Mount promotes global state, I think that is a falsehood. -Brian -- 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 - p

Re: conditional logic implemented as pattern-matching and restructuring in the signature of the function

2016-02-13 Thread Brian Marick
To add to the list, I wrote `defpatterned` for /Functional Programming for the Object-Oriented Programmer/. https://github.com/marick/patterned There are probably many others. Moving pattern matching closer to `clojure.core` might be a good thing for a roadmap. I'm pretty excited by

ANN: Suchwow 5.0.0

2016-02-11 Thread Brian Marick
Suchwow is my grab-bag library of Clojure functions. 5.0.0 is a major version bump because I dropped support of Clojure 1.5. Otherwise, it adds a few new functions plus one potentially significant new namespace. In two jobs, I've wanted to slurp in tabular data (CSV or relational queries)

Re: [ANN] fudje - unit testing library vaguely resembling midje, but with less 'calories'

2016-01-31 Thread Brian Marick
Timothy Baldridge wrote: This is a good example of a DSL, and it falls under the criticisms I level at most DSLs, mainly they aren't Clojure. If we dive into I note that Midje once had an intermediate “semi-sweet” functional interface that the `fact` macro expanded into. (It was most

Re: [ANN] fudje - unit testing library vaguely resembling midje, but with less 'calories'

2016-01-26 Thread Brian Marick
dimitris wrote: This is a small testing library inspired by midje. For what it's worth, I (author of Midje) think this is wonderful. You might consider emphasizing that you have similar checkers, as I think that's one of Midje's strong points. I've been recently incorporating

Re: [ANN] Clojure 1.8.0-RC3

2015-12-14 Thread Brian Marick
Noam: does this mean it's not an issue with Midje? If it is, I'll look into it. Noam Ben-Ari wrote: After upgrading to [reduce-fsm "0.1.4"] all my tests pass with RC3 :-) On Tuesday, December 8, 2015 at 3:14:21 PM UTC+2, Noam Ben-Ari wrote: Thanks for the prompt response, I have filed a

[ANN] Specter book approach: please evaluate

2015-11-22 Thread Brian Marick
I announced a while back that I'd be writing a short book on Specter https://github.com/nathanmarz/specter After some thrashing and the usual interruptions, I have the first chapter written. I've taken an unusual approach: teaching Specter by having you implement parts of it. I'm curious to

Re: Help with idiomatic clojure.

2015-11-13 Thread Brian
or point (if (seq some-sequence) true false) is preferred by > some (I won’t say more idiomatic) than (if (empty? some-sequence) true > false). Also, in no-errors branch you probably want to return status: 200? > > > On 12 Nov 2015, at 19:44, Brian <brian.fores...@gmail.com> wro

Re: Help with idiomatic clojure.

2015-11-12 Thread Brian
> http://www.clojure-toolbox.com > > Also, in terms of enforcing contracts - Prismatic Schema is highly > recommended but hard to ‘englishify’ the errors. Failures are considered > API failures rather than happy-case failures. > > On 12 Nov 2015, at 16:09, Brian Forester <brian.

Help with idiomatic clojure.

2015-11-12 Thread Brian Forester
I'm writing a very small REST application in clojure using compojure and ring. One problem is that I don't have anyone who can review my work or provide feedback. I've written a small function to validate a simple JSON request. I'm validating the three values that are in the post and

[ANN] Structural-typing 1.0

2015-11-01 Thread Brian Marick
https://github.com/marick/structural-typing/ This is a validation or type-checking library for Clojure, playing in roughly the same space as Prismatic Schema, Bouncer, or Validateur. It was inspired by Elm's structural typing and my previous need to validate complex data structures flowing

lazyseq?

2015-10-18 Thread Brian Marick
Is there a way to tell if `v` is a lazyseq other than `(instance? clojure.lang.LazySeq v)`? Seems like there should be, but I'm not seeing it. [Preparing to say "duh!"] -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: deprecation warnings?

2015-10-17 Thread Brian Marick
William la Forge wrote: Going forward, I'd like to deprecate some functions and have a warning displayed on first use. So I've done this: I use defprecate https://github.com/alexander-yakushev/defprecated -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: [ANN] Shrubbery 0.3.0, a stubbing, spying, and mocking library for Clojure protocols

2015-10-06 Thread Brian Guthrie
trickier to set up call-based return values; I'll think on it. Thanks for the feedback. Cheers, Brian -- 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: [ANN] Shrubbery 0.3.0, a stubbing, spying, and mocking library for Clojure protocols

2015-10-05 Thread Brian Guthrie
Great to hear! Let me know if there are any questions I can answer. Feedback gratefully accepted. Cheers, Brian On Mon, Oct 5, 2015 at 11:56 AM, James Reeves <ja...@booleanknot.com> wrote: > Very nice. I was looking for something like this. > > - James > > On 5 October

[ANN] Shrubbery 0.3.0, a stubbing, spying, and mocking library for Clojure protocols

2015-10-05 Thread Brian Guthrie
the given implementation's protocols, and tracks calls to all of them. (This behavior can be overridden.) – Replaced all macros with plain functions. (Unfortunately, this means leaning on eval in some cases.) Cheers, Brian -- You received this message because you are subscribed to the Google Group

Re: Clojure/Pedestal vs Go

2015-09-16 Thread Brian Hurt
I have no flipping clue what "system-level programming" means these days, and I'm hoping someone could spell it out. I used to think (back when I was doing that sort of stuff) that it mean operating systems level stuff- device drivers, embedded, real time, stuff like that. But no language with a

Re: Is there a better way to do this than reduce + nested map?

2015-09-13 Thread Brian Platz
:name "foo", :location 100} {:name "bar", :location 101}) On Sunday, September 13, 2015 at 10:56:14 AM UTC-4, Colin Yates wrote: > > I would transform the locations into {location id} and then use merge. > > On 13 Sep 2015, at 3:14 PM, Brian Platz <bpl...@gmail.co

Is there a better way to do this than reduce + nested map?

2015-09-13 Thread Brian Platz
I have a pattern that comes up frequently, when I need to merge some value into one map list from matching keys in a second map list. I've developed a way to handle it, but I think it could be better. Here is a simple example of it: In the below case, we are looking to replace the :location in

Re: midje only 1 test

2015-09-12 Thread Brian Marick
Roland Kaercher wrote: I *strongly* recommend doing all your testing in a repl buffer. That given, there are two ways to solve your problem. The first, which I prefer, is to start by testing everything: (use 'midje.repl) (autotest) Other than having a REPL, is

Re: midje only 1 test

2015-09-05 Thread Brian Marick
I *strongly* recommend doing all your testing in a repl buffer. That given, there are two ways to solve your problem. The first, which I prefer, is to start by testing everything: (use 'midje.repl) (autotest) Then, when you change any text and save the namespace it's in, all tests

Interest in a book on Nathan Marz's Specter?

2015-08-28 Thread Brian Marick
, I would have liked a short, exercise- and example-filled book on Specter. I'm thinking of writing that book. Leanpub lets people indicate their interest on a book's webpage, which is here: https://leanpub.com/specter If you are, please do. Brian Marick -- You received this message because you

Re: Reviewers needed for new Clojure book!

2015-08-25 Thread Brian
A bit late to the party but please include me in the list of possible reviews. thanks, BDF. On Tue, Aug 25, 2015 at 12:06 AM, Akhil Wali green.transis...@gmail.com wrote: Thank you everyone for the great response! I'll notify Packt and they shall contact anyone who is shortlisted as a

Re: How can find something inside heavily nested data structure ?

2015-08-25 Thread Brian Marick
Dave Tenny wrote: Specter looks nice. I didn't see any examples in the readme or tests for working with more deeply nested data structures such as those discussed in this thread, any pointers? Here's an example that might be relevant to the original question. Suppose you have this

Re: How can find something inside heavily nested data structure ?

2015-08-23 Thread Brian Marick
Andy- wrote: I have yet to evaluate it myself but this might do help you: https://github.com/nathanmarz/specter Specter is great. -- 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: [ANN] suchwow: a grab-bag library with some twists

2015-08-06 Thread Brian Marick
Colin Fleming wrote: I think that would be great. It would be preferable to have a single repo for docstring improvements so that tools can obtain them without bringing in other things from e.g. such-wow. Note that everything in suchwow is public domain, so the docstrings there can be

Re: Tool authors: ClojureScript support in tools.namespace?

2015-07-25 Thread Brian Marick
Midje Stuart Sierra wrote: 1. Do you need/want ClojureScript support? Eventually, but not soon. 2. What namespaces (repl, find, dir, file, parse) do you call in tools.namespace? repl, dir, track, reload 3. How would you like to distinguish between get me Clojure sources

  1   2   3   4   5   6   7   8   9   10   >