Ouch. Suspect this is the
problem
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LongRange.java#L161
Pretty sure that boolean should be round the other way.
On Saturday, April 18, 2015 at 12:32:40 PM UTC-7, Mathias De Wachter wrote:
>
> Hi,
>
> this looks like quite a serio
I must be missing something, because this is too simple?
(defn get-maybe-cached [cache key]
(dosync
(if-let [v (get @cache key)]
v
(do
(reset! cache (assoc @cache key (calculate key)))
(get @cache key)
On Saturday, August 30, 2014
This isn't a multimethod, it's a multiple-arity function. Anyway, you just
need to detect that someone has tried to define a multiple arity method and
change your definition accordingly. Something like below. I haven't
actually tried this code so it's almost definitely wrong but you get the
gis
`(defn ~name ~@(map (fn [[args & body]] `(~args (try ~@body (catch
> Error e# (println "err caught" e#)
> definitions)
>
>
>
>
>
>
>
>
> On Sunday, 31 August 2014 13:56:03 UTC+3, Beau Fabry wrote:
>>
>> This isn't a multime
ffect on atoms. It's
> really intended for co-ordinating updates to multiple refs rather than as a
> synchronisation primitive on a single entity. I might be wrong though, as I
> say I've never used it.
>
> Cheers,
> Colin
>
>
> On 31 August 2014 00:58, Beau
Started looking into Gorilla for use at work today. Even prior to this
release I was incredibly impressed. Amazing work everyone involved.
On Monday, September 1, 2014 9:12:49 PM UTC+10, Jony Hudson wrote:
>
> Ohh, and there are some new docs on how to use Gorilla alongside your
> favourite ed
The pretty-errors leiningen plugin might be worth a look
On Tuesday, September 2, 2014 7:58:31 AM UTC+10, g vim wrote:
>
> On 01/09/2014 17:50, Luc Prefontaine wrote:
> > Where do you see a Java error here ?
> >
> > I see the Clojure implementation
> > reporting that you are
> > trying to app
For what it's worth we're using Gorilla *after* leiningen. Leiningen is
used to make an uberjar, but then we start the gorilla server in our own
main. This is because we're running gorilla inside of our hadoop
environment. This way we have a gorilla instance that can issue live
cascalog queries
Just a little bit of showing off of the previous post
:-) http://i.imgur.com/zpfP9Ja.png
On Tuesday, September 2, 2014 9:36:50 AM UTC+10, Beau Fabry wrote:
>
> For what it's worth we're using Gorilla *after* leiningen. Leiningen is
> used to make an uberjar, but then we start
g able to connect to postgres via
odbc and run sql, and spinning up a repl inside of postgres that can
dynamically define functions that play with the raw data
On Wednesday, September 3, 2014 12:08:52 AM UTC+10, Jony Hudson wrote:
>
> On Tuesday, 2 September 2014 01:36:49 UTC+1, Beau Fabry
apologies, not a leiningen plugin. https://github.com/AvisoNovate/pretty
On Wednesday, September 3, 2014 2:17:21 AM UTC+10, John Gabriele wrote:
>
> On Monday, September 1, 2014 7:24:54 PM UTC-4, Beau Fabry wrote:
>>
>> The pretty-errors leiningen plugin might be worth a lo
Is the kinda ugly constant (doall usage a sign that I'm doing something
silly?
(let [num-workers 4
widgets-per-worker (inc (int (/ (count widgets) num-workers)))
bucketed-widgets (partition-all widgets-per-worker widgets)
workers (doall (map (fn [widgets]
particular, look at pipelines:
>
> https://github.com/ztellman/lamina/wiki/Pipelines
>
>
>
>
>
> On Friday, September 5, 2014 1:46:02 AM UTC-4, Beau Fabry wrote:
>>
>> Is the kinda ugly constant (doall usage a sign that I'm doing something
>> silly?
>&g
on a
> future is blocking. If the result from the futures is not important, I
> guess you could save some memory by using map and doall instead of mapv,
> though I doubt it would make any difference if you have only 4 sublists.
>
> Alternatively, have you looked at pmap ?
&g
ist-this-item) and I put a closure on the channel.
> The workers eventually grab that closure and execute it.
>
> Clearly, that closure can do whatever you like. To borrow from your
> original example, that closure is where you would put:
>
> (long-running-widget-processor widge
t suspicious.
>
> Do you really feel the 1 extra line of code is overkill? This solution
> seems to do what you want, and it's the same length as your solution.
>
>
>
>
>
> On Wednesday, September 17, 2014 8:48:09 PM UTC-4, Beau Fabry wrote:
>>
>> Thanks
need for core.async.
>
> Having said that, if you are already using core.async elsewhere in your
> project then I don't see anything particularly wrong with your way.
> On 18 Sep 2014 06:41, "Beau Fabry" >
> wrote:
>
>> Larry your solution includes the co
LightTable, the editor written in Clojurescript is currently looking for
contributors, and have started tagging issues as beginner friendly.
https://github.com/LightTable/LightTable
On Saturday, September 27, 2014 4:34:19 PM UTC+10, kurofune wrote:
>
> I am an looking for a good, active, open so
I'm in a similar position to you Wesley, I'm all for generative testing,
but sometimes I prefer not to spec out the full depth of the tree (ie some
input leaves with s/Any) and just turn on validation in staging and see
what happens. The cpu-time wasted there doesn't matter much to me. Looking
d
> this makes me think on starting to split tests in test suites. Is there
> something to handle this in clojure.test?
>
> Thanks!
>
>
> On Thu, May 26, 2016 at 7:00 PM Beau Fabry >
> wrote:
>
>> I'm in a similar position to you Wesley, I'm
I think Alex's point was given any arbitrary function can be used as the
conform part of the spec, this wouldn't be possible. Ie
boot.user=> (s/conform (s/conformer inc) 1)
2
On Saturday, June 18, 2016 at 10:35:10 AM UTC-7, Leon Grapenthin wrote:
>
> I am not sure whether I understand what you m
My guess is the class generated by jnr-ffi can't be inspected with
reflection for some reason or other, you should try poking at that sodium
instance
with http://clojure.github.io/clojure/branch-master/clojure.reflect-api.html
in a repl and see what you get!
In terms of "how expensive reflecti
> Do you find it frustrating that there's no way to turn on instrumentation
of function outputs for manual testing?
Yes. I've mentioned this elsewhere but I think being able to turn on output
checking in lower environments (dev, test, master, staging) is getting
extra values from specs basicall
gt;
>
>
> As an aside, I also love the idea of the Clojure community fostering a
> culture of gen testing each chunk of well defined functionality. If it's
> truly achievable the Clojure community could become known as an unstoppable
> force of robust code.
>
>
&
_*behave*_ correctly
> oddly compelling, now that I’ve had some time to think about it and play
> with it 😊
>
>
>
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org
>
>
>
> *From: *Beau Fabry
> *Sent: *Monday, July
With the passing test of `my-index-of`, is there any way to be confident
that test.check generated inputs that checked the branch of the :fn spec
where a return other than nil happened? All of the invocations of
`exercise-fn` in the screencast only managed to get nil as a result.
On Wednesday,
Wed, Jul 27, 2016 at 2:13 PM, Beau Fabry > wrote:
>
>> With the passing test of `my-index-of`, is there any way to be confident
>> that test.check generated inputs that checked the branch of the :fn spec
>> where a return other than nil happened? All of the invocation
While I think the spec errors are pretty unfriendly, it's probably worth
remembering that most of the times you'll get one you would have got an
inscrutable ClassCastException or incorrect behaviour from a totally
different place in the codebase prior to spec. It's definitely a huge
improvement
Just specifically on a custom REPL printer, wouldn't that negate the
benefits Alex sees in people becoming accustomed to reading spec error
messages? If every error report from each different environment potentially
looks different? Also, from the position of a community maintainer Brian is
mos
Hi Philos,
Without getting into how to implement this, the `spyscope` library and the
`clojure.tools.logging` library implement this pattern in their `spy` macro
and #spy/d reader literal respectively. So you could either add them to
your development toolkit (recommended) or you could read thei
boot.user=> (s/def ::my-map (s/and (s/keys :req [::a ::b]) (s/map-of #{::a
::b} any?)))
boot.user=> (s/explain ::my-map {::a 1 ::b 2 ::BAD 3})
In: [:boot.user/BAD 0] val: :boot.user/BAD fails spec: :boot.user/my-map
at: [0] predicate: #{:boot.user/a :boot.user/b}
Seems better
On Tuesday, Septe
I'm no expert on this, but the Actor model and the CSP model seem to be two
different ways to model a concurrent system. Clojure supports them both.
Personally I find the CSP model a simpler and easier to understand one than
Actors, and so pretty much default to it. You might find non-clojure
r
You're probably right, I was confusing actors with agents.
On Tuesday, September 20, 2016 at 7:05:19 PM UTC-7, Matan Safriel wrote:
>
> Actually, I am not sure clojure implements the actor model, which I can
> only construe as the Erlang actor model here. I am almost certain the core
> language
Changing these two lines works, but I don't know whether it would cause
other issues
```
(defmulti event-type :type)
(s/def :event/event (s/multi-spec event-type :type))
```
On Monday, October 3, 2016 at 4:01:32 AM UTC-7, Karol Hosiawa wrote:
>
> I don't know how to define multi-spec so that it
You have two possible branches for your ::fizbuzz arguments, a one-arity
and a 3-arity. The 1-arity branch allows for the value 1, which when passed
to the function fizzbuzz recursively calls the function fizzbuzz with the
arguments (3 5 1) is not a valid set of values for ::fizzbuzz and so rais
Not an answer to your question, but I usually just redefine
clojure.tools.logging/log* instead for tests.
On Monday, April 27, 2015 at 9:34:14 AM UTC-7, Vebjorn Ljosa wrote:
>
> In one of my tests, I was trying to mock something
> (`clojure.tools.logging/warn`) that happened to be a macro. It ha
With specter:
(map-indexed (fn [i name] (sp/transform sp/MAP-VALS #(nth % i) optij))
(:name optij))
=> ({:name :tom, :age 1, :tone :do} {:name :dick, :age 2, :tone :re} {:name
:harry, :age 3, :tone :mi})
Without:
(map-indexed (fn [i name] (into {} (map (fn [[k v]] [k (nth v i)]) optij)))
(:na
sorry that last nth should've been (nth % i nil)
On Tuesday, January 10, 2017 at 11:37:22 AM UTC-8, Beau Fabry wrote:
>
> With specter:
>
> (map-indexed (fn [i name] (sp/transform sp/MAP-VALS #(nth % i) optij))
> (:name optij))
> => ({:name :tom, :age 1, :tone :do} {
e-vals person-num)}))
(into {})))
(:name optij))
On Tuesday, January 10, 2017 at 6:13:28 PM UTC-8, hiskennyness wrote:
>
>
>
> On Tuesday, January 10, 2017 at 2:37:22 PM UTC-5, Beau Fabry wrote:
>>
>> With specter:
>>
>> (map-indexed (fn [i name]
> The main thing that makes me hesitate to suggest this is getting
bottlenecked on Clojure's dev process.
Imo this is a big deal. I like the way specter has the ability to add new
generally useful navigators and paths with new versions as people
"discover" them, I don't think that's a great fit
Not sure if I'm being glib here but #(s/valid? ::pm-hours %) returns a
predicate that has the exact same results as #(s/int-in-range? 12 24 %)
On Friday, September 22, 2017 at 1:10:51 PM UTC-7, Didier wrote:
>
> I'd try to call describe on the spec. As far as I know that's the only
> introspecti
As a docstring I don't find this superior. Docstrings (for me) are usually
viewed as quick little pop-up boxes in my editor. The existing clojure
docstring for `apply` gives me the information I need much faster and
with less screen real estate. YMMV.
On Monday, September 25, 2017 at 9:42:12 AM
Identified an issue with
prismatic/schema https://github.com/plumatic/schema/pull/399
On Thursday, September 28, 2017 at 9:18:52 AM UTC-7, Nathan Fisher wrote:
>
> Hi Stuart,
>
> Looks like any project using lein-cljsbuild will be affected.
>
> I forked and bumped the Clojure and ClojureScript ve
Can't you just assert on the return value of spec.test.check in a
clojure.test test? ie, this is a test in one of our repos:
(deftest ^:spec generative
(is (not-any? :failure (st/check [`export/invert-table->account-ids]
On Friday, September 29, 2017 at 3:36:26 AM UTC-7, Khalid Jebbari wrote:
> 1) Is there any way to ensure that the keys I used in `s/keys` have the
associated specs defined?
I think you should be able to do this by writing a function that uses
s/registry s/form and s/get-spec
On Monday, October 2, 2017 at 8:37:31 AM UTC-7, Yuri Govorushchenko wrote:
>
> Hi!
>
> I ha
fwiw, I vote for leaving it. It's extra flexibility and is afaict a fairly
easy error to catch. Here's a function that I think should give you every
qualified keyword that is used in a spec but that does not have a spec
defined for it:
boot.user=> (let [kws (atom #{})]
#_=> (clojure.wal
We've been using 1.9 in a small app for a while with no issues. After
upgrading schema to the latest version (with the PR above) I've also
successfully run our larger codebase with 1.9.
On Tuesday, October 3, 2017 at 4:41:14 AM UTC-7, stuart@gmail.com wrote:
>
> Hi Mark,
>
> I think this app
Seems like that's the reasonable place to check it, otherwise you're forced
into an ordering for your specs and cannot write recursive strict map specs.
On Wednesday, October 4, 2017 at 8:59:59 AM UTC-7, Yuri Govorushchenko
wrote:
>
> Thanks. This approach is also different from the macro becaus
;
> Kind regards,
> Leon.
>
>
> On Wednesday, October 4, 2017 at 7:05:29 PM UTC+2, Beau Fabry wrote:
>>
>> Seems like that's the reasonable place to check it, otherwise you're
>> forced into an ordering for your specs and cannot write recursiv
wanted to do that, I could as well spec that key with "any?".
>
> What are other benefits? They must justify the expense of likely runtime
> errors.
>
>
> On Friday, October 6, 2017 at 5:34:16 PM UTC+2, Beau Fabry wrote:
>>
>> Leon, perhaps you could add thi
vior of silently not checking the _*value*_
>> associated with a _*key*_ is in keeping with the design principles of
>> spec which focus on maps being based on a *key set*, while offering
>> functions to allow you to optionally check values.
>>
>>
>>
>> Sean
If I had to guess I'd say the name of the function isn't stored with it
nil
boot.user=> (clojure.reflect/reflect (fn foo [] nil))
{:bases #{clojure.lang.AFunction}, :flags #{:public :final}, :members
#{#clojure.reflect.Constructor{:name boot.user$eval1530$foo__1531,
:declaring-class boot.user$ev
We've switched both of our main projects to RC1 and have had no issues yet.
On Thursday, November 9, 2017 at 11:49:07 PM UTC-8, Sean Corfield wrote:
>
> We have three processes running RC1 in production as of today. Looks good
> so far. We’ve had everything else up and running on Beta 4 in produc
ly passing specs. And why prototyping needs
>>> should not be a primary concern in how s/keys behaves.
>>>
>>> I have tried to make a case for current behavior: It allows to say a key
>>> is there, without saying anything about its value. I have pointed out (s.
We updated 2 apps to 1.9 about a month ago, I believe another team is
planning to update next week. No issues.
On Monday, December 25, 2017 at 2:45:01 AM UTC-8, John Stevenson wrote:
>
> Our team has been running in production on Clojure 1.9 release candidates
> for the last 4 months. We proces
https://github.com/bfabry/specify-it
Attempted translation of the QuickCheck properties in this paper:
"How to specify it!" - John Hughes
https://www.dropbox.com/s/tx2b84kae4bw1p4/paper.pdf?dl=0
Into Clojure test.check properties. I recreated the first 5 bugs in the
paper
(and the test.check p
Added a reporting property and tweaked the key generator to be closer to
the numbers in the paper
On Thursday, July 18, 2019 at 8:25:25 AM UTC-7, Beau Fabry wrote:
>
> https://github.com/bfabry/specify-it
>
> Attempted translation of the QuickCheck properties in this paper:
>
&g
Hi Aaron,
I was I guess the lead developer on clj-headlights. If you have any
questions feel free to hit me up. It is afaik not actively maintained by
anyone anymore.
Cheers,
Beau
On Wednesday, January 22, 2020 at 8:21:57 AM UTC-8, Aaron D. wrote:
>
>
> Hi Dominic thank you!
>
> Are you mainta
The docs have also diverged from the current official release, I'm looking
forward to a new release :-)
On Saturday, September 26, 2015 at 4:24:18 AM UTC-7, Gary Verhaegen wrote:
>
> That question has been asked recently and the official answer was that a
> new release is coming "soon". There wa
I can't think of any (def* forms that allow you to specify a namespace, so
imo it would be strange if they did.
On Thursday, September 24, 2015 at 11:58:08 AM UTC-7, Gregg Reynolds wrote:
>
> Is there some compelling reason why deftype and defprotocol do not allow
> specification of a namespace
(map m [:a :b]) is a nice trick, we use it a lot in cascalog queries:
(map ?account [:id :updated-at :created-at] :> ?id ?updated-at ?created-at)
Where juxt would require more ceremony because of the need for
serialization ((mapfn [m] ((juxt :id :updated-at :created-at) m)) ?account
:> ?id ?upda
Forgive me for resurrecting a 7 year old thread, but is this still the
solution?
On Thursday, June 26, 2008 at 7:56:18 AM UTC-7, Chas Emerick wrote:
>
> At some point, I came to need to define a generated Java class that
> had methods that returned instances of the class being generated. The
>
@Brian no, is an issue with reduce-fsm (which is
fixed) https://github.com/cdorrat/reduce-fsm/issues/9
On Tuesday, December 15, 2015 at 9:42:01 AM UTC+11, Brian Marick wrote:
>
> Noam: does this mean it's not an issue with Midje? If it is, I'll look
> into it.
>
> Noam Ben-Ari wrote:
> > After
Tell the compiler that the type you're passing to the constructor is a
Collection, so it will know which constructor to use without reflection.
(set! *warn-on-reflection* true)
=> true
(import '(java.util ArrayList Collection))
=> java.util.Collection
(ArrayList. (list 1 2))
Reflection warning,
Interesting. I think it makes sense in that `dissoc` is a function for
removing a kv pair from a map, not a function for setting v to nil given a
k. I could definitely see tripping up on this though.
On Friday, February 19, 2016 at 8:07:16 AM UTC-8, Alex Miller wrote:
>
> You can find some of th
65 matches
Mail list logo