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: 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